Last active
December 30, 2023 23:15
-
-
Save pcholt/d5d72643fa1c5e9cf01f9a2d53161b3c to your computer and use it in GitHub Desktop.
Macro to create a "10 SYS {programStart}" in retroassembler for C64
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AddressDigits .var 0 | |
.macro STR(Address) | |
DigitCounter .var 0 | |
AddressDigits = Address | |
.byte " " | |
.while AddressDigits != 0 | |
* = * - 1 | |
.byte AddressDigits - ( AddressDigits / 10 ) * 10 + $30 | |
* = * - 1 | |
AddressDigits = AddressDigits / 10 | |
DigitCounter = DigitCounter + 1 | |
.endwhile | |
* = * + DigitCounter | |
.endmacro | |
.macro SYS(Address) | |
; Add BASIC line "10 SYS " + str$(Address) | |
* = $0801 | |
.byte $0C, $08, $0A, $00, $9E, $20 | |
STR(Address) | |
.byte $00, $00, $00 | |
.endmacro | |
SYS(program_execution_start) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment