From 9f23d7a79cc48739c4db3203bcc96c5d354178ee Mon Sep 17 00:00:00 2001 From: Valentin Lenhart Date: Mon, 4 Nov 2019 19:04:01 +0100 Subject: [PATCH] use the zero flag to signal success --- apps/at28w/main.asm | 3 +-- apps/zasm/main.asm | 3 +-- kernel/parse.asm | 3 ++- kernel/shell.asm | 3 +-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/apps/at28w/main.asm b/apps/at28w/main.asm index ab57c99..62802e2 100644 --- a/apps/at28w/main.asm +++ b/apps/at28w/main.asm @@ -14,8 +14,7 @@ at28wMain: ld de, .argspecs ld ix, AT28W_MAXBYTES call parseArgs - cp 0xff - jr nz, at28wInner + jr z, at28wInner ; bad args ld a, SHELL_ERR_BAD_ARGS ret diff --git a/apps/zasm/main.asm b/apps/zasm/main.asm index e1630f8..b69422b 100644 --- a/apps/zasm/main.asm +++ b/apps/zasm/main.asm @@ -27,8 +27,7 @@ zasmMain: ld de, .argspecs ld ix, ZASM_RAMSTART call parseArgs - cp 0xff - jr nz, .goodargs + jr z, .goodargs ; bad args ld hl, 0 ld de, 0 diff --git a/kernel/parse.asm b/kernel/parse.asm index 1254511..cb7a7c7 100644 --- a/kernel/parse.asm +++ b/kernel/parse.asm @@ -163,9 +163,10 @@ parseArgs: .success: ld a, PARSE_ARG_MAXCOUNT sbc a, b + cp a ; set z to signal success jr .end .error: - ld a, 0xff + ld a, 1 .end: pop ix pop hl diff --git a/kernel/shell.asm b/kernel/shell.asm index f416f1c..91fdcdf 100644 --- a/kernel/shell.asm +++ b/kernel/shell.asm @@ -155,8 +155,7 @@ shellParse: ; We're ready to parse args ld ix, SHELL_CMD_ARGS call parseArgs - cp 0xff - jr z, .parseerror + jr nz, .parseerror ; Args parsed, now we can load the routine address and call it. ld b, a ; pass number of arguments as b