![]() |
Routines |
Prev: 38452 | Up: Map | Next: 38664 |
|
||||||||||||
See Don't Spend Money and Don't Spend Money (alt).
|
||||||||||||
SpendMoney | 38654 | AND A | Set flags ready for the subtraction. | |||||||||
SpendMoney_Loop | 38655 | LD A,(DE) | Load the player cash digit from *DE into A. | |||||||||
38656 | SBC A,(HL) | Subtract the cost from the digit in *HL (with the carry flag). | ||||||||||
38657 | DAA | Digital to analogue conversion. | ||||||||||
38658 | LD (DE),A | Write the result in A back to the players cash. | ||||||||||
38659 | INC HL | Increment both the players cash and cost to deduct pointers. | ||||||||||
38660 | INC DE | |||||||||||
38661 | DJNZ SpendMoney_Loop | Decrease number of digits counter by one and loop back to SpendMoney_Loop until all digits have been processed. | ||||||||||
38663 | RET | Return. |
Prev: 38452 | Up: Map | Next: 38664 |