home *** CD-ROM | disk | FTP | other *** search
/ The Unsorted BBS Collection / thegreatunsorted.tar / thegreatunsorted / misc / video.asm < prev    next >
Assembly Source File  |  1990-04-02  |  104KB  |  2,311 lines

  1.     Page    58,132
  2.     Title    VIDEO.ASM    Apple Video Routines
  3. ;******************************************************************************
  4. ;
  5. ;   Name:    VIDEO.ASM    Apple Video Routines
  6. ;
  7. ;   Group:    Emulator
  8. ;
  9. ;   Revision:    1.00
  10. ;
  11. ;   Date:    January 30, 1988
  12. ;
  13. ;   Author:    Randy W. Spurlock
  14. ;
  15. ;******************************************************************************
  16. ;
  17. ;  Module Functional Description:
  18. ;
  19. ;        This module contains all the code for the Apple
  20. ;    video routines.
  21. ;
  22. ;******************************************************************************
  23. ;
  24. ;  Changes:
  25. ;
  26. ;    DATE     REVISION                DESCRIPTION
  27. ;  --------   --------    -------------------------------------------------------
  28. ;   1/30/88    1.00    Original
  29. ;
  30. ;******************************************************************************
  31.     Page
  32. ;
  33. ;  Public Declarations
  34. ;
  35.     Public    Video_Init        ; Video initialization routine
  36.     Public    Video_Reset        ; Video reset routine
  37.     Public    Text_Read_1        ; Low resolution/text page 1 read
  38.     Public    Text_Read_2        ; Low resolution/text page 2 read
  39.     Public    Graph_Read_1        ; High resolution page 1 read
  40.     Public    Graph_Read_2        ; High resolution page 2 read
  41.     Public    Cursor_Off        ; Turn cursor off routine
  42.     Public    Cursor_On        ; Turn cursor on routine
  43.     Public    Blink_Off        ; Turn blink off routine
  44.     Public    Blink_On        ; Turn blink on routine
  45.     Public    Set_Address        ; Set video address routine
  46.     Public    Text_Address        ; Text address mapping table
  47.     Public    Macro_Table        ; Text macro address mapping table
  48.     Public    Char_Table        ; Text character mapping table
  49.     Public    CGA_Address        ; CGA graphics address mapping table
  50.     Public    EGA_Address        ; EGA graphics address mapping table
  51.     Public    CGA_Slice        ; CGA graphics macro/slice address table
  52.     Public    EGA_Slice        ; EGA graphics macro/slice address table
  53.     Public    Reverse_Table        ; Bit reversal table
  54.     Public    Even_Table        ; Even column bit expansion table
  55.     Public    Odd_Table        ; Odd column bit expansion table
  56.     Public    Column_Table        ; CGA column expansion selection table
  57.     Public    CGA_Shift        ; CGA bit shift table
  58.     Public    EGA_Shift        ; EGA bit shift table
  59.     Public    Map_Table        ; Low resolution color mapping table
  60.     Public    Text_CGA        ; CGA display text color table
  61.     Public    Text_EGA        ; EGA display text color table
  62.     Public    Low_CGA         ; CGA display low res. color table
  63.     Public    Low_EGA         ; EGA display low res. color table
  64.     Public    High_CGA        ; CGA display high res. color table
  65.     Public    High_EGA        ; EGA display high res. color table
  66. ;
  67. ;  External Declarations
  68. ;
  69.     Extrn    CGA_Restore:Near    ; CGA restore screen routine      (CGA)
  70.     Extrn    EGA_Restore:Near    ; EGA restore screen routine      (EGA)
  71.     Extrn    EGA_Setup:Near        ; EGA graphics setup routine      (EGA)
  72.     Extrn    CGA_Table:Word        ; CGA I/O address table      (DATA)
  73.     Extrn    EGA_Table:Word        ; EGA I/O address table      (DATA)
  74.     Extrn    Write_Table:Word    ; Write memory page table     (DATA)
  75.     Extrn    IO_Read_Table:Word    ; I/O read table         (DATA)
  76.     Extrn    IO_Write_Table:Word    ; I/O write table         (DATA)
  77.     Extrn    System_Flag:Byte    ; Apple emulator system flag byte(DATA)
  78.     Extrn    Video_Flag:Byte     ; Video system flag byte     (DATA)
  79. ;
  80. ;  LOCAL Equates
  81. ;
  82. OFF_CURSOR    Equ    2000h        ; Cursor off start/end line values
  83. ON_CURSOR    Equ    0607h        ; Cursor on start/end line values
  84. CRTC_BASE    Equ    03D4h        ; CRT controller base port address
  85. START_HIGH    Equ    0Ch        ; Start address MSB index value
  86. START_LOW    Equ    0Dh        ; Start address LSB index value
  87. RESET_MODE    Equ    03h        ; Reset mode value (80 x 25)
  88. BIOS_SEG    Equ    40h        ; BIOS data segment address (400h)
  89. MODE_PORT    Equ    03D8h        ; Mode port address
  90. Mode_Reg    Equ    65h        ; Current mode register offset
  91. BLINK_BIT    Equ    20h        ; Blink bit (Bit 5)
  92. TEXT_OFFSET    Equ    008h        ; Text page offset (Page 04h)
  93. TEXT_COUNT    Equ    004h        ; Text page count (4h)
  94. GRAPH_OFFSET    Equ    040h        ; Graphics page offset (Page 20h)
  95. GRAPH_COUNT    Equ    020h        ; Graphics page count (20h)
  96. IO_OFFSET    Equ    00A0h        ; I/O byte offset (50h)
  97. IO_COUNT    Equ    008h        ; I/O count (8h)
  98. TEST_VALUE    Equ    0FFh        ; EGA information call test value
  99. PRIMARY_HIGH    Equ    09h        ; Primary high res. display attached
  100. SECONDARY_HIGH    Equ    03h        ; Secondary high res. display attached
  101. ;
  102. ;  Define any include files needed
  103. ;
  104.     Include     Macros.inc    ; Include the macro definitions
  105.     Include     Equates.inc    ; Include the equate definitions
  106.     .286c                ; Include 80286 instructions
  107.     Page
  108. ;
  109. ;  Define the emulator code segment
  110. ;
  111. Emulate Segment Word Public 'EMULATE'   ; Emulator code segment
  112.     Assume    cs:Emulate, ds:Nothing, es:Nothing
  113.     Subttl    Video_Init    Video Initialization Routine
  114.     Page    +
  115. ;******************************************************************************
  116. ;
  117. ;    Video_Init(RAM_Space)
  118. ;
  119. ;        Save the required registers
  120. ;        Determine the video type
  121. ;        If this is a CGA type video
  122. ;            Setup the CGA video RAM segment value
  123. ;            Setup the CGA I/O routine addresses
  124. ;            Call routine to restore CGA screen
  125. ;        Else this is an EGA type video
  126. ;            Setup the EGA video RAM segment value
  127. ;            Setup the EGA I/O routine addresses
  128. ;            Call routine to setup EGA graphics
  129. ;            Call routine to restore EGA screen
  130. ;        Endif for video type
  131. ;        Set video initialized flag
  132. ;        Restore the required registers
  133. ;        Return to the caller
  134. ;
  135. ;    Registers on Entry:
  136. ;
  137. ;        DS    - 65C02 RAM space
  138. ;
  139. ;    Registers on Exit:
  140. ;
  141. ;        AX    - Destroyed
  142. ;        ES    - Video segment
  143. ;
  144. ;******************************************************************************
  145.         Even            ; Force procedure to even address
  146. Video_Init    Proc    Near        ; Video initialization procedure
  147.     Save    si            ; Save the required registers
  148.     call    Video_Type        ; Call routine to get video type
  149.     test    cs:[System_Flag],EGA_TYPE
  150.     jnz    Setup_Ega        ; Jump if this is an EGA type video
  151. Setup_CGA:
  152.     mov    ax,CGA_SEGMENT        ; Get the CGA video RAM segment value
  153.     mov    es,ax            ; Setup video RAM segment address
  154.     lea    si,cs:[CGA_Table]    ; Get the CGA I/O routine table
  155.     call    Video_Setup        ; Call routine to setup I/O addresses
  156.     call    CGA_Restore        ; Call routine to restore CGA (Text)
  157.     jmp    Short Init_Done     ; Go return to the caller
  158. Setup_EGA:
  159.     mov    ax,EGA_SEGMENT        ; Get the EGA video RAM segment value
  160.     mov    es,ax            ; Setup video RAM segment address
  161.     lea    si,cs:[EGA_Table]    ; Get the EGA I/O routine table
  162.     call    Video_Setup        ; Call routine to setup I/O addresses
  163.     call    EGA_Setup        ; Call routine to setup EGA (Graphics)
  164.     call    EGA_Restore        ; Call routine to restore EGA (Text)
  165. Init_Done:
  166.     or    cs:[System_Flag],INITIALIZED
  167.     Restore si            ; Restore the required registers
  168.     ret                ; Return to the caller
  169. Video_Init    Endp            ; End of the Video_Init procedure
  170.     Subttl    Video_Reset    Video Reset Routine
  171.     Page    +
  172. ;******************************************************************************
  173. ;
  174. ;    Video_Reset()
  175. ;
  176. ;        If video has been initialized
  177. ;            Reset the video mode
  178. ;            Call routine to turn cursor on
  179. ;        Endif video has not been initialized
  180. ;        Return to the caller
  181. ;
  182. ;    Registers on Entry:
  183. ;
  184. ;        None
  185. ;
  186. ;    Registers on Exit:
  187. ;
  188. ;        AX    - Destroyed
  189. ;
  190. ;******************************************************************************
  191.         Even            ; Force procedure to even address
  192. Video_Reset    Proc    Near        ; Video reset procedure
  193.     test    cs:[System_Flag],INITIALIZED
  194.     jz    Reset_Done        ; Jump if video not initialized
  195.     mov    ah,SET_MODE        ; Get set mode video sub-function code
  196.     mov    al,RESET_MODE        ; Get the 80x25 text mode value
  197.     int    VIDEO            ; Set video mode to 80x25 text mode
  198.     call    Cursor_On        ; Call routine to turn cursor on
  199. Reset_Done:
  200.     ret                ; Return to the caller
  201. Video_Reset    Endp            ; End of the Video_Reset procedure
  202.     Subttl    Text_Read_1    Low Resolution/Text Page 1 Read
  203.     Page    +
  204. ;******************************************************************************
  205. ;
  206. ;    Text_Read_1(Effective_Address)
  207. ;
  208. ;        Read the memory location value (Byte)
  209. ;        Return to the caller
  210. ;
  211. ;    Registers on Entry:
  212. ;
  213. ;        DS:DI - 65C02 Effective address
  214. ;
  215. ;    Registers on Exit:
  216. ;
  217. ;        AL    - Memory value
  218. ;
  219. ;******************************************************************************
  220.         Even            ; Force procedure to even address
  221. Text_Read_1    Proc    Near        ; Low res/text page 1 read procedure
  222.     mov    al,ds:[di]        ; Read the memory location
  223.     ret                ; Return to the caller
  224. Text_Read_1    Endp            ; End of the Text_Read_1 procedure
  225.     Subttl    Text_Read_2    Low Resolution/Text Page 2 Read
  226.     Page    +
  227. ;******************************************************************************
  228. ;
  229. ;    Text_Read_2(Effective_Address)
  230. ;
  231. ;        Read the memory location value (Byte)
  232. ;        Return to the caller
  233. ;
  234. ;    Registers on Entry:
  235. ;
  236. ;        DS:DI - 65C02 Effective address
  237. ;
  238. ;    Registers on Exit:
  239. ;
  240. ;        AL    - Memory value
  241. ;
  242. ;******************************************************************************
  243.         Even            ; Force procedure to even address
  244. Text_Read_2    Proc    Near        ; Low res/text page 2 read procedure
  245.     mov    al,ds:[di]        ; Read the memory location
  246.     ret                ; Return to the caller
  247. Text_Read_2    Endp            ; End of the Text_Read_2 procedure
  248.     Subttl    Graph_Read_1    High Resolution Graphics Page 1 Read
  249.     Page    +
  250. ;******************************************************************************
  251. ;
  252. ;    Graph_Read_1(Effective_Address)
  253. ;
  254. ;        Read the memory location value (Byte)
  255. ;        Return to the caller
  256. ;
  257. ;    Registers on Entry:
  258. ;
  259. ;        DS:DI - 65C02 Effective address
  260. ;
  261. ;    Registers on Exit:
  262. ;
  263. ;        AL    - Memory value
  264. ;
  265. ;******************************************************************************
  266.         Even            ; Force procedure to even address
  267. Graph_Read_1    Proc    Near        ; High res page 1 read procedure
  268.     mov    al,ds:[di]        ; Read the memory location
  269.     ret                ; Return to the caller
  270. Graph_Read_1    Endp            ; End of the Graph_Read_1 procedure
  271.     Subttl    Graph_Read_2    High Resolution Graphics Page 2 Read
  272.     Page    +
  273. ;******************************************************************************
  274. ;
  275. ;    Graph_Read_2(Effective_Address)
  276. ;
  277. ;        Read the memory location value (Byte)
  278. ;        Return to the caller
  279. ;
  280. ;    Registers on Entry:
  281. ;
  282. ;        DS:DI - 65C02 Effective address
  283. ;
  284. ;    Registers on Exit:
  285. ;
  286. ;        AL    - Memory value
  287. ;
  288. ;******************************************************************************
  289.         Even            ; Force procedure to even address
  290. Graph_Read_2    Proc    Near        ; High res page 2 read procedure
  291.     mov    al,ds:[di]        ; Read the memory location
  292.     ret                ; Return to the caller
  293. Graph_Read_2    Endp            ; End of the Graph_Read_2 procedure
  294.     Subttl    Cursor_Off    Turn Cursor Off Routine
  295.     Page    +
  296. ;******************************************************************************
  297. ;
  298. ;    Cursor_Off()
  299. ;
  300. ;        Save the required registers
  301. ;        Get set cursor type function code
  302. ;        Get cursor off start and end values
  303. ;        Do BIOS video function to set cursor type (Cursor Off)
  304. ;        Restore the required registers
  305. ;        Return to the caller
  306. ;
  307. ;    Registers on Entry:
  308. ;
  309. ;        None
  310. ;
  311. ;    Registers on Exit:
  312. ;
  313. ;        None
  314. ;
  315. ;******************************************************************************
  316.         Even            ; Force procedure to even address
  317. Cursor_Off    Proc    Near        ; Turn cursor off procedure
  318.     Save    ax,cx            ; Save the required registers
  319.     mov    ah,CURSOR_TYPE        ; Get set cursor type function code
  320.     mov    cx,OFF_CURSOR        ; Get the cursor off type value
  321.     int    VIDEO            ; Turn the cursor off
  322.     Restore ax,cx            ; Restore the required registers
  323.     ret                ; Return to the caller
  324. Cursor_Off    Endp            ; End of the Cursor_Off procedure
  325.     Subttl    Cursor_On    Turn Cursor On Routine
  326.     Page    +
  327. ;******************************************************************************
  328. ;
  329. ;    Cursor_On()
  330. ;
  331. ;        Save the required registers
  332. ;        Get set cursor type function code
  333. ;        Get cursor on start and end values
  334. ;        Do BIOS video function to set cursor type (Cursor On)
  335. ;        Restore the required registers
  336. ;        Return to the caller
  337. ;
  338. ;    Registers on Entry:
  339. ;
  340. ;        None
  341. ;
  342. ;    Registers on Exit:
  343. ;
  344. ;        None
  345. ;
  346. ;******************************************************************************
  347.         Even            ; Force procedure to even address
  348. Cursor_On    Proc    Near        ; Turn cursor on procedure
  349.     Save    ax,cx            ; Save the required registers
  350.     mov    ah,CURSOR_TYPE        ; Get set cursor type sub-function code
  351.     mov    cx,ON_CURSOR        ; Get the cursor on type value
  352.     int    VIDEO            ; Turn the cursor on
  353.     Restore ax,cx            ; Restore the required registers
  354.     ret                ; Return to the caller
  355. Cursor_On    Endp            ; End of the Cursor_On procedure
  356.     Subttl    Blink_Off    Turn Background Blink Off Routine
  357.     Page    +
  358. ;******************************************************************************
  359. ;
  360. ;    Blink_Off()
  361. ;
  362. ;        Save the required registers
  363. ;        If the video type is EGA
  364. ;            Get program blink/intensity function code
  365. ;            Get blink off value
  366. ;            Do BIOS video function to set blink type (Blink Off)
  367. ;        Else the video type is CGA
  368. ;            Get current mode register value
  369. ;            Clear bit 5 (Intensity)
  370. ;            Output new mode register value
  371. ;        Endif for the video mode
  372. ;        Restore the required registers
  373. ;        Return to the caller
  374. ;
  375. ;    Registers on Entry:
  376. ;
  377. ;        None
  378. ;
  379. ;    Registers on Exit:
  380. ;
  381. ;        None
  382. ;
  383. ;******************************************************************************
  384.         Even            ; Force procedure to even address
  385. Blink_Off    Proc    Near        ; Turn blink off procedure
  386.     Save    ax,bx,dx,ds        ; Save the required registers
  387.     test    cs:[System_Flag],EGA_TYPE
  388.     jz    Off_CGA         ; Jump if not an EGA type video
  389. Off_EGA:
  390.     mov    ah,SET_PALETTE        ; Get set palette function code
  391.     mov    al,PROGRAM_BLINK    ; Get program blink sub-function code
  392.     mov    bl,INTENSITY        ; Get the blink off value (Intensity)
  393.     int    VIDEO            ; Turn the blink off (Intensity)
  394.     jmp    Short Off_Done        ; Go return to the caller
  395. Off_CGA:
  396.     mov    ax,BIOS_SEG        ; Get the BIOS data segment address
  397.     mov    ds,ax            ; Setup to access BIOS data segment
  398.     mov    dx,MODE_PORT        ; Get the mode register port address
  399.     mov    al,ds:[Mode_Reg]    ; Get the current mode register value
  400.     and    al,Not BLINK_BIT    ; Clear the blink bit (Bit 5)
  401.     out    dx,al            ; Output the new mode register value
  402. Off_Done:
  403.     Restore ax,bx,dx,ds        ; Restore the required registers
  404.     ret                ; Return to the caller
  405. Blink_Off    Endp            ; End of the Blink_Off procedure
  406.     Subttl    Blink_On    Turn Background Blink On Routine
  407.     Page    +
  408. ;******************************************************************************
  409. ;
  410. ;    Blink_On()
  411. ;
  412. ;        Save the required registers
  413. ;        If the video type is EGA
  414. ;            Get program blink/intensity function code
  415. ;            Get blink on value
  416. ;            Do BIOS video function to set blink type (Blink On)
  417. ;        Else the video type is CGA
  418. ;            Get current mode register value
  419. ;            Set bit 5 (Blink)
  420. ;            Output new mode register value
  421. ;        Endif for the video mode
  422. ;        Restore the required registers
  423. ;        Return to the caller
  424. ;
  425. ;    Registers on Entry:
  426. ;
  427. ;        None
  428. ;
  429. ;    Registers on Exit:
  430. ;
  431. ;        None
  432. ;
  433. ;******************************************************************************
  434.         Even            ; Force procedure to even address
  435. Blink_On    Proc    Near        ; Turn blink on procedure
  436.     Save    ax,bx,dx,ds        ; Save the required registers
  437.     test    cs:[System_Flag],EGA_TYPE
  438.     jz    On_CGA            ; Jump if not an EGA type video
  439. On_EGA:
  440.     mov    ah,SET_PALETTE        ; Get set palette function code
  441.     mov    al,PROGRAM_BLINK    ; Get program blink sub-function code
  442.     mov    bl,BLINK        ; Get the blink on value
  443.     int    VIDEO            ; Turn the blink on (Blink)
  444.     jmp    Short On_Done        ; Go return to the caller
  445. On_CGA:
  446.     mov    ax,BIOS_SEG        ; Get the BIOS data segment address
  447.     mov    ds,ax            ; Setup to access BIOS data segment
  448.     mov    dx,MODE_PORT        ; Get the mode register port address
  449.     mov    al,ds:[Mode_Reg]    ; Get the current mode register value
  450.     or    al,BLINK_BIT        ; Set the blink bit (Bit 5)
  451.     out    dx,al            ; Output the new mode register value
  452. On_Done:
  453.     Restore ax,bx,dx,ds        ; Restore the required registers
  454.     ret                ; Return to the caller
  455. Blink_On    Endp            ; End of the Blink_On procedure
  456.     Subttl    Set_Address    Set Video Memory Base Address
  457.     Page    +
  458. ;******************************************************************************
  459. ;
  460. ;    Set_Address(Base_Address)
  461. ;
  462. ;        Save the required registers
  463. ;        Get the CRT controller base port address
  464. ;        Output the new video memory start address
  465. ;        Restore the required registers
  466. ;        Return to the caller
  467. ;
  468. ;    Registers on Entry:
  469. ;
  470. ;        BP    - Base address
  471. ;
  472. ;    Registers on Exit:
  473. ;
  474. ;        BP    - Destroyed
  475. ;
  476. ;******************************************************************************
  477.         Even            ; Force procedure to even address
  478. Set_Address    Proc    Near        ; Set video memory address procedure
  479.     Save    ax,dx            ; Save the required registers
  480.     mov    dx,CRTC_BASE        ; Get CRT controller base port address
  481.     mov    ax,bp            ; Get new start address value
  482.     mov    ah,al            ; Move low byte into AH register
  483.     mov    al,START_LOW        ; Get start address LSB index value
  484.     out    dx,ax            ; Output LSB of new start address
  485.     mov    ax,bp            ; Get new start address value
  486.     mov    al,START_HIGH        ; Get start address MSB index value
  487.     out    dx,ax            ; Output MSB of new start address
  488.     Restore ax,dx            ; Restore the required registers
  489.     ret                ; Return to the caller
  490. Set_Address    Endp            ; End of the Set_Address procedure
  491.     Subttl    Video_Type    Determine Video Type Routine
  492.     Page    +
  493. ;******************************************************************************
  494. ;
  495. ;    Video_Type()
  496. ;
  497. ;        Save the required registers
  498. ;        Setup registers for EGA information call
  499. ;        Do the EGA information call
  500. ;        If the EGA information call returned data
  501. ;            Set video type as EGA
  502. ;            If enhanced monitor is present
  503. ;                Set display type as EGA
  504. ;            Endif
  505. ;        Endif
  506. ;        Restore the required registers
  507. ;        Return to the caller
  508. ;
  509. ;    Registers on Entry:
  510. ;
  511. ;        None
  512. ;
  513. ;    Registers on Exit:
  514. ;
  515. ;        None
  516. ;
  517. ;******************************************************************************
  518.         Even            ; Force procedure to even address
  519. Video_Type    Proc    Near        ; Set video type procedure
  520.     Save    ax,bx,cx        ; Save the required registers
  521.     mov    ah,ALT_SELECT        ; Get alternate select function code
  522.     xor    al,al            ; Setup for EGA information call
  523.     mov    bl,EGA_INFO        ; Get EGA information sub-function code
  524.     mov    bh,TEST_VALUE        ; Setup BH with special test value (FFh)
  525.     int    VIDEO            ; Do the video BIOS call
  526.     inc    bh            ; Test for an EGA style video controller
  527.     jz    Type_Done        ; Jump if this is a CGA type controller
  528.     or    cs:[System_Flag],EGA_TYPE
  529.     cmp    cl,PRIMARY_HIGH     ; Check for primary high res. display
  530.     je    Set_EGA         ; Jump if high resolution display
  531.     cmp    cl,SECONDARY_HIGH    ; Check secondary high res. display
  532.     jne    Type_Done        ; Jump if NOT high resolution display
  533. Set_EGA:
  534.     or    cs:[System_Flag],EGA_DISPLAY
  535. Type_Done:
  536.     Restore ax,bx,cx        ; Restore the required registers
  537.     ret                ; Return to the caller
  538. Video_Type    Endp            ; End of the Video_Type procedure
  539.     Subttl    Video_Setup    Setup Video I/O Routine Addresses
  540.     Page    +
  541. ;******************************************************************************
  542. ;
  543. ;    Video_Setup(IO_Table)
  544. ;
  545. ;        Save the required registers
  546. ;        Get the write memory page table offset to update (Text)
  547. ;        Get the actual text page 1 routine address
  548. ;        Get text page count value (4)
  549. ;        Update the text page 1 routine address in table
  550. ;        Get the actual text page 2 routine address
  551. ;        Get text page count value (4)
  552. ;        Update the text page 2 routine address in table
  553. ;        Get the write memory page table offset to update (Graphics)
  554. ;        Get the actual graphics page 1 routine address
  555. ;        Get graphics page count value (32)
  556. ;        Update the graphics page 1 routine address in table
  557. ;        Get the actual graphics page 2 routine address
  558. ;        Get graphics page count value (32)
  559. ;        Update the graphics page 2 routine address in table
  560. ;        Get the I/O read table offset to update
  561. ;        Get the number of I/O bytes (8)
  562. ;        Move new I/O read addresses into table
  563. ;        Get the I/O write table offset to update
  564. ;        Get the number of I/O bytes (8)
  565. ;        Move new I/O write addresses into table
  566. ;        Restore the required registers
  567. ;        Return to the caller
  568. ;
  569. ;    Registers on Entry:
  570. ;
  571. ;        SI    - Pointer to I/O address table
  572. ;
  573. ;    Registers on Exit:
  574. ;
  575. ;        None
  576. ;
  577. ;******************************************************************************
  578.         Even            ; Force procedure to even address
  579. Video_Setup    Proc    Near        ; Set video I/O addresses procedure
  580.     Save    ax,cx,si,di,ds,es    ; Save the required registers
  581.     mov    ax,cs            ; Get the current CS register value
  582.     mov    ds,ax            ; Setup DS to the current CS value
  583.     mov    es,ax            ; Setup ES to the current CS value
  584.     lea    di,cs:[Write_Table]    ; Get write memory page table offset
  585.     add    di,TEXT_OFFSET        ; Calculate starting text page offset
  586.     mov    cx,TEXT_COUNT        ; Get the number of text pages (4)
  587.     lodsw                ; Get the actual text page 1 address
  588.     rep    stosw            ; Store routine address in write table
  589.     mov    cx,TEXT_COUNT        ; Get the number of text pages (4)
  590.     lodsw                ; Get the actual text page 2 address
  591.     rep    stosw            ; Store routine address in write table
  592.     lea    di,cs:[Write_Table]    ; Get write memory page table offset
  593.     add    di,GRAPH_OFFSET     ; Calculate starting graphics offset
  594.     mov    cx,GRAPH_COUNT        ; Get the number of graphics pages (32)
  595.     lodsw                ; Get actual graphics page 1 address
  596.     rep    stosw            ; Store routine address in write table
  597.     mov    cx,GRAPH_COUNT        ; Get the number of graphics pages (32)
  598.     lodsw                ; Get actual graphics page 2 address
  599.     rep    stosw            ; Store routine address in write table
  600.     lea    di,cs:[IO_Read_Table]    ; Get the I/O read table offset
  601.     add    di,IO_OFFSET        ; Calculate starting read I/O offset
  602.     mov    cx,IO_COUNT        ; Get the number of I/O bytes (8)
  603.     Save    si            ; Save the address table pointer
  604.     rep    movsw            ; Move new addresses into the table
  605.     Restore si            ; Restore the address table pointer
  606.     lea    di,cs:[IO_Write_Table]    ; Get the I/O write table offset
  607.     add    di,IO_OFFSET        ; Calculate starting write I/O offset
  608.     mov    cx,IO_COUNT        ; Get the number of I/O bytes (8)
  609.     rep    movsw            ; Move new addresses into the table
  610.     Restore ax,cx,si,di,ds,es    ; Restore the required registers
  611.     ret                ; Return to the caller
  612. Video_Setup    Endp            ; End of the Video_Setup procedure
  613.     Subttl    Video_Tables    Define the Video Lookup Tables
  614.     Page    +
  615. ;******************************************************************************
  616. ;
  617. ;    Define the video lookup tables
  618. ;
  619. ;******************************************************************************
  620.         Even            ; Force table to even address
  621. Text_Address    Equ    This Word    ; Text video offset lookup table
  622.         Dw    0FFFFh        ; Offset 00h - Row 00h Column 00h
  623.         Dw    00001h        ; Offset 01h - Row 00h Column 01h
  624.         Dw    00003h        ; Offset 02h - Row 00h Column 02h
  625.         Dw    00005h        ; Offset 03h - Row 00h Column 03h
  626.         Dw    00007h        ; Offset 04h - Row 00h Column 04h
  627.         Dw    00009h        ; Offset 05h - Row 00h Column 05h
  628.         Dw    0000Bh        ; Offset 06h - Row 00h Column 06h
  629.         Dw    0000Dh        ; Offset 07h - Row 00h Column 07h
  630.         Dw    0000Fh        ; Offset 08h - Row 00h Column 08h
  631.         Dw    00011h        ; Offset 09h - Row 00h Column 09h
  632.         Dw    00013h        ; Offset 0Ah - Row 00h Column 0Ah
  633.         Dw    00015h        ; Offset 0Bh - Row 00h Column 0Bh
  634.         Dw    00017h        ; Offset 0Ch - Row 00h Column 0Ch
  635.         Dw    00019h        ; Offset 0Dh - Row 00h Column 0Dh
  636.         Dw    0001Bh        ; Offset 0Eh - Row 00h Column 0Eh
  637.         Dw    0001Dh        ; Offset 0Fh - Row 00h Column 0Fh
  638.         Dw    0001Fh        ; Offset 10h - Row 00h Column 10h
  639.         Dw    00021h        ; Offset 11h - Row 00h Column 11h
  640.         Dw    00023h        ; Offset 12h - Row 00h Column 12h
  641.         Dw    00025h        ; Offset 13h - Row 00h Column 13h
  642.         Dw    00027h        ; Offset 14h - Row 00h Column 14h
  643.         Dw    00029h        ; Offset 15h - Row 00h Column 15h
  644.         Dw    0002Bh        ; Offset 16h - Row 00h Column 16h
  645.         Dw    0002Dh        ; Offset 17h - Row 00h Column 17h
  646.         Dw    0002Fh        ; Offset 18h - Row 00h Column 18h
  647.         Dw    00031h        ; Offset 19h - Row 00h Column 19h
  648.         Dw    00033h        ; Offset 1Ah - Row 00h Column 1Ah
  649.         Dw    00035h        ; Offset 1Bh - Row 00h Column 1Bh
  650.         Dw    00037h        ; Offset 1Ch - Row 00h Column 1Ch
  651.         Dw    00039h        ; Offset 1Dh - Row 00h Column 1Dh
  652.         Dw    0003Bh        ; Offset 1Eh - Row 00h Column 1Eh
  653.         Dw    0003Dh        ; Offset 1Fh - Row 00h Column 1Fh
  654.         Dw    0003Fh        ; Offset 20h - Row 00h Column 20h
  655.         Dw    00041h        ; Offset 21h - Row 00h Column 21h
  656.         Dw    00043h        ; Offset 22h - Row 00h Column 22h
  657.         Dw    00045h        ; Offset 23h - Row 00h Column 23h
  658.         Dw    00047h        ; Offset 24h - Row 00h Column 24h
  659.         Dw    00049h        ; Offset 25h - Row 00h Column 25h
  660.         Dw    0004Bh        ; Offset 26h - Row 00h Column 26h
  661.         Dw    0004Dh        ; Offset 27h - Row 00h Column 27h
  662.         Dw    0027Fh        ; Offset 28h - Row 08h Column 00h
  663.         Dw    00281h        ; Offset 29h - Row 08h Column 01h
  664.         Dw    00283h        ; Offset 2Ah - Row 08h Column 02h
  665.         Dw    00285h        ; Offset 2Bh - Row 08h Column 03h
  666.         Dw    00287h        ; Offset 2Ch - Row 08h Column 04h
  667.         Dw    00289h        ; Offset 2Dh - Row 08h Column 05h
  668.         Dw    0028Bh        ; Offset 2Eh - Row 08h Column 06h
  669.         Dw    0028Dh        ; Offset 2Fh - Row 08h Column 07h
  670.         Dw    0028Fh        ; Offset 30h - Row 08h Column 08h
  671.         Dw    00291h        ; Offset 31h - Row 08h Column 09h
  672.         Dw    00293h        ; Offset 32h - Row 08h Column 0Ah
  673.         Dw    00295h        ; Offset 33h - Row 08h Column 0Bh
  674.         Dw    00297h        ; Offset 34h - Row 08h Column 0Ch
  675.         Dw    00299h        ; Offset 35h - Row 08h Column 0Dh
  676.         Dw    0029Bh        ; Offset 36h - Row 08h Column 0Eh
  677.         Dw    0029Dh        ; Offset 37h - Row 08h Column 0Fh
  678.         Dw    0029Fh        ; Offset 38h - Row 08h Column 10h
  679.         Dw    002A1h        ; Offset 39h - Row 08h Column 11h
  680.         Dw    002A3h        ; Offset 3Ah - Row 08h Column 12h
  681.         Dw    002A5h        ; Offset 3Bh - Row 08h Column 13h
  682.         Dw    002A7h        ; Offset 3Ch - Row 08h Column 14h
  683.         Dw    002A9h        ; Offset 3Dh - Row 08h Column 15h
  684.         Dw    002ABh        ; Offset 3Eh - Row 08h Column 16h
  685.         Dw    002ADh        ; Offset 3Fh - Row 08h Column 17h
  686.         Dw    002AFh        ; Offset 40h - Row 08h Column 18h
  687.         Dw    002B1h        ; Offset 41h - Row 08h Column 19h
  688.         Dw    002B3h        ; Offset 42h - Row 08h Column 1Ah
  689.         Dw    002B5h        ; Offset 43h - Row 08h Column 1Bh
  690.         Dw    002B7h        ; Offset 44h - Row 08h Column 1Ch
  691.         Dw    002B9h        ; Offset 45h - Row 08h Column 1Dh
  692.         Dw    002BBh        ; Offset 46h - Row 08h Column 1Eh
  693.         Dw    002BDh        ; Offset 47h - Row 08h Column 1Fh
  694.         Dw    002BFh        ; Offset 48h - Row 08h Column 20h
  695.         Dw    002C1h        ; Offset 49h - Row 08h Column 21h
  696.         Dw    002C3h        ; Offset 4Ah - Row 08h Column 22h
  697.         Dw    002C5h        ; Offset 4Bh - Row 08h Column 23h
  698.         Dw    002C7h        ; Offset 4Ch - Row 08h Column 24h
  699.         Dw    002C9h        ; Offset 4Dh - Row 08h Column 25h
  700.         Dw    002CBh        ; Offset 4Eh - Row 08h Column 26h
  701.         Dw    002CDh        ; Offset 4Fh - Row 08h Column 27h
  702.         Dw    004FFh        ; Offset 50h - Row 10h Column 00h
  703.         Dw    00501h        ; Offset 51h - Row 10h Column 01h
  704.         Dw    00503h        ; Offset 52h - Row 10h Column 02h
  705.         Dw    00505h        ; Offset 53h - Row 10h Column 03h
  706.         Dw    00507h        ; Offset 54h - Row 10h Column 04h
  707.         Dw    00509h        ; Offset 55h - Row 10h Column 05h
  708.         Dw    0050Bh        ; Offset 56h - Row 10h Column 06h
  709.         Dw    0050Dh        ; Offset 57h - Row 10h Column 07h
  710.         Dw    0050Fh        ; Offset 58h - Row 10h Column 08h
  711.         Dw    00511h        ; Offset 59h - Row 10h Column 09h
  712.         Dw    00513h        ; Offset 5Ah - Row 10h Column 0Ah
  713.         Dw    00515h        ; Offset 5Bh - Row 10h Column 0Bh
  714.         Dw    00517h        ; Offset 5Ch - Row 10h Column 0Ch
  715.         Dw    00519h        ; Offset 5Dh - Row 10h Column 0Dh
  716.         Dw    0051Bh        ; Offset 5Eh - Row 10h Column 0Eh
  717.         Dw    0051Dh        ; Offset 5Fh - Row 10h Column 0Fh
  718.         Dw    0051Fh        ; Offset 60h - Row 10h Column 10h
  719.         Dw    00521h        ; Offset 61h - Row 10h Column 11h
  720.         Dw    00523h        ; Offset 62h - Row 10h Column 12h
  721.         Dw    00525h        ; Offset 63h - Row 10h Column 13h
  722.         Dw    00527h        ; Offset 64h - Row 10h Column 14h
  723.         Dw    00529h        ; Offset 65h - Row 10h Column 15h
  724.         Dw    0052Bh        ; Offset 66h - Row 10h Column 16h
  725.         Dw    0052Dh        ; Offset 67h - Row 10h Column 17h
  726.         Dw    0052Fh        ; Offset 68h - Row 10h Column 18h
  727.         Dw    00531h        ; Offset 69h - Row 10h Column 19h
  728.         Dw    00533h        ; Offset 6Ah - Row 10h Column 1Ah
  729.         Dw    00535h        ; Offset 6Bh - Row 10h Column 1Bh
  730.         Dw    00537h        ; Offset 6Ch - Row 10h Column 1Ch
  731.         Dw    00539h        ; Offset 6Dh - Row 10h Column 1Dh
  732.         Dw    0053Bh        ; Offset 6Eh - Row 10h Column 1Eh
  733.         Dw    0053Dh        ; Offset 6Fh - Row 10h Column 1Fh
  734.         Dw    0053Fh        ; Offset 70h - Row 10h Column 20h
  735.         Dw    00541h        ; Offset 71h - Row 10h Column 21h
  736.         Dw    00543h        ; Offset 72h - Row 10h Column 22h
  737.         Dw    00545h        ; Offset 73h - Row 10h Column 23h
  738.         Dw    00547h        ; Offset 74h - Row 10h Column 24h
  739.         Dw    00549h        ; Offset 75h - Row 10h Column 25h
  740.         Dw    0054Bh        ; Offset 76h - Row 10h Column 26h
  741.         Dw    0054Dh        ; Offset 77h - Row 10h Column 27h
  742.         Dw    07FFFh        ; Offset 78h - Screen hole 00h
  743.         Dw    07FFFh        ; Offset 79h - Screen hole 01h
  744.         Dw    07FFFh        ; Offset 7Ah - Screen hole 02h
  745.         Dw    07FFFh        ; Offset 7Bh - Screen hole 03h
  746.         Dw    07FFFh        ; Offset 7Ch - Screen hole 04h
  747.         Dw    07FFFh        ; Offset 7Dh - Screen hole 05h
  748.         Dw    07FFFh        ; Offset 7Eh - Screen hole 06h
  749.         Dw    07FFFh        ; Offset 7Fh - Screen hole 07h
  750.         Even            ; Force table to even address
  751. Macro_Table    Equ    This Word    ; Macro line offset lookup table
  752.         Dw    0000h        ; Macro line 0 - Row 0
  753.         Dw    0050h        ; Macro line 1 - Row 1
  754.         Dw    00A0h        ; Macro line 2 - Row 2
  755.         Dw    00F0h        ; Macro line 3 - Row 3
  756.         Dw    0140h        ; Macro line 4 - Row 4
  757.         Dw    0190h        ; Macro line 5 - Row 5
  758.         Dw    01E0h        ; Macro line 6 - Row 6
  759.         Dw    0230h        ; Macro line 7 - Row 7
  760.         Even            ; Force table to even address
  761. Char_Table    Equ    This Word    ; Character lookup table
  762.         Db    040h,70h    ; Character 00h - Inverse @ Sign
  763.         Db    041h,70h    ; Character 01h - Inverse Letter A
  764.         Db    042h,70h    ; Character 02h - Inverse Letter B
  765.         Db    043h,70h    ; Character 03h - Inverse Letter C
  766.         Db    044h,70h    ; Character 04h - Inverse Letter D
  767.         Db    045h,70h    ; Character 05h - Inverse Letter E
  768.         Db    046h,70h    ; Character 06h - Inverse Letter F
  769.         Db    047h,70h    ; Character 07h - Inverse Letter G
  770.         Db    048h,70h    ; Character 08h - Inverse Letter H
  771.         Db    049h,70h    ; Character 09h - Inverse Letter I
  772.         Db    04Ah,70h    ; Character 0Ah - Inverse Letter J
  773.         Db    04Bh,70h    ; Character 0Bh - Inverse Letter K
  774.         Db    04Ch,70h    ; Character 0Ch - Inverse Letter L
  775.         Db    04Dh,70h    ; Character 0Dh - Inverse Letter M
  776.         Db    04Eh,70h    ; Character 0Eh - Inverse Letter N
  777.         Db    04Fh,70h    ; Character 0Fh - Inverse Letter O
  778.         Db    050h,70h    ; Character 10h - Inverse Letter P
  779.         Db    051h,70h    ; Character 11h - Inverse Letter Q
  780.         Db    052h,70h    ; Character 12h - Inverse Letter R
  781.         Db    053h,70h    ; Character 13h - Inverse Letter S
  782.         Db    054h,70h    ; Character 14h - Inverse Letter T
  783.         Db    055h,70h    ; Character 15h - Inverse Letter U
  784.         Db    056h,70h    ; Character 16h - Inverse Letter V
  785.         Db    057h,70h    ; Character 17h - Inverse Letter W
  786.         Db    058h,70h    ; Character 18h - Inverse Letter X
  787.         Db    059h,70h    ; Character 19h - Inverse Letter Y
  788.         Db    05Ah,70h    ; Character 1Ah - Inverse Letter Z
  789.         Db    05Bh,70h    ; Character 1Bh - Inverse Left Bracket
  790.         Db    05Ch,70h    ; Character 1Ch - Inverse Back Slash
  791.         Db    05Dh,70h    ; Character 1Dh - Inverse Right Bracket
  792.         Db    05Eh,70h    ; Character 1Eh - Inverse Carrot
  793.         Db    05Fh,70h    ; Character 1Fh - Inverse Minus
  794.         Db    020h,70h    ; Character 20h - Inverse Space
  795.         Db    021h,70h    ; Character 21h - Inverse Exclamation
  796.         Db    022h,70h    ; Character 22h - Inverse Double Quote
  797.         Db    023h,70h    ; Character 23h - Inverse Pound Sign
  798.         Db    024h,70h    ; Character 24h - Inverse Dollar Sign
  799.         Db    025h,70h    ; Character 25h - Inverse Percent Sign
  800.         Db    026h,70h    ; Character 26h - Inverse Ampersand
  801.         Db    027h,70h    ; Character 27h - Inverse Single Quote
  802.         Db    028h,70h    ; Character 28h - Inverse Left Paren.
  803.         Db    029h,70h    ; Character 29h - Inverse Right Paren.
  804.         Db    02Ah,70h    ; Character 2Ah - Inverse Asterick
  805.         Db    02Bh,70h    ; Character 2Bh - Inverse Plus Sign
  806.         Db    02Ch,70h    ; Character 2Ch - Inverse Accent Mark
  807.         Db    02Dh,70h    ; Character 2Dh - Inverse Minus Sign
  808.         Db    02Eh,70h    ; Character 2Eh - Inverse Period
  809.         Db    02Fh,70h    ; Character 2Fh - Inverse Forward Slash
  810.         Db    030h,70h    ; Character 30h - Inverse Number 0
  811.         Db    031h,70h    ; Character 31h - Inverse Number 1
  812.         Db    032h,70h    ; Character 32h - Inverse Number 2
  813.         Db    033h,70h    ; Character 33h - Inverse Number 3
  814.         Db    034h,70h    ; Character 34h - Inverse Number 4
  815.         Db    035h,70h    ; Character 35h - Inverse Number 5
  816.         Db    036h,70h    ; Character 36h - Inverse Number 6
  817.         Db    037h,70h    ; Character 37h - Inverse Number 7
  818.         Db    038h,70h    ; Character 38h - Inverse Number 8
  819.         Db    039h,70h    ; Character 39h - Inverse Number 9
  820.         Db    03Ah,70h    ; Character 3Ah - Inverse Colon
  821.         Db    03Bh,70h    ; Character 3Bh - Inverse Semi-Colon
  822.         Db    03Ch,70h    ; Character 3Ch - Inverse Less Than
  823.         Db    03Dh,70h    ; Character 3Dh - Inverse Equal Sign
  824.         Db    03Eh,70h    ; Character 3Eh - Inverse Greater Than
  825.         Db    03Fh,70h    ; Character 3Fh - Inverse Question Mark
  826.         Db    040h,87h    ; Character 40h - Flashing @ Sign
  827.         Db    041h,87h    ; Character 41h - Flashing Letter A
  828.         Db    042h,87h    ; Character 42h - Flashing Letter B
  829.         Db    043h,87h    ; Character 43h - Flashing Letter C
  830.         Db    044h,87h    ; Character 44h - Flashing Letter D
  831.         Db    045h,87h    ; Character 45h - Flashing Letter E
  832.         Db    046h,87h    ; Character 46h - Flashing Letter F
  833.         Db    047h,87h    ; Character 47h - Flashing Letter G
  834.         Db    048h,87h    ; Character 48h - Flashing Letter H
  835.         Db    049h,87h    ; Character 49h - Flashing Letter I
  836.         Db    04Ah,87h    ; Character 4Ah - Flashing Letter J
  837.         Db    04Bh,87h    ; Character 4Bh - Flashing Letter K
  838.         Db    04Ch,87h    ; Character 4Ch - Flashing Letter L
  839.         Db    04Dh,87h    ; Character 4Dh - Flashing Letter M
  840.         Db    04Eh,87h    ; Character 4Eh - Flashing Letter N
  841.         Db    04Fh,87h    ; Character 4Fh - Flashing Letter O
  842.         Db    050h,87h    ; Character 50h - Flashing Letter P
  843.         Db    051h,87h    ; Character 51h - Flashing Letter Q
  844.         Db    052h,87h    ; Character 52h - Flashing Letter R
  845.         Db    053h,87h    ; Character 53h - Flashing Letter S
  846.         Db    054h,87h    ; Character 54h - Flashing Letter T
  847.         Db    055h,87h    ; Character 55h - Flashing Letter U
  848.         Db    056h,87h    ; Character 56h - Flashing Letter V
  849.         Db    057h,87h    ; Character 57h - Flashing Letter W
  850.         Db    058h,87h    ; Character 58h - Flashing Letter X
  851.         Db    059h,87h    ; Character 59h - Flashing Letter Y
  852.         Db    05Ah,87h    ; Character 5Ah - Flashing Letter Z
  853.         Db    05Bh,87h    ; Character 5Bh - Flashing Left Bracket
  854.         Db    05Ch,87h    ; Character 5Ch - Flashing Back Slash
  855.         Db    05Dh,87h    ; Character 5Dh - Flashing Right Bracket
  856.         Db    05Eh,87h    ; Character 5Eh - Flashing Carrot
  857.         Db    05Fh,87h    ; Character 5Fh - Flashing Minus
  858.         Db    0DBh,87h    ; Character 60h - Flashing Space(Cursor)
  859.         Db    021h,87h    ; Character 61h - Flashing Exclamation
  860.         Db    022h,87h    ; Character 62h - Flashing Double Quote
  861.         Db    023h,87h    ; Character 63h - Flashing Pound Sign
  862.         Db    024h,87h    ; Character 64h - Flashing Dollar Sign
  863.         Db    025h,87h    ; Character 65h - Flashing Percent Sign
  864.         Db    026h,87h    ; Character 66h - Flashing Ampersand
  865.         Db    027h,87h    ; Character 67h - Flashing Single Quote
  866.         Db    028h,87h    ; Character 68h - Flashing Left Paren.
  867.         Db    029h,87h    ; Character 69h - Flashing Right Paren.
  868.         Db    02Ah,87h    ; Character 6Ah - Flashing Asterick
  869.         Db    02Bh,87h    ; Character 6Bh - Flashing Plus Sign
  870.         Db    02Ch,87h    ; Character 6Ch - Flashing Accent mark
  871.         Db    02Dh,87h    ; Character 6Dh - Flashing Minus Sign
  872.         Db    02Eh,87h    ; Character 6Eh - Flashing Period
  873.         Db    02Fh,87h    ; Character 6Fh - Flashing Forward Slash
  874.         Db    030h,87h    ; Character 70h - Flashing Number 0
  875.         Db    031h,87h    ; Character 71h - Flashing Number 1
  876.         Db    032h,87h    ; Character 72h - Flashing Number 2
  877.         Db    033h,87h    ; Character 73h - Flashing Number 3
  878.         Db    034h,87h    ; Character 74h - Flashing Number 4
  879.         Db    035h,87h    ; Character 75h - Flashing Number 5
  880.         Db    036h,87h    ; Character 76h - Flashing Number 6
  881.         Db    037h,87h    ; Character 77h - Flashing Number 7
  882.         Db    038h,87h    ; Character 78h - Flashing Number 8
  883.         Db    039h,87h    ; Character 79h - Flashing Number 9
  884.         Db    03Ah,87h    ; Character 7Ah - Flashing Colon
  885.         Db    03Bh,87h    ; Character 7Bh - Flashing Semi-Colon
  886.         Db    03Ch,87h    ; Character 7Ch - Flashing Less Than
  887.         Db    03Dh,87h    ; Character 7Dh - Flashing Equal Sign
  888.         Db    03Eh,87h    ; Character 7Eh - Flashing Greater Than
  889.         Db    03Fh,87h    ; Character 7Fh - Flashing Question Mark
  890.         Db    040h,07h    ; Character 80h - Normal @ Sign
  891.         Db    041h,07h    ; Character 81h - Normal Letter A
  892.         Db    042h,07h    ; Character 82h - Normal Letter B
  893.         Db    043h,07h    ; Character 83h - Normal Letter C
  894.         Db    044h,07h    ; Character 84h - Normal Letter D
  895.         Db    045h,07h    ; Character 85h - Normal Letter E
  896.         Db    046h,07h    ; Character 86h - Normal Letter F
  897.         Db    047h,07h    ; Character 87h - Normal Letter G
  898.         Db    048h,07h    ; Character 88h - Normal Letter H
  899.         Db    049h,07h    ; Character 89h - Normal Letter I
  900.         Db    04Ah,07h    ; Character 8Ah - Normal Letter J
  901.         Db    04Bh,07h    ; Character 8Bh - Normal Letter K
  902.         Db    04Ch,07h    ; Character 8Ch - Normal Letter L
  903.         Db    04Dh,07h    ; Character 8Dh - Normal Letter M
  904.         Db    04Eh,07h    ; Character 8Eh - Normal Letter N
  905.         Db    04Fh,07h    ; Character 8Fh - Normal Letter O
  906.         Db    050h,07h    ; Character 90h - Normal Letter P
  907.         Db    051h,07h    ; Character 91h - Normal Letter Q
  908.         Db    052h,07h    ; Character 92h - Normal Letter R
  909.         Db    053h,07h    ; Character 93h - Normal Letter S
  910.         Db    054h,07h    ; Character 94h - Normal Letter T
  911.         Db    055h,07h    ; Character 95h - Normal Letter U
  912.         Db    056h,07h    ; Character 96h - Normal Letter V
  913.         Db    057h,07h    ; Character 97h - Normal Letter W
  914.         Db    058h,07h    ; Character 98h - Normal Letter X
  915.         Db    059h,07h    ; Character 99h - Normal Letter Y
  916.         Db    05Ah,07h    ; Character 9Ah - Normal Letter Z
  917.         Db    05Bh,07h    ; Character 9Bh - Normal Left Bracket
  918.         Db    05Ch,07h    ; Character 9Ch - Normal Back Slash
  919.         Db    05Dh,07h    ; Character 9Dh - Normal Right Bracket
  920.         Db    05Eh,07h    ; Character 9Eh - Normal Carrot
  921.         Db    05Fh,07h    ; Character 9Fh - Normal Minus
  922.         Db    020h,07h    ; Character A0h - Normal Space
  923.         Db    021h,07h    ; Character A1h - Normal Exclamation
  924.         Db    022h,07h    ; Character A2h - Normal Double Quote
  925.         Db    023h,07h    ; Character A3h - Normal Pound Sign
  926.         Db    024h,07h    ; Character A4h - Normal Dollar Sign
  927.         Db    025h,07h    ; Character A5h - Normal Percent Sign
  928.         Db    026h,07h    ; Character A6h - Normal Ampersand
  929.         Db    027h,07h    ; Character A7h - Normal Single Quote
  930.         Db    028h,07h    ; Character A8h - Normal Left Paren.
  931.         Db    029h,07h    ; Character A9h - Normal Right Paren.
  932.         Db    02Ah,07h    ; Character AAh - Normal Asterick
  933.         Db    02Bh,07h    ; Character ABh - Normal Plus Sign
  934.         Db    02Ch,07h    ; Character ACh - Normal Accent Mark
  935.         Db    02Dh,07h    ; Character ADh - Normal Minus Sign
  936.         Db    02Eh,07h    ; Character AEh - Normal Period
  937.         Db    02Fh,07h    ; Character AFh - Normal Forward Slash
  938.         Db    030h,07h    ; Character B0h - Normal Number 0
  939.         Db    031h,07h    ; Character B1h - Normal Number 1
  940.         Db    032h,07h    ; Character B2h - Normal Number 2
  941.         Db    033h,07h    ; Character B3h - Normal Number 3
  942.         Db    034h,07h    ; Character B4h - Normal Number 4
  943.         Db    035h,07h    ; Character B5h - Normal Number 5
  944.         Db    036h,07h    ; Character B6h - Normal Number 6
  945.         Db    037h,07h    ; Character B7h - Normal Number 7
  946.         Db    038h,07h    ; Character B8h - Normal Number 8
  947.         Db    039h,07h    ; Character B9h - Normal Number 9
  948.         Db    03Ah,07h    ; Character BAh - Normal Colon
  949.         Db    03Bh,07h    ; Character BBh - Normal Semi-Colon
  950.         Db    03Ch,07h    ; Character BCh - Normal Less Than
  951.         Db    03Dh,07h    ; Character BDh - Normal Equal Sign
  952.         Db    03Eh,07h    ; Character BEh - Normal Greater Than
  953.         Db    03Fh,07h    ; Character BFh - Normal Question Mark
  954.         Db    040h,07h    ; Character C0h - Normal @ Sign
  955.         Db    041h,07h    ; Character C1h - Normal Letter A
  956.         Db    042h,07h    ; Character C2h - Normal Letter B
  957.         Db    043h,07h    ; Character C3h - Normal Letter C
  958.         Db    044h,07h    ; Character C4h - Normal Letter D
  959.         Db    045h,07h    ; Character C5h - Normal Letter E
  960.         Db    046h,07h    ; Character C6h - Normal Letter F
  961.         Db    047h,07h    ; Character C7h - Normal Letter G
  962.         Db    048h,07h    ; Character C8h - Normal Letter H
  963.         Db    049h,07h    ; Character C9h - Normal Letter I
  964.         Db    04Ah,07h    ; Character CAh - Normal Letter J
  965.         Db    04Bh,07h    ; Character CBh - Normal Letter K
  966.         Db    04Ch,07h    ; Character CCh - Normal Letter L
  967.         Db    04Dh,07h    ; Character CDh - Normal Letter M
  968.         Db    04Eh,07h    ; Character CEh - Normal Letter N
  969.         Db    04Fh,07h    ; Character CFh - Normal Letter O
  970.         Db    050h,07h    ; Character D0h - Normal Letter P
  971.         Db    051h,07h    ; Character D1h - Normal Letter Q
  972.         Db    052h,07h    ; Character D2h - Normal Letter R
  973.         Db    053h,07h    ; Character D3h - Normal Letter S
  974.         Db    054h,07h    ; Character D4h - Normal Letter T
  975.         Db    055h,07h    ; Character D5h - Normal Letter U
  976.         Db    056h,07h    ; Character D6h - Normal Letter V
  977.         Db    057h,07h    ; Character D7h - Normal Letter W
  978.         Db    058h,07h    ; Character D8h - Normal Letter X
  979.         Db    059h,07h    ; Character D9h - Normal Letter Y
  980.         Db    05Ah,07h    ; Character DAh - Normal Letter Z
  981.         Db    05Bh,07h    ; Character DBh - Normal Left Bracket
  982.         Db    05Ch,07h    ; Character DCh - Normal Back Slash
  983.         Db    05Dh,07h    ; Character DDh - Normal Right Bracket
  984.         Db    05Eh,07h    ; Character DEh - Normal Carrot
  985.         Db    05Fh,07h    ; Character DFh - Normal Minus
  986.         Db    020h,07h    ; Character E0h - Normal @ Sign
  987.         Db    061h,07h    ; Character E1h - Normal Letter a
  988.         Db    062h,07h    ; Character E2h - Normal Letter b
  989.         Db    063h,07h    ; Character E3h - Normal Letter c
  990.         Db    064h,07h    ; Character E4h - Normal Letter d
  991.         Db    065h,07h    ; Character E5h - Normal Letter e
  992.         Db    066h,07h    ; Character E6h - Normal Letter f
  993.         Db    067h,07h    ; Character E7h - Normal Letter g
  994.         Db    068h,07h    ; Character E8h - Normal Letter h
  995.         Db    069h,07h    ; Character E9h - Normal Letter i
  996.         Db    06Ah,07h    ; Character EAh - Normal Letter j
  997.         Db    06Bh,07h    ; Character EBh - Normal Letter k
  998.         Db    06Ch,07h    ; Character ECh - Normal Letter l
  999.         Db    06Dh,07h    ; Character EDh - Normal Letter m
  1000.         Db    06Eh,07h    ; Character EEh - Normal Letter n
  1001.         Db    06Fh,07h    ; Character EFh - Normal Letter o
  1002.         Db    070h,07h    ; Character F0h - Normal Letter p
  1003.         Db    071h,07h    ; Character F1h - Normal Letter q
  1004.         Db    072h,07h    ; Character F2h - Normal Letter r
  1005.         Db    073h,07h    ; Character F3h - Normal Letter s
  1006.         Db    074h,07h    ; Character F4h - Normal Letter t
  1007.         Db    075h,07h    ; Character F5h - Normal Letter u
  1008.         Db    076h,07h    ; Character F6h - Normal Letter v
  1009.         Db    077h,07h    ; Character F7h - Normal Letter w
  1010.         Db    078h,07h    ; Character F8h - Normal Letter x
  1011.         Db    079h,07h    ; Character F9h - Normal Letter y
  1012.         Db    07Ah,07h    ; Character FAh - Normal Letter z
  1013.         Db    03Bh,07h    ; Character FBh - Normal Left Bracket
  1014.         Db    03Ch,07h    ; Character FCh - Normal Back Slash
  1015.         Db    03Dh,07h    ; Character FDh - Normal Right Bracket
  1016.         Db    03Eh,07h    ; Character FEh - Normal Carrot
  1017.         Db    03Fh,07h    ; Character FFh - Normal Minus
  1018.         Even            ; Force table to even address
  1019. CGA_Address    Equ    This Word    ; CGA graphics video offset lookup table
  1020.         Dw    0FFFFh        ; Offset 00h - Row 00h Column 000h
  1021.         Dw    00000h        ; Offset 01h - Row 00h Column 007h
  1022.         Dw    00002h        ; Offset 02h - Row 00h Column 00Eh
  1023.         Dw    00004h        ; Offset 03h - Row 00h Column 015h
  1024.         Dw    00006h        ; Offset 04h - Row 00h Column 01Ch
  1025.         Dw    00007h        ; Offset 05h - Row 00h Column 023h
  1026.         Dw    00009h        ; Offset 06h - Row 00h Column 02Ah
  1027.         Dw    0000Bh        ; Offset 07h - Row 00h Column 031h
  1028.         Dw    0000Dh        ; Offset 08h - Row 00h Column 038h
  1029.         Dw    0000Eh        ; Offset 09h - Row 00h Column 03Fh
  1030.         Dw    00010h        ; Offset 0Ah - Row 00h Column 046h
  1031.         Dw    00012h        ; Offset 0Bh - Row 00h Column 04Dh
  1032.         Dw    00014h        ; Offset 0Ch - Row 00h Column 054h
  1033.         Dw    00015h        ; Offset 0Dh - Row 00h Column 05Bh
  1034.         Dw    00017h        ; Offset 0Eh - Row 00h Column 062h
  1035.         Dw    00019h        ; Offset 0Fh - Row 00h Column 069h
  1036.         Dw    0001Bh        ; Offset 10h - Row 00h Column 070h
  1037.         Dw    0001Ch        ; Offset 11h - Row 00h Column 077h
  1038.         Dw    0001Eh        ; Offset 12h - Row 00h Column 07Eh
  1039.         Dw    00020h        ; Offset 13h - Row 00h Column 085h
  1040.         Dw    00022h        ; Offset 14h - Row 00h Column 08Ch
  1041.         Dw    00023h        ; Offset 15h - Row 00h Column 093h
  1042.         Dw    00025h        ; Offset 16h - Row 00h Column 09Ah
  1043.         Dw    00027h        ; Offset 17h - Row 00h Column 0A1h
  1044.         Dw    00029h        ; Offset 18h - Row 00h Column 0A8h
  1045.         Dw    0002Ah        ; Offset 19h - Row 00h Column 0AFh
  1046.         Dw    0002Ch        ; Offset 1Ah - Row 00h Column 0B6h
  1047.         Dw    0002Eh        ; Offset 1Bh - Row 00h Column 0BDh
  1048.         Dw    00030h        ; Offset 1Ch - Row 00h Column 0C4h
  1049.         Dw    00031h        ; Offset 1Dh - Row 00h Column 0CBh
  1050.         Dw    00033h        ; Offset 1Eh - Row 00h Column 0D2h
  1051.         Dw    00035h        ; Offset 1Fh - Row 00h Column 0D9h
  1052.         Dw    00037h        ; Offset 20h - Row 00h Column 0E0h
  1053.         Dw    00038h        ; Offset 21h - Row 00h Column 0E7h
  1054.         Dw    0003Ah        ; Offset 22h - Row 00h Column 0EEh
  1055.         Dw    0003Ch        ; Offset 23h - Row 00h Column 0F5h
  1056.         Dw    0003Eh        ; Offset 24h - Row 00h Column 0FCh
  1057.         Dw    0003Fh        ; Offset 25h - Row 00h Column 103h
  1058.         Dw    00041h        ; Offset 26h - Row 00h Column 10Ah
  1059.         Dw    00043h        ; Offset 27h - Row 00h Column 111h
  1060.         Dw    009FFh        ; Offset 28h - Row 40h Column 000h
  1061.         Dw    00A00h        ; Offset 29h - Row 40h Column 007h
  1062.         Dw    00A02h        ; Offset 2Ah - Row 40h Column 00Eh
  1063.         Dw    00A04h        ; Offset 2Bh - Row 40h Column 015h
  1064.         Dw    00A06h        ; Offset 2Ch - Row 40h Column 01Ch
  1065.         Dw    00A07h        ; Offset 2Dh - Row 40h Column 023h
  1066.         Dw    00A09h        ; Offset 2Eh - Row 40h Column 02Ah
  1067.         Dw    00A0Bh        ; Offset 2Fh - Row 40h Column 031h
  1068.         Dw    00A0Dh        ; Offset 30h - Row 40h Column 038h
  1069.         Dw    00A0Eh        ; Offset 31h - Row 40h Column 03Fh
  1070.         Dw    00A10h        ; Offset 32h - Row 40h Column 046h
  1071.         Dw    00A12h        ; Offset 33h - Row 40h Column 04Dh
  1072.         Dw    00A14h        ; Offset 34h - Row 40h Column 054h
  1073.         Dw    00A15h        ; Offset 35h - Row 40h Column 05Bh
  1074.         Dw    00A17h        ; Offset 36h - Row 40h Column 062h
  1075.         Dw    00A19h        ; Offset 37h - Row 40h Column 069h
  1076.         Dw    00A1Bh        ; Offset 38h - Row 40h Column 070h
  1077.         Dw    00A1Ch        ; Offset 39h - Row 40h Column 077h
  1078.         Dw    00A1Eh        ; Offset 3Ah - Row 40h Column 07Eh
  1079.         Dw    00A20h        ; Offset 3Bh - Row 40h Column 085h
  1080.         Dw    00A22h        ; Offset 3Ch - Row 40h Column 08Ch
  1081.         Dw    00A23h        ; Offset 3Dh - Row 40h Column 093h
  1082.         Dw    00A25h        ; Offset 3Eh - Row 40h Column 09Ah
  1083.         Dw    00A27h        ; Offset 3Fh - Row 40h Column 0A1h
  1084.         Dw    00A29h        ; Offset 40h - Row 40h Column 0A8h
  1085.         Dw    00A2Ah        ; Offset 41h - Row 40h Column 0AFh
  1086.         Dw    00A2Ch        ; Offset 42h - Row 40h Column 0B6h
  1087.         Dw    00A2Eh        ; Offset 43h - Row 40h Column 0BDh
  1088.         Dw    00A30h        ; Offset 44h - Row 40h Column 0C4h
  1089.         Dw    00A31h        ; Offset 45h - Row 40h Column 0CBh
  1090.         Dw    00A33h        ; Offset 46h - Row 40h Column 0D2h
  1091.         Dw    00A35h        ; Offset 47h - Row 40h Column 0D9h
  1092.         Dw    00A37h        ; Offset 48h - Row 40h Column 0E0h
  1093.         Dw    00A38h        ; Offset 49h - Row 40h Column 0E7h
  1094.         Dw    00A3Ah        ; Offset 4Ah - Row 40h Column 0EEh
  1095.         Dw    00A3Ch        ; Offset 4Bh - Row 40h Column 0F5h
  1096.         Dw    00A3Eh        ; Offset 4Ch - Row 40h Column 0FCh
  1097.         Dw    00A3Fh        ; Offset 4Dh - Row 40h Column 103h
  1098.         Dw    00A41h        ; Offset 4Eh - Row 40h Column 10Ah
  1099.         Dw    00A43h        ; Offset 4Fh - Row 40h Column 111h
  1100.         Dw    013FFh        ; Offset 50h - Row 80h Column 000h
  1101.         Dw    01400h        ; Offset 51h - Row 80h Column 007h
  1102.         Dw    01402h        ; Offset 52h - Row 80h Column 00Eh
  1103.         Dw    01404h        ; Offset 53h - Row 80h Column 015h
  1104.         Dw    01406h        ; Offset 54h - Row 80h Column 01Ch
  1105.         Dw    01407h        ; Offset 55h - Row 80h Column 023h
  1106.         Dw    01409h        ; Offset 56h - Row 80h Column 02Ah
  1107.         Dw    0140Bh        ; Offset 57h - Row 80h Column 031h
  1108.         Dw    0140Dh        ; Offset 58h - Row 80h Column 038h
  1109.         Dw    0140Eh        ; Offset 59h - Row 80h Column 03Fh
  1110.         Dw    01410h        ; Offset 5Ah - Row 80h Column 046h
  1111.         Dw    01412h        ; Offset 5Bh - Row 80h Column 04Dh
  1112.         Dw    01414h        ; Offset 5Ch - Row 80h Column 054h
  1113.         Dw    01415h        ; Offset 5Dh - Row 80h Column 05Bh
  1114.         Dw    01417h        ; Offset 5Eh - Row 80h Column 062h
  1115.         Dw    01419h        ; Offset 5Fh - Row 80h Column 069h
  1116.         Dw    0141Bh        ; Offset 60h - Row 80h Column 070h
  1117.         Dw    0141Ch        ; Offset 61h - Row 80h Column 077h
  1118.         Dw    0141Eh        ; Offset 62h - Row 80h Column 07Eh
  1119.         Dw    01420h        ; Offset 63h - Row 80h Column 085h
  1120.         Dw    01422h        ; Offset 64h - Row 80h Column 08Ch
  1121.         Dw    01423h        ; Offset 65h - Row 80h Column 093h
  1122.         Dw    01425h        ; Offset 66h - Row 80h Column 09Ah
  1123.         Dw    01427h        ; Offset 67h - Row 80h Column 0A1h
  1124.         Dw    01429h        ; Offset 68h - Row 80h Column 0A8h
  1125.         Dw    0142Ah        ; Offset 69h - Row 80h Column 0AFh
  1126.         Dw    0142Ch        ; Offset 6Ah - Row 80h Column 0B6h
  1127.         Dw    0142Eh        ; Offset 6Bh - Row 80h Column 0BDh
  1128.         Dw    01430h        ; Offset 6Ch - Row 80h Column 0C4h
  1129.         Dw    01431h        ; Offset 6Dh - Row 80h Column 0CBh
  1130.         Dw    01433h        ; Offset 6Eh - Row 80h Column 0D2h
  1131.         Dw    01435h        ; Offset 6Fh - Row 80h Column 0D9h
  1132.         Dw    01437h        ; Offset 70h - Row 80h Column 0E0h
  1133.         Dw    01438h        ; Offset 71h - Row 80h Column 0E7h
  1134.         Dw    0143Ah        ; Offset 72h - Row 80h Column 0EEh
  1135.         Dw    0143Ch        ; Offset 73h - Row 80h Column 0F5h
  1136.         Dw    0143Eh        ; Offset 74h - Row 80h Column 0FCh
  1137.         Dw    0143Fh        ; Offset 75h - Row 80h Column 103h
  1138.         Dw    01441h        ; Offset 76h - Row 80h Column 10Ah
  1139.         Dw    01443h        ; Offset 77h - Row 80h Column 111h
  1140.         Dw    07FFFh        ; Offset 78h - Screen hole 00h
  1141.         Dw    07FFFh        ; Offset 79h - Screen hole 01h
  1142.         Dw    07FFFh        ; Offset 7Ah - Screen hole 02h
  1143.         Dw    07FFFh        ; Offset 7Bh - Screen hole 03h
  1144.         Dw    07FFFh        ; Offset 7Ch - Screen hole 04h
  1145.         Dw    07FFFh        ; Offset 7Dh - Screen hole 05h
  1146.         Dw    07FFFh        ; Offset 7Eh - Screen hole 06h
  1147.         Dw    07FFFh        ; Offset 7Fh - Screen hole 07h
  1148. EGA_Address    Equ    This Word    ; EGA graphics video offset lookup table
  1149.         Dw    0FFFFh        ; Offset 00h - Row 00h Column 000h
  1150.         Dw    0FFFFh        ; Offset 01h - Row 00h Column 007h
  1151.         Dw    00000h        ; Offset 02h - Row 00h Column 00Eh
  1152.         Dw    00001h        ; Offset 03h - Row 00h Column 015h
  1153.         Dw    00002h        ; Offset 04h - Row 00h Column 01Ch
  1154.         Dw    00003h        ; Offset 05h - Row 00h Column 023h
  1155.         Dw    00004h        ; Offset 06h - Row 00h Column 02Ah
  1156.         Dw    00005h        ; Offset 07h - Row 00h Column 031h
  1157.         Dw    00006h        ; Offset 08h - Row 00h Column 038h
  1158.         Dw    00006h        ; Offset 09h - Row 00h Column 03Fh
  1159.         Dw    00007h        ; Offset 0Ah - Row 00h Column 046h
  1160.         Dw    00008h        ; Offset 0Bh - Row 00h Column 04Dh
  1161.         Dw    00009h        ; Offset 0Ch - Row 00h Column 054h
  1162.         Dw    0000Ah        ; Offset 0Dh - Row 00h Column 05Bh
  1163.         Dw    0000Bh        ; Offset 0Eh - Row 00h Column 062h
  1164.         Dw    0000Ch        ; Offset 0Fh - Row 00h Column 069h
  1165.         Dw    0000Dh        ; Offset 10h - Row 00h Column 070h
  1166.         Dw    0000Dh        ; Offset 11h - Row 00h Column 077h
  1167.         Dw    0000Eh        ; Offset 12h - Row 00h Column 07Eh
  1168.         Dw    0000Fh        ; Offset 13h - Row 00h Column 085h
  1169.         Dw    00010h        ; Offset 14h - Row 00h Column 08Ch
  1170.         Dw    00011h        ; Offset 15h - Row 00h Column 093h
  1171.         Dw    00012h        ; Offset 16h - Row 00h Column 09Ah
  1172.         Dw    00013h        ; Offset 17h - Row 00h Column 0A1h
  1173.         Dw    00014h        ; Offset 18h - Row 00h Column 0A8h
  1174.         Dw    00014h        ; Offset 19h - Row 00h Column 0AFh
  1175.         Dw    00015h        ; Offset 1Ah - Row 00h Column 0B6h
  1176.         Dw    00016h        ; Offset 1Bh - Row 00h Column 0BDh
  1177.         Dw    00017h        ; Offset 1Ch - Row 00h Column 0C4h
  1178.         Dw    00018h        ; Offset 1Dh - Row 00h Column 0CBh
  1179.         Dw    00019h        ; Offset 1Eh - Row 00h Column 0D2h
  1180.         Dw    0001Ah        ; Offset 1Fh - Row 00h Column 0D9h
  1181.         Dw    0001Bh        ; Offset 20h - Row 00h Column 0E0h
  1182.         Dw    0001Bh        ; Offset 21h - Row 00h Column 0E7h
  1183.         Dw    0001Ch        ; Offset 22h - Row 00h Column 0EEh
  1184.         Dw    0001Dh        ; Offset 23h - Row 00h Column 0F5h
  1185.         Dw    0001Eh        ; Offset 24h - Row 00h Column 0FCh
  1186.         Dw    0001Fh        ; Offset 25h - Row 00h Column 103h
  1187.         Dw    00020h        ; Offset 26h - Row 00h Column 10Ah
  1188.         Dw    00021h        ; Offset 27h - Row 00h Column 111h
  1189.         Dw    009FFh        ; Offset 28h - Row 40h Column 000h
  1190.         Dw    009FFh        ; Offset 29h - Row 40h Column 007h
  1191.         Dw    00A00h        ; Offset 2Ah - Row 40h Column 00Eh
  1192.         Dw    00A01h        ; Offset 2Bh - Row 40h Column 015h
  1193.         Dw    00A02h        ; Offset 2Ch - Row 40h Column 01Ch
  1194.         Dw    00A03h        ; Offset 2Dh - Row 40h Column 023h
  1195.         Dw    00A04h        ; Offset 2Eh - Row 40h Column 02Ah
  1196.         Dw    00A05h        ; Offset 2Fh - Row 40h Column 031h
  1197.         Dw    00A06h        ; Offset 30h - Row 40h Column 038h
  1198.         Dw    00A06h        ; Offset 31h - Row 40h Column 03Fh
  1199.         Dw    00A07h        ; Offset 32h - Row 40h Column 046h
  1200.         Dw    00A08h        ; Offset 33h - Row 40h Column 04Dh
  1201.         Dw    00A09h        ; Offset 34h - Row 40h Column 054h
  1202.         Dw    00A0Ah        ; Offset 35h - Row 40h Column 05Bh
  1203.         Dw    00A0Bh        ; Offset 36h - Row 40h Column 062h
  1204.         Dw    00A0Ch        ; Offset 37h - Row 40h Column 069h
  1205.         Dw    00A0Dh        ; Offset 38h - Row 40h Column 070h
  1206.         Dw    00A0Dh        ; Offset 39h - Row 40h Column 077h
  1207.         Dw    00A0Eh        ; Offset 3Ah - Row 40h Column 07Eh
  1208.         Dw    00A0Fh        ; Offset 3Bh - Row 40h Column 085h
  1209.         Dw    00A10h        ; Offset 3Ch - Row 40h Column 08Ch
  1210.         Dw    00A11h        ; Offset 3Dh - Row 40h Column 093h
  1211.         Dw    00A12h        ; Offset 3Eh - Row 40h Column 09Ah
  1212.         Dw    00A13h        ; Offset 3Fh - Row 40h Column 0A1h
  1213.         Dw    00A14h        ; Offset 40h - Row 40h Column 0A8h
  1214.         Dw    00A14h        ; Offset 41h - Row 40h Column 0AFh
  1215.         Dw    00A15h        ; Offset 42h - Row 40h Column 0B6h
  1216.         Dw    00A16h        ; Offset 43h - Row 40h Column 0BDh
  1217.         Dw    00A17h        ; Offset 44h - Row 40h Column 0C4h
  1218.         Dw    00A18h        ; Offset 45h - Row 40h Column 0CBh
  1219.         Dw    00A19h        ; Offset 46h - Row 40h Column 0D2h
  1220.         Dw    00A1Ah        ; Offset 47h - Row 40h Column 0D9h
  1221.         Dw    00A1Bh        ; Offset 48h - Row 40h Column 0E0h
  1222.         Dw    00A1Bh        ; Offset 49h - Row 40h Column 0E7h
  1223.         Dw    00A1Ch        ; Offset 4Ah - Row 40h Column 0EEh
  1224.         Dw    00A1Dh        ; Offset 4Bh - Row 40h Column 0F5h
  1225.         Dw    00A1Eh        ; Offset 4Ch - Row 40h Column 0FCh
  1226.         Dw    00A1Fh        ; Offset 4Dh - Row 40h Column 103h
  1227.         Dw    00A20h        ; Offset 4Eh - Row 40h Column 10Ah
  1228.         Dw    00A21h        ; Offset 4Fh - Row 40h Column 111h
  1229.         Dw    013FFh        ; Offset 50h - Row 80h Column 000h
  1230.         Dw    013FFh        ; Offset 51h - Row 80h Column 007h
  1231.         Dw    01400h        ; Offset 52h - Row 80h Column 00Eh
  1232.         Dw    01401h        ; Offset 53h - Row 80h Column 015h
  1233.         Dw    01402h        ; Offset 54h - Row 80h Column 01Ch
  1234.         Dw    01403h        ; Offset 55h - Row 80h Column 023h
  1235.         Dw    01404h        ; Offset 56h - Row 80h Column 02Ah
  1236.         Dw    01405h        ; Offset 57h - Row 80h Column 031h
  1237.         Dw    01406h        ; Offset 58h - Row 80h Column 038h
  1238.         Dw    01406h        ; Offset 59h - Row 80h Column 03Fh
  1239.         Dw    01407h        ; Offset 5Ah - Row 80h Column 046h
  1240.         Dw    01408h        ; Offset 5Bh - Row 80h Column 04Dh
  1241.         Dw    01409h        ; Offset 5Ch - Row 80h Column 054h
  1242.         Dw    0140Ah        ; Offset 5Dh - Row 80h Column 05Bh
  1243.         Dw    0140Bh        ; Offset 5Eh - Row 80h Column 062h
  1244.         Dw    0140Ch        ; Offset 5Fh - Row 80h Column 069h
  1245.         Dw    0140Dh        ; Offset 60h - Row 80h Column 070h
  1246.         Dw    0140Dh        ; Offset 61h - Row 80h Column 077h
  1247.         Dw    0140Eh        ; Offset 62h - Row 80h Column 07Eh
  1248.         Dw    0140Fh        ; Offset 63h - Row 80h Column 085h
  1249.         Dw    01410h        ; Offset 64h - Row 80h Column 08Ch
  1250.         Dw    01411h        ; Offset 65h - Row 80h Column 093h
  1251.         Dw    01412h        ; Offset 66h - Row 80h Column 09Ah
  1252.         Dw    01413h        ; Offset 67h - Row 80h Column 0A1h
  1253.         Dw    01414h        ; Offset 68h - Row 80h Column 0A8h
  1254.         Dw    01414h        ; Offset 69h - Row 80h Column 0AFh
  1255.         Dw    01415h        ; Offset 6Ah - Row 80h Column 0B6h
  1256.         Dw    01416h        ; Offset 6Bh - Row 80h Column 0BDh
  1257.         Dw    01417h        ; Offset 6Ch - Row 80h Column 0C4h
  1258.         Dw    01418h        ; Offset 6Dh - Row 80h Column 0CBh
  1259.         Dw    01419h        ; Offset 6Eh - Row 80h Column 0D2h
  1260.         Dw    0141Ah        ; Offset 6Fh - Row 80h Column 0D9h
  1261.         Dw    0141Bh        ; Offset 70h - Row 80h Column 0E0h
  1262.         Dw    0141Bh        ; Offset 71h - Row 80h Column 0E7h
  1263.         Dw    0141Ch        ; Offset 72h - Row 80h Column 0EEh
  1264.         Dw    0141Dh        ; Offset 73h - Row 80h Column 0F5h
  1265.         Dw    0141Eh        ; Offset 74h - Row 80h Column 0FCh
  1266.         Dw    0141Fh        ; Offset 75h - Row 80h Column 103h
  1267.         Dw    01420h        ; Offset 76h - Row 80h Column 10Ah
  1268.         Dw    01421h        ; Offset 77h - Row 80h Column 111h
  1269.         Dw    07FFFh        ; Offset 78h - Screen hole 00h
  1270.         Dw    07FFFh        ; Offset 79h - Screen hole 01h
  1271.         Dw    07FFFh        ; Offset 7Ah - Screen hole 02h
  1272.         Dw    07FFFh        ; Offset 7Bh - Screen hole 03h
  1273.         Dw    07FFFh        ; Offset 7Ch - Screen hole 04h
  1274.         Dw    07FFFh        ; Offset 7Dh - Screen hole 05h
  1275.         Dw    07FFFh        ; Offset 7Eh - Screen hole 06h
  1276.         Dw    07FFFh        ; Offset 7Fh - Screen hole 07h
  1277. CGA_Slice    Equ    This Word    ; CGA Slice/Macro line lookup table
  1278.         Dw    00000h        ; Slice 000 - Macro 000 - Row 00h
  1279.         Dw    00140h        ; Slice 000 - Macro 001 - Row 08h
  1280.         Dw    00280h        ; Slice 000 - Macro 010 - Row 10h
  1281.         Dw    003C0h        ; Slice 000 - Macro 011 - Row 18h
  1282.         Dw    00500h        ; Slice 000 - Macro 100 - Row 20h
  1283.         Dw    00640h        ; Slice 000 - Macro 101 - Row 28h
  1284.         Dw    00780h        ; Slice 000 - Macro 110 - Row 30h
  1285.         Dw    008C0h        ; Slice 000 - Macro 111 - Row 38h
  1286.         Dw    02000h        ; Slice 001 - Macro 000 - Row 01h
  1287.         Dw    02140h        ; Slice 001 - Macro 001 - Row 09h
  1288.         Dw    02280h        ; Slice 001 - Macro 010 - Row 11h
  1289.         Dw    023C0h        ; Slice 001 - Macro 011 - Row 19h
  1290.         Dw    02500h        ; Slice 001 - Macro 100 - Row 21h
  1291.         Dw    02640h        ; Slice 001 - Macro 101 - Row 29h
  1292.         Dw    02780h        ; Slice 001 - Macro 110 - Row 31h
  1293.         Dw    028C0h        ; Slice 001 - Macro 111 - Row 39h
  1294.         Dw    00050h        ; Slice 010 - Macro 000 - Row 02h
  1295.         Dw    00190h        ; Slice 010 - Macro 001 - Row 0Ah
  1296.         Dw    002D0h        ; Slice 010 - Macro 010 - Row 12h
  1297.         Dw    00410h        ; Slice 010 - Macro 011 - Row 1Ah
  1298.         Dw    00550h        ; Slice 010 - Macro 100 - Row 22h
  1299.         Dw    00690h        ; Slice 010 - Macro 101 - Row 2Ah
  1300.         Dw    007D0h        ; Slice 010 - Macro 110 - Row 32h
  1301.         Dw    00910h        ; Slice 010 - Macro 111 - Row 3Ah
  1302.         Dw    02050h        ; Slice 011 - Macro 000 - Row 03h
  1303.         Dw    02190h        ; Slice 011 - Macro 001 - Row 0Bh
  1304.         Dw    022D0h        ; Slice 011 - Macro 010 - Row 13h
  1305.         Dw    02410h        ; Slice 011 - Macro 011 - Row 1Bh
  1306.         Dw    02550h        ; Slice 011 - Macro 100 - Row 23h
  1307.         Dw    02690h        ; Slice 011 - Macro 101 - Row 2Bh
  1308.         Dw    027D0h        ; Slice 011 - Macro 110 - Row 33h
  1309.         Dw    02910h        ; Slice 011 - Macro 111 - Row 3Bh
  1310.         Dw    000A0h        ; Slice 100 - Macro 000 - Row 04h
  1311.         Dw    001E0h        ; Slice 100 - Macro 001 - Row 0Ch
  1312.         Dw    00320h        ; Slice 100 - Macro 010 - Row 14h
  1313.         Dw    00460h        ; Slice 100 - Macro 011 - Row 1Ch
  1314.         Dw    005A0h        ; Slice 100 - Macro 100 - Row 24h
  1315.         Dw    006E0h        ; Slice 100 - Macro 101 - Row 2Ch
  1316.         Dw    00820h        ; Slice 100 - Macro 110 - Row 34h
  1317.         Dw    00960h        ; Slice 100 - Macro 111 - Row 3Ch
  1318.         Dw    020A0h        ; Slice 101 - Macro 000 - Row 05h
  1319.         Dw    021E0h        ; Slice 101 - Macro 001 - Row 0Dh
  1320.         Dw    02320h        ; Slice 101 - Macro 010 - Row 15h
  1321.         Dw    02460h        ; Slice 101 - Macro 011 - Row 1Dh
  1322.         Dw    025A0h        ; Slice 101 - Macro 100 - Row 25h
  1323.         Dw    026E0h        ; Slice 101 - Macro 101 - Row 2Dh
  1324.         Dw    02820h        ; Slice 101 - Macro 110 - Row 35h
  1325.         Dw    02960h        ; Slice 101 - Macro 111 - Row 3Dh
  1326.         Dw    000F0h        ; Slice 110 - Macro 000 - Row 06h
  1327.         Dw    00230h        ; Slice 110 - Macro 001 - Row 0Eh
  1328.         Dw    00370h        ; Slice 110 - Macro 010 - Row 16h
  1329.         Dw    004B0h        ; Slice 110 - Macro 011 - Row 1Eh
  1330.         Dw    005F0h        ; Slice 110 - Macro 100 - Row 26h
  1331.         Dw    00730h        ; Slice 110 - Macro 101 - Row 2Eh
  1332.         Dw    00870h        ; Slice 110 - Macro 110 - Row 36h
  1333.         Dw    009B0h        ; Slice 110 - Macro 111 - Row 3Eh
  1334.         Dw    020F0h        ; Slice 111 - Macro 000 - Row 07h
  1335.         Dw    02230h        ; Slice 111 - Macro 001 - Row 0Fh
  1336.         Dw    02370h        ; Slice 111 - Macro 010 - Row 17h
  1337.         Dw    024B0h        ; Slice 111 - Macro 011 - Row 1Fh
  1338.         Dw    025F0h        ; Slice 111 - Macro 100 - Row 27h
  1339.         Dw    02730h        ; Slice 111 - Macro 101 - Row 2Fh
  1340.         Dw    02870h        ; Slice 111 - Macro 110 - Row 37h
  1341.         Dw    029B0h        ; Slice 111 - Macro 111 - Row 3Fh
  1342. EGA_Slice    Equ    This Word    ; EGA Slice/Macro line lookup table
  1343.         Dw    00000h        ; Slice 000 - Macro 000 - Row 00h
  1344.         Dw    00140h        ; Slice 000 - Macro 001 - Row 08h
  1345.         Dw    00280h        ; Slice 000 - Macro 010 - Row 10h
  1346.         Dw    003C0h        ; Slice 000 - Macro 011 - Row 18h
  1347.         Dw    00500h        ; Slice 000 - Macro 100 - Row 20h
  1348.         Dw    00640h        ; Slice 000 - Macro 101 - Row 28h
  1349.         Dw    00780h        ; Slice 000 - Macro 110 - Row 30h
  1350.         Dw    008C0h        ; Slice 000 - Macro 111 - Row 38h
  1351.         Dw    00028h        ; Slice 001 - Macro 000 - Row 01h
  1352.         Dw    00168h        ; Slice 001 - Macro 001 - Row 09h
  1353.         Dw    002A8h        ; Slice 001 - Macro 010 - Row 11h
  1354.         Dw    003E8h        ; Slice 001 - Macro 011 - Row 19h
  1355.         Dw    00528h        ; Slice 001 - Macro 100 - Row 21h
  1356.         Dw    00668h        ; Slice 001 - Macro 101 - Row 29h
  1357.         Dw    007A8h        ; Slice 001 - Macro 110 - Row 31h
  1358.         Dw    008E8h        ; Slice 001 - Macro 111 - Row 39h
  1359.         Dw    00050h        ; Slice 010 - Macro 000 - Row 02h
  1360.         Dw    00190h        ; Slice 010 - Macro 001 - Row 0Ah
  1361.         Dw    002D0h        ; Slice 010 - Macro 010 - Row 12h
  1362.         Dw    00410h        ; Slice 010 - Macro 011 - Row 1Ah
  1363.         Dw    00550h        ; Slice 010 - Macro 100 - Row 22h
  1364.         Dw    00690h        ; Slice 010 - Macro 101 - Row 2Ah
  1365.         Dw    007D0h        ; Slice 010 - Macro 110 - Row 32h
  1366.         Dw    00910h        ; Slice 010 - Macro 111 - Row 3Ah
  1367.         Dw    00078h        ; Slice 011 - Macro 000 - Row 03h
  1368.         Dw    001B8h        ; Slice 011 - Macro 001 - Row 0Bh
  1369.         Dw    002F8h        ; Slice 011 - Macro 010 - Row 13h
  1370.         Dw    00438h        ; Slice 011 - Macro 011 - Row 1Bh
  1371.         Dw    00578h        ; Slice 011 - Macro 100 - Row 23h
  1372.         Dw    006B8h        ; Slice 011 - Macro 101 - Row 2Bh
  1373.         Dw    007F8h        ; Slice 011 - Macro 110 - Row 33h
  1374.         Dw    00938h        ; Slice 011 - Macro 111 - Row 3Bh
  1375.         Dw    000A0h        ; Slice 100 - Macro 000 - Row 04h
  1376.         Dw    001E0h        ; Slice 100 - Macro 001 - Row 0Ch
  1377.         Dw    00320h        ; Slice 100 - Macro 010 - Row 14h
  1378.         Dw    00460h        ; Slice 100 - Macro 011 - Row 1Ch
  1379.         Dw    005A0h        ; Slice 100 - Macro 100 - Row 24h
  1380.         Dw    006E0h        ; Slice 100 - Macro 101 - Row 2Ch
  1381.         Dw    00820h        ; Slice 100 - Macro 110 - Row 34h
  1382.         Dw    00960h        ; Slice 100 - Macro 111 - Row 3Ch
  1383.         Dw    000C8h        ; Slice 101 - Macro 000 - Row 05h
  1384.         Dw    00208h        ; Slice 101 - Macro 001 - Row 0Dh
  1385.         Dw    00348h        ; Slice 101 - Macro 010 - Row 15h
  1386.         Dw    00488h        ; Slice 101 - Macro 011 - Row 1Dh
  1387.         Dw    005C8h        ; Slice 101 - Macro 100 - Row 25h
  1388.         Dw    00708h        ; Slice 101 - Macro 101 - Row 2Dh
  1389.         Dw    00848h        ; Slice 101 - Macro 110 - Row 35h
  1390.         Dw    00988h        ; Slice 101 - Macro 111 - Row 3Dh
  1391.         Dw    000F0h        ; Slice 110 - Macro 000 - Row 06h
  1392.         Dw    00230h        ; Slice 110 - Macro 001 - Row 0Eh
  1393.         Dw    00370h        ; Slice 110 - Macro 010 - Row 16h
  1394.         Dw    004B0h        ; Slice 110 - Macro 011 - Row 1Eh
  1395.         Dw    005F0h        ; Slice 110 - Macro 100 - Row 26h
  1396.         Dw    00730h        ; Slice 110 - Macro 101 - Row 2Eh
  1397.         Dw    00870h        ; Slice 110 - Macro 110 - Row 36h
  1398.         Dw    009B0h        ; Slice 110 - Macro 111 - Row 3Eh
  1399.         Dw    00118h        ; Slice 111 - Macro 000 - Row 07h
  1400.         Dw    00258h        ; Slice 111 - Macro 001 - Row 0Fh
  1401.         Dw    00398h        ; Slice 111 - Macro 010 - Row 17h
  1402.         Dw    004D8h        ; Slice 111 - Macro 011 - Row 1Fh
  1403.         Dw    00618h        ; Slice 111 - Macro 100 - Row 27h
  1404.         Dw    00758h        ; Slice 111 - Macro 101 - Row 2Fh
  1405.         Dw    00898h        ; Slice 111 - Macro 110 - Row 37h
  1406.         Dw    009D8h        ; Slice 111 - Macro 111 - Row 3Fh
  1407.         Even            ; Force table to even address
  1408. Reverse_Table    Equ    This Byte    ; Graphics video bit reversal table
  1409.         Reverse <00000000>    ; Binary 00000000b reversed - 00000000b
  1410.         Reverse <00000001>    ; Binary 00000001b reversed - 10000000b
  1411.         Reverse <00000010>    ; Binary 00000010b reversed - 01000000b
  1412.         Reverse <00000011>    ; Binary 00000011b reversed - 11000000b
  1413.         Reverse <00000100>    ; Binary 00000100b reversed - 00100000b
  1414.         Reverse <00000101>    ; Binary 00000101b reversed - 10100000b
  1415.         Reverse <00000110>    ; Binary 00000110b reversed - 01100000b
  1416.         Reverse <00000111>    ; Binary 00000111b reversed - 11100000b
  1417.         Reverse <00001000>    ; Binary 00001000b reversed - 00010000b
  1418.         Reverse <00001001>    ; Binary 00001001b reversed - 10010000b
  1419.         Reverse <00001010>    ; Binary 00001010b reversed - 01010000b
  1420.         Reverse <00001011>    ; Binary 00001011b reversed - 11010000b
  1421.         Reverse <00001100>    ; Binary 00001100b reversed - 00110000b
  1422.         Reverse <00001101>    ; Binary 00001101b reversed - 10110000b
  1423.         Reverse <00001110>    ; Binary 00001110b reversed - 01110000b
  1424.         Reverse <00001111>    ; Binary 00001111b reversed - 11110000b
  1425.         Reverse <00010000>    ; Binary 00010000b reversed - 00001000b
  1426.         Reverse <00010001>    ; Binary 00010001b reversed - 10001000b
  1427.         Reverse <00010010>    ; Binary 00010010b reversed - 01001000b
  1428.         Reverse <00010011>    ; Binary 00010011b reversed - 11001000b
  1429.         Reverse <00010100>    ; Binary 00010100b reversed - 00101000b
  1430.         Reverse <00010101>    ; Binary 00010101b reversed - 10101000b
  1431.         Reverse <00010110>    ; Binary 00010110b reversed - 01101000b
  1432.         Reverse <00010111>    ; Binary 00010111b reversed - 11101000b
  1433.         Reverse <00011000>    ; Binary 00011000b reversed - 00011000b
  1434.         Reverse <00011001>    ; Binary 00011001b reversed - 10011000b
  1435.         Reverse <00011010>    ; Binary 00011010b reversed - 01011000b
  1436.         Reverse <00011011>    ; Binary 00011011b reversed - 11011000b
  1437.         Reverse <00011100>    ; Binary 00011100b reversed - 00111000b
  1438.         Reverse <00011101>    ; Binary 00011101b reversed - 10111000b
  1439.         Reverse <00011110>    ; Binary 00011110b reversed - 01111000b
  1440.         Reverse <00011111>    ; Binary 00011111b reversed - 11111000b
  1441.         Reverse <00100000>    ; Binary 00100000b reversed - 00000100b
  1442.         Reverse <00100001>    ; Binary 00100001b reversed - 10000100b
  1443.         Reverse <00100010>    ; Binary 00100010b reversed - 01000100b
  1444.         Reverse <00100011>    ; Binary 00100011b reversed - 11000100b
  1445.         Reverse <00100100>    ; Binary 00100100b reversed - 00100100b
  1446.         Reverse <00100101>    ; Binary 00100101b reversed - 10100100b
  1447.         Reverse <00100110>    ; Binary 00100110b reversed - 01100100b
  1448.         Reverse <00100111>    ; Binary 00100111b reversed - 11100100b
  1449.         Reverse <00101000>    ; Binary 00101000b reversed - 00010100b
  1450.         Reverse <00101001>    ; Binary 00101001b reversed - 10010100b
  1451.         Reverse <00101010>    ; Binary 00101010b reversed - 01010100b
  1452.         Reverse <00101011>    ; Binary 00101011b reversed - 11010100b
  1453.         Reverse <00101100>    ; Binary 00101100b reversed - 00110100b
  1454.         Reverse <00101101>    ; Binary 00101101b reversed - 10110100b
  1455.         Reverse <00101110>    ; Binary 00101110b reversed - 01110100b
  1456.         Reverse <00101111>    ; Binary 00101111b reversed - 11110100b
  1457.         Reverse <00110000>    ; Binary 00110000b reversed - 00001100b
  1458.         Reverse <00110001>    ; Binary 00110001b reversed - 10001100b
  1459.         Reverse <00110010>    ; Binary 00110010b reversed - 01001100b
  1460.         Reverse <00110011>    ; Binary 00110011b reversed - 11001100b
  1461.         Reverse <00110100>    ; Binary 00110100b reversed - 00101100b
  1462.         Reverse <00110101>    ; Binary 00110101b reversed - 10101100b
  1463.         Reverse <00110110>    ; Binary 00110110b reversed - 01101100b
  1464.         Reverse <00110111>    ; Binary 00110111b reversed - 11101100b
  1465.         Reverse <00111000>    ; Binary 00111000b reversed - 00011100b
  1466.         Reverse <00111001>    ; Binary 00111001b reversed - 10011100b
  1467.         Reverse <00111010>    ; Binary 00111010b reversed - 01011100b
  1468.         Reverse <00111011>    ; Binary 00111011b reversed - 11011100b
  1469.         Reverse <00111100>    ; Binary 00111100b reversed - 00111100b
  1470.         Reverse <00111101>    ; Binary 00111101b reversed - 10111100b
  1471.         Reverse <00111110>    ; Binary 00111110b reversed - 01111100b
  1472.         Reverse <00111111>    ; Binary 00111111b reversed - 11111100b
  1473.         Reverse <01000000>    ; Binary 01000000b reversed - 00000010b
  1474.         Reverse <01000001>    ; Binary 01000001b reversed - 10000010b
  1475.         Reverse <01000010>    ; Binary 01000010b reversed - 01000010b
  1476.         Reverse <01000011>    ; Binary 01000011b reversed - 11000010b
  1477.         Reverse <01000100>    ; Binary 01000100b reversed - 00100010b
  1478.         Reverse <01000101>    ; Binary 01000101b reversed - 10100010b
  1479.         Reverse <01000110>    ; Binary 01000110b reversed - 01100010b
  1480.         Reverse <01000111>    ; Binary 01000111b reversed - 11100010b
  1481.         Reverse <01001000>    ; Binary 01001000b reversed - 00010010b
  1482.         Reverse <01001001>    ; Binary 01001001b reversed - 10010010b
  1483.         Reverse <01001010>    ; Binary 01001010b reversed - 01010010b
  1484.         Reverse <01001011>    ; Binary 01001011b reversed - 11010010b
  1485.         Reverse <01001100>    ; Binary 01001100b reversed - 00110010b
  1486.         Reverse <01001101>    ; Binary 01001101b reversed - 10110010b
  1487.         Reverse <01001110>    ; Binary 01001110b reversed - 01110010b
  1488.         Reverse <01001111>    ; Binary 01001111b reversed - 11110010b
  1489.         Reverse <01010000>    ; Binary 01010000b reversed - 00001010b
  1490.         Reverse <01010001>    ; Binary 01010001b reversed - 10001010b
  1491.         Reverse <01010010>    ; Binary 01010010b reversed - 01001010b
  1492.         Reverse <01010011>    ; Binary 01010011b reversed - 11001010b
  1493.         Reverse <01010100>    ; Binary 01010100b reversed - 00101010b
  1494.         Reverse <01010101>    ; Binary 01010101b reversed - 10101010b
  1495.         Reverse <01010110>    ; Binary 01010110b reversed - 01101010b
  1496.         Reverse <01010111>    ; Binary 01010111b reversed - 11101010b
  1497.         Reverse <01011000>    ; Binary 01011000b reversed - 00011010b
  1498.         Reverse <01011001>    ; Binary 01011001b reversed - 10011010b
  1499.         Reverse <01011010>    ; Binary 01011010b reversed - 01011010b
  1500.         Reverse <01011011>    ; Binary 01011011b reversed - 11011010b
  1501.         Reverse <01011100>    ; Binary 01011100b reversed - 00111010b
  1502.         Reverse <01011101>    ; Binary 01011101b reversed - 10111010b
  1503.         Reverse <01011110>    ; Binary 01011110b reversed - 01111010b
  1504.         Reverse <01011111>    ; Binary 01011111b reversed - 11111010b
  1505.         Reverse <01100000>    ; Binary 01100000b reversed - 00000110b
  1506.         Reverse <01100001>    ; Binary 01100001b reversed - 10000110b
  1507.         Reverse <01100010>    ; Binary 01100010b reversed - 01000110b
  1508.         Reverse <01100011>    ; Binary 01100011b reversed - 11000110b
  1509.         Reverse <01100100>    ; Binary 01100100b reversed - 00100110b
  1510.         Reverse <01100101>    ; Binary 01100101b reversed - 10100110b
  1511.         Reverse <01100110>    ; Binary 01100110b reversed - 01100110b
  1512.         Reverse <01100111>    ; Binary 01100111b reversed - 11100110b
  1513.         Reverse <01101000>    ; Binary 01101000b reversed - 00010110b
  1514.         Reverse <01101001>    ; Binary 01101001b reversed - 10010110b
  1515.         Reverse <01101010>    ; Binary 01101010b reversed - 01010110b
  1516.         Reverse <01101011>    ; Binary 01101011b reversed - 11010110b
  1517.         Reverse <01101100>    ; Binary 01101100b reversed - 00110110b
  1518.         Reverse <01101101>    ; Binary 01101101b reversed - 10110110b
  1519.         Reverse <01101110>    ; Binary 01101110b reversed - 01110110b
  1520.         Reverse <01101111>    ; Binary 01101111b reversed - 11110110b
  1521.         Reverse <01110000>    ; Binary 01110000b reversed - 00001110b
  1522.         Reverse <01110001>    ; Binary 01110001b reversed - 10001110b
  1523.         Reverse <01110010>    ; Binary 01110010b reversed - 01001110b
  1524.         Reverse <01110011>    ; Binary 01110011b reversed - 11001110b
  1525.         Reverse <01110100>    ; Binary 01110100b reversed - 00101110b
  1526.         Reverse <01110101>    ; Binary 01110101b reversed - 10101110b
  1527.         Reverse <01110110>    ; Binary 01110110b reversed - 01101110b
  1528.         Reverse <01110111>    ; Binary 01110111b reversed - 11101110b
  1529.         Reverse <01111000>    ; Binary 01111000b reversed - 00011110b
  1530.         Reverse <01111001>    ; Binary 01111001b reversed - 10011110b
  1531.         Reverse <01111010>    ; Binary 01111010b reversed - 01011110b
  1532.         Reverse <01111011>    ; Binary 01111011b reversed - 11011110b
  1533.         Reverse <01111100>    ; Binary 01111100b reversed - 00111110b
  1534.         Reverse <01111101>    ; Binary 01111101b reversed - 10111110b
  1535.         Reverse <01111110>    ; Binary 01111110b reversed - 01111110b
  1536.         Reverse <01111111>    ; Binary 01111111b reversed - 11111110b
  1537. Even_Table    Equ    This Word    ; Graphics even col. color exp. table
  1538.         Color    <BBBBBBB>    ; Value 00000000b = BBBBBBBx
  1539.         Color    <BBBBBBP>    ; Value 00000010b = BBBBBBPx
  1540.         Color    <BBBBBGB>    ; Value 00000100b = BBBBBGBx
  1541.         Color    <BBBBBGP>    ; Value 00000110b = BBBBBGPx
  1542.         Color    <BBBBPBB>    ; Value 00001000b = BBBBPBBx
  1543.         Color    <BBBBPBP>    ; Value 00001010b = BBBBPBPx
  1544.         Color    <BBBBPGB>    ; Value 00001100b = BBBBPGBx
  1545.         Color    <BBBBPGP>    ; Value 00001110b = BBBBPGPx
  1546.         Color    <BBBGBBB>    ; Value 00010000b = BBBGBBBx
  1547.         Color    <BBBGBBP>    ; Value 00010010b = BBBGBBPx
  1548.         Color    <BBBGBGB>    ; Value 00010100b = BBBGBGBx
  1549.         Color    <BBBGBGP>    ; Value 00010110b = BBBGBGPx
  1550.         Color    <BBBGPBB>    ; Value 00011000b = BBBGPBBx
  1551.         Color    <BBBGPBP>    ; Value 00011010b = BBBGPBPx
  1552.         Color    <BBBGPGB>    ; Value 00011100b = BBBGPGBx
  1553.         Color    <BBBGPGP>    ; Value 00011110b = BBBGPGPx
  1554.         Color    <BBPBBBB>    ; Value 00100000b = BBPBBBBx
  1555.         Color    <BBPBBBP>    ; Value 00100010b = BBPBBBPx
  1556.         Color    <BBPBBGB>    ; Value 00100100b = BBPBBGBx
  1557.         Color    <BBPBBGP>    ; Value 00100110b = BBPBBGPx
  1558.         Color    <BBPBPBB>    ; Value 00101000b = BBPBPBBx
  1559.         Color    <BBPBPBP>    ; Value 00101010b = BBPBPBPx
  1560.         Color    <BBPBPGB>    ; Value 00101100b = BBPBPGBx
  1561.         Color    <BBPBPGP>    ; Value 00101110b = BBPBPGPx
  1562.         Color    <BBPGBBB>    ; Value 00110000b = BBPGBBBx
  1563.         Color    <BBPGBBP>    ; Value 00110010b = BBPGBBPx
  1564.         Color    <BBPGBGB>    ; Value 00110100b = BBPGBGBx
  1565.         Color    <BBPGBGP>    ; Value 00110110b = BBPGBGPx
  1566.         Color    <BBPGPBB>    ; Value 00111000b = BBPGPBBx
  1567.         Color    <BBPGPBP>    ; Value 00111010b = BBPGPBPx
  1568.         Color    <BBPGPGB>    ; Value 00111100b = BBPGPGBx
  1569.         Color    <BBPGPGP>    ; Value 00111110b = BBPGPGPx
  1570.         Color    <BGBBBBB>    ; Value 01000000b = BGBBBBBx
  1571.         Color    <BGBBBBP>    ; Value 01000010b = BGBBBBPx
  1572.         Color    <BGBBBGB>    ; Value 01000100b = BGBBBGBx
  1573.         Color    <BGBBBGP>    ; Value 01000110b = BGBBBGPx
  1574.         Color    <BGBBPBB>    ; Value 01001000b = BGBBPBBx
  1575.         Color    <BGBBPBP>    ; Value 01001010b = BGBBPBPx
  1576.         Color    <BGBBPGB>    ; Value 01001100b = BGBBPGBx
  1577.         Color    <BGBBPGP>    ; Value 01001110b = BGBBPGPx
  1578.         Color    <BGBGBBB>    ; Value 01010000b = BGBGBBBx
  1579.         Color    <BGBGBBP>    ; Value 01010010b = BGBGBBPx
  1580.         Color    <BGBGBGB>    ; Value 01010100b = BGBGBGBx
  1581.         Color    <BGBGBGP>    ; Value 01010110b = BGBGBGPx
  1582.         Color    <BGBGPBB>    ; Value 01011000b = BGBGPBBx
  1583.         Color    <BGBGPBP>    ; Value 01011010b = BGBGPBPx
  1584.         Color    <BGBGPGB>    ; Value 01011100b = BGBGPGBx
  1585.         Color    <BGBGPGP>    ; Value 01011110b = BGBGPGPx
  1586.         Color    <BGPBBBB>    ; Value 01100000b = BGPBBBBx
  1587.         Color    <BGPBBBP>    ; Value 01100010b = BGPBBBPx
  1588.         Color    <BGPBBGB>    ; Value 01100100b = BGPBBGBx
  1589.         Color    <BGPBBGP>    ; Value 01100110b = BGPBBGPx
  1590.         Color    <BGPBPBB>    ; Value 01101000b = BGPBPBBx
  1591.         Color    <BGPBPBP>    ; Value 01101010b = BGPBPBPx
  1592.         Color    <BGPBPGB>    ; Value 01101100b = BGPBPGBx
  1593.         Color    <BGPBPGP>    ; Value 01101110b = BGPBPGPx
  1594.         Color    <BGPGBBB>    ; Value 01110000b = BGPGBBBx
  1595.         Color    <BGPGBBP>    ; Value 01110010b = BGPGBBPx
  1596.         Color    <BGPGBGB>    ; Value 01110100b = BGPGBGBx
  1597.         Color    <BGPGBGP>    ; Value 01110110b = BGPGBGPx
  1598.         Color    <BGPGPBB>    ; Value 01111000b = BGPGPBBx
  1599.         Color    <BGPGPBP>    ; Value 01111010b = BGPGPBPx
  1600.         Color    <BGPGPGB>    ; Value 01111100b = BGPGPGBx
  1601.         Color    <BGPGPGP>    ; Value 01111110b = BGPGPGPx
  1602.         Color    <PBBBBBB>    ; Value 10000000b = PBBBBBBx
  1603.         Color    <PBBBBBP>    ; Value 10000010b = PBBBBBPx
  1604.         Color    <PBBBBGB>    ; Value 10000100b = PBBBBGBx
  1605.         Color    <PBBBBGP>    ; Value 10000110b = PBBBBGPx
  1606.         Color    <PBBBPBB>    ; Value 10001000b = PBBBPBBx
  1607.         Color    <PBBBPBP>    ; Value 10001010b = PBBBPBPx
  1608.         Color    <PBBBPGB>    ; Value 10001100b = PBBBPGBx
  1609.         Color    <PBBBPGP>    ; Value 10001110b = PBBBPGPx
  1610.         Color    <PBBGBBB>    ; Value 10010000b = PBBGBBBx
  1611.         Color    <PBBGBBP>    ; Value 10010010b = PBBGBBPx
  1612.         Color    <PBBGBGB>    ; Value 10010100b = PBBGBGBx
  1613.         Color    <PBBGBGP>    ; Value 10010110b = PBBGBGPx
  1614.         Color    <PBBGPBB>    ; Value 10011000b = PBBGPBBx
  1615.         Color    <PBBGPBP>    ; Value 10011010b = PBBGPBPx
  1616.         Color    <PBBGPGB>    ; Value 10011100b = PBBGPGBx
  1617.         Color    <PBBGPGP>    ; Value 10011110b = PBBGPGPx
  1618.         Color    <PBPBBBB>    ; Value 10100000b = PBPBBBBx
  1619.         Color    <PBPBBBP>    ; Value 10100010b = PBPBBBPx
  1620.         Color    <PBPBBGB>    ; Value 10100100b = PBPBBGBx
  1621.         Color    <PBPBBGP>    ; Value 10100110b = PBPBBGPx
  1622.         Color    <PBPBPBB>    ; Value 10101000b = PBPBPBBx
  1623.         Color    <PBPBPBP>    ; Value 10101010b = PBPBPBPx
  1624.         Color    <PBPBPGB>    ; Value 10101100b = PBPBPGBx
  1625.         Color    <PBPBPGP>    ; Value 10101110b = PBPBPGPx
  1626.         Color    <PBPGBBB>    ; Value 10110000b = PBPGBBBx
  1627.         Color    <PBPGBBP>    ; Value 10110010b = PBPGBBPx
  1628.         Color    <PBPGBGB>    ; Value 10110100b = PBPGBGBx
  1629.         Color    <PBPGBGP>    ; Value 10110110b = PBPGBGPx
  1630.         Color    <PBPGPBB>    ; Value 10111000b = PBPGPBBx
  1631.         Color    <PBPGPBP>    ; Value 10111010b = PBPGPBPx
  1632.         Color    <PBPGPGB>    ; Value 10111100b = PBPGPGBx
  1633.         Color    <PBPGPGP>    ; Value 10111110b = PBPGPGPx
  1634.         Color    <PGBBBBB>    ; Value 11000000b = PGBBBBBx
  1635.         Color    <PGBBBBP>    ; Value 11000010b = PGBBBBPx
  1636.         Color    <PGBBBGB>    ; Value 11000100b = PGBBBGBx
  1637.         Color    <PGBBBGP>    ; Value 11000110b = PGBBBGPx
  1638.         Color    <PGBBPBB>    ; Value 11001000b = PGBBPBBx
  1639.         Color    <PGBBPBP>    ; Value 11001010b = PGBBPBPx
  1640.         Color    <PGBBPGB>    ; Value 11001100b = PGBBPGBx
  1641.         Color    <PGBBPGP>    ; Value 11001110b = PGBBPGPx
  1642.         Color    <PGBGBBB>    ; Value 11010000b = PGBGBBBx
  1643.         Color    <PGBGBBP>    ; Value 11010010b = PGBGBBPx
  1644.         Color    <PGBGBGB>    ; Value 11010100b = PGBGBGBx
  1645.         Color    <PGBGBGP>    ; Value 11010110b = PGBGBGPx
  1646.         Color    <PGBGPBB>    ; Value 11011000b = PGBGPBBx
  1647.         Color    <PGBGPBP>    ; Value 11011010b = PGBGPBPx
  1648.         Color    <PGBGPGB>    ; Value 11011100b = PGBGPGBx
  1649.         Color    <PGBGPGP>    ; Value 11011110b = PGBGPGPx
  1650.         Color    <PGPBBBB>    ; Value 11100000b = PGPBBBBx
  1651.         Color    <PGPBBBP>    ; Value 11100010b = PGPBBBPx
  1652.         Color    <PGPBBGB>    ; Value 11100100b = PGPBBGBx
  1653.         Color    <PGPBBGP>    ; Value 11100110b = PGPBBGPx
  1654.         Color    <PGPBPBB>    ; Value 11101000b = PGPBPBBx
  1655.         Color    <PGPBPBP>    ; Value 11101010b = PGPBPBPx
  1656.         Color    <PGPBPGB>    ; Value 11101100b = PGPBPGBx
  1657.         Color    <PGPBPGP>    ; Value 11101110b = PGPBPGPx
  1658.         Color    <PGPGBBB>    ; Value 11110000b = PGPGBBBx
  1659.         Color    <PGPGBBP>    ; Value 11110010b = PGPGBBPx
  1660.         Color    <PGPGBGB>    ; Value 11110100b = PGPGBGBx
  1661.         Color    <PGPGBGP>    ; Value 11110110b = PGPGBGPx
  1662.         Color    <PGPGPBB>    ; Value 11111000b = PGPGPBBx
  1663.         Color    <PGPGPBP>    ; Value 11111010b = PGPGPBPx
  1664.         Color    <PGPGPGB>    ; Value 11111100b = PGPGPGBx
  1665.         Color    <PGPGPGP>    ; Value 11111110b = PGPGPGPx
  1666. Odd_Table    Equ    This Word    ; Graphics odd col. color exp. table
  1667.         Color    <BBBBBBB>    ; Value 00000000b = BBBBBBBx
  1668.         Color    <BBBBBBG>    ; Value 00000010b = BBBBBBGx
  1669.         Color    <BBBBBPB>    ; Value 00000100b = BBBBBPBx
  1670.         Color    <BBBBBPG>    ; Value 00000110b = BBBBBPGx
  1671.         Color    <BBBBGBB>    ; Value 00001000b = BBBBGBBx
  1672.         Color    <BBBBGBG>    ; Value 00001010b = BBBBGBGx
  1673.         Color    <BBBBGPB>    ; Value 00001100b = BBBBGPBx
  1674.         Color    <BBBBGPG>    ; Value 00001110b = BBBBGPGx
  1675.         Color    <BBBPBBB>    ; Value 00010000b = BBBPBBBx
  1676.         Color    <BBBPBBG>    ; Value 00010010b = BBBPBBGx
  1677.         Color    <BBBPBPB>    ; Value 00010100b = BBBPBPBx
  1678.         Color    <BBBPBPG>    ; Value 00010110b = BBBPBPGx
  1679.         Color    <BBBPGBB>    ; Value 00011000b = BBBPGBBx
  1680.         Color    <BBBPGBG>    ; Value 00011010b = BBBPGBGx
  1681.         Color    <BBBPGPB>    ; Value 00011100b = BBBPGPBx
  1682.         Color    <BBBPGPG>    ; Value 00011110b = BBBPGPGx
  1683.         Color    <BBGBBBB>    ; Value 00100000b = BBGBBBBx
  1684.         Color    <BBGBBBG>    ; Value 00100010b = BBGBBBGx
  1685.         Color    <BBGBBPB>    ; Value 00100100b = BBGBBPBx
  1686.         Color    <BBGBBPG>    ; Value 00100110b = BBGBBPGx
  1687.         Color    <BBGBGBB>    ; Value 00101000b = BBGBGBBx
  1688.         Color    <BBGBGBG>    ; Value 00101010b = BBGBGBGx
  1689.         Color    <BBGBGPB>    ; Value 00101100b = BBGBGPBx
  1690.         Color    <BBGBGPG>    ; Value 00101110b = BBGBGPGx
  1691.         Color    <BBGPBBB>    ; Value 00110000b = BBGPBBBx
  1692.         Color    <BBGPBBG>    ; Value 00110010b = BBGPBBGx
  1693.         Color    <BBGPBPB>    ; Value 00110100b = BBGPBPBx
  1694.         Color    <BBGPBPG>    ; Value 00110110b = BBGPBPGx
  1695.         Color    <BBGPGBB>    ; Value 00111000b = BBGPGBBx
  1696.         Color    <BBGPGBG>    ; Value 00111010b = BBGPGBGx
  1697.         Color    <BBGPGPB>    ; Value 00111100b = BBGPGPBx
  1698.         Color    <BBGPGPG>    ; Value 00111110b = BBGPGPGx
  1699.         Color    <BPBBBBB>    ; Value 01000000b = BPBBBBBx
  1700.         Color    <BPBBBBG>    ; Value 01000010b = BPBBBBGx
  1701.         Color    <BPBBBPB>    ; Value 01000100b = BPBBBPBx
  1702.         Color    <BPBBBPG>    ; Value 01000110b = BPBBBPGx
  1703.         Color    <BPBBGBB>    ; Value 01001000b = BPBBGBBx
  1704.         Color    <BPBBGBG>    ; Value 01001010b = BPBBGBGx
  1705.         Color    <BPBBGPB>    ; Value 01001100b = BPBBGPBx
  1706.         Color    <BPBBGPG>    ; Value 01001110b = BPBBGPGx
  1707.         Color    <BPBPBBB>    ; Value 01010000b = BPBPBBBx
  1708.         Color    <BPBPBBG>    ; Value 01010010b = BPBPBBGx
  1709.         Color    <BPBPBPB>    ; Value 01010100b = BPBPBPBx
  1710.         Color    <BPBPBPG>    ; Value 01010110b = BPBPBPGx
  1711.         Color    <BPBPGBB>    ; Value 01011000b = BPBPGBBx
  1712.         Color    <BPBPGBG>    ; Value 01011010b = BPBPGBGx
  1713.         Color    <BPBPGPB>    ; Value 01011100b = BPBPGPBx
  1714.         Color    <BPBPGPG>    ; Value 01011110b = BPBPGPGx
  1715.         Color    <BPGBBBB>    ; Value 01100000b = BPGBBBBx
  1716.         Color    <BPGBBBG>    ; Value 01100010b = BPGBBBGx
  1717.         Color    <BPGBBPB>    ; Value 01100100b = BPGBBPBx
  1718.         Color    <BPGBBPG>    ; Value 01100110b = BPGBBPGx
  1719.         Color    <BPGBGBB>    ; Value 01101000b = BPGBGBBx
  1720.         Color    <BPGBGBG>    ; Value 01101010b = BPGBGBGx
  1721.         Color    <BPGBGPB>    ; Value 01101100b = BPGBGPBx
  1722.         Color    <BPGBGPG>    ; Value 01101110b = BPGBGPGx
  1723.         Color    <BPGPBBB>    ; Value 01110000b = BPGPBBBx
  1724.         Color    <BPGPBBG>    ; Value 01110010b = BPGPBBGx
  1725.         Color    <BPGPBPB>    ; Value 01110100b = BPGPBPBx
  1726.         Color    <BPGPBPG>    ; Value 01110110b = BPGPBPGx
  1727.         Color    <BPGPGBB>    ; Value 01111000b = BPGPGBBx
  1728.         Color    <BPGPGBG>    ; Value 01111010b = BPGPGBGx
  1729.         Color    <BPGPGPB>    ; Value 01111100b = BPGPGPBx
  1730.         Color    <BPGPGPG>    ; Value 01111110b = BPGPGPGx
  1731.         Color    <GBBBBBB>    ; Value 10000000b = GBBBBBBx
  1732.         Color    <GBBBBBG>    ; Value 10000010b = GBBBBBGx
  1733.         Color    <GBBBBPB>    ; Value 10000100b = GBBBBPBx
  1734.         Color    <GBBBBPG>    ; Value 10000110b = GBBBBPGx
  1735.         Color    <GBBBGBB>    ; Value 10001000b = GBBBGBBx
  1736.         Color    <GBBBGBG>    ; Value 10001010b = GBBBGBGx
  1737.         Color    <GBBBGPB>    ; Value 10001100b = GBBBGPBx
  1738.         Color    <GBBBGPG>    ; Value 10001110b = GBBBGPGx
  1739.         Color    <GBBPBBB>    ; Value 10010000b = GBBPBBBx
  1740.         Color    <GBBPBBG>    ; Value 10010010b = GBBPBBGx
  1741.         Color    <GBBPBPB>    ; Value 10010100b = GBBPBPBx
  1742.         Color    <GBBPBPG>    ; Value 10010110b = GBBPBPGx
  1743.         Color    <GBBPGBB>    ; Value 10011000b = GBBPGBBx
  1744.         Color    <GBBPGBG>    ; Value 10011010b = GBBPGBGx
  1745.         Color    <GBBPGPB>    ; Value 10011100b = GBBPGPBx
  1746.         Color    <GBBPGPG>    ; Value 10011110b = GBBPGPGx
  1747.         Color    <GBGBBBB>    ; Value 10100000b = GBGBBBBx
  1748.         Color    <GBGBBBG>    ; Value 10100010b = GBGBBBGx
  1749.         Color    <GBGBBPB>    ; Value 10100100b = GBGBBPBx
  1750.         Color    <GBGBBPG>    ; Value 10100110b = GBGBBPGx
  1751.         Color    <GBGBGBB>    ; Value 10101000b = GBGBGBBx
  1752.         Color    <GBGBGBG>    ; Value 10101010b = GBGBGBGx
  1753.         Color    <GBGBGPB>    ; Value 10101100b = GBGBGPBx
  1754.         Color    <GBGBGPG>    ; Value 10101110b = GBGBGPGx
  1755.         Color    <GBGPBBB>    ; Value 10110000b = GBGPBBBx
  1756.         Color    <GBGPBBG>    ; Value 10110010b = GBGPBBGx
  1757.         Color    <GBGPBPB>    ; Value 10110100b = GBGPBPBx
  1758.         Color    <GBGPBPG>    ; Value 10110110b = GBGPBPGx
  1759.         Color    <GBGPGBB>    ; Value 10111000b = GBGPGBBx
  1760.         Color    <GBGPGBG>    ; Value 10111010b = GBGPGBGx
  1761.         Color    <GBGPGPB>    ; Value 10111100b = GBGPGPBx
  1762.         Color    <GBGPGPG>    ; Value 10111110b = GBGPGPGx
  1763.         Color    <GPBBBBB>    ; Value 11000000b = GPBBBBBx
  1764.         Color    <GPBBBBG>    ; Value 11000010b = GPBBBBGx
  1765.         Color    <GPBBBPB>    ; Value 11000100b = GPBBBPBx
  1766.         Color    <GPBBBPG>    ; Value 11000110b = GPBBBPGx
  1767.         Color    <GPBBGBB>    ; Value 11001000b = GPBBGBBx
  1768.         Color    <GPBBGBG>    ; Value 11001010b = GPBBGBGx
  1769.         Color    <GPBBGPB>    ; Value 11001100b = GPBBGPBx
  1770.         Color    <GPBBGPG>    ; Value 11001110b = GPBBGPGx
  1771.         Color    <GPBPBBB>    ; Value 11010000b = GPBPBBBx
  1772.         Color    <GPBPBBG>    ; Value 11010010b = GPBPBBGx
  1773.         Color    <GPBPBPB>    ; Value 11010100b = GPBPBPBx
  1774.         Color    <GPBPBPG>    ; Value 11010110b = GPBPBPGx
  1775.         Color    <GPBPGBB>    ; Value 11011000b = GPBPGBBx
  1776.         Color    <GPBPGBG>    ; Value 11011010b = GPBPGBGx
  1777.         Color    <GPBPGPB>    ; Value 11011100b = GPBPGPBx
  1778.         Color    <GPBPGPG>    ; Value 11011110b = GPBPGPGx
  1779.         Color    <GPGBBBB>    ; Value 11100000b = GPGBBBBx
  1780.         Color    <GPGBBBG>    ; Value 11100010b = GPGBBBGx
  1781.         Color    <GPGBBPB>    ; Value 11100100b = GPGBBPBx
  1782.         Color    <GPGBBPG>    ; Value 11100110b = GPGBBPGx
  1783.         Color    <GPGBGBB>    ; Value 11101000b = GPGBGBBx
  1784.         Color    <GPGBGBG>    ; Value 11101010b = GPGBGBGx
  1785.         Color    <GPGBGPB>    ; Value 11101100b = GPGBGPBx
  1786.         Color    <GPGBGPG>    ; Value 11101110b = GPGBGPGx
  1787.         Color    <GPGPBBB>    ; Value 11110000b = GPGPBBBx
  1788.         Color    <GPGPBBG>    ; Value 11110010b = GPGPBBGx
  1789.         Color    <GPGPBPB>    ; Value 11110100b = GPGPBPBx
  1790.         Color    <GPGPBPG>    ; Value 11110110b = GPGPBPGx
  1791.         Color    <GPGPGBB>    ; Value 11111000b = GPGPGBBx
  1792.         Color    <GPGPGBG>    ; Value 11111010b = GPGPGBGx
  1793.         Color    <GPGPGPB>    ; Value 11111100b = GPGPGPBx
  1794.         Color    <GPGPGPG>    ; Value 11111110b = GPGPGPGx
  1795. Column_Table    Equ    This Word    ; CGA graphics video column table
  1796.         Dw    Even_Table    ; Address Mod 4 = 0 (Even column)
  1797.         Dw    Odd_Table    ; Address Mod 4 = 1 (Odd column)
  1798.         Dw    Even_Table    ; Address Mod 4 = 2 (Even column)
  1799.         Dw    Odd_Table    ; Address Mod 4 = 3 (Odd column)
  1800. CGA_Shift    Equ    This Byte    ; CGA graphics video shift table
  1801.         Shift    <00,00>     ; Offset Mod 4 = 0 Word/Byte Shifts
  1802.         Shift    <06,02>     ; Offset Mod 4 = 1 Word/Byte Shifts
  1803.         Shift    <04,04>     ; Offset Mod 4 = 2 Word/Byte Shifts
  1804.         Shift    <02,00>     ; Offset Mod 4 = 3 Word/Byte Shifts
  1805. EGA_Shift    Equ    This Byte    ; EGA graphics video shift table
  1806.         Db    0        ; Offset Mod 8 = 0 Data Shift
  1807.         Db    7        ; Offset Mod 8 = 1 Data Shift
  1808.         Db    6        ; Offset Mod 8 = 2 Data Shift
  1809.         Db    5        ; Offset Mod 8 = 3 Data Shift
  1810.         Db    4        ; Offset Mod 8 = 0 Data Shift
  1811.         Db    3        ; Offset Mod 8 = 1 Data Shift
  1812.         Db    2        ; Offset Mod 8 = 2 Data Shift
  1813.         Db    1        ; Offset Mod 8 = 3 Data Shift
  1814. ;******************************************************************************
  1815. ;
  1816. ;    Define the color mapping values and mapping table
  1817. ;
  1818. ;******************************************************************************
  1819.         Map    0,BLACK     ; Map color  0 to  0 (Black)
  1820.         Map    1,LIGHT_MAGENTA ; Map color  1 to 13 (Light magenta)
  1821.         Map    2,BLUE        ; Map color  2 to  1 (Blue)
  1822.         Map    3,MAGENTA    ; Map color  3 to  5 (Magenta)
  1823.         Map    4,GREEN     ; Map color  4 to  2 (Green)
  1824.         Map    5,GRAY        ; Map color  5 to  8 (Gray)
  1825.         Map    6,LIGHT_BLUE    ; Map color  6 to  9 (Light Blue)
  1826.         Map    7,LIGHT_CYAN    ; Map color  7 to 11 (Light Cyan)
  1827.         Map    8,BROWN     ; Map color  8 to  6 (Brown)
  1828.         Map    9,RED        ; Map color  9 to  4 (Red)
  1829.         Map    10,WHITE    ; Map color 10 to  7 (White)
  1830.         Map    11,LIGHT_RED    ; Map color 11 to 12 (Light Red)
  1831.         Map    12,LIGHT_GREEN    ; Map color 12 to 10 (Light Green)
  1832.         Map    13,YELLOW    ; Map color 13 to 14 (Yellow)
  1833.         Map    14,CYAN     ; Map color 14 to  3 (Cyan)
  1834.         Map    15,INTENSE_WHITE; Map color 15 to 15 (Intense White)
  1835. Map_Table    Equ    This Byte    ; Graphics color mapping table
  1836.         Convert 0,0        ; Background - 00    Foreground - 00
  1837.         Convert 0,1        ; Background - 00    Foreground - 01
  1838.         Convert 0,2        ; Background - 00    Foreground - 02
  1839.         Convert 0,3        ; Background - 00    Foreground - 03
  1840.         Convert 0,4        ; Background - 00    Foreground - 04
  1841.         Convert 0,5        ; Background - 00    Foreground - 05
  1842.         Convert 0,6        ; Background - 00    Foreground - 06
  1843.         Convert 0,7        ; Background - 00    Foreground - 07
  1844.         Convert 0,8        ; Background - 00    Foreground - 08
  1845.         Convert 0,9        ; Background - 00    Foreground - 09
  1846.         Convert 0,10        ; Background - 00    Foreground - 10
  1847.         Convert 0,11        ; Background - 00    Foreground - 11
  1848.         Convert 0,12        ; Background - 00    Foreground - 12
  1849.         Convert 0,13        ; Background - 00    Foreground - 13
  1850.         Convert 0,14        ; Background - 00    Foreground - 14
  1851.         Convert 0,15        ; Background - 00    Foreground - 15
  1852.         Convert 1,0        ; Background - 01    Foreground - 00
  1853.         Convert 1,1        ; Background - 01    Foreground - 01
  1854.         Convert 1,2        ; Background - 01    Foreground - 02
  1855.         Convert 1,3        ; Background - 01    Foreground - 03
  1856.         Convert 1,4        ; Background - 01    Foreground - 04
  1857.         Convert 1,5        ; Background - 01    Foreground - 05
  1858.         Convert 1,6        ; Background - 01    Foreground - 06
  1859.         Convert 1,7        ; Background - 01    Foreground - 07
  1860.         Convert 1,8        ; Background - 01    Foreground - 08
  1861.         Convert 1,9        ; Background - 01    Foreground - 09
  1862.         Convert 1,10        ; Background - 01    Foreground - 10
  1863.         Convert 1,11        ; Background - 01    Foreground - 11
  1864.         Convert 1,12        ; Background - 01    Foreground - 12
  1865.         Convert 1,13        ; Background - 01    Foreground - 13
  1866.         Convert 1,14        ; Background - 01    Foreground - 14
  1867.         Convert 1,15        ; Background - 01    Foreground - 15
  1868.         Convert 2,0        ; Background - 02    Foreground - 00
  1869.         Convert 2,1        ; Background - 02    Foreground - 01
  1870.         Convert 2,2        ; Background - 02    Foreground - 02
  1871.         Convert 2,3        ; Background - 02    Foreground - 03
  1872.         Convert 2,4        ; Background - 02    Foreground - 04
  1873.         Convert 2,5        ; Background - 02    Foreground - 05
  1874.         Convert 2,6        ; Background - 02    Foreground - 06
  1875.         Convert 2,7        ; Background - 02    Foreground - 07
  1876.         Convert 2,8        ; Background - 02    Foreground - 08
  1877.         Convert 2,9        ; Background - 02    Foreground - 09
  1878.         Convert 2,10        ; Background - 02    Foreground - 10
  1879.         Convert 2,11        ; Background - 02    Foreground - 11
  1880.         Convert 2,12        ; Background - 02    Foreground - 12
  1881.         Convert 2,13        ; Background - 02    Foreground - 13
  1882.         Convert 2,14        ; Background - 02    Foreground - 14
  1883.         Convert 2,15        ; Background - 02    Foreground - 15
  1884.         Convert 3,0        ; Background - 03    Foreground - 00
  1885.         Convert 3,1        ; Background - 03    Foreground - 01
  1886.         Convert 3,2        ; Background - 03    Foreground - 02
  1887.         Convert 3,3        ; Background - 03    Foreground - 03
  1888.         Convert 3,4        ; Background - 03    Foreground - 04
  1889.         Convert 3,5        ; Background - 03    Foreground - 05
  1890.         Convert 3,6        ; Background - 03    Foreground - 06
  1891.         Convert 3,7        ; Background - 03    Foreground - 07
  1892.         Convert 3,8        ; Background - 03    Foreground - 08
  1893.         Convert 3,9        ; Background - 03    Foreground - 09
  1894.         Convert 3,10        ; Background - 03    Foreground - 10
  1895.         Convert 3,11        ; Background - 03    Foreground - 11
  1896.         Convert 3,12        ; Background - 03    Foreground - 12
  1897.         Convert 3,13        ; Background - 03    Foreground - 13
  1898.         Convert 3,14        ; Background - 03    Foreground - 14
  1899.         Convert 3,15        ; Background - 03    Foreground - 15
  1900.         Convert 4,0        ; Background - 04    Foreground - 00
  1901.         Convert 4,1        ; Background - 04    Foreground - 01
  1902.         Convert 4,2        ; Background - 04    Foreground - 02
  1903.         Convert 4,3        ; Background - 04    Foreground - 03
  1904.         Convert 4,4        ; Background - 04    Foreground - 04
  1905.         Convert 4,5        ; Background - 04    Foreground - 05
  1906.         Convert 4,6        ; Background - 04    Foreground - 06
  1907.         Convert 4,7        ; Background - 04    Foreground - 07
  1908.         Convert 4,8        ; Background - 04    Foreground - 08
  1909.         Convert 4,9        ; Background - 04    Foreground - 09
  1910.         Convert 4,10        ; Background - 04    Foreground - 10
  1911.         Convert 4,11        ; Background - 04    Foreground - 11
  1912.         Convert 4,12        ; Background - 04    Foreground - 12
  1913.         Convert 4,13        ; Background - 04    Foreground - 13
  1914.         Convert 4,14        ; Background - 04    Foreground - 14
  1915.         Convert 4,15        ; Background - 04    Foreground - 15
  1916.         Convert 5,0        ; Background - 05    Foreground - 00
  1917.         Convert 5,1        ; Background - 05    Foreground - 01
  1918.         Convert 5,2        ; Background - 05    Foreground - 02
  1919.         Convert 5,3        ; Background - 05    Foreground - 03
  1920.         Convert 5,4        ; Background - 05    Foreground - 04
  1921.         Convert 5,5        ; Background - 05    Foreground - 05
  1922.         Convert 5,6        ; Background - 05    Foreground - 06
  1923.         Convert 5,7        ; Background - 05    Foreground - 07
  1924.         Convert 5,8        ; Background - 05    Foreground - 08
  1925.         Convert 5,9        ; Background - 05    Foreground - 09
  1926.         Convert 5,10        ; Background - 05    Foreground - 10
  1927.         Convert 5,11        ; Background - 05    Foreground - 11
  1928.         Convert 5,12        ; Background - 05    Foreground - 12
  1929.         Convert 5,13        ; Background - 05    Foreground - 13
  1930.         Convert 5,14        ; Background - 05    Foreground - 14
  1931.         Convert 5,15        ; Background - 05    Foreground - 15
  1932.         Convert 6,0        ; Background - 06    Foreground - 00
  1933.         Convert 6,1        ; Background - 06    Foreground - 01
  1934.         Convert 6,2        ; Background - 06    Foreground - 02
  1935.         Convert 6,3        ; Background - 06    Foreground - 03
  1936.         Convert 6,4        ; Background - 06    Foreground - 04
  1937.         Convert 6,5        ; Background - 06    Foreground - 05
  1938.         Convert 6,6        ; Background - 06    Foreground - 06
  1939.         Convert 6,7        ; Background - 06    Foreground - 07
  1940.         Convert 6,8        ; Background - 06    Foreground - 08
  1941.         Convert 6,9        ; Background - 06    Foreground - 09
  1942.         Convert 6,10        ; Background - 06    Foreground - 10
  1943.         Convert 6,11        ; Background - 06    Foreground - 11
  1944.         Convert 6,12        ; Background - 06    Foreground - 12
  1945.         Convert 6,13        ; Background - 06    Foreground - 13
  1946.         Convert 6,14        ; Background - 06    Foreground - 14
  1947.         Convert 6,15        ; Background - 06    Foreground - 15
  1948.         Convert 7,0        ; Background - 07    Foreground - 00
  1949.         Convert 7,1        ; Background - 07    Foreground - 01
  1950.         Convert 7,2        ; Background - 07    Foreground - 02
  1951.         Convert 7,3        ; Background - 07    Foreground - 03
  1952.         Convert 7,4        ; Background - 07    Foreground - 04
  1953.         Convert 7,5        ; Background - 07    Foreground - 05
  1954.         Convert 7,6        ; Background - 07    Foreground - 06
  1955.         Convert 7,7        ; Background - 07    Foreground - 07
  1956.         Convert 7,8        ; Background - 07    Foreground - 08
  1957.         Convert 7,9        ; Background - 07    Foreground - 09
  1958.         Convert 7,10        ; Background - 07    Foreground - 10
  1959.         Convert 7,11        ; Background - 07    Foreground - 11
  1960.         Convert 7,12        ; Background - 07    Foreground - 12
  1961.         Convert 7,13        ; Background - 07    Foreground - 13
  1962.         Convert 7,14        ; Background - 07    Foreground - 14
  1963.         Convert 7,15        ; Background - 07    Foreground - 15
  1964.         Convert 8,0        ; Background - 08    Foreground - 00
  1965.         Convert 8,1        ; Background - 08    Foreground - 01
  1966.         Convert 8,2        ; Background - 08    Foreground - 02
  1967.         Convert 8,3        ; Background - 08    Foreground - 03
  1968.         Convert 8,4        ; Background - 08    Foreground - 04
  1969.         Convert 8,5        ; Background - 08    Foreground - 05
  1970.         Convert 8,6        ; Background - 08    Foreground - 06
  1971.         Convert 8,7        ; Background - 08    Foreground - 07
  1972.         Convert 8,8        ; Background - 08    Foreground - 08
  1973.         Convert 8,9        ; Background - 08    Foreground - 09
  1974.         Convert 8,10        ; Background - 08    Foreground - 10
  1975.         Convert 8,11        ; Background - 08    Foreground - 11
  1976.         Convert 8,12        ; Background - 08    Foreground - 12
  1977.         Convert 8,13        ; Background - 08    Foreground - 13
  1978.         Convert 8,14        ; Background - 08    Foreground - 14
  1979.         Convert 8,15        ; Background - 08    Foreground - 15
  1980.         Convert 9,0        ; Background - 09    Foreground - 00
  1981.         Convert 9,1        ; Background - 09    Foreground - 01
  1982.         Convert 9,2        ; Background - 09    Foreground - 02
  1983.         Convert 9,3        ; Background - 09    Foreground - 03
  1984.         Convert 9,4        ; Background - 09    Foreground - 04
  1985.         Convert 9,5        ; Background - 09    Foreground - 05
  1986.         Convert 9,6        ; Background - 09    Foreground - 06
  1987.         Convert 9,7        ; Background - 09    Foreground - 07
  1988.         Convert 9,8        ; Background - 09    Foreground - 08
  1989.         Convert 9,9        ; Background - 09    Foreground - 09
  1990.         Convert 9,10        ; Background - 09    Foreground - 10
  1991.         Convert 9,11        ; Background - 09    Foreground - 11
  1992.         Convert 9,12        ; Background - 09    Foreground - 12
  1993.         Convert 9,13        ; Background - 09    Foreground - 13
  1994.         Convert 9,14        ; Background - 09    Foreground - 14
  1995.         Convert 9,15        ; Background - 09    Foreground - 15
  1996.         Convert 10,0        ; Background - 10    Foreground - 00
  1997.         Convert 10,1        ; Background - 10    Foreground - 01
  1998.         Convert 10,2        ; Background - 10    Foreground - 02
  1999.         Convert 10,3        ; Background - 10    Foreground - 03
  2000.         Convert 10,4        ; Background - 10    Foreground - 04
  2001.         Convert 10,5        ; Background - 10    Foreground - 05
  2002.         Convert 10,6        ; Background - 10    Foreground - 06
  2003.         Convert 10,7        ; Background - 10    Foreground - 07
  2004.         Convert 10,8        ; Background - 10    Foreground - 08
  2005.         Convert 10,9        ; Background - 10    Foreground - 09
  2006.         Convert 10,10        ; Background - 10    Foreground - 10
  2007.         Convert 10,11        ; Background - 10    Foreground - 11
  2008.         Convert 10,12        ; Background - 10    Foreground - 12
  2009.         Convert 10,13        ; Background - 10    Foreground - 13
  2010.         Convert 10,14        ; Background - 10    Foreground - 14
  2011.         Convert 10,15        ; Background - 10    Foreground - 15
  2012.         Convert 11,0        ; Background - 11    Foreground - 00
  2013.         Convert 11,1        ; Background - 11    Foreground - 01
  2014.         Convert 11,2        ; Background - 11    Foreground - 02
  2015.         Convert 11,3        ; Background - 11    Foreground - 03
  2016.         Convert 11,4        ; Background - 11    Foreground - 04
  2017.         Convert 11,5        ; Background - 11    Foreground - 05
  2018.         Convert 11,6        ; Background - 11    Foreground - 06
  2019.         Convert 11,7        ; Background - 11    Foreground - 07
  2020.         Convert 11,8        ; Background - 11    Foreground - 08
  2021.         Convert 11,9        ; Background - 11    Foreground - 09
  2022.         Convert 11,10        ; Background - 11    Foreground - 10
  2023.         Convert 11,11        ; Background - 11    Foreground - 11
  2024.         Convert 11,12        ; Background - 11    Foreground - 12
  2025.         Convert 11,13        ; Background - 11    Foreground - 13
  2026.         Convert 11,14        ; Background - 11    Foreground - 14
  2027.         Convert 11,15        ; Background - 11    Foreground - 15
  2028.         Convert 12,0        ; Background - 12    Foreground - 00
  2029.         Convert 12,1        ; Background - 12    Foreground - 01
  2030.         Convert 12,2        ; Background - 12    Foreground - 02
  2031.         Convert 12,3        ; Background - 12    Foreground - 03
  2032.         Convert 12,4        ; Background - 12    Foreground - 04
  2033.         Convert 12,5        ; Background - 12    Foreground - 05
  2034.         Convert 12,6        ; Background - 12    Foreground - 06
  2035.         Convert 12,7        ; Background - 12    Foreground - 07
  2036.         Convert 12,8        ; Background - 12    Foreground - 08
  2037.         Convert 12,9        ; Background - 12    Foreground - 09
  2038.         Convert 12,10        ; Background - 12    Foreground - 10
  2039.         Convert 12,11        ; Background - 12    Foreground - 11
  2040.         Convert 12,12        ; Background - 12    Foreground - 12
  2041.         Convert 12,13        ; Background - 12    Foreground - 13
  2042.         Convert 12,14        ; Background - 12    Foreground - 14
  2043.         Convert 12,15        ; Background - 12    Foreground - 15
  2044.         Convert 13,0        ; Background - 13    Foreground - 00
  2045.         Convert 13,1        ; Background - 13    Foreground - 01
  2046.         Convert 13,2        ; Background - 13    Foreground - 02
  2047.         Convert 13,3        ; Background - 13    Foreground - 03
  2048.         Convert 13,4        ; Background - 13    Foreground - 04
  2049.         Convert 13,5        ; Background - 13    Foreground - 05
  2050.         Convert 13,6        ; Background - 13    Foreground - 06
  2051.         Convert 13,7        ; Background - 13    Foreground - 07
  2052.         Convert 13,8        ; Background - 13    Foreground - 08
  2053.         Convert 13,9        ; Background - 13    Foreground - 09
  2054.         Convert 13,10        ; Background - 13    Foreground - 10
  2055.         Convert 13,11        ; Background - 13    Foreground - 11
  2056.         Convert 13,12        ; Background - 13    Foreground - 12
  2057.         Convert 13,13        ; Background - 13    Foreground - 13
  2058.         Convert 13,14        ; Background - 13    Foreground - 14
  2059.         Convert 13,15        ; Background - 13    Foreground - 15
  2060.         Convert 14,0        ; Background - 14    Foreground - 00
  2061.         Convert 14,1        ; Background - 14    Foreground - 01
  2062.         Convert 14,2        ; Background - 14    Foreground - 02
  2063.         Convert 14,3        ; Background - 14    Foreground - 03
  2064.         Convert 14,4        ; Background - 14    Foreground - 04
  2065.         Convert 14,5        ; Background - 14    Foreground - 05
  2066.         Convert 14,6        ; Background - 14    Foreground - 06
  2067.         Convert 14,7        ; Background - 14    Foreground - 07
  2068.         Convert 14,8        ; Background - 14    Foreground - 08
  2069.         Convert 14,9        ; Background - 14    Foreground - 09
  2070.         Convert 14,10        ; Background - 14    Foreground - 10
  2071.         Convert 14,11        ; Background - 14    Foreground - 11
  2072.         Convert 14,12        ; Background - 14    Foreground - 12
  2073.         Convert 14,13        ; Background - 14    Foreground - 13
  2074.         Convert 14,14        ; Background - 14    Foreground - 14
  2075.         Convert 14,15        ; Background - 14    Foreground - 15
  2076.         Convert 15,0        ; Background - 15    Foreground - 00
  2077.         Convert 15,1        ; Background - 15    Foreground - 01
  2078.         Convert 15,2        ; Background - 15    Foreground - 02
  2079.         Convert 15,3        ; Background - 15    Foreground - 03
  2080.         Convert 15,4        ; Background - 15    Foreground - 04
  2081.         Convert 15,5        ; Background - 15    Foreground - 05
  2082.         Convert 15,6        ; Background - 15    Foreground - 06
  2083.         Convert 15,7        ; Background - 15    Foreground - 07
  2084.         Convert 15,8        ; Background - 15    Foreground - 08
  2085.         Convert 15,9        ; Background - 15    Foreground - 09
  2086.         Convert 15,10        ; Background - 15    Foreground - 10
  2087.         Convert 15,11        ; Background - 15    Foreground - 11
  2088.         Convert 15,12        ; Background - 15    Foreground - 12
  2089.         Convert 15,13        ; Background - 15    Foreground - 13
  2090.         Convert 15,14        ; Background - 15    Foreground - 14
  2091.         Convert 15,15        ; Background - 15    Foreground - 15
  2092. ;******************************************************************************
  2093. ;
  2094. ;    Define the text color palette table for CGA display
  2095. ;
  2096. ;     0 0 0 I 0 r g b
  2097. ;    -----------------
  2098. ;    |7|6|5|4|3|2|1|0|
  2099. ;    -----------------
  2100. ;     | | | | | | | |
  2101. ;     ----- | | | | -------> Primary Blue Gun
  2102. ;       |   | | | ---------> Primary Green Gun
  2103. ;       |   | | -----------> Primary Red Gun
  2104. ;       |   | -------------> ***** Not Used *****
  2105. ;       |   ---------------> Intensity
  2106. ;       -------------------> ***** Not Used *****
  2107. ;
  2108. ;******************************************************************************
  2109. Text_CGA    Equ    This Byte    ; Text CGA color palette table
  2110.         CGA    <>        ; Color 0 - Black        []
  2111.         CGA    <b>        ; Color 1 - Blue        [b]
  2112.         CGA    <g>        ; Color 2 - Green        [g]
  2113.         CGA    <gb>        ; Color 3 - Cyan        [gb]
  2114.         CGA    <r>        ; Color 4 - Red         [r]
  2115.         CGA    <rb>        ; Color 5 - Magenta        [rb]
  2116.         CGA    <rg>        ; Color 6 - Brown        [rg]
  2117.         CGA    <rgb>        ; Color 7 - White        [rgb]
  2118.         CGA    <I>        ; Color 8 - Gray        [I]
  2119.         CGA    <Ib>        ; Color 9 - Light Blue        [Ib]
  2120.         CGA    <Ig>        ; Color A - Light Green     [Ig]
  2121.         CGA    <Igb>        ; Color B - Light Cyan        [Igb]
  2122.         CGA    <Ir>        ; Color C - Light Red        [Ir]
  2123.         CGA    <Irb>        ; Color D - Light Magenta    [Irb]
  2124.         CGA    <Irg>        ; Color E - Yellow        [Irg]
  2125.         CGA    <Irgb>        ; Color F - Intense White    [Irgb]
  2126.         CGA    <>        ; Background - Black        []
  2127. ;******************************************************************************
  2128. ;
  2129. ;    Define the text color palette table for EGA display
  2130. ;
  2131. ;     0 0 R G B r g b
  2132. ;    -----------------
  2133. ;    |7|6|5|4|3|2|1|0|
  2134. ;    -----------------
  2135. ;     | | | | | | | |
  2136. ;     --- | | | | | -------> Primary Blue Gun
  2137. ;      |  | | | | ---------> Primary Green Gun
  2138. ;      |  | | | -----------> Primary Red Gun
  2139. ;      |  | | -------------> Secondary Blue Gun
  2140. ;      |  | ---------------> Secondary Green Gun
  2141. ;      |  -----------------> Secondary Red Gun
  2142. ;      --------------------> ***** Not Used *****
  2143. ;
  2144. ;******************************************************************************
  2145. Text_EGA    Equ    This Byte    ; Text EGA color palette table
  2146.         EGA    <>        ; Color 0 - Black        []
  2147.         EGA    <b>        ; Color 1 - Blue        [b]
  2148.         EGA    <g>        ; Color 2 - Green        [g]
  2149.         EGA    <gb>        ; Color 3 - Cyan        [gb]
  2150.         EGA    <r>        ; Color 4 - Red         [r]
  2151.         EGA    <rb>        ; Color 5 - Magenta        [rb]
  2152.         EGA    <Gr>        ; Color 6 - Brown        [Gr]
  2153.         EGA    <rgb>        ; Color 7 - White        [rgb]
  2154.         EGA    <RGB>        ; Color 8 - Gray        [RGB]
  2155.         EGA    <RGBb>        ; Color 9 - Light Blue        [RGBb]
  2156.         EGA    <RGBg>        ; Color A - Light Green     [RGBg]
  2157.         EGA    <RGBgb>     ; Color B - Light Cyan        [RGBgb]
  2158.         EGA    <RGBr>        ; Color C - Light Red        [RGBr]
  2159.         EGA    <RGBrb>     ; Color D - Light Magenta    [RGBrb]
  2160.         EGA    <RGBrg>     ; Color E - Yellow        [RGBrg]
  2161.         EGA    <RGBrgb>    ; Color F - Intense White    [RGBrgb]
  2162.         EGA    <>        ; Background - Black    []
  2163. ;******************************************************************************
  2164. ;
  2165. ;    Define the low resolution color palette table for CGA display
  2166. ;
  2167. ;     0 0 0 I 0 r g b
  2168. ;    -----------------
  2169. ;    |7|6|5|4|3|2|1|0|
  2170. ;    -----------------
  2171. ;     | | | | | | | |
  2172. ;     ----- | | | | -------> Primary Blue Gun
  2173. ;       |   | | | ---------> Primary Green Gun
  2174. ;       |   | | -----------> Primary Red Gun
  2175. ;       |   | -------------> ***** Not Used *****
  2176. ;       |   ---------------> Intensity
  2177. ;       -------------------> ***** Not Used *****
  2178. ;
  2179. ;******************************************************************************
  2180. Low_CGA     Equ    This Byte    ; Low res. CGA color palette table
  2181.         CGA    <>        ; Color 0 - Black    []
  2182.         CGA    <Irb>        ; Color 1 - Magenta    [Irb]
  2183.         CGA    <b>        ; Color 2 - Dark Blue    [b]
  2184.         CGA    <rb>        ; Color 3 - Purple    [rb]
  2185.         CGA    <g>        ; Color 4 - Dark Green    [g]
  2186.         CGA    <I>        ; Color 5 - Gray 1    [I]
  2187.         CGA    <Ib>        ; Color 6 - Medium Blue [Ib]
  2188.         CGA    <Igb>        ; Color 7 - Light Blue    [Igb]
  2189.         CGA    <rg>        ; Color 8 - Brown    [rg]
  2190.         CGA    <r>        ; Color 9 - Orange    [r]
  2191.         CGA    <rgb>        ; Color A - Gray 2    [rgb]
  2192.         CGA    <Ir>        ; Color B - Pink    [Ir]
  2193.         CGA    <Ig>        ; Color C - Light Green [Ig]
  2194.         CGA    <Irg>        ; Color D - Yellow    [Irg]
  2195.         CGA    <gb>        ; Color E - Aquamarine    [gb]
  2196.         CGA    <Irgb>        ; Color F - White    [Irgb]
  2197.         CGA    <>        ; Background - Black    []
  2198. ;******************************************************************************
  2199. ;
  2200. ;    Define the low resolution color palette table for EGA display
  2201. ;
  2202. ;     0 0 R G B r g b
  2203. ;    -----------------
  2204. ;    |7|6|5|4|3|2|1|0|
  2205. ;    -----------------
  2206. ;     | | | | | | | |
  2207. ;     --- | | | | | -------> Primary Blue Gun
  2208. ;      |  | | | | ---------> Primary Green Gun
  2209. ;      |  | | | -----------> Primary Red Gun
  2210. ;      |  | | -------------> Secondary Blue Gun
  2211. ;      |  | ---------------> Secondary Green Gun
  2212. ;      |  -----------------> Secondary Red Gun
  2213. ;      --------------------> ***** Not Used *****
  2214. ;
  2215. ;******************************************************************************
  2216. Low_EGA     Equ    This Byte    ; Low res. EGA color palette table
  2217.         EGA    <>        ; Color 0 - Black    []
  2218.         EGA    <RBrb>        ; Color 1 - Magenta    [RBrb]
  2219.         EGA    <B>        ; Color 2 - Dark Blue    [B]
  2220.         EGA    <RB>        ; Color 3 - Purple    [RB]
  2221.         EGA    <G>        ; Color 4 - Dark Green    [G]
  2222.         EGA    <RGB>        ; Color 5 - Gray 1    [RGB]
  2223.         EGA    <b>        ; Color 6 - Medium Blue [b]
  2224.         EGA    <Bb>        ; Color 7 - Light Blue    [Bb]
  2225.         EGA    <Gr>        ; Color 8 - Brown    [Gr]
  2226.         EGA    <Rrg>        ; Color 9 - Orange    [Rrg]
  2227.         EGA    <rgb>        ; Color A - Gray 2    [rgb]
  2228.         EGA    <RGBr>        ; Color B - Pink    [RGBr]
  2229.         EGA    <Gg>        ; Color C - Light Green [Gg]
  2230.         EGA    <RGrg>        ; Color D - Yellow    [RGrg]
  2231.         EGA    <Bg>        ; Color E - Aquamarine    [Bg]
  2232.         EGA    <RGBrgb>    ; Color F - White    [RGBrgb]
  2233.         EGA    <>        ; Background - Black    []
  2234. ;******************************************************************************
  2235. ;
  2236. ;    Define the high resolution color palette table for CGA display
  2237. ;
  2238. ;     0 0 0 I 0 r g b
  2239. ;    -----------------
  2240. ;    |7|6|5|4|3|2|1|0|
  2241. ;    -----------------
  2242. ;     | | | | | | | |
  2243. ;     ----- | | | | -------> Primary Blue Gun
  2244. ;       |   | | | ---------> Primary Green Gun
  2245. ;       |   | | -----------> Primary Red Gun
  2246. ;       |   | -------------> ***** Not Used *****
  2247. ;       |   ---------------> Intensity
  2248. ;       -------------------> ***** Not Used *****
  2249. ;
  2250. ;******************************************************************************
  2251. High_CGA    Equ    This Byte    ; High res. CGA color palette table
  2252.         CGA    <>        ; Color 0 - Black    []
  2253.         CGA    <Irb>        ; Color 1 - Purple    [Irb]
  2254.         CGA    <>        ; Color 2 - Black    []
  2255.         CGA    <Ig>        ; Color 3 - Green    [Ig]
  2256.         CGA    <>        ; Color 4 - Black    []
  2257.         CGA    <Ib>        ; Color 5 - Blue    [Ib]
  2258.         CGA    <>        ; Color 6 - Black    []
  2259.         CGA    <Irg>        ; Color 7 - Orange    [Irg]
  2260.         CGA    <>        ; Color 8 - Black    []
  2261.         CGA    <Irb>        ; Color 9 - Purple    [Irb]
  2262.         CGA    <>        ; Color A - Black    []
  2263.         CGA    <Ig>        ; Color B - Green    [Ig]
  2264.         CGA    <>        ; Color C - Black    []
  2265.         CGA    <Ib>        ; Color D - Blue    [Ib]
  2266.         CGA    <>        ; Color E - Black    []
  2267.         CGA    <Irg>        ; Color F - Orange    [Irg]
  2268.         CGA    <>        ; Background - Black    []
  2269. ;******************************************************************************
  2270. ;
  2271. ;    Define the high resolution color palette table for EGA display
  2272. ;
  2273. ;     0 0 0 I 0 r g b
  2274. ;    -----------------
  2275. ;    |7|6|5|4|3|2|1|0|
  2276. ;    -----------------
  2277. ;     | | | | | | | |
  2278. ;     ----- | | | | -------> Primary Blue Gun
  2279. ;       |   | | | ---------> Primary Green Gun
  2280. ;       |   | | -----------> Primary Red Gun
  2281. ;       |   | -------------> ***** Not Used *****
  2282. ;       |   ---------------> Intensity
  2283. ;       -------------------> ***** Not Used *****
  2284. ;
  2285. ;******************************************************************************
  2286. High_EGA    Equ    This Byte    ; High res. EGA color palette table
  2287.         CGA    <>        ; Color 0 - Black    []
  2288.         CGA    <Irb>        ; Color 1 - Purple    [Irb]
  2289.         CGA    <>        ; Color 2 - Black    []
  2290.         CGA    <Ig>        ; Color 3 - Green    [Ig]
  2291.         CGA    <>        ; Color 4 - Black    []
  2292.         CGA    <Ib>        ; Color 5 - Blue    [Ib]
  2293.         CGA    <>        ; Color 6 - Black    []
  2294.         CGA    <Irg>        ; Color 7 - Orange    [Irg]
  2295.         CGA    <>        ; Color 8 - Black    []
  2296.         CGA    <Irb>        ; Color 9 - Purple    [Irb]
  2297.         CGA    <>        ; Color A - Black    []
  2298.         CGA    <Ig>        ; Color B - Green    [Ig]
  2299.         CGA    <>        ; Color C - Black    []
  2300.         CGA    <Ib>        ; Color D - Blue    [Ib]
  2301.         CGA    <>        ; Color E - Black    []
  2302.         CGA    <Irg>        ; Color F - Orange    [Irg]
  2303.         CGA    <>        ; Background - Black    []
  2304. ;******************************************************************************
  2305. ;
  2306. ;    Define the end of the Emulator Code Segment
  2307. ;
  2308. ;******************************************************************************
  2309. Emulate Ends
  2310.     End                ; End of the Video module
  2311.