home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programming
/
powerprogramming1994.iso
/
progtool
/
microcrn
/
issue_41.arc
/
TURKKEYS.ARC
/
MSDOS.MAC
next >
Wrap
Text File
|
1988-03-10
|
2KB
|
73 lines
;** Code from 86World column in Micro Cornuicopia magazine Issue #41
;**
;**
;***************************************************************************
;** MSDOS.MAC **
;** **
;** A set of macros and constants to help in writing programs with **
;** the MASM assembler for use under MSDOS. **
;** **
;** To use: **
;** place the line "INCLUDE MSDOS.MAC" at the beginning **
;** of your assembly language source files **
;** **
;** <lrs> 05/28/86 **
;***************************************************************************
;
; ASCII Constants
;
ctl equ -40h
CR equ ctl+'M'
LF equ ctl+'J'
EOF equ ctl+'Z'
;
; DOS Predefined Handles
;
StdIn equ 0
StdOut equ 1
StdErr equ 2
Aux equ 3
Prn equ 4
;
; A 'DOS' Instruction
;
DOS MACRO FtnNum
MOV AH,FtnNum
INT 21h
ENDM ;DOS
;
; DOS Function Numbers
;
OpenHandle equ 3Dh
Read equ 0
Write equ 1
RandW equ 2
CloseHandle equ 3Eh
ReadHandle equ 3Fh
WriteHandle equ 40h
GetVector equ 35h
SetVector equ 25h
EndF equ 4Ch
TerminateKeep equ 31h
;
; Handle Input & Output Macros
;
Input MACRO Handle, Address, Bytes
MOV BX,Handle
MOV CX,Bytes
MOV DX,offset Address
DOS ReadHandle
ENDM ;Input
Output MACRO Handle, Address, Bytes
MOV BX,Handle
MOV CX,Bytes
MOV DX,offset Address
DOS WriteHandle
ENDM ;Output
;
; end of MSDOS.MAC
;