Routines |
Prev: 9634 | Up: Map | Next: 9708 |
|
||||||||||||
See Don't Spend Money and Don't Spend Money (alt).
|
||||||||||||
SpendMoney | 96FE | AND A | Set flags ready for the subtraction. | |||||||||
SpendMoney_Loop | 96FF | LD A,(DE) | Load the player cash digit from *DE into A. | |||||||||
9700 | SBC A,(HL) | Subtract the cost from the digit in *HL (with the carry flag). | ||||||||||
9701 | DAA | Digital to analogue conversion. | ||||||||||
9702 | LD (DE),A | Write the result in A back to the players cash. | ||||||||||
9703 | INC HL | Increment both the players cash and cost to deduct pointers. | ||||||||||
9704 | INC DE | |||||||||||
9705 | DJNZ SpendMoney_Loop | Decrease number of digits counter by one and loop back to SpendMoney_Loop until all digits have been processed. | ||||||||||
9707 | RET | Return. |
Prev: 9634 | Up: Map | Next: 9708 |