----------------------------------------------------------------------- CONSTANTS: Constants are specific numbers entered into assembly language instructions. The default base for all constants in the assembler is hexadecimal. Either a prefix or a suffix is used, not both. Base Prefix Suffix 02 % Q 10 ! T 16 $ H Ex : 10010111Q = %10010111 = 97H = $97 Additionally, a character $ or * by itself is used to mean "the current program counter". JMP $ ; jump to itself JMP * ; jump to itself ------------------------------------------------------------------------ The following list of pseudo operations (assembler driectives) are allowed in place of opcodes: DS n or RMB n Define Storage, n = number or label, reserves n bytes. Forward references of n are not allowed. -------------------------------------------------------------------------- DB m or FCB m Define Byte storage, m = label, number or string. Strings generate ASCII codes for multiple bytes. Numbers and labels define only a single byte per parameter. Multiple parameters are allowed and are separated by commas. --------------------------------------------------------------------------- DW n or FDB n Define Word storage, n=label, number or string. Two bytes are generated for each number or label. Multiple parameters are allowed and are separated by commas. ---------------------------------------------------------------------------- label: EQU n Assigns the value of the number or label n to the label lab. Forward references to n are not allowed. ---------------------------------------------------------------------------- ORG n Sets the ORiGin to the value of the number or label n. All assembler lines after this statement will be placed in memory at n. Forward references to n are not allowed. ---------------------------------------------------------------------------- Example: VAR DS 1 ;Allocate 1 byte of memory for variable VAR DB 1,2,3,4,5 ;Set up constant array in memory DW 'vector' ;Place constant word 'vector' in memory LBL1: EQU $100 ;Set label LBL1 to value $100 ORG $800 ;Assemble code from address $800 An ASCII constant may be specified by placing a character in single or double quotes (i.e. 'A' which is the same as 41H). Strings consist of a series of characters enclosed in quotes, such as : STR db 'this is a string'