home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
assemblr
/
asm
/
wasm
/
dos.mac
< prev
next >
Wrap
Text File
|
1987-08-13
|
1KB
|
61 lines
List-
;=============================================================================
; DOS Macro Interface
;
; These are macros to implement a few common DOS functions.
;================================================
; Execute a DOS function call.
;
; FUNC - function number: 8 bit operand.
Dos Macro Func
Mov Ah, Func
Int 21h
Endm
;================================================
; Reallocate the segment in ES to the specified
; number of bytes.
;
; BYTES - new size of segment in bytes: 16 bit
; operand.
Reallocate Macro Bytes
Mov Bx, Bytes
Mov Cl, 4
Shr Bx, Cl
Inc Bx
Dos 4ah
Endm
;================================================
; Allocate a new segment with the specified
; number of bytes. AX returns the segment address.
;
; BYTES - new size of segment in bytes: 16 bit
; operand.
Allocate Macro Bytes
Mov Bx, Bytes
Mov Cl, 4
Shr Bx, Cl
Inc Bx
Dos 48h
Endm
;================================================
; Exit the program with error code set.
;
; ERR - error code (default 0): 8 bit operand.
Exit Macro Err
If Type(Err) And Type()
Sub Al, Al
Else
Mov Al, Err
Endif
Dos 4ch
Endm