source: xtideuniversalbios/trunk/Assembly_Library/Inc/BiosData.inc@ 116

Last change on this file since 116 was 116, checked in by krille_n_@…, 14 years ago

Changes to all parts of the project:

  • Removed a redundant macro (HPIO_NORMALIZE_PTR)
  • Deleted XTIDE_Universal_BIOS/Inc/BiosData.inc since that was also redundant.
  • Size optimization: Changed the LOAD_BDA_SEGMENT_TO macro to use the stack on 186+ processors (the old behaviour can still be used where needed).
  • Made other minor size optimizations and cleanups to various functions, mostly in the Int13h handler.
File size: 6.9 KB
RevLine 
[116]1; Project name : XTIDE Universal BIOS
[41]2; Description : Equates for BIOS Data Area.
3%ifndef BIOSDATA_INC
4%define BIOSDATA_INC
5
6;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7; BIOS DATA AREA VARIABLES ;
8;;;;;;;;;;;;;;;;;;;;;;;;;;;;
9
10; BIOS Data Area (related to floppy drives and hard disks)
11struc BDA
12 resb 400h ; 40:0h, Start of BDA
13 .wCOM1 resb 2 ; 0:400h, Serial I/O Address, Port 1
14 .wCOM2 resb 2 ; 0:402h, Serial I/O Address, Port 2
15 .wCOM3 resb 2 ; 0:404h, Serial I/O Address, Port 3
16 .wCOM4 resb 2 ; 0:406h, Serial I/O Address, Port 4
17 .wLPT1 resb 2 ; 0:408h, Parallel I/O Address, Port 1
18 .wLPT2 resb 2 ; 0:40Ah, Parallel I/O Address, Port 2
[116]19 .wLPT3 resb 2 ; 0:40Ch, Parallel I/O Address, Port 3
[41]20 .wLPT4: ; 0:40Eh, Parallel I/O Address, Port 4 (PC/XT)
21 .wSegEBDA resb 2 ; 0:40Eh, Extended BIOS Data Area segment (AT+)
[116]22
[41]23 .wEquipment resb 2 ; 0:410h, Equipment Word
24 .bTest resb 1 ; 0:412h, Manufacturing test
25 .wBaseMem resb 2 ; 0:413h, Base Memory Size in kB
26 .wAdptrMem: ; 0:415h, Adapter Memory Size (PC/XT)
27 .wError resb 2 ; 0:415h, Error Codes (AT+)
28 .bKBFlgs1 resb 1 ; 0:417h, Keyboard, Shift Flags, Set 1
29 .bKBFlgs2 resb 1 ; 0:418h, Keyboard, Shift Flags, Set 2
30 .bKBNumpad resb 1 ; 0:419h, Keyboard, ALT+Numpad work area
31 .wKBHead resb 2 ; 0:41Ah, Keyboard, Head of buffer pointer
32 .wKBTail resb 2 ; 0:41Ch, Keyboard, Tail of buffer pointer
33 .rgwKBBuff resb 32 ; 0:41Eh, Keyboard, 16-word buffer
[116]34
[41]35 .bFDRecal resb 1 ; 0:43Eh, Diskette, Recalibrate status
36 .bFDMotor resb 1 ; 0:43Fh, Diskette, Motor status
[116]37
[41]38 .bFDMotTime resb 1 ; 0:440h, Diskette, Motor timeout counter
39 .bFDRetST resb 1 ; 0:441h, Diskette, Controller status return code
40 .rgbFDStatus resb 7 ; 0:442h, Diskette, Diskette and Disk Controller status bytes
41 .bVidMode resb 1 ; 0:449h, Video, Mode
42 .wVidColumns resb 2 ; 0:44Ah, Video, Number of columns
43 .wVidBpP resb 2 ; 0:44Ch, Video, Total number of bytes per page
44 .wVidPageOff resb 2 ; 0:44Eh, Video, Current page offset
[116]45
[41]46 .rgwVidCurPos resb 16 ; 0:450h, Video, Cursor position, pages 0...7
[116]47
[41]48 .wVidCurShape resb 2 ; 0:460h, Video, Cursor shape
49 .bVidPageIdx resb 1 ; 0:462h, Video, Active display page
50 .wVidPort resb 2 ; 0:463h, Video, I/O Port number base
51 .bVidModeReg resb 1 ; 0:465h, Video, Internal mode register
52 .bVidPalette resb 1 ; 0:466h, Video, Color palette
53 .wCasTimeCnt: ; 0:467h, Cassette, Time count at data edge (PC)
54 .wGenOff resb 2 ; 0:467h, General use offset (XT+)
55 .wCasCRC: ; 0:469h, Cassette, CRC register (PC)
56 .wGenSeg resb 2 ; 0:469h, General use segment (XT+)
57 .bCasLast: ; 0:46Bh, Cassette, Last value read
58 .bLastIRQ resb 1 ; 0:46Bh, Last interrupt that occurred (XT+)
59 .dwTimerTicks resb 4 ; 0:46Ch, Timer ticks count
[116]60
[41]61 .bTimer24h resb 1 ; 0:470h, Timer ticks rollover flag
62 .bKBCtrlBrk resb 1 ; 0:471h, Keyboard, Ctrl+Break flag
63 .wBoot resb 2 ; 0:472h, Warm boot flag
64 .bHDLastSt resb 1 ; 0:474h, Hard Disk, Status of Last Operation (XT+)
65 .bHDCount resb 1 ; 0:475h, Hard Disk, Number of HDs Attached (XT+)
[116]66 .bHDCtrl resb 1 ; 0:476h, Hard Disk, Control Byte (temp, XT+)
[41]67 .bHDPortOff resb 1 ; 0:477h, Hard Disk, Port Offset (XT)
68 .bLPT1Timeout resb 1 ; 0:478h, Parallel Printer 1, Timeout (XT+)
69 .bLPT2Timeout resb 1 ; 0:479h, Parallel Printer 2, Timeout (XT+)
70 .bLPT3Timeout resb 1 ; 0:47Ah, Parallel Printer 3, Timeout (XT+)
71 .bLPT4Timeout resb 1 ; 0:47Bh, Parallel Printer 4, Timeout (XT+)
72 .bCOM1Timeout resb 1 ; 0:47Ch, Serial 1, Timeout (XT+)
73 .bCOM2Timeout resb 1 ; 0:47Dh, Serial 2, Timeout (XT+)
74 .bCOM3Timeout resb 1 ; 0:47Eh, Serial 3, Timeout (XT+)
75 .bCOM4Timeout resb 1 ; 0:47Fh, Serial 4, Timeout (XT+)
[116]76
[41]77 .wKBPtrStart resb 2 ; 0:480h, Keyboard, Pointer to start of buffer (XT+)
78 .wKBPtrEnd resb 2 ; 0:482h, Keyboard, Pointer to end of buffer (XT+)
79 .bVidRows resb 1 ; 0:484h, Video, Number of rows (EGA+)
80 .wVidPpC resb 2 ; 0:485h, Video, Pixels per character (EGA+)
81 .bVidOptns resb 1 ; 0:487h, Video, Options (EGA+)
82 .bVidSwitches resb 1 ; 0:488h, Video, Switches (EGA+)
83 .bVidSave1 resb 1 ; 0:489h, Video, Save area 1 (VGA+)
84 .bVidSave2 resb 1 ; 0:48Ah, Video, Save area 2 (VGA+)
85 .bFDCfgData resb 1 ; 0:48Bh, Diskette, Configuration data (AT+)
86 .bHDStatus resb 1 ; 0:48Ch, Hard Disk, Status Register (AT+)
87 .bHDError resb 1 ; 0:48Dh, Hard Disk, Error Register (AT+)
88 .bHDTaskFlg resb 1 ; 0:48Eh, Hard Disk, Task Complete Flag (AT+)
89 .bFDCtrlInfo resb 1 ; 0:48Fh, Diskette, Controller information (AT+)
[116]90
[41]91 .bFDMedia0 resb 1 ; 0:490h, Diskette 0, Media state (AT+)
92 .bFDMedia1 resb 1 ; 0:491h, Diskette 1, Media state (AT+)
93 .bFDOpStart0 resb 1 ; 0:492h, Diskette 0, Operational starting state (AT+)
94 .bFDOpStart1 resb 1 ; 0:493h, Diskette 1, Operational starting state (AT+)
95 .bFDCurCyl0 resb 1 ; 0:494h, Diskette 0, Current cylinder (AT+)
96 .bFDCurCyl1 resb 1 ; 0:495h, Diskette 1, Current cylinder (AT+)
97 .bKBFlgs3 resb 1 ; 0:496h, Keyboard, Status flags 3 (AT+)
98 .bKBFlgs4 resb 1 ; 0:497h, Keyboard, Status flags 4 (AT+)
99 .dwWaitPtr resb 4 ; 0:498h, User's wait flag pointer (AT+)
100 .dwWaitCnt resb 4 ; 0:49Ch, User's wait count (AT+)
[116]101
[41]102 .bWaitFlg resb 1 ; 0:4A0h, Wait flag (AT+)
103 .rgbLAN resb 7 ; 0:4A1h, Local Area Network (AT+)
104 .dwVidPtr resb 4 ; 0:4A8h, Video, Parameter Control Block Pointer (EGA+)
105 resb 22h ; Reserved from 0:4ACh...0:4CDh
106
107 .dwDays resb 4 ; 0:4CEh, Clock, Days since 1980 (some BIOSes, AT+)
108 resb 2Eh ; Reserved from 0:4D2h...0:4FFh
109
110 .bPrntScrn resb 1 ; 0:500, Print screen status
111endstruc
112
113; BDA struct with only Hard Disk related locations
114struc HDBDA
115 resb 474h
116 .bHDLastSt resb 1 ; 0:474h, Status of Last Operation (XT+)
117 .bHDCount resb 1 ; 0:475h, Number of HDs Attached (XT+)
118 .bHDCtrl resb 1 ; 0:476h, Control Byte (temp, XT+)
119 .bHDPortOff resb 1 ; 0:477h, Port Offset (XT)
120 resb 15h
121 .bHDStatus: ; 0:48Ch, Status Register (AT+)
122 .bHDError: ; 0:48Dh, Error Register (AT+)
123 .wHDStAndErr resb 2
124 .bHDTaskFlg resb 1 ; 0:48Eh, Task Complete Flag (AT+)
125endstruc
126
127
128;--------------------------------------------------------------------
129; Load BDA (Bios Data Area) segment to wanted segment register.
130;
[116]131; Use an exclamation point (!) as the third parameter when you want
132; to force the use of the register in the second parameter. This is
133; useful when that register needs to be zeroed in subsequent code or
134; when stack usage is undesirable (ie speed is critical).
135;
[41]136; LOAD_BDA_SEGMENT_TO
137; Parameters:
138; %1: Destination Segment Register
139; %2: Temporary WORD Register
[116]140; %3: Can be ! or empty
[41]141; Returns:
142; %1: BDA segment (zero)
143; Corrupts registers:
144; %2
145;--------------------------------------------------------------------
[116]146%macro LOAD_BDA_SEGMENT_TO 2-3
147%ifndef USE_186
[41]148 xor %2, %2
149 mov %1, %2
[116]150%elifidn %3, !
151 xor %2, %2
152 mov %1, %2
153%else
154 push BYTE 0
155 pop %1
156%endif
[41]157%endmacro
158
159
160%endif ; BIOSDATA_INC
Note: See TracBrowser for help on using the repository browser.