added COPY command

improved filtering of FshVarscpy
This commit is contained in:
Stephen Toth 2018-06-28 12:30:04 -04:00
parent 754e522e20
commit c27bf4645f
6 changed files with 106 additions and 21 deletions

Binary file not shown.

View File

@ -24,6 +24,15 @@ fshcmddecode:
call z, bytecpy
pop hl
push hl
push de
ld de, fshcmdCOPY
call strcmp
ld hl, fshcmdCOPYo
pop de
call z, bytecpy
pop hl
push hl
push de
ld de, fshcmdVARS
@ -59,7 +68,11 @@ fshcmdroute:
ld de, fshcmdSETo
call bytecmp
jp z, fshcmdSETf
ld de, fshcmdCOPYo
call bytecmp
jp z, fshcmdCOPYf
ld de, fshcmdVARSo
call bytecmp
jp z, fshcmdVARSf

View File

@ -77,29 +77,32 @@ fshvarcpy:
ld bc, FshVarsSize / 2 - 1
call cpBCDE
pop bc
jr c, fshvarcpyOOBException
push bc
push de
push hl
ld bc, FshVarsSize / 2
call cpBCDE
jr c, fshvarcpyOOBException
ld bc, FshVars
add hl, hl
add hl, bc
ex de, hl
add hl, hl
add hl, bc
ld a, (de)
ld (hl), a
push bc
ld bc, FshVarsSize / 2
call cpHLBC
pop bc
jr nc, fshvarcpyOOBException
push de
push hl
ld bc, FshVarsSize / 2
call cpBCDE
jr c, fshvarcpyOOBException
ld bc, FshVars
add hl, hl
add hl, bc
ex de, hl
add hl, hl
add hl, bc
ld a, (de)
ld (hl), a
inc de
inc hl
ld a, (de)
ld (hl), a
pop hl
ld a, (de)
ld (hl), a
pop hl
pop de
pop bc
ret
fshvarcpyOOBException:

View File

@ -1,4 +1,5 @@
#include "includes/commands/EXIT.asm"
#include "includes/commands/SET.asm"
#include "includes/commands/COPY.asm"
#include "includes/commands/CLS.asm"
#include "includes/commands/VARS.asm"

View File

@ -0,0 +1,68 @@
fshcmdCOPY: .db "COPY", 0
fshcmdCOPYo: .db $02
fshcmdCOPYu: .db "Copys a value in FSH memory to another addess", 0
fshcmdCOPYf:
fshcmdCOPYfArg0:
ld hl, FshCmdArg0
ld de, 0
ld e, (hl)
inc hl
ld d, (hl)
ex de, hl
ld de, 0
call cpHLDE
jr nz, fshcmdCOPYfArg1
fshcmdCOPYfArg0Get:
ld a, 'G'
call _PutC
xor a
ld (CurCol), a
ld hl, fshcmdCOPYfDSource
call _PutS
ld hl, fshcmdCOPYfInputBuffer
ld de, 3
call inputnumstr
call strtob
ld hl, FshCmdArg0
ld (hl), a
call _NewLine
fshcmdCOPYfArg1:
ld hl, FshCmdArg1
ld de, 0
ld e, (hl)
inc hl
ld d, (hl)
ex de, hl
ld de, 0
call cpHLDE
jr nz, fshcmdCOPYfExe
fshcmdCOPYfArg1Get:
xor a
ld (CurCol), a
ld hl, fshcmdCOPYfDDestination
call _PutS
ld hl, fshcmdCOPYfInputBuffer
ld de, 3
call inputnumstr
call strtob
ex de, hl
ld hl, FshCmdArg1
ld (hl), a
fshcmdCOPYfExe:
ld hl, FshCmdArg0
ld de, 0
ld e, (hl)
ex de, hl
push hl
ld hl, FshCmdArg1
ld de, 0
ld e, (hl)
pop hl
;ld de, $77
call fshvarcpy
call _NewLine
jp ErrCatch
fshcmdCOPYfInputBuffer: .db $00, $00, $00, $00, $00, $00
fshcmdCOPYfDSource: .db "Source= ", 0
fshcmdCOPYfDDestination: .db "Destination= ", 0

View File

@ -66,5 +66,5 @@ fshcmdSETfExe:
jp ErrCatch
fshcmdSETfInputBuffer: .db $00, $00, $00, $00, $00, $00
fshcmdSETfDIndex: .db "Index= ", 0
fshcmdSETfDIndex: .db "Destination= ", 0
fshcmdSETfDValue: .db "Value= ", 0