addvec: .macro r,vecLoc,vecLength .data Lnsum: .word 0 Li: .word 0 Ltmp: .word 0 LnvecL: .word -vecLength Lbump: .word -triple(0,1,0) .text subz Lnsum,Lnsum,next subz Li,Li,next L0: subz Lnsum,vecLoc,next subz Li,negone,next subz Ltmp,Ltmp,next subz Ltmp,Li,next subz Ltmp,LnvecL,Ldone subz L0,Lbump,next subz Ltmp,Ltmp,L0 Ldone: subz r,r,next subz r,Lnsum,next .endmacro .data vec: .word 1 .word 2 res: .word 0 .text addvec vec done: subz tmp,tmp,done .data 0x9000 negone: .word -1 done: .word 0we expand this to:
and then translate to machine code:
bsy+cse30.f99@cs.ucsd.edu, last updated
email bsy.