diff --git a/FSHa.asm b/FSHa.asm index 2121a43..e5d5ccf 100644 --- a/FSHa.asm +++ b/FSHa.asm @@ -12,8 +12,8 @@ Setup: CALL fshvarreset Input: - LD C, $00 - CALL fshcmdfill + LD A, $00 + CALL commandfill LD HL, PS1 CALL printprompt @@ -27,7 +27,7 @@ Input: Decode: LD HL, FshCmd LD DE, FshCmdOP - CALL fshcmddecode + CALL commanddecode Route: LD HL, FshCmdOP @@ -59,7 +59,7 @@ FshFlags: .DB %00000000 #include "includes/Cursor.asm" #include "includes/Print.asm" -#include "includes/FshCmd.asm" +#include "includes/Command.asm" #include "includes/Err.asm" #include "includes/String.asm" diff --git a/bin/FSHa.8xp b/bin/FSHa.8xp index 96aaca5..d2b10ee 100644 Binary files a/bin/FSHa.8xp and b/bin/FSHa.8xp differ diff --git a/includes/Command.asm b/includes/Command.asm new file mode 100644 index 0000000..ffb3549 --- /dev/null +++ b/includes/Command.asm @@ -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" diff --git a/includes/FshCmd.asm b/includes/FshCmd.asm index 870c674..e169512 100644 --- a/includes/FshCmd.asm +++ b/includes/FshCmd.asm @@ -98,28 +98,4 @@ fshcmdroute: ld (hl), $01 jp Err -; fshvarfill -;; 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" +#include "includes/FshCommands/FshCommands.inc" diff --git a/includes/FshCommands.inc b/includes/FshCommands/FshCommands.inc similarity index 100% rename from includes/FshCommands.inc rename to includes/FshCommands/FshCommands.inc