This is an example of an assembly program for the SimpComp computer. Included
below is a ruler and field labels, not actually part of the file. These are
included to show how a file should be formatted. The actual file itself starts
with the first semicolon line.
80 columns
1 2 3 4 5 6 7
0123456789012345678901234567890123456789012345678901234567890123456789012345678
-------------------------------------------------------------------------------
LABEL MNEMONIC OPERANDS COMMENTS
-------------------------------------------------------------------------------
------------------------- Start of File ---------------------------------------
;
; A sample program
;
; this is a comment line
;
ORG 1000 ; start assembly at 1000h
START: LD A, FIRSTOP ; get the first operand
LD B, SECNDOP ; get the second operand
ADD A, B ; A <- A + B
ST ANSWR, A ; store it
LAST: HALT
;
; Data area
;
DATA: ORG 1100 ; put data in new page
FIRSTOP: DW 300 ; first operand
SECNDOP: DW 100 ; second operand
ANSWR: RW 1 ; reserve a single word
;
END