这是 6502 Assembly 的什么方言,我如何编译它而不将其翻译成不同的 6502 方言?
*=$0900
jmp Start
SCRN_START=$0400
Print=$ffd2
Basin=$ffcf
incasm "Character_ASCII_Const.asm"
defm PrintText
ldy #>/1 ; Load Hi Byte to Y
lda #</1 ; Load Lo Byte to Acc.
jsr String ; Print The text until hit Zero
endm
Start
lda #$83
clc
sbc #$02
jsr PrintAccumlator
rts
我目前使用 CC65 作为我的 6502 汇编器。
我编译我的代码如下:
$ cl65 -o mycode.prg -u __EXEHDR__ -t c64 -C c64-asm.cfg mycode.asm
但这意味着我必须对上面的代码进行编辑,所以它现在看起来像这样。
jmp Start
SCRN_START=$0400
Print=$ffd2
Basin=$ffcf
.include "Character_ASCII_Const.asm"
.macro PrintText value
ldy #>value ; Load Hi Byte to Y
lda #<value ; Load Lo Byte to Acc.
jsr String ; Print The text until hit Zero
.endmacro
Start:
lda #$83
clc
sbc #$02
jsr PrintAccumlator
rts
这是我的c64-asm.cfg
FEATURES {
STARTADDRESS: default = $0801;
}
SYMBOLS {
__LOADADDR__: type = import;
}
MEMORY {
ZP: file = "", start = $0002, size = $00FE, define = yes;
LOADADDR: file = %O, start = %S - 2, size = $0002;
MAIN: file = %O, start = %S, size = $D000 - %S;
}
SEGMENTS {
ZEROPAGE: load = ZP, type = zp, optional = yes;
LOADADDR: load = LOADADDR, type = ro;
EXEHDR: load = MAIN, type = ro, optional = yes;
CODE: load = MAIN, type = rw;
RODATA: load = MAIN, type = ro, optional = yes;
DATA: load = MAIN, type = rw, optional = yes;
BSS: load = MAIN, type = bss, optional = yes, define = yes;
}