; multiply
; Rosemary Francis

; this program calculates r0 = r1 * r0
; it dirties r0, r1 and r2

multiply
	mov r2 r0

	movi r0 0
	cmpi r1 0
	ifs cc_eq
	ret
	nop

	subi r1 1
loop234	add r0 r2
	cmpi r1 0
	ifs cc_gt
	br loop234 ;random number to avoid label clash
	subi r1 1
	ret