IBM Personal Computer MACRO Assembler
Version 2.00
POST ----- 01/10/86
SYSTEM POST AND B I as PROCEDURES
1-1
01-10-86
091
PAGE
SETUP HARDWARE I NT. VECTOR TABLE
I
~;~----------------------------------------------
MOV
S I ,OFFSET F 1
; GET MSG ADDR
CALL
E_MSG
; PR I NT MSG ON SCREEN
;
--
-
------- --
-
---- -- - --
-
--
-
---
- --
-- ---
-
- ---
--- -
--
SETUP_INT_TABLEI
GET VECTOR CNT
SETUP OS SEG REG
SK I P OVER SEGMENT
KBD WAITI
DELAY FOR A WH I LE
CHECK FOR STUCK KEYS
SCAN CODE = O?
YES -
CaNT I NUE TESTI NG
CONVERT AND PR I NT
CLR KBD,
SET CLK
LI
NE HIGH
ENABLE KBD, CLK
I N NEXT BYTE
AL,OC8H
PORT B,AL
AL,48H
PORT B,AL
CX,CX
OS
AX,AX
ES,AX
CX,08
CS
OS
S I ,OFFSET VECTOR TABLE
01 ,OFFSET 0 I NT_PTR
F5
AL,KB DATA
AL,O -
F1
XPC_BYTE
MOV
OUT
MOV
OUT
SUB
LOOP
IN
CMP
..IE
CALL
PUSH
SUB
MOV
MOV
PUSH
POP
MOV
MOV
MOV
CL, 12
SET PGM LOOP CNT
MOV
AL, OFFH
WR I TE T I MER 0 CNT REG
OUT
T I MER 0 , AL
MOV
DATA AREA[OINTR FLAG-DATA40),0
; RESET INTR RECEIVED FLAG
MOV
AL, OFEH
-
; REENABLE T I MER 0
I NTERRUTS
OUT
INTA01,AL
TEST
DATA AREA
[0
I NTR FLAG-DATA40), 01 H
; T I MER 0
I NTERRUPT OCCUR?
.JNZ
06
-
-
;
YES -
TIMER CNTING TOO FAST, ERR
LOOP
010
; WAIT FOR INTR FOR SPECIFIED TIME
; - - - - -
SETUP TI MER 0 TO MODE 3
MOVSW
INC
01
INC
01
LOOP
F1A
POP
OS
;----- SET UP OTHER INTERRUPTS AS NECESSARY
MOV
WORD PTR ONM I PTR, OFFSET NM I
I NT ; NM I
INTERRUPT
MOV
WORD PTR 0 I NT5 PTR, OFFSET PRTNT SCREEN 1 ; PR I NT SCREEN
MOV
WORD PTR OBAS Ie PTR+2, OF600H
- ; SEGMENT FOR CASSETTE BAS I C
MOV
WORD PTR OEXT_PTR+2,0000
;SEGMENT FOR VIDEO EXTENSION
SETUP TIMER 0 TO BLINK LED IF MANUFACTURING TEST MODE
CMP
DATA AREA[OMFG TST-DATA40),0IH
; MFG. TEST MODE?
.JNZ
EXP To
-
MOV
WORD PTR DSI [ICH·4) ,OFFSET BLlNK_INT
;
SETUP TIMER TO BLINK LED
;
KEYBOARD TEST
; DESCRIPTION
I
RESET THE KEYBOARD AND CHECK THAT SCAN
I
CODE 'AA'
I S RETURNED TO THE CPU.
I
CHECK FOR STUCK KEYS.
I
~~; ~ ~ ~
----
-
---
-
--- ---
-
--- -
-
-- ----- -- --- -- -- --
-
- --
MOV
AL, 99H
; SET 8255 MODE A, C= IN B=OUT
OUT
CMD PORT, AL
MOV
AL,DATA_AREA[OEQUIP_FLAG-DATA40)
AND
AL, 0 1
; TEST CHAMBER?
.JZ
F1
; BYPASS I F SO
CMP
DATA_AREA[OMFG_TST-DATA40), 1
; MANUFACTUR ING TEST MODE?
..IE
F1
; YES -
SK I P KEYBOARD TEST
CALL
KBD RESET
;
I SSUE RESET TO KEYBRD
.JCXZ
F6 -
; PR I NT ERR MSG I F NO INTERRUPT
MOV
AL ,49H
; ENABLE KEYBOARD
OUT
PORT B, AL
CMP
BL, OAAH
SCAN CODE AS EXPECTED?
.JNE
F6
NO -
0 I SPLA Y ERROR MSG
; ----- CHECK FOR STUCK KEYS
MOV
AL, OFFH
0 I SABLE ALL DEV I CE INTERRUPTS
OUT
INTA01,AL
MOV
AL,36H
SEL TIM O,LSB,MSB,MODE 3
OUT
T I MER+3, AL
WR I TE T I MER MODE REG
MOV
AL,O
OUT
TI MER, AL
; WR I TE LSB TO
TI MER 0 REG
OUT
TIMER,AL
; WRITE MSB TO TIMER 0 REG
;
---
-
--
---
---- --- -
-
---
-
--
- -
------
-
-- -- ---
-
----
- --
;
8253 T I MER CHECKOUT
; DESCRIPTION
I
;
VERIFY THAT THE SYSTEM TIMER
(01 DOESN'T COUNT
I
;
TOO FAST OR TOO SLOW.
I
b;~--------------------------------------------------- ---
MOV
DATA AREA[OMFG ERR FLAG-DATA40) ,02H
-
-
-
;
<><><><><><><><><><><><><><><><>
;
<><><>T I MER CHECKPO I NT
(2 1<><><>
MOV
AL, OFEH
; MASK ALL I NTRS EXCEPT L VL 0
OUT
INTA01,AL
; WRITE THE 8259 IMR
MOV
AL,OOOIOOOOB
;
SEL TIM 0, LSB, MODE 0, BINARY
OUT
TIM CTL, AL
; WR I TE T I MER CONTROL MODE REG
MOV
CX ,
T
6H
;
SET PGM LOOP CNT
MOV
AL,CL
;
SET TIMER 0 CNT REG
OUT
TIMERO,AL
; WRITE TIMER 0 CNT REG
TEST
DATA AREA[OINTR FLAG-DATA40),0IH
-
-
; DID TIMER 0 INTERRUPT OCCUR?
.JNZ
09
;
YES - CHECK T I MER OP FOR SLOW T I ME
LOOP
08
; WAIT FOR INTR FOR SPECIFIED TIME
..IMP
06
;
TIMER 0
INTR DIDN'T OCCUR - ERR
0101
081
F61
F51
F1AI
03C4 BO FF
03C6 E6 21
03C8 BO 36
03CA E6 43
03CC BO 00
03CE E6 40
0300 E6 40
0302
0302 BO 99
0304 E6 63
0306 AO 0410 R
0309 24 01
03DB
14
30
0300 80 3E 0412 R 01
03E2 14 29
03E4 E8
19E3 R
03E1 E3
IE
03E9 BO 49
03EB E6 61
03ED 80 FB AA
03FO 15 15
0380
0380 C6 06 0415 R 02
0400
0400 IE
040E 2B CO
0410 8E CO
0412 B9 0008
0415 OE
0416 IF
0411 BE IEF3 R
041 A BF 0020 R
0410
0410 A5
041E 41
041F 41
0420 E2 FB
0422
IF
0392 BO FE
0394 E6 21
0396 BO
10
0398 E6 43
039A B9 0016
0390 8A CI
039F E6 40
03Al
03A 1 F6 06 046B R 01
043B 80 3E 0412 R 01
0440 15 OA
0442 C1 06 0010 1909 R
03F2 BO C8
03F4 E6 61
03F6 BO 48
03F8 E6 61
03FA 2B C9
03FC
03FC E2 FE
03FE E4 60
0400 3C 00
0402 14 09
0404 E8
1958 R
0401
0401 BE 098A R
040A E8
1916 R
0423 C1 06 0008 R 02C3 R
0429 C1 06 0014 R 1F54 R
042F C1 06 0062 R F600
0435 C1 06 001E R 0000
03A6 15 04
03A8 E2 F1
03AA EB 09
03AC
03AC BlOC
03AE BO FF
03BO E6 40
03B2 C6 06 046B R 00
03B1 BO FE
03B9 E6 21
03BB
03BB F6 06 046B R 01
03CO 15 C3
03C2 E2 F1
680
681
682
683
684
685
686
681
688
689
690
691
692
693
694
695
696
691
698
699
100
10 I
102
103
104
105
106
101
108
109
110
111
112
113
114
115
116
111
118
119
120
121
122
123
124
125
126
121
128
129
130
131
132
133
134
135
136
131
138
139
140
141
142
143
144
145
146
141
148
149
150
151
152
153
154
155
156
151
158
159
160
161
162
163
164
165
166
161
168
169
110
111
112
113
114
115
116
111
118
119
180
181
182
183
184
185
186
181
188
189
190
191
192
193
5-90
POST (01/10/86)