; a equ 0 ; b equ 1 ; c equ 2 ; d equ 3 ; output equ 4 ; 0x0100 ; .org 0x100 0x020302030101 ; 0x100 main: subge tmp,tmp,next 0x020300000102 ; 0x101 subge tmp,a,next 0x020702070103 ; 0x102 subge x,x,next 0x020702030104 ; 0x103 subge x,tmp,next 0x020302030105 ; 0x104 subge tmp,tmp,next 0x020300010106 ; 0x105 subge tmp,b,next 0x020802080107 ; 0x106 subge y,y,next 0x020802030108 ; 0x107 subge y,tmp,next 0x012101210109 ; 0x108 subge negMultRet,negMultRet,next 0x01210200010a ; 0x109 subge negMultRet,L000,next 0x02030203011a ; 0x10a subge tmp,tmp,negMult ; 0x10b LretLabel000: 0x00040004010c ; subge output,output,next 0x00040206010d ; 0x10c subge output,negProd,next 0x02030203010e ; 0x10d subge tmp,tmp,next 0x02030002010f ; 0x10e subge tmp,c,next 0x020702070110 ; 0x10f subge x,x,next 0x020702030111 ; 0x110 subge x,tmp,next 0x020302030112 ; 0x111 subge tmp,tmp,next 0x020300030113 ; 0x112 subge tmp,d,next 0x020802080114 ; 0x113 subge y,y,next 0x020802030115 ; 0x114 subge y,tmp,next 0x012101210116 ; 0x115 subge negMultRet,negMultRet,next 0x012102010117 ; 0x116 subge negMultRet,L001,next 0x02030203011a ; 0x117 subge tmp,tmp,negMult ; 0x118 LretLabel001: 0x000402060119 ; subge output,negProd,next 0x020302030119 ; 0x119 done: subge tmp,tmp,done ; 0x02090209011b ; 0x11a negMult: subge xx,xx,next 0x02090207011c ; 0x11b subge xx,x,next ; 0x100 xx = -x 0x02060206011d ; 0x11c subge negProd,negProd,next ; 0x100 negProd = 0 0x020902040121 ; 0x11d multLoop: subge xx,zero,negMultRet ; 0x100 xx = xx + 0 ; ; 0x100 = -x + 0 >= 0 ; ; 0x100 or 0 >= x. 0x02060208011f ; 0x11e subge negProd,y,next ; 0x100 negProd = negProd - y 0x020902050120 ; 0x11f subge xx,neg1,next ; 0x100 xx = xx + 1 0x02030203011d ; 0x120 subge tmp,tmp,multLoop 0x000000000000 ; 0x121 negMultRet: .word 0,0,0 ; 0x100 negProd = -(x * y)