forked from adriancable/8086tiny
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathAMIS.MAC
78 lines (66 loc) · 2.23 KB
/
AMIS.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
[list -]
%if 0
AMIS.MAC - NASM macros and structures to work with the IISP and AMIS
Public Domain by C. Masloch, 2008-2009
I recommend reading AMIS itself for the exact function descriptions.
%endif
%ifndef __AMIS_MAC__
%assign __AMIS_MAC__ 1
struc IISPENTRY
ieEntry: resb 2 ; 00h "jmp short" to ieStart
ieNext: resd 1 ; 02h next vector
ieSignature: resb 2 ; 06h "KB"
ieEOI: resb 1 ; 08h 80h if issues "end of interrupt"
ieJmphwreset: resb 2 ; 09h "jmp short" to hardware reset
ieReserved: resb 7 ; 0Bh initialize to 0, don't depend on these
ieStart: ; 12h actual vector code
endstruc
struc AMISSIGNATURE
asVendor: resb 8 ; 00h blank padded vendor name
asProduct: resb 8 ; 08h blank padded product name
asDescription: resb 1 ; 10h ASCIZ description, up to 64 byte
endstruc
; AMIS Int2D functions (in al)
afInstalled equ 00h ; installation check
afEntry equ 01h ; get private entry
afUninstall equ 02h ; uninstall
afPopup equ 03h ; request pop-up
afInterrupts equ 04h ; determine chained interrupts
afHotkeys equ 05h ; get hotkey list
afDevices equ 06h ; get device information (changes ah)
; Layout of AMIS interrupt lists:
; byte:00 Interrupt number. Last entry if 2Dh
; word:01 IISP interrupt entry in same segment.
; Generate an IISP interrupt entry
;
; %1 = label for interrupt entry
; %2 = End of Interrupt flag, default 0
; 0 means usual interrupt hook which passes the interrupt down,
; 80h means the interrupt isn't passed to previous handlers
; %3 = label of retf opcode used (actual used label is %3.hwreset)
; If no label is specified, a dummy hardware reset opcode is
; created in front of the actual interrupt entry.
%imacro iispentry 1-3.nolist 0
%ifn %0 >= 3
iisphwreset %1
%endif
%1: jmp short .start
.next: dd 0
.signature: db "KB"
.eoi: db %2
%if %0 >= 3
.jmphwreset: jmp short %3.hwreset
%else
.jmphwreset: jmp short %1.hwreset
%endif
.reserved: times 7 db 0
.start:
%endmacro
; Generate a retf opcode for an IISP compatible interrupt entry, with label
;
; %1 = label for retf opcode (actual generated label is %1.hwreset)
%imacro iisphwreset 1.nolist
%1.hwreset: retf
%endmacro
%endif
[list +]