; 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. ; ; Note that the Negative light will come on after the subtraction. ; It will go off after the addition, because only subtracting a big ; number from a small number sets the Negative light. Addition can ; never set the Negative light. ; ; Output: 994 ; ;Loc. Code Label Mnemon. Operand Comments ;---- ---- ----- ------- ------- ------------------------- 00 162 LDA 62 ; load first number 01 463 SUB 63 ; subract second number 02 364 ADD 64 ; add third number 03 600 OUT ; output result 04 700 HLT ; to to sleep 62 007 DAT 007 ; first number 63 015 DAT 015 ; second number 64 002 DAT 002 ; third number