From: Robert Pengelly Date: Mon, 30 Sep 2024 16:38:26 +0000 (+0100) Subject: Process environment passed to us X-Git-Url: https://git.candlhat.org/?a=commitdiff_plain;h=3cacc4630aac5575310e1554f0af0469aa86b7a1;p=chimaera.git Process environment passed to us --- diff --git a/build/chimaera.img b/build/chimaera.img index 89c9d7b..2933388 100644 Binary files a/build/chimaera.img and b/build/chimaera.img differ diff --git a/build/chimaera.vhd b/build/chimaera.vhd index 8a05227..47cb422 100644 Binary files a/build/chimaera.vhd and b/build/chimaera.vhd differ diff --git a/src/apps/pcomm/pcomm.asm b/src/apps/pcomm/pcomm.asm index 0816320..2e21d9e 100644 --- a/src/apps/pcomm/pcomm.asm +++ b/src/apps/pcomm/pcomm.asm @@ -26,6 +26,40 @@ _main: mov bx, offset _welcome_message call _writestr + mov ax, cs:[HEX (2C)] + + and ax, ax + jz .L110 + + push ds + push bx + + mov ds, ax + xor bx, bx + +.L109: + + cmp byte ptr [bx], 0 + je .L117 + + call _handler_set + push bx + + call _strlen + add sp, 2 + + add bx, ax + inc bx + + jmp .L109 + +.L117: + + pop bx + pop ds + +.L110: + xor ax, ax push ax diff --git a/src/apps/pcomm/set.asm b/src/apps/pcomm/set.asm index 95049ec..5663e2f 100644 --- a/src/apps/pcomm/set.asm +++ b/src/apps/pcomm/set.asm @@ -20,6 +20,9 @@ _handler_set: push es push ds + mov ax, cs + mov es, ax + xor dx, dx call _skip_whitespace @@ -114,7 +117,11 @@ _handler_set.trim: _handler_set.got_arg: + mov ax, cs + mov ds, ax + mov bx, offset _arg + push di mov di, offset _var