Table of Contents Previous topic Next topic
CROSS ASSEMBLER->Assembler Expressions->Literals
The numerical value expressed by an ASCII character can be obtained by enclosing the ASCII character within apostrophes:
'<ASCII character>' eg 'A' evaluates to $41
Up to four characters can be evaluated and integrated into the same 32 bit number by enclosing them all within the same pair of apostrophes. The last character is positioned as the lowest byte in the number.
Apostrophies can be included as characters to be evaluated providing they are not followed by another non-apostrophy character. The final apostrophy is the terminator and is not evaluated.
Some examples of literals are shown below: 1 0073 label1 equ 's'
2 7361 label2 equ 'sa'
3 7665 label3 equ 'save' ;Only 16 bits are listed but
4 7361 label4 equ label3 shr 16 ;the 'sa' is still is present in symbol 'label3'
5 7827 label5 equ 'x'' ;The first apostrophy after the x is evaluated