I BM Persona I Computer MACRO Assemb I er
Vers
i
on 2.00
VIDEO ---- 01/10/86
VIDEO DISPLAY BIOS
1-5
01-10-86
INPUT
SET CPOS
-
TH I S ROUT I NE SETS THE CURRENT CURSOR POS I T I ON TO THE
NEW X-V VALUES PASSED
AL HAS THE NEW ACT I VE 0 I SPLA Y PAGE
OUTPUT
THE 6845 I S RESET TO 0 I SPLA Y THAT PAGE
ACT 0 I SP PAGE
-
THIS ROUT I NE SETS THE ACT I VE 0 I SPLA Y PAGE, ALLOW I NG
THE FULL USE OF THE MEMORY SET ASIDE FOR THE VIDEO ATTACHMENT
INPUT
DETERM I NE LOCAT I ON I N REGEN BUFFER
ADD IN THE START ADDRESS FOR THIS PAGE
o
I V I DE BY 2 FOR CHAR ONLY COUNT
REG I STER NUMBER FOR CURSOR
OUTPUT THE VALUE TO THE 6845
SET CPOS RETURN
GET-ROW/COLUMN TO AX
CURSOR SET
SET_CPOS_RETURN
;
ALL DONE
ENDP
V IDEO RETURN
ENDP -
NEAR
POSITION
CX,AX
CX ,OCRT START
CX,
I
-
AH,14
10416
DX,AL
SET CURSOR POSITION, AX HAS ROW/COLUMN FOR CURSOR
PROC
CALL
MOV
ADD
SAR
MOV
CALL
RET
ENDP
(BH)
HAS COLOR 10
IF BH=O, THE BACKGROUND COLOR VALUE IS SET
FROM THE LOW BITS OF BL (0-31)
IF BH= 1, THE PALETTE SELECT I ON I S MADE
BASED ON THE LOW BIT OF BL
I
o
= GREEN, RED,
YELLOW FOR COLORS
1,2,3
1 = BLUE, CYAN, MAGENTA FOR COLORS 1,2,3
(BLI HAS THE COLOR VALUE TO BE USED
OUTPUT
THE COLOR SELECT I ON I S UPDATED
OUT
RET
SET_CTYPE
JMP
SET_CPOS
READ CURSOR
-
TH I S ROUTI NE READS THE CURRENT CUR SOR VALUE FROM THE
6845, FORMATS IT, AND SENDS
I T BACK TO THE CALLER
INPUT
BH - PAGE OF CURSOR
OUTPUT
OX - ROW, COLUMN OF· THE CURRENT CURSOR POS I T I ON
CX - CURRENT CURSOR MODE
OX - ROW, COLUMN OF NEW CURSOR
BH - 0 I SPLA Y PAGE OF CURSOR
OUTPUT
CURSOR
I S SET AT 6S45
IF 0 I SPLA Y PAGE I S CURRENT 0 I SPLA Y
~~~~- ~~~~~~
-
-
---
~~~~
-
-
--
~~~~
---- --
-
---
-
-- ---
-
MOV
BL,BH
XOR
BH,BH
SAL
BX, 1
; WORD OFFSET
MOV
OX, [BX+OFFSET OCURSOR POSN)
MOV
CX,OCURSOR MODE
-
POP
BP
-
POP
01
POP
SI
POP
BX
POP
AX
DISCARD SAVED CX AND OX
POP
AX
POP
OS
POP
ES
IRET
REAO_CURSOR
ENDP
;~~-~~~~--------~~~~----~~~~------------------
-
MOV
AL,BH
; MOVE PAGE NUMBER TO WORK REGI STER
CBW
; CONVERT PAGE TO WORD VALUE
SAL
AX, 1
; WORD OFFSET
XCHG
AX, S I
; USE I NDEX REG I STER
MOV
[SI+OFFSET OCURSOR_POSN) ,OX
;
SAVE THE POINTER
CMP
OACT I VE PAGE, BH
JNZ
10411
-
MOV
AX,DX
CALL
10418
10418
10411:
10418
;~~
-
~ ~ ~~
-
~~~~
---
~~~~
-
-
-
-
~~~~
-- -- - ----- - --- -- - -----
-
MOV
OACTlVE_PAGE,AL
SAVE ACTIVE PAGE VALUE
CBW
CONVERT (AL ) TO WORD
PUSH
AX
SAVE PAGE VALUE
MUL
WORD PTR OCRT LEN
0 I SPLA Y PAGE TIMES REGEN LENGTH
MOV
OCRT START ,AX-
SAVE START ADDRESS FOR LATER
MOV
CX,AX
START ADDRESS TO CX
SAR
CX, I
DIVIDE BY 2 FOR 6845 HANDLING
MOV
AH, 12
6845 REG I STER FOR START ADDRESS
CALL
10416
POP
BX
; RECOVER PAGE VALUE
SAL
BX, I
;
-2 FOR WORD OFFSET
MOV
AX, [BX + OFFSET OCURSOR POSN)
; GET CURSOR FOR TH I S PAGE
CALL
104 18
-; SET THE CURSOR POS I T I ON
JMP
V IDEO RETURN
ACT_0 I SP_PAGE
ENDP-
:
-
~~~
-
~~~~~
--
-
-- -
-
-- --- --- ---- -------- - --- -
-
--
;
TH I S ROUT I NE WILL ESTABLI SH THE BACKGROUND COLOR, THE OVERSCAN COLOR,
;
AND THE FOREGROUND COLOR SET FOR MED I UM RESOLUT I ON GRAPH I CS
INPUT
;
;
;~~
-
~~~~~
- - -
----
~~~~
----
~~~~
----------
-
-
-
--
-- --
-
MOV
OX, OADDR 6845
;
I/O PORT FOR PALETTE
ADD
OX, 5
-
I OVERSCAN PORT
MOV
AL,oCRT PALETTE
I GET THE CURRENT PALETTE VALUE
OR
BH , BH
-
I
I S TH I S COLOR O?
JNZ
10420
I OUTPUT COLOR I
HANDLE COLOR 0 BY SETT I NG THE BACKGROUND COLOR
451
0165 EE
458
0166 C3
459
0161
460
461
462
463
464
465
466
461
468
469
410
411
0161
412
0161 8A C1
413
0169 98
414
016A 01 EO
415
016C 96
416
0160 89 94 0050 R
411
0111
38 3E 0062 R
418
0115 15 05
419
0111 8B C2
480
0119 E8 011E R
481
011C
482
011C EB BF
483
011E
484
485
486
481
011E
488
011E E8 0200 R
489
0181
8B C8
490
0183 03 OE 004E R
491
0181 01 F9
492
0 I 89 B4 OE
493
018B E8 0151 R
494
018E C3
495
018F
496
491
498
499
500
501
502
503
504
505
506
018F
501
018F 8A OF
508
019 I 32 FF
509
0193 01 E3
510
0195 8B 91 0050 R
511
0199 8B OE 0060 R
512
0190 50
513
019E 5F
514
019F 5E
515
01 AO 5B
516
01 A 1 58
511
01 A2 58
518
0 I A3
1F
519
0 I A4 01
520
01 A5 CF
521
01 A6
522
523
524
525
526
521
528
529
530
531
0 I A6
532
0 I A6 A2 0062 R
533
0 I A9 98
534
01AA 50
535
01AB F1 26 004C R
536
OlAF A3 004E R
531
01B2 8B C8
538
0lB4 01 F9
539
01B6 B4 OC
540
01 B8 E8 0 I 5 I R
541
01BB 5B
542
01 BC 0 I E3
543
OIBE 8B 81 0050 R
544
0 I C2 E8 0 l1E R
545
0 1C5 E9 0 I 3D R
546
01 C8
547
548
549
550
551
552
553
554
555
556
551
558
559
560
561
562
563
01 C8
564
0 I C8 8B 16 0063 R
565
0 ICC 83 C2 05
566
01 CF AO 0066 R
561
0102 OA FF
568
0104 15 OE
569
510
5-66
VIDEO (01/10/86)