; Wait for input test
! J. X, `+ D# X: [6 `8 T$ ]) Q& K n& ^- z/ Q9 P( O m e
; IO area of the simulator has to be set at the address $e000
) s# y' ?; p1 V% U; (Option/Simulator/InOut memory area)
1 u8 w7 r7 z0 B! r, V3 B; In/Out Window will only accept input when it has focus (is active)
: i" Q/ m: f) {/ q0 V( d; K2 L/ _( p( f' A N# u0 e
*= $0600 ;不太懂
/ K# v3 O: d; r5 F. @( x. `- H+ t
8 J2 }. s2 ^5 q3 J3 M2 ~3 Gio_area = $e0007 P* D$ P. g+ R: a$ F
io_cls = io_area + 0 ; clear terminal window; h0 O6 n$ K# q9 `' [9 {" ]
io_putc = io_area + 1 ; put char
$ G6 Q/ Y! e) n1 iio_putr = io_area + 2 ; put raw char (doesn't interpret CR/LF)
! {% C4 x( k- [) N- h7 t) uio_puth = io_area + 3 ; put as hex number* ?( ^( |" i+ `
io_getc = io_area + 4 ; get char
; g0 f% U* i) p" B \; u) F+ i5 C/ |; z9 v* z
LDA #$a4 x6 G- l0 ^ H) M# ^' W2 g2 D5 L
STA io_putc ; this will move cursor to the next line; H! K( [: \- |" H4 k# ]7 C
STA io_putr ; this will print character" I% l* V$ C$ t3 B
9 A5 f5 i* b& v7 @. _1 u LDA #'>'7 B+ u x0 V4 U7 I7 _
STA io_putc ;后面的输入过程也不太懂
) ^6 q* H) u+ s" A" z! a- k & m R5 p7 {' f" M3 |' V
.wait
9 X; c' U2 x2 n LDA io_getc
4 h1 P) K( K* g( G BEQ .wait
2 n6 J6 t- g) v- q6 _ STA io_puth
/ K3 c/ j4 C- f5 X' e* h JMP .wait
& L+ q6 C/ E- g- d( q- K2 d2 j& f9 l. b0 l
BRK