The following program multiplies two numbers together. It calculates C = A X B where A is 9, B is 7 and C is the answer (63). It is the same as the addition program except that it uses a multiplication table rather than an addition table.

Multiplication Program

label address data comment start 00000000000000000000000000010000 start 0000000000000100 A 0000000000000001 0000000000009 (A) B 0000000000000010 00000000000010017 (B) C 0000000000000011 000000000111answer (C) instr_1 000000000000000000000100 0000000000000001 from address of A 0000000000000101 0000000000001100 to instr_3's from addr. 0000000000000110 0000000011110000 copy to these bits 00000000000001110000000000100100 go to instr_2, rot. 4 instr_2 0000000000001000 0000000000000010 from address of B 0000000000001001 0000000000001100 to instr_3's from addr. 0000000000001010 0000000000001111 copy to these bits 00000000000010110000000000110000 go to instr_3, no rot. instr_3 0000000000001100 00000100from multiply table 0000000000001101 0000000000000011 to address of C 0000000000001110 0000000011111111 copy to these bits 0000000000001111000000000000000001000000 go to instr_4, no rot. instr_4 0000000000010000 0000000000000000 doesn't matter 0000000000010001 0000000000000000 doesn't matter 0000000000010010 0000000000000000 copy NO bits 00000000000100110000000001000000 go to this instruction multiply 000001000000000000000000000000000 X 0 = 00 000001000000000100000000000000000 X 1 = 00 000001000000001000000000000000000 X 2 = 00 . . . 000001001001011000000000010101009 X 6 = 54 000001001001011100000000011000119 X 7 = 63 000001001001100000000000011100109 X 8 = 72 000001001001100100000000100000019 X 9 = 81Notice that one can save a lot of work by salvaging (copying) instructions from a program one has already written for use in a new, similar program. Tables can often be salvaged as well.

Page 32

Page 31 . . . Page 1 . . . Page 33