nurpax / c64jasm

C64 6502 assembler in TypeScript
51 stars 14 forks source link

basic upstart doesn't match kickassembler? #59

Open nurpax opened 5 years ago

nurpax commented 5 years ago

This is the start macro I've been using. It seems to work but doesn't give identical results to KA:

!filescope c64
!macro basic_start(addr) {
* = $801
    !byte $0c, $08, $00, $00, $9e
    !for d in [10000, 1000, 100, 10, 1] {
        !if (addr >= d) {
            !byte $30 + (addr/d)%10
        }
    }
    !byte 0, 0, 0
}
nurpax commented 5 years ago

This gives identical results:

!filescope c64
!macro basic_start(addr) {
* = $801
    !byte $0b, $08, $0a, $00, $9e
    !for d in [10000, 1000, 100, 10, 1] {
        !if (addr >= d) {
            !byte $30 + (addr/d)%10
        }
    }
    !byte 0, 0, 0
}