From 94e89b5caaa29ad559477f68ac8e4abb1c9c23e3 Mon Sep 17 00:00:00 2001 From: Robert Pengelly Date: Wed, 14 Aug 2024 21:33:00 +0100 Subject: [PATCH] Return last exit code --- build/chimaera.img | Bin 368640 -> 368640 bytes build/chimaera.vhd | Bin 34120704 -> 34120704 bytes src/apps/hello/hello.asm | 19 +++++++++---------- src/kernel/int21.asm | 4 ++++ 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/build/chimaera.img b/build/chimaera.img index b3e0a5e31ae9b55348b009f87f1b27250b64b7f8..399d6a4daed734870072e8915f8deeb3d4caf39c 100644 GIT binary patch delta 2688 zcmZ`)3s6&68b0>|Nq7W#)F>z+0SyJ~g($d6^q@RKR2~5=gtzT<*KW5%rva_iT7p?e zVge{f#YT%fR2Jz@sj;(Iry4gFa1pE2y1H#$N3{GYY<+E6Knr^k(4kIyXYRTG{r>;^ z&wua#I6A9HXBF)ZbG_*MdD15f`rXTgA9?3`=OW~IBIgyKp1w{pdHGD@PxY)*ugpwJ zN=eL=WaVZ_eyMjuxe*AhP0CD5N|F4E-Ul^gBb1Pynz|}2Q9_>*{^ib-AVD z&a1-O+1{zsBb(frF2YS>L;^I!Da;K21ZcJ*MtQ8`>~g$PSoK4us*`Hyi9xm4g$u8T7&T|pJs z9t%EHWMM@d_&tUhkJ}|Mf#C^;Q4GV_)D83EC^Uq@j^TR@{n&IJd>zmY4A(Gxh2b(b zSz#Pgs1t(?gB8Q)*mM~N9gqb>JBGhvIF9KqdMgjEI^gm{7(T$T9|NH{a&Y#IQG5r6 z?HI~2yoU|+z`%OwG3})_MZRmNd0+MKf-Dgb?-5;8*$W~U9M_a6=pc6kzOc^)OWIK z*lszq>1$@j9R+8Q-BxhT-&27D(zJPjyDYRl0i>b!tK{0|rIB|-+CAV_2n|7_7Mr@O zub)l`hnUb{O%B(^)1yuDguY}UNB~!moL+iBA z{uWVe-N8`Ht-+rD5}GP+NxQ)AZW-L_&IH~J)}QyNRF36o&N3*+dGk?DrW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Jyjm7O|YjCRPwDiB-gEVhxc)d_v?B zoLEbIN~|M3Bi0k26JHQt5*vs-Vk41HY$7%jTZpa1SH#!EHex%mgV;%YLwrjV5W9%) zh~2~OH8#3kY~QB7PSYKU6mDshddBd!y_5;q7zSc#iN zJ#mZpCvls&L)<0q5%-A)#J`B&hz8;z(MUWZnuy256XJK`529Jd<4=QuOlSxj!j`Zj ww1mCp5FUS;9ji1--!HpwWEz9(%?B>t!Q;nyOiG?Two7-9(RMTOm(mXT-}>Z!d;kCd diff --git a/src/apps/hello/hello.asm b/src/apps/hello/hello.asm index bba6775..4ed55a5 100644 --- a/src/apps/hello/hello.asm +++ b/src/apps/hello/hello.asm @@ -69,12 +69,12 @@ _main: ; mov ax, [bp] ; call _writehex ; call _crlf -; -; mov ax, HEX (4B01) -; mov bx, offset _param_blk -; mov dx, offset _app_name -; int HEX (21) -; + + mov ax, HEX (4B01) + mov bx, offset _param_blk + mov dx, offset _app_name + int HEX (21) + ; mov ah, HEX (62) ; int HEX (21) ; @@ -487,7 +487,7 @@ _main: ; xor ax, ax ; int 0x16 - xor ax, ax + mov ax, 1 ret ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -503,7 +503,6 @@ _msg_hello: db "Hello, world!", HEX (0D), HEX ;_flags: db "w+b", HEX (00) ;_buffer: db 512 dup (0) ;_to_write: dw HEX (0000) -;_app_name: db "\\command.com", HEX (00) -;_param_blk: db 22 dup (0) -; +_app_name: db "\\command.com", HEX (00) +_param_blk: db 22 dup (0) ;_msg_any_key: db "Press any key to exit...", HEX (0D), HEX (0A), HEX (00) diff --git a/src/kernel/int21.asm b/src/kernel/int21.asm index 2b2e5e1..e300cf6 100644 --- a/src/kernel/int21.asm +++ b/src/kernel/int21.asm @@ -4281,6 +4281,10 @@ _int21_4C.done: mov cs:[_curr_psp], bx call _free_mem + + xor ah, ah + mov al, cs:[_last_ret_val] + retf ;****************************************************************************** -- 2.34.1