mirror of https://github.com/falsovsky/z80.git
"," implementado
This commit is contained in:
parent
867a6bfbe0
commit
efab5a3ef0
|
@ -65,7 +65,7 @@ mainloop
|
|||
|
||||
ld a, (last_k) ; Se o valor da ultima tecla pressionada ainda
|
||||
cp $0 ; for 0, é porque ainda não se pressionou nenhuma
|
||||
jr Z, mainloop ; tecla, por isso... repete
|
||||
jr z, mainloop ; tecla, por isso... repete
|
||||
|
||||
exit
|
||||
pop bc ; Tira o BC da Stack
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
org 30000
|
||||
|
||||
tv_flag equ $5c3c ; Variavel das flags da tv
|
||||
last_k equ $5c08 ; Contem a ultima tecla pressionada
|
||||
|
||||
OP_INC_DP equ $3e
|
||||
OP_DEC_DP equ $3c
|
||||
|
@ -49,6 +50,10 @@ read_bf
|
|||
; .
|
||||
cp OP_OUT
|
||||
jr z, F_OUT
|
||||
|
||||
; ,
|
||||
cp OP_IN
|
||||
jr z, F_IN
|
||||
|
||||
continue
|
||||
pop hl
|
||||
|
@ -92,4 +97,15 @@ F_OUT
|
|||
ld (hl), a
|
||||
jr continue
|
||||
|
||||
F_IN
|
||||
ld a, $0
|
||||
ld (last_k), a ; Limpa o valor da ultima tecla pressionada
|
||||
F_IN_LOOP
|
||||
ld a, (last_k) ; Se o valor da ultima tecla pressionada ainda
|
||||
cp $0 ; for 0, é porque ainda não se pressionou nenhuma
|
||||
jr z, F_IN_LOOP ; tecla, por isso... repete
|
||||
ld hl, (memory_pos)
|
||||
ld (hl), a
|
||||
jr continue
|
||||
|
||||
end start
|
||||
|
|
Loading…
Reference in New Issue