Mail Archives: djgpp-workers/1996/09/18/22:34:52
DJ Delorie wrote:
> 
> > However, how do I convince symify to use the modified stub that I
> > have made instead of the standard one?  I don't want to get rid of
> > the standard stub, for obvious reasons.  Ideally, the new stub would
> > be in the same directory as the program itself.
> 
> You build a new version of symify.
Okay... Here's a question that will show my mostly complete ignorance
of assembly.  :)  I have examined the stub.asm code, and while most of
it is comprehensible, it still doesn't give me any clues on how to
return system exit codes in assembly.
Obviously, the critical part of stub.asm is the parts that generate the
error messages.  Exactly what instructions would I need to add here to
set an error code, and how do I output said code in the exit call?
Thanks for the help!  I think I've got a good start on the rest of the
project, but my lack of knowledge of assembly is a hindrance here.  I
attach below the relevant sections of stub.asm.
===== cut here =====
;-----------------------------------------------------------------------------
;  Most errors come here, early ones jump direct (8088 instructions)
error_no_progfile:
	mov	dx, msg_no_progfile
	jmp	error_fn
error_not_exe:
	mov	dx, msg_not_exe
	jmp	error_fn
error_not_coff:
	mov	dx, msg_not_coff
;	jmp	error_fn
error_fn:
	push	dx
	mov	bx, [loadname_nul]	; error, print file name
	movb	[bx], '$'
	mov	bx, loadname
	jmp	@f1
error_no_dos_memory_umb:
	call	restore_umb
error_no_dos_memory:
	mov	dx, msg_no_dos_memory
	jmp	error
error_in_modesw:
	mov	dx, msg_error_in_modesw
	jmp	error
perror_no_selectors:
	mov	dx, msg_no_selectors
	jmp	error
perror_no_dpmi_memory:
	mov	dx, msg_no_dpmi_memory
	jmp	error
perror_no_dos_memory:
	mov	dx, msg_no_dos_memory
;	jmp	error
error:
	push	dx
	mov	bx, err_string
@f1:
	call	printstr
	pop	bx
	call	printstr
exit:
	mov	bx, crlfdollar
	call	printstr
	mov	ax, 0x4cff		; error exit
	int	0x21
===== end =====
-- 
--------------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I    |         fighteer AT cs DOT com          
|
| Proud owner of what might one day  |    http://www.cs.com/fighteer    
|
| be a spectacular MUD...            |  Plan: To make Bill Gates suffer 
|
--------------------------------------------------------------------------
- Raw text -