IBM Persona I Computer MACRO Assemb I er
Vers
i
on 2.00
POST ----- 01/ 10/86
SYSTEM POST AND 810S PROCEDURES
1-13
01-10-86
ENTRY:
(CX)
= COUNT OF 15.085737 MICROSECOND INTERVALS TO WAIT
MEMORY REFRESH T I MER 1 OUTPUT AT THE DMA CHANNEL 0
ADDRESS REG I STER USED AS REFERENCE.
READ T I ME COUNT
GET THE OVERFLOW FLAG
AND THEN RESET THE OVERFLOW FLAG
GET COUNT OF T I ME HIGH WORD
GET COUNT OF T I ME LOW WORD
RETURN WITH NO CARRY
SET T I ME COUNT
SET T I ME COUNT LOW WORD
SET THE T I ME COUNT HIGH WORD
RESET OVERFLOW FLAG
RETURN WITH NO CARRY
I NVAL I 0 FUNCT I ON (NOT SUPPORTED)
SET CARRY FLAG FOR ERROR (CY= 1 )
EX I T THROUGH COMMON RETURN
READ SYSTEM DAY COUNTER
GET COUNT OF DAYS
EX I T THROUGH COMMON RETURN WITH CY=O
SET SYSTEM DAY COUNTER
SET COUNT OF DAYS
EX IT THROUGH COMMON RETURN WITH CY=O
SETUP T I MER 2
SAVE INTERRUPT STATUS
BLOCK INTERRUPT S OUR I NG UPDATE
SELECT
TI MER 2 I LSB I MSB I 8 I NARY
WR I TE THE T I MER MODE REG I STER
I/O DELAY
o
I V I SOR FOR HZ ( LOW)
WRITE TIMER 2 COUNT -
LS8
I/O DELAY
DIVISOR FOR HZ
(HIGH)
WRITE TIMER 2 COUNT - MSB
GET CURRENT SETT I NG OF PORT
SAVE THAT SETT I NG
GATE T I MER 2 AND TURN SPEAKER ON
AND RESTORE INTERRUPT STATUS
1 /64 SECOND PER COUNT (BL)
DEL A Y COUNT FOR 1 /64 OF A SECOND
GO TO BEEP DEL A Y 1 /64 COUNT
(BL) LENGTH COUNT EXPIRED?
NO - CONT I NUE BEEP I NG SPEAKER
;
SAVE INTERRUPT STATUS
; BLOCK I NTERRUPTS OUR I NG UPDATE
; GET CURRENT PORT VALUE
;
I SOLATE CURRENT SPEAKER BI TS I N CASE
;
SOMEONE TURNED THEM OFF OUR I NG BEEP
; RECOVER VALUE OF PORT
; FORCE SPEAKER DA T A OFF
; AND STOP SPEAKER T I MER
; RESTORE INTERRUPT FLAG STATE
; FORCE 1 /64 SECOND DEL A Y (SHORT)
MIN I MUM DELAY BETWEEN ALL BEEPS
SAVE INTERRUPT STATUS
BLOCK INTERRUPT S OUR I NG UPDATE
GET CURRENT PORT VALUE IN CASE
SOMEONE TURNED THEM ON
RECOVER VALUE OF PORT B
RESTORE SPEAKER STATUS
RESTORE INTERRUPT FLAG STATE
CX I ODA Y_COUNT
OTIMER LOW,DX
OT IMER-HIGH,CX
OT I MER:OFL I 0
NEAR
AL,OTIMER OFL
OTi MER OFL I 0
CX,OTlMER HIGH
OX ,OT I MER:LOW
PROC
NEAR
PUSHF
CLI
MOV
AL I 10 1 10 1 I OB
OUT
TIMER+3 , AL
NOP
MOV
AL,CL
OUT
TIMER+2 , AL
NOP
MOV
AL,CH
OUT
TIMER+2 , AL
IN
AL,PORT_B
MOV
AH,AL
OR
AL , GATE2+SPK2
OUT
PORT_B IAL
POPF
MOV
CX , 1035
CALL
WAITF
DEC
BL
..JNZ
G7
PUSHF
CLI
IN
AL,PORT_B
OR
AL,NOT
(GATE2+SPK2 )
AND
AH,AL
MOV
AL,AH
AND
AL,NOT
(GATE2+SPK2 )
OUT
PORT_B,AL
POPF
MOV
CX I 1035
CALL
WAITF
PUSHF
CLI
IN
AL,PORT_B
AND
AL I GATE2+ SPK2
OR
AL,AH
OUT
PORT_B,AL
POPF
RET
ENDP
EXIT:
; --- WA I TF --------------------------------------------------------------
F I XED T I ME WA I T ROUT I NE (HARDWARE CONTROLLED -
NOT PROCESSOR)
:
:
:
:
:
:
:
AFTER
(CX ) T I ME COUNT (PLUS OR M I NUS 31M I CROSECONDS )
:
(CX)
=
0
:
WAITF
PROC
NEAR
DELAY FOR
(CX) -15.085737 US
PUSH
AX
SAVE WORK REG I STER
(AH)
SHR
CX , 1
DIVIDE 15us COUNT DOWN TO 30us COUNT
..JCXZ
WAITF9
EX I T I F COUNT WAS ZERO OR ONE
OUT
DMA+ 12 IAL
CLEAR THE DMA BYTE POINTER FLIP/FLOP
WAITF1 :
PUSHF
SAVE I NTERRUPT STATE
CLI
BLOCK INTERRUPTS TILL NEXT CHANGE
WAITF3:
WA I T FOR REFRESH ADDRESS CHANGE
IN
AL,DMA
READ CURRENT ADDRESS LOW BYTE
AND
AL, III 1 1 110B
DISCARD LOW BIT ( 30us)
CMP
AH,AL
DID VALUE ..JUST CHANGE
MOV
AH,AL
SAVE NEW / OLD VALUE INCASE IT DID
IN
AL,DMA
READ HIGH BYTE
(AND IGNORE)
..JE
WAITF3
WAIT FOR A CHANGE IN ADDRESS 81TS
POPF
; RESTORE INTERRUPTS
BEEP
G7:
OEC59H
00C59H
..JMP
DISKETTE_10_1
; - - - BEEP - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --
ROUT I NE TO SOUND THE BEEPER US I NG T I MER 2 FOR TONE
:
ENTRY:
:
( BL ) = DURA T I ON COUNTER
(
1 FOR 1 /64 SECOND )
:
(CX)
= FREQUENCY DIVISOR
(1193180/FREQUENCY)
(1331 FOR 886 HZ)
:
EXIT:
:
(AX) I (BL) I (CX) MODIFIED.
:
BEEP
RTC
-
00
PROC
MOV
MOV
MOV
MOV
RET
RTC
-
10:
MOV
MOV
MOV
RET
RTC_NS:
STC
RET
RTC_AO:
MOV
RET
RTC_BO:
MOV
RET
RTC
-
00
ENDP
ORG
ORG
01 SKETTE
-
10:
1364 09CE
1365 09CE AO 0070 R
1366 0901 C6 06 0070 R 00
1367 0906 88 OE 006E R
1368 09DA 88 16 006C R
1369 09DE C3
1370
1371
09DF
1372 09DF 89 16 006C R
1373 09E3 89 OE 006E R
1374 09E7 C6 06 0070 R 00
1375 09EC C3
1376
1377 09ED
1378 09ED F9
1379 09EE C3
1380
1381
09EF
1382 09EF 88 OE OOCE R
1383 09F3 C3
1384
1385 09F4
1386 09F4 89 OE OOCE R
1387 09F8 C3
1388
1389 09F9
1390
1391
1392 OC59
1393 OC59 E9 0000 E
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404 OC5C
1405 OC5C 9C
1406 OC5D FA
1407 OC5E 80 B6
1408 OC60 E6 43
1409 OC62 90
1410 OC63 8A C 1
141 1 OC65 E6 42
1412 OC67 90
1413 OC68 8A C5
14 14 OC6A E6 42
141 5 OC6C E4 6 1
1416 OC6E 8A EO
1417 OC70 OC 03
1418 OC72 E6 61
1419 OC74 90
1420 OC75
1421
OC75 B9 040B
1422 OC78 E8 OCAO R
1423 OC7B FE CB
1424 OC7D 75 F6
1425
1426 OC7F 9C
1427 OC80 FA
1428 OC81 E4 61
1429 OC83 OC FC
1430 OC85 22 EO
143 1 OC87 8A C4
1432 OC89 24 FC
1433 OC8B E6 61
1434 OC8D 90
1435 OC8E B9 040B
1436 OC91 E8 OCAO R
1437 OC94 9C
1438 OC95 FA
1439 OC96 E4 6 I
1440 OC98 24 03
1441 OC9A OA C4
1442 OC9C E6 61
1443 OC9E 90
1444 OC9F C3
1445
1446 OCAO
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460 OCAO
1461 OCAO 50
1462 OCA 1 01
E9
1463 OCA3 E3
13
1464
1465 OCA5 E6 OC
1466 OCA7
1467 OCA7 9C
1468 OCA8 FA
1469 OCA9
1470 OCA9 E4 00
147 1 OCAB 24 FE
1472 OCAD 3A EO
1473 OCAF 8A EO
1474 OCBI E4 00
1475 OCB3 74 F4
1476
1477 OCB5 90
5-96
POST (01/10/86)