use*_*704 10 assembly c64 6502
我在仿真C64机器上玩asm时遇到了一些问题.
我想要做的是检查键盘上的键"N"是否被按下,然后程序应该等待更改显示在地址$ D012上.现在我不明白的是我如何"等待"改变出现?任何人都可以告诉我它的全部意义吗?
检查键盘上的N按钮是否按下很简单 - 只需使用子程序FFE4(输入)和FFD2(输出).
我真的不想要为我做任何事情,但如果我能得到关于D012如何工作以及如何"等待"改变的快速信息,我将非常感激.
提前致谢!
$d012 包含当前的栅格线。
如果您只需要等到寄存器更改,即等到下一个光栅行,就可以执行简单的忙碌等待:
lda $d012 ;load the current raster line into the accumulator
cmp $d012 ;check if it has changed
beq *-3 ;if not, jump back and check again
Run Code Online (Sandbox Code Playgroud)
编辑:
如果要等待几个栅格线,例如3:
lda $d012
clc ;make sure carry is clear
adc #$03 ;add lines to wait
cmp $d012
bne *-3 ;check *until* we're at the target raster line
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2039 次 |
| 最近记录: |