A83: Date: Tue, 7 Nov 2000 17:20:21 -0500


[Prev][Next][Index][Thread]

A83: Date: Tue, 7 Nov 2000 17:20:21 -0500




I need some major help.  Ok, I have this routine that is called when
decimalpoint = 1.  No problem so far.  The variable decnumtime = 0.  OP1 = 2
OP2 = 10 OP4 = 3  When the routine is first called.  However, when I run the
program I always recieve an overflow error.  I think there is an error with
the line "jr nz,Multgain".  I can up with that idea after some
experimenting, but I am not sure why.  Can someone please help debug this?
Thanks in advance.
Rob





Decsodiv:
 ld a,(decnumtime)      ;load decnumtime into a
 inc a                  ;a + 1 = a
 ld (decnumtime),a	;load a into decnumtime
 inc a			;a + 1 = a
Multgain:			;Multgain lable
 B_CALL FPMult		;Multiplies OP1 * OP2 = OP1
 dec a			;a - 1 = a
 jr nz,Multgain		;if a =/= 0 then goto Multagain
 xor a			;set a to 0
 ld a,(decnumtime)	;load decnumtime into a
 B_CALL OP4ToOP2 		;Moves OP4 into OP2
 B_CALL FPAdd		;OP1 + OP2 = OP1
 inc a			;a + 1 = a
Divagain:			;Divagain lable
 B_CALL FPDiv		;OP1 / OP2 = OP1
 dec a			;a - 1 = a
 jr nz,Divagain		;if a =/= 0 then goto Divagain
 jp bipassmult		;goto bipassmult (No errors From Here on out)
 ret