; LMC Sample Program (from class) ; -IAN! idallen@ncf.ca ; ; We will use this 6-column format for all LMC programs. ; We won't use the Label column yet. ; ; The "DAT" (data) mnemonic is not an LMC instruction. It is used by ; assembler programmers to indicate that the given operand is data ; to be placed in memory at this location. ; ; Input Queue (for "IN" statements): ; 024 ; 351 ; ; Output: 375 ; ;Loc. Code Label Mnemon. Operand Comments ;---- ---- ----- ------- ------- ------------------------- 00 500 IN ; input first number 01 206 STO 06 ; save in memory 02 500 IN ; input second number 03 306 ADD 06 ; add first number 04 600 OUT ; output sum 05 700 HLT ; go to sleep 06 942 DAT 942 ; junk 07 600 DAT 600 ; junk 08 123 DAT 123 ; junk 09 132 DAT 132 ; junk