NES(6502组装)精灵运动

J.W*_*son 2 assembly 6502 sprite nes

我目前正在开发NES(6502)组装游戏,但不了解如何进行精灵移动,这里我认为它应该如何工作:

(loop)
LDA $200 ;will load into the A register the content of address $200,wich contain the Y postion of my sprite
INA ;Increment the A register wich would increment the content of A wich is the Y position of my sprite..?
Run Code Online (Sandbox Code Playgroud)

但是似乎您无法增加A寄存器累加器,因为在尝试使用INA指令进行汇编时出现错误。但是我想使用地址$ 200的内容,而不是在其中选择一个值,我不知道如何使子画面移动。

谢谢!

Mic*_*ael 5

INANES中使用的6502变体确实没有可用。您可以A使用以下指令对加1:

CLC     ; Clear carry
ADC #1  ; A = A + 1 + carry = A + 1
Run Code Online (Sandbox Code Playgroud)

或者,如果任何一个索引寄存器都是免费的,则可以使用:

LDX $200  ; or LDY
INX       ; or INY
Run Code Online (Sandbox Code Playgroud)

请记住,虽然,其他的算术运算一样ADCSBCLSR,等,不能执行XY