*=Beginning of comments
Start address (of data section or program)
ORG $C000
declaring a constant
CONST EQU 5
declaring variables in memory
i RMB 4 (reserve 4 memory bytes)
declaring and initializing variables in memory
FCB 12, 20 (declares and initializes two 1-byte variables)
FDB $1234, ABCD(declaresandinitializedtow2−bytevariables)</p><p>i FCB 12 (reserves1−byteinmemory,initializedtonumber12(decimal))</p><p></p><p></p><p>Programwrittenincolumns</p><ol><li><p>Column:Labels</p></li><li><p>Column:instruction</p></li><li><p>Column:Instructionoperands</p></li><li><p>Column:comment</p></li></ol><p></p><p></p><tablestyle="min−width:75px;"><colgroup><colstyle="min−width:25px;"><colstyle="min−width:25px;"><colstyle="min−width:25px;"></colgroup><tbody><tr><tdcolspan="1"rowspan="1"><p></p></td><tdcolspan="1"rowspan="1"><p>ORG</p></td><tdcolspan="1"rowspan="1"><p>B000
DATA1 | FCB | 10(Stored in $B000) |
DATA2 | FCB | 15(Stored in $B001) |
DATA3 | FCB | $1A(stored in $B002) |
RESULT | RMB | 1(reserve 1-byte in memory) |
All variables have to be initialized by programmer before use
int i=0 → i FCB 0
int i → i RMB 0
i = 0 → CLR i