delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/06/11/19:54:50

Message-ID: <339F017B.2CCE@cs.com>
Date: Wed, 11 Jun 1997 19:50:19 +0000
From: "John M. Aldrich" <fighteer AT cs DOT com>
Reply-To: fighteer AT cs DOT com
Organization: Two pounds of chaos and a pinch of salt
MIME-Version: 1.0
To: DJGPP Workers Mailing List <djgpp-workers AT delorie DOT com>
Subject: stub.asm error code patch (stub.dif)
References: <199706111229 DOT IAA00961 AT delorie DOT com>

This is a multi-part message in MIME format.

--------------733870EA25F8
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Alright, since everybody seems to be agreed that the error codes are not
a problem, here is the patch to insert them.  Note that this is against
the stock stub.asm in v2.01; I have not yet applied any changes
submitted to the list on the theory that they aren't official.

Please also note that the compiled stub remains less than the 2048 byte
maximum.

-- 
---------------------------------------------------------------------
|      John M. Aldrich       | "Be wary of strong drink.  It can    |
|       aka Fighteer I       | make you shoot at tax collectors--   |
|   mailto:fighteer AT cs DOT com   | and miss."                           |
| http://www.cs.com/fighteer |                 - Lazarus Long       |
---------------------------------------------------------------------

--------------733870EA25F8
Content-Type: text/plain; charset=us-ascii; name="STUB.DIF"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="STUB.DIF"

*** src/stub/stub.as~   Sat Oct  5 18:49:52 1996
--- src/stub/stub.as~   Thu Nov  7 22:11:34 1996
***************
*** 116,121 ****
--- 116,122 ----
	int     0x21
	cmp     al, 3
	jae     dos3ok
+       mov     al, 109
	mov     dx, msg_bad_dos
	jmpl    error
  dos3ok:
***************
*** 180,185 ****
--- 181,187 ----
	xor     cx, cx                  ; flag for load attempt set cx = 0
	jz      @f2                     ; We always jump, shorter than jmp
  @b1:
+       mov     al, 110
	mov     dx, msg_no_dpmi
	jmpl    error
  @b2:
***************
*** 576,589 ****
--- 578,594 ----
  ;  Most errors come here, early ones jump direct (8088 instructions)
  
  error_no_progfile:
+       mov     al, 102
	mov     dx, msg_no_progfile
	jmp     error_fn
  
  error_not_exe:
+       mov     al, 103
	mov     dx, msg_not_exe
	jmp     error_fn
  
  error_not_coff:
+       mov     al, 104
	mov     dx, msg_not_coff
  ;     jmp     error_fn
  
***************
*** 597,618 ****
--- 602,628 ----
  error_no_dos_memory_umb:
	call    restore_umb
  error_no_dos_memory:
+       mov     al, 105
	mov     dx, msg_no_dos_memory
	jmp     error
  
  error_in_modesw:
+       mov     al, 106
	mov     dx, msg_error_in_modesw
	jmp     error
  
  perror_no_selectors:
+       mov     al, 107
	mov     dx, msg_no_selectors
	jmp     error
  
  perror_no_dpmi_memory:
+       mov     al, 108
	mov     dx, msg_no_dpmi_memory
	jmp     error
  
  perror_no_dos_memory:
+       mov     al, 105
	mov     dx, msg_no_dos_memory
  ;     jmp     error
  
***************
*** 626,638 ****
  exit:
	mov     bx, crlfdollar
	call    printstr
!       mov     ax, 0x4cff              ; error exit
	int     0x21
  
  printstr1:
	inc     bx
	mov     ah, 2
	int     0x21
  printstr:
	mov     dl, [bx]
	cmp     dl, '$'
--- 636,650 ----
  exit:
	mov     bx, crlfdollar
	call    printstr
!       mov     ah, 0x4c                ; error exit - exit code is in al
	int     0x21
  
  printstr1:
	inc     bx
+       push    ax                      ; have to preserve al set by error call
	mov     ah, 2
	int     0x21
+       pop     ax                      ; restore ax (John A.)
  printstr:
	mov     dl, [bx]
	cmp     dl, '$'

--------------733870EA25F8--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019