I ve开始为DCPU-16举办学习会,为0x10c做准备,但是在达到 我正在继续工作,我发现,该方案是对关键投入的回应。 逐步进入,我发现,这部法典在设置的坡道上 st,等待关键投入。
a. 在此提供线:
IFE [0x9000 + I],0 ; if keyboard buffer is empty
SET PC,loop
之所以如此,是因为该守则是采用较老版本的DCPU? 如果是,它现在如何工作?
First post on Stack overflow, if I ve made any faux pas please excuse me, and thank you all. Full Code:
SET A,0
SET B,0
SET C, 0xF000
SET I, 0
:loop
IFE [0x9000 + I],0 ; if keyboard buffer is empty
SET PC,loop
IFE [0x9000 + I],8
SET PC, backspace
IFE [0x9000 + I],10
SET PC, enter
SET B, [0x9000 + I]
BOR B,C
SET [0x8000+A], B
SET [0x9000 + I], 0
ADD A, 1
ADD I, 1
IFE I, 16
SET I, 0
SET PC,loop
:backspace
SUB A, 1
SET [0x8000+A],0
SET [0x9000 + I], 0
ADD I, 1
IFE I, 16
SET I, 0
SET PC,loop
:enter
AND A, 0xFFE0
ADD A, 0x0020
SET [0x9000 + I], 0
ADD I, 1
IFE I, 16
SET I, 0
SET PC,loop