From c230856f097069fb026459c42debfcf0b608584f Mon Sep 17 00:00:00 2001
From: Valentin Lenhart <valentin.lenhart@posteo.de>
Date: Mon, 21 Oct 2019 17:30:15 +0200
Subject: [PATCH] pass the number of arguments to the called function

---
 kernel/shell.asm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/shell.asm b/kernel/shell.asm
index 75f58ee..55fbee4 100644
--- a/kernel/shell.asm
+++ b/kernel/shell.asm
@@ -159,6 +159,7 @@ shellParse:
 	jr	z, .parseerror
 
 	; Args parsed, now we can load the routine address and call it.
+	ld	b, a ; pass number of arguments as b
 	; let's have DE point to the jump line
 	ld	hl, SHELL_CMD_ARGS
 	ld	a, PARSE_ARG_MAXCOUNT