Homework E5 program. Inputs: 009 032 Loc. Code Labels Mnem. Operand Comments............. ---- ---- ------ ----- ------- --------------------- 00 500 IN 01 220 STO 20 02 500 IN 03 221 STO 21 04 118 LDA 18 05 319 ADD 19 06 218 STO 18 07 121 LDA 21 08 420 SUB 20 09 800 SKN 10 903 JMP 03 11 320 ADD 20 12 221 STO 21 13 118 LDA 18 14 600 OUT 15 121 LDA 21 16 600 OUT 17 700 HLT 18 999 DAT 999 19 001 DAT 001 20 000 DAT ? 21 000 DAT ? ======================================================================= Same program, using labels instead of mailbox numbers: Label Table: Label Location ----- -------- LOOP 03 QUOT 18 ONE 19 DIVOR 20 DEND 21 Loc. Code Labels Mnem. Operand Comments............. ---- ---- ------ ----- ------- --------------------- 00 500 IN ; read and store divisor 01 220 STO DIVOR 02 500 IN ; read and store dividend 03 221 LOOP STO DEND 04 118 LDA QUOT ; count number of subtractions 05 319 ADD ONE 06 218 STO QUOT 07 121 LDA DEND ; subtract divisor from dividend 08 420 SUB DIVOR 09 800 SKN 10 903 JMP LOOP ; loop unless Negative 11 320 ADD DIVOR ; superfluous code (optimized) 12 221 STO DEND ; superfluous code (optimized) 13 118 LDA QUOT ; output quotient 14 600 OUT 15 121 LDA DEND ; output remainder 16 600 OUT 17 700 HLT 18 999 QUOT DAT 999 ; quotient 19 001 ONE DAT 001 ; constant 1 20 000 DIVOR DAT ? ; divisor 21 000 DEND DAT ? ; dividend