Prev: 3686 Up: Map Next: 369B
368F: THE 'JUMP ON TRUE' SUBROUTINE (offset +00)
The address of this routine is found in the table of addresses. It is called via the calculator literal +00 by the routines at NEXT_LOOP, DRAW, e_to_fp, PRINT_FP, int, ln, get_argt, cos, atn, sqr and to_power.
This subroutine executes a conditional jump if the 'last value' on the calculator stack, or more precisely the number addressed currently by the DE register pair, is true.
Input
DE Address of the first byte of the last value on the calculator stack
HL' Address of the jump offset
Output
HL' Address of the next calculator literal to execute
jump_true 368F INC DE Point to the third byte, which is zero or one.
3690 INC DE
3691 LD A,(DE) Collect this byte in the A register.
3692 DEC DE Point to the first byte once again.
3693 DEC DE
3694 AND A Test the third byte: is it zero?
3695 JR NZ,jump Make the jump if the byte is non-zero, i.e. if the number is not-false.
3697 EXX Go to the alternate register set.
3698 INC HL Pass over the jump length.
3699 EXX Back to the main set of registers.
369A RET Finished.
Prev: 3686 Up: Map Next: 369B