CSE 30 -- Lecture 7 -- Oct 21

This may not correspond exactly to what was written during lecture since I wrote the code on-the-fly and didn't copy it down.
addvec:		.macro	r,vecLoc,vecLength
Lnsum:		.word	0
Li:		.word	0
Ltmp:		.word	0
LnvecL:		.word	-vecLength
Lbump:		.word	-triple(0,1,0)
		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

vec:		.word	1
		.word	2
res:		.word	0
		addvec vec
done:		subz tmp,tmp,done
		.data	0x9000
negone:		.word	-1
done:		.word	0
we expand this to:

and then translate to machine code:

[ search CSE | CSE home | bsy's home page | webster i/f | yahoo | hotbot | lycos | altavista | pgp key svr | spam | commerce ]
picture of bsy

bsy+cse30.f99@cs.ucsd.edu, last updated Thu Oct 21 14:42:22 PDT 1999. Copyright 1999 Bennet Yee.
email bsy.

Don't make me hand over my privacy keys!