-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathAIL.MAC
84 lines (80 loc) · 3.32 KB
/
AIL.MAC
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
;ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
;ÛÛ ÛÛ
;ÛÛ AIL.MAC ÛÛ
;ÛÛ ÛÛ
;ÛÛ IBM Audio Interface Library -- General purpose 80x86 macros ÛÛ
;ÛÛ ÛÛ
;ÛÛ Version 1.00 of 27-Sep-91: Initial version for AIL V2.0 release ÛÛ
;ÛÛ ÛÛ
;ÛÛ 8086 ASM source compatible with Turbo Assembler v2.0 or later ÛÛ
;ÛÛ Author: John Miles ÛÛ
;ÛÛ ÛÛ
;ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
;ÛÛ ÛÛ
;ÛÛ Copyright (C) 1991, 1992 Miles Design, Inc. ÛÛ
;ÛÛ ÛÛ
;ÛÛ Miles Design, Inc. ÛÛ
;ÛÛ 10926 Jollyville #308 ÛÛ
;ÛÛ Austin, TX 78759 ÛÛ
;ÛÛ (512) 345-2642 / FAX (512) 338-9630 / BBS (512) 454-9990 ÛÛ
;ÛÛ ÛÛ
;ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
FAR_TO_HUGE MACRO fp_seg,fp_off ;normalize far pointer
push ax bx
mov ax,fp_seg
mov bx,fp_off
shr bx,1
shr bx,1
shr bx,1
shr bx,1
add ax,bx
mov fp_seg,ax
and fp_off,0fh
pop bx ax
ENDM
ADD_PTR MACRO add_l,add_h,pseg,poff ;add 32-bit dword to far ptr
push bx
push cx
mov bx,pseg
xor cx,cx
shl bx,1
rcl cx,1
shl bx,1
rcl cx,1
shl bx,1
rcl cx,1
shl bx,1
rcl cx,1
add bx,poff
adc cx,0
add bx,add_l
adc cx,add_h
mov poff,bx
and poff,1111b
shr cx,1
rcr bx,1
shr cx,1
rcr bx,1
shr cx,1
rcr bx,1
shr cx,1
rcr bx,1
mov pseg,bx
pop cx
pop bx
ENDM
POP_F MACRO ;avoid POPF bug on brain-dead 80286's
LOCAL intel_bytes
db 80h ;make an OR BH,00 instruction
intel_bytes: iret
db 00h
push cs
call intel_bytes
ENDM
REP_MOVSB MACRO ;do REP MOVSB with 16-bit transfers
shr cx,1
rep movsw
adc cx,cx
rep movsb
ENDM