mirror of https://github.com/falsovsky/z80.git
Nao repetir os push e pop
This commit is contained in:
parent
f4a32b91eb
commit
d28d4a1e76
|
|
@ -24,6 +24,7 @@ main
|
||||||
ld hl, brainfuck
|
ld hl, brainfuck
|
||||||
read_bf
|
read_bf
|
||||||
ld a,(hl)
|
ld a,(hl)
|
||||||
|
push hl
|
||||||
|
|
||||||
; EOF
|
; EOF
|
||||||
cp 0
|
cp 0
|
||||||
|
|
@ -50,6 +51,7 @@ read_bf
|
||||||
jr z, F_OUT
|
jr z, F_OUT
|
||||||
|
|
||||||
continue
|
continue
|
||||||
|
pop hl
|
||||||
inc hl
|
inc hl
|
||||||
jr read_bf
|
jr read_bf
|
||||||
|
|
||||||
|
|
@ -58,41 +60,32 @@ end_main
|
||||||
ret ; Sai para o BASIC
|
ret ; Sai para o BASIC
|
||||||
|
|
||||||
F_INC_DP
|
F_INC_DP
|
||||||
push hl
|
|
||||||
ld hl, (memory_pos)
|
ld hl, (memory_pos)
|
||||||
inc hl
|
inc hl
|
||||||
ld (memory_pos), hl
|
ld (memory_pos), hl
|
||||||
pop hl
|
|
||||||
jr continue
|
jr continue
|
||||||
|
|
||||||
F_DEC_DP
|
F_DEC_DP
|
||||||
push hl
|
|
||||||
ld hl, (memory_pos)
|
ld hl, (memory_pos)
|
||||||
dec hl
|
dec hl
|
||||||
ld (memory_pos), hl
|
ld (memory_pos), hl
|
||||||
pop hl
|
|
||||||
jr continue
|
jr continue
|
||||||
|
|
||||||
F_INC_VAL
|
F_INC_VAL
|
||||||
push hl
|
|
||||||
ld hl, (memory_pos)
|
ld hl, (memory_pos)
|
||||||
ld a, (hl)
|
ld a, (hl)
|
||||||
inc a
|
inc a
|
||||||
ld (hl), a
|
ld (hl), a
|
||||||
pop hl
|
|
||||||
jr continue
|
jr continue
|
||||||
|
|
||||||
F_DEC_VAL
|
F_DEC_VAL
|
||||||
push hl
|
|
||||||
ld hl, (memory_pos)
|
ld hl, (memory_pos)
|
||||||
ld a, (hl)
|
ld a, (hl)
|
||||||
dec a
|
dec a
|
||||||
ld (hl), a
|
ld (hl), a
|
||||||
pop hl
|
|
||||||
jr continue
|
jr continue
|
||||||
|
|
||||||
F_OUT
|
F_OUT
|
||||||
push hl
|
|
||||||
ld hl, (memory_pos)
|
ld hl, (memory_pos)
|
||||||
ld a, (hl)
|
ld a, (hl)
|
||||||
rst $10
|
rst $10
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in New Issue