Return last exit code
authorRobert Pengelly <robertapengelly@hotmail.com>
Wed, 14 Aug 2024 20:33:00 +0000 (21:33 +0100)
committerRobert Pengelly <robertapengelly@hotmail.com>
Wed, 14 Aug 2024 20:33:00 +0000 (21:33 +0100)
build/chimaera.img
build/chimaera.vhd
src/apps/hello/hello.asm
src/kernel/int21.asm

index b3e0a5e31ae9b55348b009f87f1b27250b64b7f8..399d6a4daed734870072e8915f8deeb3d4caf39c 100644 (file)
Binary files a/build/chimaera.img and b/build/chimaera.img differ
index 26c7b5c8a7edac55bfcdf61bab16d2dbb49c7763..05a7911bf67f529c3f7262af6603d8a1c9215e9c 100644 (file)
Binary files a/build/chimaera.vhd and b/build/chimaera.vhd differ
index bba67756583a1b384f2f4e492c4421241aef9766..4ed55a5b5df606a061f480bea1b55e90ecb475cd 100644 (file)
@@ -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)
index 2b2e5e114f6d8172a91d5b9890a5db0e11daea8a..e300cf657e80f3aa605a38fbab9d976bbe9e1819 100644 (file)
@@ -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
 
 ;******************************************************************************