restructured commands
This commit is contained in:
parent
9aed40be6f
commit
753a4747dd
8
FSHa.asm
8
FSHa.asm
|
|
@ -12,8 +12,8 @@ Setup:
|
||||||
CALL fshvarreset
|
CALL fshvarreset
|
||||||
|
|
||||||
Input:
|
Input:
|
||||||
LD C, $00
|
LD A, $00
|
||||||
CALL fshcmdfill
|
CALL commandfill
|
||||||
|
|
||||||
LD HL, PS1
|
LD HL, PS1
|
||||||
CALL printprompt
|
CALL printprompt
|
||||||
|
|
@ -27,7 +27,7 @@ Input:
|
||||||
Decode:
|
Decode:
|
||||||
LD HL, FshCmd
|
LD HL, FshCmd
|
||||||
LD DE, FshCmdOP
|
LD DE, FshCmdOP
|
||||||
CALL fshcmddecode
|
CALL commanddecode
|
||||||
|
|
||||||
Route:
|
Route:
|
||||||
LD HL, FshCmdOP
|
LD HL, FshCmdOP
|
||||||
|
|
@ -59,7 +59,7 @@ FshFlags: .DB %00000000
|
||||||
#include "includes/Cursor.asm"
|
#include "includes/Cursor.asm"
|
||||||
#include "includes/Print.asm"
|
#include "includes/Print.asm"
|
||||||
|
|
||||||
#include "includes/FshCmd.asm"
|
#include "includes/Command.asm"
|
||||||
#include "includes/Err.asm"
|
#include "includes/Err.asm"
|
||||||
#include "includes/String.asm"
|
#include "includes/String.asm"
|
||||||
|
|
||||||
|
|
|
||||||
BIN
bin/FSHa.8xp
BIN
bin/FSHa.8xp
Binary file not shown.
|
|
@ -0,0 +1,36 @@
|
||||||
|
;;Commanddecode
|
||||||
|
;;Decodes all commands.
|
||||||
|
;;Inputs:
|
||||||
|
;; HL: Cmd String mem loc
|
||||||
|
;; DE: Op code mem loc
|
||||||
|
;;Output:
|
||||||
|
;; Sets (DE) with command op code
|
||||||
|
commanddecode:
|
||||||
|
;add more
|
||||||
|
call fshcmddecode
|
||||||
|
ret
|
||||||
|
|
||||||
|
; commandfill
|
||||||
|
;; fills command mem with byte a
|
||||||
|
commandfill:
|
||||||
|
push hl
|
||||||
|
push bc
|
||||||
|
push de
|
||||||
|
ld b, 0
|
||||||
|
ld de, 0
|
||||||
|
ld c, a
|
||||||
|
ld hl, FshCmd
|
||||||
|
commandfillLoop:
|
||||||
|
ld (hl), c
|
||||||
|
inc hl
|
||||||
|
inc b
|
||||||
|
inc de
|
||||||
|
ld a, b
|
||||||
|
cp FshCmdSize
|
||||||
|
jr c, commandfillLoop
|
||||||
|
pop de
|
||||||
|
pop bc
|
||||||
|
pop hl
|
||||||
|
ret
|
||||||
|
|
||||||
|
#include "includes/FshCmd.asm"
|
||||||
|
|
@ -98,28 +98,4 @@ fshcmdroute:
|
||||||
ld (hl), $01
|
ld (hl), $01
|
||||||
jp Err
|
jp Err
|
||||||
|
|
||||||
; fshvarfill
|
#include "includes/FshCommands/FshCommands.inc"
|
||||||
;; fills fshcmd with byte
|
|
||||||
;; Inputs:
|
|
||||||
;; C: byte
|
|
||||||
fshcmdfill:
|
|
||||||
push hl
|
|
||||||
push bc
|
|
||||||
push de
|
|
||||||
ld b, 0
|
|
||||||
ld de, 0
|
|
||||||
ld hl, FshCmd
|
|
||||||
fshcmdfillLoop:
|
|
||||||
ld (hl), c
|
|
||||||
inc hl
|
|
||||||
inc b
|
|
||||||
inc de
|
|
||||||
ld a, b
|
|
||||||
cp FshCmdSize
|
|
||||||
jr c, fshcmdfillLoop
|
|
||||||
pop de
|
|
||||||
pop bc
|
|
||||||
pop hl
|
|
||||||
ret
|
|
||||||
|
|
||||||
#include "includes/FshCommands.inc"
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue