v2.0 raw # CONVERTED FROM OLD uCODE BY upgrade.pl multiply.hex # Multiply 2 values together (GH = E * F) # Destroys E by shifting out. Shifts answer into GH 00 00 # NULLs / NOOPs to start 1f 2a 20 # fetch 42, store in E 1f 64 21 # fetch 100,store in F 0f 22 23 # zero, store in G, H 1f 08 24 # loop counter I=8 1b 28 1c 29 # store PC in MN "LOOPSTART" # Shift GH left: 02 # cond clr 13 01 23 # fetch H, shift left (SETTING COND), store back into H 12 01 22 # fetch G, shift left, store back into G # Shift E left. If we overflowed, add F to GH: 10 01 20 # fetch E, shift left (SETTING COND), store back into E 11 4f 00 # fetch F, else 0 (if E did NOT overflow when shifting) 02 # Cond clear 53 23 # add H (poss overflowing), store back into H 0f 52 22 # fetch 0, add G (and carry!), store back into G 02 # cond clr 14 6f 01 24 # loop counter I-- 8f 00 # If non-zero... 18 2b 19 3c # conditionally jump back to MN "LOOPSTART" 00 00 # Pad (NOOPs) 1f 2f 2f # "halt" (by repeatedly re-writing the halt instr at [PC])