Routines |
Prev: 6E84 | Up: Map | Next: 6EAE |
|
||||||||
6E87 | LD E,A | A=N | ||||||
6E88 | ADD A,A | |||||||
6E89 | ADD A,A | |||||||
6E8A | ADD A,E | |||||||
6E8B | ADD A,A | |||||||
This entry point is used by the routine at 76FA with A=2.
|
||||||||
6E8C | LD D,$FF | Prepare DE for subtraction | ||||||
6E8E | NEG | A=-N | ||||||
6E90 | JR $6E94 | |||||||
6E92 | LD D,$00 | Prepare DE for addition | ||||||
6E94 | LD E,A | Now DE=number of bucks to add (may be negative) | ||||||
This entry point is used by the routine at 6EB1 with DE=FFFF (-1).
|
||||||||
6E95 | LD HL,($7F9E) | Collect the current number of bucks from 7F9E | ||||||
6E98 | ADD HL,DE | Adjust the number | ||||||
6E99 | INC H | Is the result negative? | ||||||
6E9A | JR NZ,$6E9F | Jump if not | ||||||
6E9C | LD HL,$0100 | Set HL up so that the next instruction reduces it to 0 | ||||||
6E9F | DEC H | Restore the value of HL (if it was non-negative), or set it to 0 (if it was negative) | ||||||
6EA0 | LD A,H | Set the zero flag if the number of bucks is now 0 | ||||||
6EA1 | OR L | |||||||
6EA2 | PUSH AF | Save the zero flag temporarily | ||||||
6EA3 | LD ($7F9E),HL | Store the new amount at 7F9E | ||||||
6EA6 | LD DE,$50F8 | DE=display file address | ||||||
6EA9 | CALL $6E1A | Print the number of bucks | ||||||
6EAC | POP AF | Restore the zero flag | ||||||
6EAD | RET |
Prev: 6E84 | Up: Map | Next: 6EAE |