Crossware

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 a pair of single quotation marks:

'<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 single quotation marks.  The last character is positioned as the lowest byte in the number.

Single quotation marks can be included as characters to be evaluated providing they are followed by another single quotation mark character.  The final single quotation mark 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 quotation mark after the x is evaluated