home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Audio 4.94 - Over 11,000 Files
/
audio-11000.iso
/
msdos
/
sndbords
/
proaudio
/
pcmtlsrc
/
pcmtlsrc.arj
/
PCM.ARJ
/
MACRO.INC
< prev
next >
Wrap
Text File
|
1992-07-29
|
5KB
|
316 lines
;$Author: BCRANE $
;$Date: 29 Jul 1992 16:57:42 $
;$Header: W:/sccs/sdkapp/macro.inv 1.0 29 Jul 1992 16:57:42 BCRANE $
;$Log: W:/sccs/sdkapp/macro.inv $
;
; Rev 1.0 29 Jul 1992 16:57:42 BCRANE
;Initial revision.
;$Logfile: W:/sccs/sdkapp/macro.inv $
;$Modtimes$
;$Revision: 1.0 $
;$Workfile: macro.inc $
;; 'macro.inc: copyright Shark, 1992', 00h
GETDOSVECTOR equ 35h
SETDOSVECTOR equ 25h
VIDEOSCREEN equ 0B000h
pushall macro
push bx
push cx
push si
push di
push es
push ds
push bp
endm
popall macro
pop bp
pop ds
pop es
pop di
pop si
pop cx
pop bx
endm
dspmonochar macro at, char
push bx
push es
mov bx, VIDEOSCREEN
mov es, bx
mov bx, at
mov es:[bx], byte ptr char
pop es
pop bx
endm
;; macro.inc - defined macros
;;
dstring macro string
ifnb <string>
push dx
mov dx, offset string
endif
mov ah, 09h
int 21h
ifnb <string>
pop dx
endif
endm
monoclrscrn macro attribute
push cx
push di
push es
mov di, VIDEOSCREEN
mov es, di
mov di, 0
mov cx, 80*25
ifnb <attribute>
mov ax, attribute
endif
cld
rep stosw
pop es
pop di
pop cx
endm
monoflipscreen macro attribute
push cx
push di
push es
mov di, VIDEOSCREEN
mov es, di
mov di, 0
mov cx, 80*25
ifnb <attribute>
mov al, attribute
endif
cld
@@:
inc di
stosb
loop @B
pop es
pop di
pop cx
endm
;; terminate - returning to DOS with an exit code
;; [mov al, [code]]
;;
;; Syntax:
;;
;; terminate mov 0 to al and terminate
;;
;; terminate [constant] mov "constant" to al and terminate
;;
;; terminate using [reg] mov register to al and terminate
;;
terminate macro using, reg
mov ah, 4Ch
ifb <using>
mov al, 00h
elseifidn <using>, <resident>
resident using reg
exitm
elseifnb <reg>
mov al, reg
else
mov al, using
endif
int 21h
endm
;; resident - going TSR with an exit code
;; [mov al, [code]]
;;
;; Syntax:
;;
;; resident [size] move size to dx, return 0
;;
;; resident size [retval] move size to dx, return retval
;;
;; resident size using [reg] move size to dx, register to al
;;
;; if specified size is moved to dx (paragraphs of resident code)
;;
resident macro size, using, reg
ifnb <size>
mov dx, size
endif
ifb <using>
mov ax, 03100h
else
ifnb <reg>
mov ah, 031h
mov al, reg
else
mov ah, 031h
mov al, using
endif
endif
int 21h
endm
;; pushem - push a list of registers to be popped off by popem
;; the list for pushem and popem is in the same order, but the
;; actual pushes and pops are in reverse order
pushem macro r1, r2, r3, r4, r5, r6, r7, r8
ifnb <r1>
push r1
ifnb <r2>
push r2
ifnb <r3>
push r3
ifnb <r4>
push r4
ifnb <r5>
push r5
ifnb <r6>
push r6
ifnb <r7>
push r7
ifnb <r8>
push r8
endif
endif
endif
endif
endif
endif
endif
endif
endm
;; popem - pop a list of registers (pushed by pushem)
;; the list for pushem and popem is in the same order, but the
;; actual pushes and pops are in reverse order
popem macro r1, r2, r3, r4, r5, r6, r7, r8
ifnb <r8>
pop r8
endif
ifnb <r7>
pop r7
endif
ifnb <r6>
pop r6
endif
ifnb <r5>
pop r5
endif
ifnb <r4>
pop r4
endif
ifnb <r3>
pop r3
endif
ifnb <r2>
pop r2
endif
ifnb <r1>
pop r1
endif
endm
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;z
;; dsp_hex - display a byte as a hex number
dsp_hexbyte macro num
local loniblt10, hiniblt10
ifnb <num>
mov al, num
endif
mov dl, al
mov dh, al
shr dl, 1
shr dl, 1
shr dl, 1
shr dl, 1
and dl, 00Fh
add dl, '0'
cmp dl, 10 + '0'
jl loniblt10
add dl, 'A' - '0' - 10
loniblt10:
mov ah, 02h
int 021h
mov dl, dh
and dl, 00Fh
add dl, '0'
cmp dl, 10 + '0'
jl hiniblt10
add dl, 'A' - '0' - 10
; sub dl, '0'
; sub dl, 10
; add dl, 'A'
hiniblt10:
mov ah, 02h
int 021h
endm
;; mono_hex - display a byte as a hex number on monochrome screen at es:di
mono_hexbyte macro num
local loniblt10, hiniblt10
ifnb <num>
mov al, byte ptr num
endif
push cx
push ax
mov cl, 4
shr al, cl
and al, 0Fh
add al, '0'
cmp al, 10 + '0'
jl hiniblt10
add al, 'A' - '0' - 10
hiniblt10:
mov ah, monoatr
cld
stosw
pop ax
push ax
and al, 0Fh
add al, '0'
cmp al, 10 + '0'
jl loniblt10
add al, 'A' - '0' - 10
loniblt10:
mov ah, monoatr
cld
stosw
pop ax
pop cx
endm