diff --git a/FSHa.asm b/FSHa.asm index e5d5ccf..b55f7d5 100644 --- a/FSHa.asm +++ b/FSHa.asm @@ -31,7 +31,7 @@ Decode: Route: LD HL, FshCmdOP - JP fshcmdroute + JP commandroute Fin: JP Input diff --git a/includes/Command.asm b/includes/Command.asm index ffb3549..244c7b9 100644 --- a/includes/Command.asm +++ b/includes/Command.asm @@ -6,10 +6,23 @@ ;;Output: ;; Sets (DE) with command op code commanddecode: - ;add more call fshcmddecode ret +;;commandroute +;;Routes all commamds. +;;Inputs: +;; HL: Op code mem loc +;;Outputs: +;; Jp to loc for cmd func +;; ult go to Fin +commandroute: + call fshcmdroute + + ld hl, FshCmdErrCode + ld (hl), $01 + jp Err + ; commandfill ;; fills command mem with byte a commandfill: diff --git a/includes/FshCmd.asm b/includes/FshCmd.asm index e169512..84e9763 100644 --- a/includes/FshCmd.asm +++ b/includes/FshCmd.asm @@ -63,13 +63,14 @@ fshcmddecode: ret ;;fshcmdroute -;;Routes all commamds. +;;Routes FshCommamds. ;;Inputs: ;; HL: Op code mem loc ;;Outputs: ;; Jp to loc for cmd func -;; ult go to Fin fshcmdroute: + pop bc ;pop the ret loc from stack into bc + ld de, fshcmdEXITo call bytecmp jp z, fshcmdEXITf @@ -93,9 +94,8 @@ fshcmdroute: ld de, fshcmdCLSo call bytecmp jp z, fshcmdCLSf - - ld hl, FshCmdErrCode - ld (hl), $01 - jp Err + + push bc ;put ret location back on stack + ret #include "includes/FshCommands/FshCommands.inc"