Microsoft (R) Macro Assembler Version 5.10                  5/16/24 23:40:12
CP/DOS DosExit mapper                                       Page     1-1


				;
				page 60,132
				;
				title CP/DOS DosExit mapper
				;
 0000				dosxxx  segment byte public 'dos'
				        assume  cs:dosxxx,ds:nothing,es:nothing,ss:nothing
				;
				;**********************************************************************
				;*
				;*   MODULE:   dosexit
				;*
				;*   FUNCTION:  Exit a process
				;*
				;*   CALLING SEQUENCE:
				;*
				;*       push      word   action code
				;*       push      word   result code
				;*       call      dosexit
				;*
				;*   MODULES CALLED:  DOS Int 21h, Function 4ch, terminate process
				;*
				;*********************************************************************
				
				            public   dosexit
				            .sall
				            include  macros.inc
			     C	;
			     C	
			     C	
			     C	pushal  macro
			     C	        push    bx
			     C	        push    cx
			     C	        push    dx
			     C	        push    si
			     C	        push    di
			     C	        push    ds
			     C	        push    es
			     C	        push    ss
			     C	        push    bp
			     C	        endm
			     C	;
			     C	popal   macro
			     C	        pop     bp
			     C	        pop     ss
			     C	        pop     es
			     C	        pop     ds
			     C	        pop     di
			     C	        pop     si
			     C	        pop     dx
			     C	        pop     cx
			     C	        pop     bx
			     C	        endm
			     C	;
			     C	Enter   macro   Routine
			     C	
Microsoft (R) Macro Assembler Version 5.10                  5/16/24 23:40:12
CP/DOS DosExit mapper                                       Page     1-2


			     C	        push    bp
			     C	        mov     bp,sp
			     C	        pushal
			     C	
			     C	        endm
			     C	;
			     C	Mexit   macro
			     C	
			     C	        popal
			     C	        mov     sp,bp
			     C	        pop     bp
			     C	
			     C	        endm
			     C	
				
				str         struc
 0000  0000			old_bp      dw       ?
 0002  00000000			return      dd       ?
 0006  0000			Result      dw       ?       ; result code
 0008  0000			Action      dw       ?       ; action code
 000A				str         ends
				
 0000				dosexit     proc     far
				
				            Enter    DosExit             ; push registers
				
 000C  8B 46 08			            mov      ax,[bp].action      ; set resule code area
 000F  3D 0001			            cmp      ax,1                ; check for valid action code
 0012  7F 09			            jg       exit                ; jump if invalid action code
				
 0014  8B 46 06			            mov      ax,[bp].result      ; else, set result code
				
 0017  B4 4C			            mov      ah,4ch              ; load opcode
 0019  CD 21			            int      21h                 ; do exit
				
 001B  33 C0			            xor      ax,ax               ; set good return code
				
 001D				exit:       mexit                        ; pop registers
 0029  CA 0004			            ret      size str - 6        ; return
				
 002C				dosexit     endp
				
 002C				dosxxx      ends
				
				            end

Microsoft (R) Macro Assembler Version 5.10                  5/16/24 23:40:12
CP/DOS DosExit mapper                                       Symbols-1


Macros:

		N a m e			Lines

ENTER  . . . . . . . . . . . . .  	   3
MEXIT  . . . . . . . . . . . . .  	   3
POPAL  . . . . . . . . . . . . .  	   9
PUSHAL . . . . . . . . . . . . .  	   9

Structures and Records:

                N a m e                 Width   # fields
                                        Shift   Width   Mask    Initial

STR  . . . . . . . . . . . . . .  	000A	0004
  OLD_BP . . . . . . . . . . . .  	0000
  RETURN . . . . . . . . . . . .  	0002
  RESULT . . . . . . . . . . . .  	0006
  ACTION . . . . . . . . . . . .  	0008

Segments and Groups:

                N a m e         	Length	 Align	Combine Class

DOSXXX . . . . . . . . . . . . .  	002C	BYTE	PUBLIC	'DOS'

Symbols:            

                N a m e         	Type	 Value	 Attr

dosexit  . . . . . . . . . . . .  	F PROC	0000	DOSXXX	Global	Length = 002C

EXIT . . . . . . . . . . . . . .  	L NEAR	001D	DOSXXX

@CPU . . . . . . . . . . . . . .  	TEXT  0101h		
@FILENAME  . . . . . . . . . . .  	TEXT  exit		
@VERSION . . . . . . . . . . . .  	TEXT  510		


    104 Source  Lines
    128 Total   Lines
     18 Symbols

  47546 + 327170 Bytes symbol space free

      0 Warning Errors
      0 Severe  Errors
