From 2d04cacc5322951f187bb17e017c12920ac8ebe2 Mon Sep 17 00:00:00 2001 From: Mark Zbikowski Date: Thu, 25 Apr 2024 21:24:10 +0100 Subject: MZ is back! --- v4.0/src/DEV/ANSI/ANSI.ASM | 1169 +++++ v4.0/src/DEV/ANSI/ANSI.INC | 312 ++ v4.0/src/DEV/ANSI/ANSI.LNK | 8 + v4.0/src/DEV/ANSI/ANSI.SKL | 16 + v4.0/src/DEV/ANSI/ANSIINIT.ASM | 413 ++ v4.0/src/DEV/ANSI/ANSIVID.INC | 54 + v4.0/src/DEV/ANSI/IOCTL.ASM | 1126 +++++ v4.0/src/DEV/ANSI/MAKEFILE | 33 + v4.0/src/DEV/ANSI/PARSER.ASM | 325 ++ v4.0/src/DEV/COUNTRY/MAKEFILE | 19 + v4.0/src/DEV/COUNTRY/MKCNTRY.ASM | 2377 ++++++++++ v4.0/src/DEV/COUNTRY/MKCNTRY.INC | 140 + v4.0/src/DEV/DISPLAY/CPS-FUNC.INC | 728 +++ v4.0/src/DEV/DISPLAY/DEF-EQU.INC | 290 ++ v4.0/src/DEV/DISPLAY/DISPLAY.ASM | 388 ++ v4.0/src/DEV/DISPLAY/DISPLAY.LNK | 4 + v4.0/src/DEV/DISPLAY/DISPLAY.SKL | 15 + v4.0/src/DEV/DISPLAY/DISPMES.ASM | 17 + v4.0/src/DEV/DISPLAY/EGA/437-8X14.ASM | 269 ++ v4.0/src/DEV/DISPLAY/EGA/437-8X16.ASM | 269 ++ v4.0/src/DEV/DISPLAY/EGA/437-8X8.ASM | 270 ++ v4.0/src/DEV/DISPLAY/EGA/437-CPI.ASM | 49 + v4.0/src/DEV/DISPLAY/EGA/850-8X14.ASM | 270 ++ v4.0/src/DEV/DISPLAY/EGA/850-8X16.ASM | 270 ++ v4.0/src/DEV/DISPLAY/EGA/850-8X8.ASM | 270 ++ v4.0/src/DEV/DISPLAY/EGA/850-CPI.ASM | 49 + v4.0/src/DEV/DISPLAY/EGA/860-8X14.ASM | 270 ++ v4.0/src/DEV/DISPLAY/EGA/860-8X16.ASM | 270 ++ v4.0/src/DEV/DISPLAY/EGA/860-8X8.ASM | 270 ++ v4.0/src/DEV/DISPLAY/EGA/860-CPI.ASM | 49 + v4.0/src/DEV/DISPLAY/EGA/863-8X14.ASM | 270 ++ v4.0/src/DEV/DISPLAY/EGA/863-8X16.ASM | 270 ++ v4.0/src/DEV/DISPLAY/EGA/863-8X8.ASM | 270 ++ v4.0/src/DEV/DISPLAY/EGA/863-CPI.ASM | 49 + v4.0/src/DEV/DISPLAY/EGA/865-8X14.ASM | 270 ++ v4.0/src/DEV/DISPLAY/EGA/865-8X16.ASM | 270 ++ v4.0/src/DEV/DISPLAY/EGA/865-8X8.ASM | 270 ++ v4.0/src/DEV/DISPLAY/EGA/865-CPI.ASM | 49 + v4.0/src/DEV/DISPLAY/EGA/COPYRIGH.ASM | 11 + v4.0/src/DEV/DISPLAY/EGA/CPI-HEAD.ASM | 15 + v4.0/src/DEV/DISPLAY/EGA/EGA.LNK | 8 + v4.0/src/DEV/DISPLAY/EGA/MAKEFILE | 55 + v4.0/src/DEV/DISPLAY/F-PARSER.INC | 2040 +++++++++ v4.0/src/DEV/DISPLAY/INIT.ASM | 965 ++++ v4.0/src/DEV/DISPLAY/INT10COM.INC | 1029 +++++ v4.0/src/DEV/DISPLAY/INT2FCOM.INC | 323 ++ v4.0/src/DEV/DISPLAY/LCD/437-CPI.ASM | 290 ++ v4.0/src/DEV/DISPLAY/LCD/850-CPI.ASM | 290 ++ v4.0/src/DEV/DISPLAY/LCD/860-CPI.ASM | 290 ++ v4.0/src/DEV/DISPLAY/LCD/863-CPI.ASM | 290 ++ v4.0/src/DEV/DISPLAY/LCD/865-CPI.ASM | 292 ++ v4.0/src/DEV/DISPLAY/LCD/COPYRIGH.ASM | 10 + v4.0/src/DEV/DISPLAY/LCD/FONT-R3.ASM | 15 + v4.0/src/DEV/DISPLAY/LCD/LCD.LNK | 8 + v4.0/src/DEV/DISPLAY/LCD/MAKEFILE | 32 + v4.0/src/DEV/DISPLAY/MACROS.INC | 29 + v4.0/src/DEV/DISPLAY/MAKEFILE | 53 + v4.0/src/DEV/DISPLAY/PARSER.ASM | 809 ++++ v4.0/src/DEV/DISPLAY/TABLES.INC | 368 ++ v4.0/src/DEV/DISPLAY/WRITE.INC | 373 ++ v4.0/src/DEV/DISPLAY/ZERO.DAT | 1 + v4.0/src/DEV/DRIVER/DRIVER.ASM | 1296 ++++++ v4.0/src/DEV/DRIVER/DRIVER.LNK | 3 + v4.0/src/DEV/DRIVER/DRIVER.MAK | 19 + v4.0/src/DEV/DRIVER/DRIVER.SKL | 21 + v4.0/src/DEV/DRIVER/MAKEFILE | 23 + v4.0/src/DEV/KEYBOARD/KDF.ASM | 393 ++ v4.0/src/DEV/KEYBOARD/KDFBE.ASM | 1833 ++++++++ v4.0/src/DEV/KEYBOARD/KDFCF.ASM | 1769 ++++++++ v4.0/src/DEV/KEYBOARD/KDFDK.ASM | 1631 +++++++ v4.0/src/DEV/KEYBOARD/KDFEOF.ASM | 32 + v4.0/src/DEV/KEYBOARD/KDFFR.ASM | 1529 +++++++ v4.0/src/DEV/KEYBOARD/KDFFR120.ASM | 2307 ++++++++++ v4.0/src/DEV/KEYBOARD/KDFFR189.ASM | 1529 +++++++ v4.0/src/DEV/KEYBOARD/KDFGE.ASM | 1333 ++++++ v4.0/src/DEV/KEYBOARD/KDFIT.ASM | 794 ++++ v4.0/src/DEV/KEYBOARD/KDFIT141.ASM | 794 ++++ v4.0/src/DEV/KEYBOARD/KDFIT142.ASM | 864 ++++ v4.0/src/DEV/KEYBOARD/KDFLA.ASM | 1322 ++++++ v4.0/src/DEV/KEYBOARD/KDFNL.ASM | 1515 +++++++ v4.0/src/DEV/KEYBOARD/KDFNO.ASM | 1607 +++++++ v4.0/src/DEV/KEYBOARD/KDFNOW.ASM | 507 +++ v4.0/src/DEV/KEYBOARD/KDFPO.ASM | 1607 +++++++ v4.0/src/DEV/KEYBOARD/KDFSF.ASM | 1627 +++++++ v4.0/src/DEV/KEYBOARD/KDFSG.ASM | 1629 +++++++ v4.0/src/DEV/KEYBOARD/KDFSP.ASM | 1373 ++++++ v4.0/src/DEV/KEYBOARD/KDFSU.ASM | 1680 +++++++ v4.0/src/DEV/KEYBOARD/KDFSV.ASM | 1687 +++++++ v4.0/src/DEV/KEYBOARD/KDFUK.ASM | 655 +++ v4.0/src/DEV/KEYBOARD/KDFUK166.ASM | 655 +++ v4.0/src/DEV/KEYBOARD/KDFUK168.ASM | 848 ++++ v4.0/src/DEV/KEYBOARD/KEYBMAC.INC | 323 ++ v4.0/src/DEV/KEYBOARD/KEYBOARD.LNK | 6 + v4.0/src/DEV/KEYBOARD/KEYBSHAR.INC | 304 ++ v4.0/src/DEV/KEYBOARD/MAKEFILE | 59 + v4.0/src/DEV/MAKEFILE | 31 + v4.0/src/DEV/PRINTER/4201/4201.CPI | Bin 0 -> 6404 bytes v4.0/src/DEV/PRINTER/4201/4201.INC | 801 ++++ v4.0/src/DEV/PRINTER/4201/4201.MAK | 7 + v4.0/src/DEV/PRINTER/4201/MAKEFILE | 0 v4.0/src/DEV/PRINTER/4208/4208-CPY.ASM | 10 + v4.0/src/DEV/PRINTER/4208/4208.CPI | Bin 0 -> 720 bytes v4.0/src/DEV/PRINTER/4208/4208.INC | 90 + v4.0/src/DEV/PRINTER/4208/4208.MAK | 7 + v4.0/src/DEV/PRINTER/4208/MAKEFILE | 0 v4.0/src/DEV/PRINTER/5202/5202.ASM | 108 + v4.0/src/DEV/PRINTER/5202/MAKEFILE | 21 + v4.0/src/DEV/PRINTER/CPSFONT.ASM | 1961 +++++++++ v4.0/src/DEV/PRINTER/CPSFONT3.ASM | 1961 +++++++++ v4.0/src/DEV/PRINTER/CPSPEQU.INC | 577 +++ v4.0/src/DEV/PRINTER/CPSPI.ASM | 2422 ++++++++++ v4.0/src/DEV/PRINTER/CPSPI07.ASM | 1416 ++++++ v4.0/src/DEV/PRINTER/CPSPM10.ASM | 3851 ++++++++++++++++ v4.0/src/DEV/PRINTER/MAKEFILE | 40 + v4.0/src/DEV/PRINTER/PARSE4E.ASM | 1106 +++++ v4.0/src/DEV/PRINTER/PARSER.ASM | 668 +++ v4.0/src/DEV/PRINTER/PRINTER.LNK | 9 + v4.0/src/DEV/PRINTER/PRINTER.SKL | 17 + v4.0/src/DEV/PRINTER/PRTINT2F.ASM | 450 ++ v4.0/src/DEV/PRINTER/PTRMSG.ASM | 41 + v4.0/src/DEV/PRINTER/ZERO.DAT | 1 + v4.0/src/DEV/RAMDRIVE/ABOVE.INC | 61 + v4.0/src/DEV/RAMDRIVE/AB_MACRO.INC | 180 + v4.0/src/DEV/RAMDRIVE/DEVSYM.INC | 128 + v4.0/src/DEV/RAMDRIVE/DIRENT.INC | 56 + v4.0/src/DEV/RAMDRIVE/EMM.INC | 223 + v4.0/src/DEV/RAMDRIVE/LOADALL.INC | 35 + v4.0/src/DEV/RAMDRIVE/MAKEFILE | 36 + v4.0/src/DEV/RAMDRIVE/MESSAGES.ASM | 82 + v4.0/src/DEV/RAMDRIVE/MI.INC | 18 + v4.0/src/DEV/RAMDRIVE/RAMDRIVE.ASM | 6218 ++++++++++++++++++++++++++ v4.0/src/DEV/RAMDRIVE/RAMDRIVE.LNK | 3 + v4.0/src/DEV/RAMDRIVE/SYSCALL.INC | 146 + v4.0/src/DEV/SMARTDRV/ABOVE.ASM | 62 + v4.0/src/DEV/SMARTDRV/AB_MACRO.ASM | 180 + v4.0/src/DEV/SMARTDRV/CMACROS.INC | 932 ++++ v4.0/src/DEV/SMARTDRV/DEVSYM.ASM | 128 + v4.0/src/DEV/SMARTDRV/DIRENT.ASM | 56 + v4.0/src/DEV/SMARTDRV/EMM.ASM | 223 + v4.0/src/DEV/SMARTDRV/FL13.ASM | 148 + v4.0/src/DEV/SMARTDRV/FLMES.ASM | 86 + v4.0/src/DEV/SMARTDRV/FLUSH13.C | 686 +++ v4.0/src/DEV/SMARTDRV/FLUSH13.LNK | 4 + v4.0/src/DEV/SMARTDRV/INT13.DOC | 369 ++ v4.0/src/DEV/SMARTDRV/LOADALL.ASM | 35 + v4.0/src/DEV/SMARTDRV/MAKEFILE | 19 + v4.0/src/DEV/SMARTDRV/MI.ASM | 18 + v4.0/src/DEV/SMARTDRV/OLI.CMP | 464 ++ v4.0/src/DEV/SMARTDRV/SMARTDRV.ASM | 7587 ++++++++++++++++++++++++++++++++ v4.0/src/DEV/SMARTDRV/SMARTDRV.LNK | 3 + v4.0/src/DEV/SMARTDRV/SYSCALL.ASM | 147 + v4.0/src/DEV/VDISK/MAKEFILE | 33 + v4.0/src/DEV/VDISK/SLM.INI | 4 + v4.0/src/DEV/VDISK/VDISK.ASM | 2221 ++++++++++ v4.0/src/DEV/VDISK/VDISK.INC | 28 + v4.0/src/DEV/VDISK/VDISK.LNK | 3 + v4.0/src/DEV/VDISK/VDISK.SKL | 36 + v4.0/src/DEV/VDISK/VDISKMSG.ASM | 27 + v4.0/src/DEV/VDISK/VDISKSYS.ASM | 3024 +++++++++++++ v4.0/src/DEV/VDISK/VDISKSYS.INC | 37 + v4.0/src/DEV/XMA2EMS/DIAGS.ASM | 1909 ++++++++ v4.0/src/DEV/XMA2EMS/EMSINIT.INC | 886 ++++ v4.0/src/DEV/XMA2EMS/EMS_US.MSG | 110 + v4.0/src/DEV/XMA2EMS/GENIOCTL.INC | 167 + v4.0/src/DEV/XMA2EMS/I13HOOK.INC | 449 ++ v4.0/src/DEV/XMA2EMS/LIM40.INC | 1792 ++++++++ v4.0/src/DEV/XMA2EMS/LIM40B.INC | 3468 +++++++++++++++ v4.0/src/DEV/XMA2EMS/MAKEFILE | 24 + v4.0/src/DEV/XMA2EMS/PARMPARS.INC | 530 +++ v4.0/src/DEV/XMA2EMS/PS2_5060.INC | 735 ++++ v4.0/src/DEV/XMA2EMS/ROMSCAN.INC | 420 ++ v4.0/src/DEV/XMA2EMS/XMA1DIAG.INC | 1870 ++++++++ v4.0/src/DEV/XMA2EMS/XMA2EMS.ASM | 2591 +++++++++++ v4.0/src/DEV/XMA2EMS/XMA2EMS.LC | 11 + v4.0/src/DEV/XMA2EMS/XMA2EMS.SKL | 39 + v4.0/src/DEV/XMA2EMS/XMA2EMSP.INC | 243 + v4.0/src/DEV/XMAEM/INDEACC.INC | 218 + v4.0/src/DEV/XMAEM/INDEDAT.INC | 535 +++ v4.0/src/DEV/XMAEM/INDEDES.MAC | 173 + v4.0/src/DEV/XMAEM/INDEDMA.ASM | 660 +++ v4.0/src/DEV/XMAEM/INDEEMU.ASM | 653 +++ v4.0/src/DEV/XMAEM/INDEEXC.ASM | 799 ++++ v4.0/src/DEV/XMAEM/INDEGDT.ASM | 379 ++ v4.0/src/DEV/XMAEM/INDEI15.ASM | 503 +++ v4.0/src/DEV/XMAEM/INDEIDT.ASM | 512 +++ v4.0/src/DEV/XMAEM/INDEINI.ASM | 1474 +++++++ v4.0/src/DEV/XMAEM/INDEINS.MAC | 923 ++++ v4.0/src/DEV/XMAEM/INDEMAUS.ASM | 73 + v4.0/src/DEV/XMAEM/INDEMSG.ASM | 96 + v4.0/src/DEV/XMAEM/INDEMSUS.ASM | 76 + v4.0/src/DEV/XMAEM/INDEMSUS.INC | 64 + v4.0/src/DEV/XMAEM/INDEOVP.MAC | 111 + v4.0/src/DEV/XMAEM/INDEPAT.ASM | 74 + v4.0/src/DEV/XMAEM/INDEXMA.ASM | 781 ++++ v4.0/src/DEV/XMAEM/INDEXMAE.SYS | 8 + v4.0/src/DEV/XMAEM/MAKEFILE | 57 + v4.0/src/DEV/XMAEM/XMAEM.ARF | 13 + v4.0/src/DEV/XMAEM/XMAEM.LC | 19 + v4.0/src/DEV/XMAEM/XMAEM.LNK | 13 + v4.0/src/DEV/XMAEM/XMAEM.MAK | 66 + v4.0/src/DEV/XMAEM/XMAEM.SKL | 16 + 201 files changed, 115778 insertions(+) create mode 100644 v4.0/src/DEV/ANSI/ANSI.ASM create mode 100644 v4.0/src/DEV/ANSI/ANSI.INC create mode 100644 v4.0/src/DEV/ANSI/ANSI.LNK create mode 100644 v4.0/src/DEV/ANSI/ANSI.SKL create mode 100644 v4.0/src/DEV/ANSI/ANSIINIT.ASM create mode 100644 v4.0/src/DEV/ANSI/ANSIVID.INC create mode 100644 v4.0/src/DEV/ANSI/IOCTL.ASM create mode 100644 v4.0/src/DEV/ANSI/MAKEFILE create mode 100644 v4.0/src/DEV/ANSI/PARSER.ASM create mode 100644 v4.0/src/DEV/COUNTRY/MAKEFILE create mode 100644 v4.0/src/DEV/COUNTRY/MKCNTRY.ASM create mode 100644 v4.0/src/DEV/COUNTRY/MKCNTRY.INC create mode 100644 v4.0/src/DEV/DISPLAY/CPS-FUNC.INC create mode 100644 v4.0/src/DEV/DISPLAY/DEF-EQU.INC create mode 100644 v4.0/src/DEV/DISPLAY/DISPLAY.ASM create mode 100644 v4.0/src/DEV/DISPLAY/DISPLAY.LNK create mode 100644 v4.0/src/DEV/DISPLAY/DISPLAY.SKL create mode 100644 v4.0/src/DEV/DISPLAY/DISPMES.ASM create mode 100644 v4.0/src/DEV/DISPLAY/EGA/437-8X14.ASM create mode 100644 v4.0/src/DEV/DISPLAY/EGA/437-8X16.ASM create mode 100644 v4.0/src/DEV/DISPLAY/EGA/437-8X8.ASM create mode 100644 v4.0/src/DEV/DISPLAY/EGA/437-CPI.ASM create mode 100644 v4.0/src/DEV/DISPLAY/EGA/850-8X14.ASM create mode 100644 v4.0/src/DEV/DISPLAY/EGA/850-8X16.ASM create mode 100644 v4.0/src/DEV/DISPLAY/EGA/850-8X8.ASM create mode 100644 v4.0/src/DEV/DISPLAY/EGA/850-CPI.ASM create mode 100644 v4.0/src/DEV/DISPLAY/EGA/860-8X14.ASM create mode 100644 v4.0/src/DEV/DISPLAY/EGA/860-8X16.ASM create mode 100644 v4.0/src/DEV/DISPLAY/EGA/860-8X8.ASM create mode 100644 v4.0/src/DEV/DISPLAY/EGA/860-CPI.ASM create mode 100644 v4.0/src/DEV/DISPLAY/EGA/863-8X14.ASM create mode 100644 v4.0/src/DEV/DISPLAY/EGA/863-8X16.ASM create mode 100644 v4.0/src/DEV/DISPLAY/EGA/863-8X8.ASM create mode 100644 v4.0/src/DEV/DISPLAY/EGA/863-CPI.ASM create mode 100644 v4.0/src/DEV/DISPLAY/EGA/865-8X14.ASM create mode 100644 v4.0/src/DEV/DISPLAY/EGA/865-8X16.ASM create mode 100644 v4.0/src/DEV/DISPLAY/EGA/865-8X8.ASM create mode 100644 v4.0/src/DEV/DISPLAY/EGA/865-CPI.ASM create mode 100644 v4.0/src/DEV/DISPLAY/EGA/COPYRIGH.ASM create mode 100644 v4.0/src/DEV/DISPLAY/EGA/CPI-HEAD.ASM create mode 100644 v4.0/src/DEV/DISPLAY/EGA/EGA.LNK create mode 100644 v4.0/src/DEV/DISPLAY/EGA/MAKEFILE create mode 100644 v4.0/src/DEV/DISPLAY/F-PARSER.INC create mode 100644 v4.0/src/DEV/DISPLAY/INIT.ASM create mode 100644 v4.0/src/DEV/DISPLAY/INT10COM.INC create mode 100644 v4.0/src/DEV/DISPLAY/INT2FCOM.INC create mode 100644 v4.0/src/DEV/DISPLAY/LCD/437-CPI.ASM create mode 100644 v4.0/src/DEV/DISPLAY/LCD/850-CPI.ASM create mode 100644 v4.0/src/DEV/DISPLAY/LCD/860-CPI.ASM create mode 100644 v4.0/src/DEV/DISPLAY/LCD/863-CPI.ASM create mode 100644 v4.0/src/DEV/DISPLAY/LCD/865-CPI.ASM create mode 100644 v4.0/src/DEV/DISPLAY/LCD/COPYRIGH.ASM create mode 100644 v4.0/src/DEV/DISPLAY/LCD/FONT-R3.ASM create mode 100644 v4.0/src/DEV/DISPLAY/LCD/LCD.LNK create mode 100644 v4.0/src/DEV/DISPLAY/LCD/MAKEFILE create mode 100644 v4.0/src/DEV/DISPLAY/MACROS.INC create mode 100644 v4.0/src/DEV/DISPLAY/MAKEFILE create mode 100644 v4.0/src/DEV/DISPLAY/PARSER.ASM create mode 100644 v4.0/src/DEV/DISPLAY/TABLES.INC create mode 100644 v4.0/src/DEV/DISPLAY/WRITE.INC create mode 100644 v4.0/src/DEV/DISPLAY/ZERO.DAT create mode 100644 v4.0/src/DEV/DRIVER/DRIVER.ASM create mode 100644 v4.0/src/DEV/DRIVER/DRIVER.LNK create mode 100644 v4.0/src/DEV/DRIVER/DRIVER.MAK create mode 100644 v4.0/src/DEV/DRIVER/DRIVER.SKL create mode 100644 v4.0/src/DEV/DRIVER/MAKEFILE create mode 100644 v4.0/src/DEV/KEYBOARD/KDF.ASM create mode 100644 v4.0/src/DEV/KEYBOARD/KDFBE.ASM create mode 100644 v4.0/src/DEV/KEYBOARD/KDFCF.ASM create mode 100644 v4.0/src/DEV/KEYBOARD/KDFDK.ASM create mode 100644 v4.0/src/DEV/KEYBOARD/KDFEOF.ASM create mode 100644 v4.0/src/DEV/KEYBOARD/KDFFR.ASM create mode 100644 v4.0/src/DEV/KEYBOARD/KDFFR120.ASM create mode 100644 v4.0/src/DEV/KEYBOARD/KDFFR189.ASM create mode 100644 v4.0/src/DEV/KEYBOARD/KDFGE.ASM create mode 100644 v4.0/src/DEV/KEYBOARD/KDFIT.ASM create mode 100644 v4.0/src/DEV/KEYBOARD/KDFIT141.ASM create mode 100644 v4.0/src/DEV/KEYBOARD/KDFIT142.ASM create mode 100644 v4.0/src/DEV/KEYBOARD/KDFLA.ASM create mode 100644 v4.0/src/DEV/KEYBOARD/KDFNL.ASM create mode 100644 v4.0/src/DEV/KEYBOARD/KDFNO.ASM create mode 100644 v4.0/src/DEV/KEYBOARD/KDFNOW.ASM create mode 100644 v4.0/src/DEV/KEYBOARD/KDFPO.ASM create mode 100644 v4.0/src/DEV/KEYBOARD/KDFSF.ASM create mode 100644 v4.0/src/DEV/KEYBOARD/KDFSG.ASM create mode 100644 v4.0/src/DEV/KEYBOARD/KDFSP.ASM create mode 100644 v4.0/src/DEV/KEYBOARD/KDFSU.ASM create mode 100644 v4.0/src/DEV/KEYBOARD/KDFSV.ASM create mode 100644 v4.0/src/DEV/KEYBOARD/KDFUK.ASM create mode 100644 v4.0/src/DEV/KEYBOARD/KDFUK166.ASM create mode 100644 v4.0/src/DEV/KEYBOARD/KDFUK168.ASM create mode 100644 v4.0/src/DEV/KEYBOARD/KEYBMAC.INC create mode 100644 v4.0/src/DEV/KEYBOARD/KEYBOARD.LNK create mode 100644 v4.0/src/DEV/KEYBOARD/KEYBSHAR.INC create mode 100644 v4.0/src/DEV/KEYBOARD/MAKEFILE create mode 100644 v4.0/src/DEV/MAKEFILE create mode 100644 v4.0/src/DEV/PRINTER/4201/4201.CPI create mode 100644 v4.0/src/DEV/PRINTER/4201/4201.INC create mode 100644 v4.0/src/DEV/PRINTER/4201/4201.MAK create mode 100644 v4.0/src/DEV/PRINTER/4201/MAKEFILE create mode 100644 v4.0/src/DEV/PRINTER/4208/4208-CPY.ASM create mode 100644 v4.0/src/DEV/PRINTER/4208/4208.CPI create mode 100644 v4.0/src/DEV/PRINTER/4208/4208.INC create mode 100644 v4.0/src/DEV/PRINTER/4208/4208.MAK create mode 100644 v4.0/src/DEV/PRINTER/4208/MAKEFILE create mode 100644 v4.0/src/DEV/PRINTER/5202/5202.ASM create mode 100644 v4.0/src/DEV/PRINTER/5202/MAKEFILE create mode 100644 v4.0/src/DEV/PRINTER/CPSFONT.ASM create mode 100644 v4.0/src/DEV/PRINTER/CPSFONT3.ASM create mode 100644 v4.0/src/DEV/PRINTER/CPSPEQU.INC create mode 100644 v4.0/src/DEV/PRINTER/CPSPI.ASM create mode 100644 v4.0/src/DEV/PRINTER/CPSPI07.ASM create mode 100644 v4.0/src/DEV/PRINTER/CPSPM10.ASM create mode 100644 v4.0/src/DEV/PRINTER/MAKEFILE create mode 100644 v4.0/src/DEV/PRINTER/PARSE4E.ASM create mode 100644 v4.0/src/DEV/PRINTER/PARSER.ASM create mode 100644 v4.0/src/DEV/PRINTER/PRINTER.LNK create mode 100644 v4.0/src/DEV/PRINTER/PRINTER.SKL create mode 100644 v4.0/src/DEV/PRINTER/PRTINT2F.ASM create mode 100644 v4.0/src/DEV/PRINTER/PTRMSG.ASM create mode 100644 v4.0/src/DEV/PRINTER/ZERO.DAT create mode 100644 v4.0/src/DEV/RAMDRIVE/ABOVE.INC create mode 100644 v4.0/src/DEV/RAMDRIVE/AB_MACRO.INC create mode 100644 v4.0/src/DEV/RAMDRIVE/DEVSYM.INC create mode 100644 v4.0/src/DEV/RAMDRIVE/DIRENT.INC create mode 100644 v4.0/src/DEV/RAMDRIVE/EMM.INC create mode 100644 v4.0/src/DEV/RAMDRIVE/LOADALL.INC create mode 100644 v4.0/src/DEV/RAMDRIVE/MAKEFILE create mode 100644 v4.0/src/DEV/RAMDRIVE/MESSAGES.ASM create mode 100644 v4.0/src/DEV/RAMDRIVE/MI.INC create mode 100644 v4.0/src/DEV/RAMDRIVE/RAMDRIVE.ASM create mode 100644 v4.0/src/DEV/RAMDRIVE/RAMDRIVE.LNK create mode 100644 v4.0/src/DEV/RAMDRIVE/SYSCALL.INC create mode 100644 v4.0/src/DEV/SMARTDRV/ABOVE.ASM create mode 100644 v4.0/src/DEV/SMARTDRV/AB_MACRO.ASM create mode 100644 v4.0/src/DEV/SMARTDRV/CMACROS.INC create mode 100644 v4.0/src/DEV/SMARTDRV/DEVSYM.ASM create mode 100644 v4.0/src/DEV/SMARTDRV/DIRENT.ASM create mode 100644 v4.0/src/DEV/SMARTDRV/EMM.ASM create mode 100644 v4.0/src/DEV/SMARTDRV/FL13.ASM create mode 100644 v4.0/src/DEV/SMARTDRV/FLMES.ASM create mode 100644 v4.0/src/DEV/SMARTDRV/FLUSH13.C create mode 100644 v4.0/src/DEV/SMARTDRV/FLUSH13.LNK create mode 100644 v4.0/src/DEV/SMARTDRV/INT13.DOC create mode 100644 v4.0/src/DEV/SMARTDRV/LOADALL.ASM create mode 100644 v4.0/src/DEV/SMARTDRV/MAKEFILE create mode 100644 v4.0/src/DEV/SMARTDRV/MI.ASM create mode 100644 v4.0/src/DEV/SMARTDRV/OLI.CMP create mode 100644 v4.0/src/DEV/SMARTDRV/SMARTDRV.ASM create mode 100644 v4.0/src/DEV/SMARTDRV/SMARTDRV.LNK create mode 100644 v4.0/src/DEV/SMARTDRV/SYSCALL.ASM create mode 100644 v4.0/src/DEV/VDISK/MAKEFILE create mode 100644 v4.0/src/DEV/VDISK/SLM.INI create mode 100644 v4.0/src/DEV/VDISK/VDISK.ASM create mode 100644 v4.0/src/DEV/VDISK/VDISK.INC create mode 100644 v4.0/src/DEV/VDISK/VDISK.LNK create mode 100644 v4.0/src/DEV/VDISK/VDISK.SKL create mode 100644 v4.0/src/DEV/VDISK/VDISKMSG.ASM create mode 100644 v4.0/src/DEV/VDISK/VDISKSYS.ASM create mode 100644 v4.0/src/DEV/VDISK/VDISKSYS.INC create mode 100644 v4.0/src/DEV/XMA2EMS/DIAGS.ASM create mode 100644 v4.0/src/DEV/XMA2EMS/EMSINIT.INC create mode 100644 v4.0/src/DEV/XMA2EMS/EMS_US.MSG create mode 100644 v4.0/src/DEV/XMA2EMS/GENIOCTL.INC create mode 100644 v4.0/src/DEV/XMA2EMS/I13HOOK.INC create mode 100644 v4.0/src/DEV/XMA2EMS/LIM40.INC create mode 100644 v4.0/src/DEV/XMA2EMS/LIM40B.INC create mode 100644 v4.0/src/DEV/XMA2EMS/MAKEFILE create mode 100644 v4.0/src/DEV/XMA2EMS/PARMPARS.INC create mode 100644 v4.0/src/DEV/XMA2EMS/PS2_5060.INC create mode 100644 v4.0/src/DEV/XMA2EMS/ROMSCAN.INC create mode 100644 v4.0/src/DEV/XMA2EMS/XMA1DIAG.INC create mode 100644 v4.0/src/DEV/XMA2EMS/XMA2EMS.ASM create mode 100644 v4.0/src/DEV/XMA2EMS/XMA2EMS.LC create mode 100644 v4.0/src/DEV/XMA2EMS/XMA2EMS.SKL create mode 100644 v4.0/src/DEV/XMA2EMS/XMA2EMSP.INC create mode 100644 v4.0/src/DEV/XMAEM/INDEACC.INC create mode 100644 v4.0/src/DEV/XMAEM/INDEDAT.INC create mode 100644 v4.0/src/DEV/XMAEM/INDEDES.MAC create mode 100644 v4.0/src/DEV/XMAEM/INDEDMA.ASM create mode 100644 v4.0/src/DEV/XMAEM/INDEEMU.ASM create mode 100644 v4.0/src/DEV/XMAEM/INDEEXC.ASM create mode 100644 v4.0/src/DEV/XMAEM/INDEGDT.ASM create mode 100644 v4.0/src/DEV/XMAEM/INDEI15.ASM create mode 100644 v4.0/src/DEV/XMAEM/INDEIDT.ASM create mode 100644 v4.0/src/DEV/XMAEM/INDEINI.ASM create mode 100644 v4.0/src/DEV/XMAEM/INDEINS.MAC create mode 100644 v4.0/src/DEV/XMAEM/INDEMAUS.ASM create mode 100644 v4.0/src/DEV/XMAEM/INDEMSG.ASM create mode 100644 v4.0/src/DEV/XMAEM/INDEMSUS.ASM create mode 100644 v4.0/src/DEV/XMAEM/INDEMSUS.INC create mode 100644 v4.0/src/DEV/XMAEM/INDEOVP.MAC create mode 100644 v4.0/src/DEV/XMAEM/INDEPAT.ASM create mode 100644 v4.0/src/DEV/XMAEM/INDEXMA.ASM create mode 100644 v4.0/src/DEV/XMAEM/INDEXMAE.SYS create mode 100644 v4.0/src/DEV/XMAEM/MAKEFILE create mode 100644 v4.0/src/DEV/XMAEM/XMAEM.ARF create mode 100644 v4.0/src/DEV/XMAEM/XMAEM.LC create mode 100644 v4.0/src/DEV/XMAEM/XMAEM.LNK create mode 100644 v4.0/src/DEV/XMAEM/XMAEM.MAK create mode 100644 v4.0/src/DEV/XMAEM/XMAEM.SKL (limited to 'v4.0/src/DEV') diff --git a/v4.0/src/DEV/ANSI/ANSI.ASM b/v4.0/src/DEV/ANSI/ANSI.ASM new file mode 100644 index 0000000..a1d59c6 --- /dev/null +++ b/v4.0/src/DEV/ANSI/ANSI.ASM @@ -0,0 +1,1169 @@ +PAGE ,132 +TITLE CONDEV FANCY CONSOLE DRIVER + +;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +; +; ADDRESSES FOR I/O +; +;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +;------------------------------------------------------------------------------ +;AN000; New functionality in DOS 4.00 +;AN001; GHG fix scrolling flashes on Mod 25/30's +;AN002; P1767 VIDEO_MODE_TABLE not initialized correctly 10/16/87 J.K. +;AN003; D375 /X needs to be supported by ANSI sequence also 12/14/87 J.K. +;AN004; D397 /L option for Enforcing number of lines 12/17/87 J.K. +;AN005; D479 An option to disable the extended keyboard functions 02/12/88 J.K. +;AN006; P4241 AN001 fix be Revised to fix this problem 04/20/88 J.K. +;AN007; P4532 Scrolling has a snow for CGA adapter 04/27/88 J.K. +;AN008; P4533 In mode Dh, Eh, Fh, 10h and 13h, Scrolling not working 04/27/88 J.K. +;AN009; P4766 In mode 11h, and 12h erase display leaves bottom 5 05/24/88 F.G. +;------------------------------------------------------------------------------ + +TRUE EQU 0FFFFh +FALSE EQU 0 + +BREAK MACRO subtitle + SUBTTL subtitle + PAGE ,132 +ENDM + +AsmVars Macro varlist +IRP var, +AsmVar var +ENDM +ENDM + +AsmVar Macro var +IFNDEF var +var = FALSE +ENDIF +ENDM + +INCLUDE VECTOR.INC +INCLUDE MULT.INC +INCLUDE ANSI.INC ; WGR equates and structures ;AN000; +.xlist +INCLUDE STRUC.INC ; WGR include STRUC macros ;AN000; +.list + +BREAK + + CR=13 ;CARRIAGE RETURN + BACKSP=8 ;BACKSPACE + ESC_CHAR=1BH + BRKADR=6CH ;006C BREAK VECTOR ADDRESS + ASNMAX=400 ;WGR (increased) SIZE OF KEY ASSIGNMENT BUFFER + +PUBLIC SWITCH_X ; WGR/X option for extended keyboard redefinition support;AN000; +PUBLIC SCAN_LINES ; WGR ;AN000; +PUBLIC VIDEO_MODE_TABLE ; WGR ;AN000; +PUBLIC VIDEO_TABLE_MAX ; WGR ;AN000; +public MAX_VIDEO_TAB_NUM ;P1767 +PUBLIC PTRSAV ; WGR ;AN000; +PUBLIC ERR1 ; WGR ;AN000; +PUBLIC ERR2 ; WGR ;AN000; +PUBLIC EXT_16 ; WGR ;AN000; +PUBLIC BRKADR ; WGR ;AN000; +PUBLIC BRKKY ; WGR ;AN000; +PUBLIC COUT ; WGR ;AN000; +PUBLIC BASE ; WGR ;AN000; +PUBLIC MODE ; WGR ;AN000; +PUBLIC MAXCOL ; WGR ;AN000; +PUBLIC TRANS ; WGR ;AN000; +PUBLIC STATUS ; WGR ;AN000; +PUBLIC EXIT ; WGR ;AN000; +PUBLIC NO_OPERATION ; WGR ;AN000; +PUBLIC HDWR_FLAG ; WGR ;AN000; +public Switch_L ;AN004; +public Switch_K ;AN005; + ;AN000; +CODE SEGMENT PUBLIC BYTE + + ASSUME CS:CODE,DS:NOTHING,ES:NOTHING +;----------------------------------------------- +; +; C O N - CONSOLE DEVICE DRIVER +; + +EXTRN CON$INIT:NEAR ; WGR ANSI initialization code +EXTRN GENERIC_IOCTL:NEAR ; WGR Generic IOCTL code +EXTRN REQ_TXT_LENGTH:WORD ; WGR current text length +EXTRN GRAPHICS_FLAG:BYTE ; WGR graphics flag + +CONDEV: ;HEADER FOR DEVICE "CON" + DW -1,-1 + DW 1100000001010011B ;WGR changed to match CON ;AC000; + DW STRATEGY + DW ENTRY + DB 'CON ' + +;-------------------------------------------------------------- +; +; COMMAND JUMP TABLES +CONTBL: + DW CON$INIT + DW NO_OPERATION ; WGR ;AC000; + DW NO_OPERATION ; WGR ;AC000; + DW NO_OPERATION ; WGR ;AC000; + DW CON$READ + DW CON$RDND + DW NO_OPERATION ; WGR ;AC000; + DW CON$FLSH + DW CON$WRIT + DW CON$WRIT + DW NO_OPERATION ; WGR ;AC000; + DW NO_OPERATION ; WGR ;AC000; + DW NO_OPERATION ; WGR ;AC000; + DW NO_OPERATION ; WGR ;AC000; + DW NO_OPERATION ; WGR ;AC000; + DW NO_OPERATION ; WGR ;AC000; + DW NO_OPERATION ; WGR ;AN000; + DW NO_OPERATION ; WGR ;AN000; + DW NO_OPERATION ; WGR ;AN000; + DW GENERIC_IOCTL ; WGR generic IOCTL routine offset ;AN000; +MAX_CMD EQU ($ - CONTBL)/2 ; WGR size of CONTBL ;AN000; + +CMDTABL DB 'A' + DW CUU ;cursor up + DB 'B' + DW CUD ;cursor down + DB 'C' + DW CUF ;cursor forward + DB 'D' + DW CUB ;cursor back + DB 'H' + DW CUP ;cursor position + DB 'J' + DW ED ;erase display + DB 'K' + DW EL ;erase line + DB 'R' + DW CPR ;cursor postion report + DB 'f' + DW CUP ;cursor position + DB 'h' + DW SM ;set mode + DB 'l' + DW RM ;reset mode + DB 'm' + DW SGR ;select graphics rendition + DB 'n' + DW DSR ;device status report + DB 'p' + DW KEYASN ;key assignment + db 'q' ;AN003; dynamic support of /X option through ansi sequence + dw ExtKey ;AN003; esc[0q = reset it. esc[1q = set it + DB 's' + DW PSCP ;save cursor postion + DB 'u' + DW PRCP ;restore cursor position + DB 00 + +GRMODE DB 00,00000000B,00000111B + DB 01,11111111B,00001000B + DB 04,11111000B,00000001B + DB 05,11111111B,10000000B + DB 07,11111000B,01110000B + DB 08,10001000B,00000000B + DB 30,11111000B,00000000B + DB 31,11111000B,00000100B + DB 32,11111000B,00000010B + DB 33,11111000B,00000110B + DB 34,11111000B,00000001B + DB 35,11111000B,00000101B + DB 36,11111000B,00000011B + DB 37,11111000B,00000111B + DB 40,10001111B,00000000B + DB 41,10001111B,01000000B + DB 42,10001111B,00100000B + DB 43,10001111B,01100000B + DB 44,10001111B,00010000B + DB 45,10001111B,01010000B + DB 46,10001111B,00110000B + DB 47,10001111B,01110000B + DB 0FFH + +;--------------------------------------------------- +; +; Device entry point +; +CMDLEN = 0 ;LENGTH OF THIS COMMAND +UNIT = 1 ;SUB UNIT SPECIFIER +CMD = 2 ;COMMAND CODE +STATUS = 3 ;STATUS +MEDIA = 13 ;MEDIA DESCRIPTOR +TRANS = 14 ;TRANSFER ADDRESS +COUNT = 18 ;COUNT OF BLOCKS OR CHARACTERS +START = 20 ;FIRST BLOCK TO TRANSFER + +PTRSAV DD 0 + +BUF1: BUF_DATA <> ; WGR Next CON Buffer area ;AN000; + +STRATP PROC FAR + +STRATEGY: + MOV WORD PTR CS:[PTRSAV],BX + MOV WORD PTR CS:[PTRSAV+2],ES + RET + +STRATP ENDP + +ENTRY: + PUSH SI + PUSH AX + PUSH CX + PUSH DX + PUSH DI + PUSH BP + PUSH DS + PUSH ES + PUSH BX +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; WGR ;AN000; +; Check if header link has to be set WGR (Code ported from ;AN000; +; WGR DISPLAY.SYS) ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; WGR ;AN000; + LEA BX, BUF1 ; WGR ;AN000; + MOV DI,OFFSET CONDEV ; WGR CON Device header ;AN000; + ; WGR ;AN000; + MOV CONPTR.DEV_HDRO,DI ; WGR ;AN000; + MOV CONPTR.DEV_HDRS,CS ; WGR ;AN000; + CLD ; WGR all moves forward ;AN000; + ; WGR ;AN000; + CMP CONPTR.CON_STRAO, -1 ; WGR ;AN000; + JNE L4 ; WGR has been linked to DOS CON ;AN000; + CMP CONPTR.CON_STRAS, -1 ; WGR ;AN000; + JNE L4 ; WGR has been linked to DOS CON ;AN000; + ; WGR next device header : ES:[DI] ;AN000; + LDS SI,DWORD PTR CONPTR.DEV_HDRO;WGR ;AN000; + LES DI,DWORD PTR HP.DH_NEXTO; WGR ;AN000; + ; WGR ;AN000; +;$SEARCH WHILE ; WGR pointer to next device header is NOT ;AN000; +L1: ; WGR ;AN000; + PUSH ES ; WGR -1 ;AN000; + POP AX ; WGR ;AN000; + CMP AX,-1 ; WGR ;AN000; +;$LEAVE E, AND ; WGR leave if both offset and segment are ;AN000; + JNE NOT0FFFF ; WGR ;AN000; + ; WGR ;AN000; + CMP DI,-1 ; WGR 0FFFFH ;AN000; +;$LEAVE E ; WGR ;AN000; + JE L4 ; WGR ;AN000; +NOT0FFFF: ; WGR ;AN000; + PUSH DI ; WGR ;AN000; + PUSH SI ; WGR ;AN000; + MOV CX,NAME_LEN ; WGR ;AN000; + LEA DI,NHD.DH_NAME ; WGR ;AN000; + LEA SI,HP.DH_NAME ; WGR ;AN000; + REPE CMPSB ; WGR ;AN000; + POP SI ; WGR ;AN000; + POP DI ; WGR ;AN000; + AND CX,CX ; WGR ;AN000; +;$EXITIF Z ; WGR Exit if name is found in linked hd. ;AN000; + JNZ L3 ; WGR Name is not found ;AN000; + ; WGR Name is found in the linked header ;AN000; + MOV AX,NHD.DH_STRAO ; WGR Get the STRATEGY address ;AN000; + MOV CONPTR.CON_STRAO,AX ; WGR ;AN000; + MOV AX,ES ; WGR ;AN000; +X1: MOV CONPTR.CON_STRAS,AX ; WGR ;AN000; + ; WGR ;AN000; + MOV AX,NHD.DH_INTRO ; WGR Get the INTERRUPT address ;AN000; + MOV CONPTR.CON_INTRO,AX ; WGR ;AN000; + MOV AX,ES ; WGR ;AN000; +X2: MOV CONPTR.CON_INTRS,AX ; WGR ;AN000; + ; WGR ;AN000; +;$ORELSE ; WGR FInd next header to have the same ;AN000; + JMP L4 ; WGR Device Name ;AN000; +L3: ; WGR ;AN000; + LES DI,DWORD PTR NHD.DH_NEXTO;WGR ;AN000; +;$ENDLOOP ; WGR ;AN000; + JMP L1 ; WGR ;AN000; +L4: ; WGR ;AN000; + + LDS BX,CS:[PTRSAV] ;GET PONTER TO I/O PACKET + + MOV CX,WORD PTR DS:[BX].COUNT ;CX = COUNT + + MOV AL,BYTE PTR DS:[BX].CMD + CBW + MOV SI,OFFSET CONTBL + ADD SI,AX + ADD SI,AX + CMP AL,MAX_CMD ; WGR not a call for ANSI...chain to lower device;AC000; + JA NO_OPERATION + + LES DI,DWORD PTR DS:[BX].TRANS + + PUSH CS + POP DS + + ASSUME DS:CODE + + JMP WORD PTR [SI] ;GO DO COMMAND + +;===================================================== +;= +;= SUBROUTINES SHARED BY MULTIPLE DEVICES +;= +;===================================================== +;---------------------------------------------------------- +; +; EXIT - ALL ROUTINES RETURN THROUGH THIS PATH +; +BUS$EXIT: ;DEVICE BUSY EXIT + MOV AH,00000011B + JMP SHORT ERR1 + +NO_OPERATION: ; WGR ;AN000; + CALL PASS_CONTROL ; WGR Pass control to lower CON ;AN000; + JMP SHORT ERR2 ; WGR ;AN000; + +ERR$EXIT: + MOV AH,10000001B ;MARK ERROR RETURN + JMP SHORT ERR1 + +EXITP PROC FAR + +EXIT: MOV AH,00000001B +ERR1: LDS BX,CS:[PTRSAV] + MOV WORD PTR [BX].STATUS,AX ;MARK OPERATION COMPLETE +ERR2: + POP BX ; WGR ;AN000; + POP ES + POP DS + POP BP + POP DI + POP DX + POP CX + POP AX + POP SI + RET ;RESTORE REGS AND RETURN +EXITP ENDP +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; WGR ;AN000; +; PASS CONTROL WGR ;AN000; +; WGR ;AN000; +; This calls the attached device to perform any further ;AN000; +; action on the call! WGR ;AN000; +; WGR ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; WGR ;AN000; +PASS_CONTROL PROC ; WGR ;AN000; + LEA SI,BUF1 ; WGR ;AN000; + LES BX,CS:[PTRSAV] ; WGR pass the request header to the ;AN000; + CALL DWORD PTR CS:[SI].CON_STRAO ; CON strategy routine. ;AN000; + CALL DWORD PTR CS:[SI].CON_INTRO ; WGR interrupt the CON ;AN000; + RET ; WGR ;AN000; +PASS_CONTROL ENDP ; WGR ;AN000; +;----------------------------------------------- ;AN000; +; +; BREAK KEY HANDLING +; +BRKKY: + MOV CS:ALTAH,3 ;INDICATE BREAK KEY SET +INTRET: IRET + +; +; WARNING - Variables are very order dependent, be careful +; when adding new ones! - c.p. +; +WRAP DB 0 ; 0 = WRAP, 1 = NO WRAP +ASNPTR DW 4 +STATE DW S1 +MODE DB 3 ;* +MAXCOL DB 79 ;* +COL DB 0 +ROW DB 0 +SAVCR DW 0 +INQ DB 0 +PRMCNT LABEL BYTE +PRMCNTW DW 0 +KEYCNT DB 0 +KEYPTR DW BUF +REPORT DB ESC_CHAR,'[00;00R',CR ;CURSOR POSTION REPORT BUFFER +ALTAH DB 0 ;Special key handling + +EXT_16 DB 0 ; WGR Extended INT 16h flag ;AN000; +Switch_X DB OFF ; WGR /X flag ;AN000; +Switch_L db OFF ;DCR397; 1= /L flag entered. +Switch_K db OFF ;AN005; To control EXT_16 +SCAN_LINES DB ? ; WGR flag for available scan lines (VGA) ;AN000; +HDWR_FLAG DW 0 ; WGR byte of flags indicating video support ;AN000; + +VIDEO_MODE_TABLE LABEL BYTE ; WGR table containing applicable ;AN000; +MODE_TABLE <> ; WGR video modes and corresponding ;AN000; +MODE_TABLE <> ; WGR data. ;AN000; +MODE_TABLE <> ; WGR this table is initialized at ;AN000; +MODE_TABLE <> ; WGR INIT time ;AN000; +MODE_TABLE <> ; WGR ;AN000; +MODE_TABLE <> ; WGR ;AN000; +MODE_TABLE <> ; WGR ;AN000; +MODE_TABLE <> ; WGR ;AN000; +MODE_TABLE <> ; WGR ;AN000; +MODE_TABLE <> ; WGR ;AN000; +MODE_TABLE <> ; WGR ;AN000; +MODE_TABLE <> ; WGR ;AN000; +MODE_TABLE <> ; WGR ;AN000; +MODE_TABLE <> ; WGR ;AN000; +MODE_TABLE <> ; WGR ;AN000; +VIDEO_TABLE_MAX EQU $ ; WGR maximum address for video table ;AN000; +MAX_VIDEO_TAB_NUM EQU ($-VIDEO_MODE_TABLE)/TYPE MODE_TABLE ;P1767 Max number of table + ;AN000; +;------------------------------------------------------------- +; +; CHROUT - WRITE OUT CHAR IN AL USING CURRENT ATTRIBUTE +; +ATTRW LABEL WORD +ATTR DB 00000111B ;CHARACTER ATTRIBUTE +BPAGE DB 0 ;BASE PAGE +base dw 0b800h +screen_seg dw 00000h + +chrout: cmp al,13 + jnz trylf + mov [col],0 + jmp short setit + +trylf: cmp al,10 + jz lf + cmp al,7 + jnz tryback +torom: + mov bx,[attrw] + and bl,7 + mov ah,14 + int 10h +ret5: ret + +tryback: + cmp al,8 + jnz outchr + cmp [col],0 + jz ret5 + dec [col] + jmp short setit + +outchr: + mov bx,[attrw] + mov cx,1 + mov ah,9 + int 10h + inc [col] + mov al,[col] + cmp al,[maxcol] + jbe setit + cmp [wrap],0 + jz outchr1 + dec [col] + ret +outchr1: + mov [col],0 +lf: inc [row] + MOV AH,30 ; GHG Fix for ROUNDUP/PALACE + MOV AL,MODE ; GHG Fix for ROUNDUP/PALACE + CMP AL,11H ; GHG Fix for ROUNDUP/PALACE + JE LF2 ; GHG Fix for ROUNDUP/PALACE + CMP AL,12H ; GHG Fix for ROUNDUP/PALACE + JE LF2 ; GHG Fix for ROUNDUP/PALACE + .IF ; WGR ;AN000; + MOV AH,DEFAULT_LENGTH ; WGR ;AN000; + .ELSE ; WGR ;AN000; + MOV AH,BYTE PTR [REQ_TXT_LENGTH] ; GHG Fix for ROUNDUP/PALACE + .ENDIF ; WGR ;AN000; +LF2: ; GHG Fix for ROUNDUP/PALACE + cmp [row],AH ; GHG Fix for ROUNDUP/PALACE + jb setit + DEC AH ; GHG Fix for ROUNDUP/PALACE + mov [row],AH ; GHG Fix for ROUNDUP/PALACE + call scroll + +setit: mov dh,row + mov dl,col + mov bh,[bpage] + mov ah,2 + int 10h + ret + +;AN006;Writing a LF char through Teletype function to scroll the screen +;has a side effect of changing the color of the cursor when the PROMPT +;setting in PTM P4241 is used. AN001 uses this method to fix the strobing +;problem of the palace machine. The old method of scrolling used to directly +;write into video buffer. The old method has been used by AN001 for +;CGA adater of mode 2 or 3 only. +;To solve P4241, but to maintain the fix of the strobing problem of palace +;machine, we return back to the old logic but the old logic has to be +;Revised for the displays above CGA level. For the adapters above +;CGA display, we don't need to turn off/on the video - this will causes +;a strobing, if you use do this, for Palace machine. +;This logic will be only applied to mode 2 and 3 only. + +scroll: +;AN006;AN008; Myscroll is only for Mode 2 and 3 of all display unit. +; .IF ; GHG is this the CGA? ;AN000; + .IF < MODE eq 2 > or + .IF < MODE eq 3 > + jmp myscroll + .ENDIF +; .ENDIF +;AN006;AN008; Other modes (=APA mode) use TeleType function of +; writing LF to scroll the screen!. + mov al,10 ; GHG + jmp torom ; GHG + +myscroll: + mov bh,[attr] + mov bl,' ' + MOV AL,[MAXCOL] ; WGR ;AN000; + CBW ; WGR ;AN000; + INC AX ; WGR ;AN000; + MOV BP,AX ; WGR ;AN000; + MOV SI,BP ; WGR ;AN000; + ADD SI,BP ; WGR ;AN000; + .IF ; WGR ;AN000; + MOV AX,DEFAULT_LENGTH ; WGR ;AN000; + .ELSE ; WGR ;AN000; + MOV AX,[REQ_TXT_LENGTH] ; WGR ;AN000; + .ENDIF ; WGR ;AN000; + DEC AX ; WGR ;AN000; + MUL BP ; WGR ;AN000; + MOV CX,AX ; WGR ;AN000; + mov ax,[base] + add ax,[screen_seg] + mov es,ax + mov ds,ax + xor di,di + cld + cmp cs:[base],0b800h + jz colorcard + + rep movsw + mov ax,bx + mov cx,bp + rep stosw +sret: push cs + pop ds + ret + +colorcard: +; We must protect this with a critical section +; +; INT 29H calls to device drivers do not enter CritDevice +; The user MIGHT hit Ctrl-NumLock in the middle of this +; which will leave the screen blanked. + mov ax,8000H + CritDevice ; Enter Device critical section + int int_IBM + + cmp cs:[Hdwr_Flag], MCGA_ACTIVE ;AN006;AN007;above CGA level? + jae Skip_Video_Off ;AN006;AN007; + + mov dx,3dah +wait2: in al,dx + test al,8 + jz wait2 + mov al,25h + mov dx,3d8h + out dx,al ;turn off video +Skip_Video_Off: ;AN006; + rep movsw + mov ax,bx + mov cx,bp + rep stosw + cmp cs:[Hdwr_Flag], MCGA_ACTIVE ;AN006;AN007; + jae Skip_Video_On ;AN006;AN007; + mov al,29h + mov dx,3d8h + out dx,al ;turn on video + +Skip_Video_On: ;AN006; + mov ax,8100H + CritDevice ; Leave Device critical section + int int_IBM + + jmp sret + +;------------------------------------------------------ +; +; CONSOLE READ ROUTINE +; +CON$READ: + JCXZ CON$EXIT +CON$LOOP: + PUSH CX ;SAVE COUNT + CALL CHRIN ;GET CHAR IN AL + POP CX + STOSB ;STORE CHAR AT ES:DI + LOOP CON$LOOP +CON$EXIT: + JMP EXIT +;--------------------------------------------------------- +; +; INPUT SINGLE CHAR INTO AL +; +CHRIN: XOR AX,AX + XCHG AL,ALTAH ;GET CHARACTER & ZERO ALTAH + OR AL,AL + JNZ KEYRET + +INAGN: CMP KEYCNT,0 + JNZ KEY5A + + XOR AH,AH + .IF ; WGR extended interrupt available? ;AN000; + MOV AH,10h ; WGR yes..perform extended call ;AN000; + INT 16H ; WGR ;AN000; + .IF ; WGR /X switch used? ;AN000; + CALL CHECK_FOR_REMAP ; WGR no....map to normal call ;AN000; + .ENDIF ; WGR ;AN000; + CALL SCAN ; WGR check for redefinition ;AN000; + .IF NZ AND ; WGR no redefinition?...and ;AN000; + .IF ; WGR /X switch used? ;AN000; + CALL CHECK_FOR_REMAP ; WGR then remap.. ;AN000; + OR BX,BX ; WGR reset zero flag for jump test in old code ;AN000; + .ENDIF ; WGR ;AN000; + .ELSE ; WGR extended interrupt not available ;AN000; + INT 16H ; WGR ;AN000; + CALL SCAN ; WGR check for redefinition ;AN000; + .ENDIF ; WGR ;AN000; + JNZ ALT10 ;IF NO MATCH JUST RETURN IT + + DEC CX + DEC CX + INC BX + INC BX + .IF OR ; WGR check whether the ;AN000; + .IF AND ; WGR keypacket is an extended one? ;AN000; + .IF ; WGR switch must be set for 0E0h extended ;AN000; + DEC CX ; WGR adjust pointers ;AN000; + INC BX ; WGR appropiately ;AN000; + .ENDIF + MOV KEYCNT,CL + MOV KEYPTR,BX +KEY5A: ; Jmp here to get rest of translation + CALL KEY5 ;GET FIRST KEY FROM TRANSLATION +ALT10: + OR AX,AX ;Check for non-key after BREAK + JZ INAGN + OR AL,AL ;SPECIAL CASE? + JNZ KEYRET + MOV ALTAH,AH ;STORE SPECIAL KEY +KEYRET: RET + +KEY5: MOV BX,KEYPTR ;GET A KEY FROM TRANSLATION TABLE + MOV AX,WORD PTR [BX] + DEC KEYCNT + INC BX + OR AL,AL + JNZ KEY6 + INC BX + DEC KEYCNT +KEY6: MOV KEYPTR,BX + RET + +SCAN: MOV BX,OFFSET BUF +KEYLP: MOV CL,BYTE PTR [BX] + XOR CH,CH + OR CX,CX + JZ NOTFND + .IF OR ; WGR check whether the ;AN000; + .IF AND ; WGR keypacket is an extended one. ;AN000; + .IF ; WGR switch must be set for 0E0h extended ;AN000; + CMP AX,WORD PTR [BX+1] ; WGR yes...compare the word ;AN000; + .ELSE ; WGR ;AN000; + CMP AL,BYTE PTR [BX+1] ; WGR no...compare the byte ;AN000; + .ENDIF ; WGR ;AN000; + JZ MATCH + ADD BX,CX + JMP KEYLP +NOTFND: OR BX,BX +MATCH: RET +;-------------------------------------------------------------- +; +; KEYBOARD NON DESTRUCTIVE READ, NO WAIT +; +CON$RDND: + MOV AL,[ALTAH] + OR AL,AL + JNZ RDEXIT + + CMP [KEYCNT],0 + JZ RD1 + MOV BX,[KEYPTR] + MOV AL,BYTE PTR [BX] + JMP SHORT RDEXIT + +RD1: MOV AH,1 + .IF ; WGR extended INT16 available? ;AN000; + ADD AH,10H ; WGR yes....adjust to extended call ;AN000; + .ENDIF + INT 16H + JZ CONBUS + OR AX,AX + JNZ RD2 + MOV AH,0 + .IF ; WGR extended interrupt available? ;AN000; + MOV AH,10h ; WGR yes..perform extended call ;AN000; + INT 16H ; WGR ;AN000; + .IF ; WGR /X switch used? ;AN000; + CALL CHECK_FOR_REMAP ; WGR no....map to normal call ;AN000; + .ENDIF ; WGR ;AN000; + .ELSE ; WGR ;AN000; + INT 16H ; WGR ;AN000; + .ENDIF ; WGR ;AN000; + JMP CON$RDND + +RD2: CALL SCAN + .IF NZ AND ; WGR if no redefinition ;AN000; + .IF AND ; WGR and extended INT16 used ;AN000; + .IF ; WGR and /x used ....then ;AN000; + CALL CHECK_FOR_REMAP ; WGR remap to standard call ;AN000; + OR BX,BX ; WGR reset zero flag for jump test in old code ;AN000; + .ENDIF + JNZ RDEXIT + + MOV AL,BYTE PTR [BX+2] + CMP BYTE PTR [BX+1],0 + JNZ RDEXIT + MOV AL,BYTE PTR [BX+3] +RDEXIT: LDS BX,[PTRSAV] + MOV [BX].MEDIA,AL +EXVEC: JMP EXIT +CONBUS: JMP BUS$EXIT +;-------------------------------------------------------------- +; +; KEYBOARD FLUSH ROUTINE +; +CON$FLSH: + MOV [ALTAH],0 ;Clear out holding buffer + MOV [KEYCNT],0 + +; PUSH DS +; XOR BP,BP +; MOV DS,BP ;Select segment 0 +; MOV DS:BYTE PTR 41AH,1EH ; Reset KB queue head pointer +; MOV DS:BYTE PTR 41CH,1EH ;Reset tail pointer +; POP DS + +Flush: mov ah,1 + .IF ; WGR is extended call available? ;AN000; + ADD AH,10H ; WGR yes....adjust for extended ;AN000; + .ENDIF ; WGR ;AN000; + int 16h + jz FlushDone + mov ah,0 + .IF ; WGR is extended call available? ;AN000; + ADD AH,10H ; WGR yes....adjust for extended ;AN000; + .ENDIF ; WGR ;AN000; + int 16h + jmp Flush +FlushDone: + + JMP EXVEC +;---------------------------------------------------------- +; +; CONSOLE WRITE ROUTINE +; +CON$WRIT: + JCXZ EXVEC + +CON$LP: MOV AL,ES:[DI] ;GET CHAR + INC DI + CALL OUTC ;OUTPUT CHAR + LOOP CON$LP ;REPEAT UNTIL ALL THROUGH + JMP EXVEC + +COUT: STI + PUSH DS + PUSH CS + POP DS + CALL OUTC + POP DS + IRET + +OUTC: PUSH AX + PUSH BX + PUSH CX + PUSH DX + PUSH SI + PUSH DI + PUSH ES + PUSH BP + + MOV [BASE],0B800H + XCHG AX,SI ; SAVE CHARACTER TO STUFF + MOV AX,40H ; POINT TO ROS BIOS + MOV DS,AX + MOV AX,DS:[49H] ; AL=MODE, AH=MAX COL + DEC AH ; ANSI NEEDS 0-79 OR 0-39 + MOV WORD PTR CS:[MODE],AX ; SAVE MODE AND MAX COL + CMP AL,7 + JNZ NOT_BW + MOV WORD PTR CS:[BASE],0B000H +NOT_BW: MOV AL,DS:[62H] ; GET ACTIVE PAGE + MOV CS:[BPAGE],AL + CBW + ADD AX,AX + MOV BX,AX + MOV AX,DS:[BX+50H] ; AL=COL, AH=ROW + MOV WORD PTR CS:[COL],AX ; SAVE ROW AND COLUMN + MOV AX,DS:[4EH] ; GET START OF SCREEN SEG + MOV CL,4 + SHR AX,CL ; CONVERT TO A SEGMENT + PUSH CS + POP DS + MOV [SCREEN_SEG],AX + XCHG AX,SI ; GET BACK CHARACTER IN AL + + CALL VIDEO + POP BP + POP ES + POP DI + POP SI + POP DX + POP CX + POP BX + POP AX + RET + + +;---------------------------------------------------------- +; +; OUTPUT SINGLE CHAR IN AL TO VIDEO DEVICE +; +VIDEO: MOV SI,OFFSET STATE + JMP [SI] + +S2: CMP AL,'[' + JZ S22 + JMP S1 +S22: MOV WORD PTR [SI],OFFSET S3 + XOR BX,BX + MOV WORD PTR INQ,BX + JMP SHORT S3B + +S3: CMP AL,';' + JNZ S3C +S3A: INC PRMCNT +S3B: CALL GETPTR + XOR AX,AX + MOV WORD PTR [BX],AX ;DEFAULT VALUE IS ZERO + RET + +S3C: CMP AL,'0' + JB S3D + CMP AL,'9' + JA S3D + CALL GETPTR + SUB AL,'0' + XCHG AL,BYTE PTR [BX] + MOV AH,10 + MUL AH ;*10 + ADD BYTE PTR [BX],AL ;MOVE IN DIGIT + RET + +S3D: CMP AL,'=' + JZ S3RET + CMP AL,'?' + JZ S3RET + CMP AL,'"' ;BEGIN QUOTED STRING + JZ S3E + CMP AL,"'" + JNZ S7 +S3E: MOV WORD PTR [SI],OFFSET S4 + MOV [INQ],AL +S3RET: RET + +; +; ENTER QUOTED STRINGS +; + +S4: CMP AL,[INQ] ;CHECK FOR STRING TERMINATOR + JNZ S4A + DEC PRMCNT ;TERMINATE STRING + MOV WORD PTR [SI],OFFSET S3 + RET + +S4A: CALL GETPTR + MOV BYTE PTR [BX],AL + MOV WORD PTR [SI],OFFSET S4 + JMP S3A +; +; LOOK FOR ANSI COMMAND SPECIFIED IN AL +; + +S7: MOV BX,OFFSET CMDTABL-3 +; +S7A: ADD BX,3 + CMP BYTE PTR [BX],0 + JZ S1B + CMP BYTE PTR [BX],AL + JNZ S7A +; +S7B: MOV AX,WORD PTR [BX+1] ;AX = JUMP ADDRESS + MOV BX,OFFSET BUF + INC BX + ADD BX,ASNPTR ;BX = PTR TO PARM LIST + MOV DL,BYTE PTR [BX] + XOR DH,DH ;DX = FIRST PARAMETER + MOV CX,DX + OR CX,CX + JNZ S7C + INC CX ;CX = DX, CX=1 IF DX=0 +S7C: JMP AX ;AL = COMMAND + +S1: CMP AL,ESC_CHAR ;ESCAPE SEQUENCE? + JNZ S1B + MOV WORD PTR [SI],OFFSET S2 + RET + +S1B: CALL CHROUT +S1A: MOV WORD PTR [STATE],OFFSET S1 + RET + +MOVCUR: CMP BYTE PTR [BX],AH + JZ SETCUR + ADD BYTE PTR [BX],AL + LOOP MOVCUR +SETCUR: MOV DX,WORD PTR COL + XOR BX,BX + MOV AH,2 + INT 16 + JMP S1A + +CUP: .IF ; WGR ;AN000; + CMP CL,DEFAULT_LENGTH ; WGR ;AN000; + .ELSE ; WGR ;AN000; + CMP CL,BYTE PTR [REQ_TXT_LENGTH] ; WGR ;AN000; + .ENDIF ; WGR ;AN000; + JA SETCUR + MOV AL,MAXCOL + MOV CH,BYTE PTR [BX+1] + OR CH,CH + JZ CUP1 + DEC CH +CUP1: CMP AL,CH + JA CUP2 + MOV CH,AL +CUP2: XCHG CL,CH + DEC CH + MOV WORD PTR COL,CX + JMP SETCUR + +CUF: MOV AH,MAXCOL + MOV AL,1 +CUF1: MOV BX,OFFSET COL + JMP MOVCUR + +CUB: MOV AX,00FFH + JMP CUF1 + +CUU: MOV AX,00FFH +CUU1: MOV BX,OFFSET ROW + JMP MOVCUR + +CUD: .IF ; WGR ;AN000; + MOV AH,DEFAULT_LENGTH ; WGR ;AN000; + .ELSE ; WGR ;AN000; + MOV AH,BYTE PTR [REQ_TXT_LENGTH] ; WGR ;AN000; + .ENDIF ; WGR ;AN000; + MOV AL,1 ; WGR ;AN000; + JMP CUU1 + +ExtKey: ;AN003; + cmp dl, 0 ;AN003; DL = previous parameter + jne ExtKey_1 ;AN003; + mov Switch_X, OFF ;AN003; reset it if 0. + jmp S1A ;AN003; +ExtKey_1: ;AN003; + cmp dl, 1 ;AN003; 1 ? + je SetExtKey ;AN003; + jmp S1A ;AN003; ignore it +SetExtKey: ;AN003; + mov Switch_X, ON ;AN003; set it if 1. + jmp S1A ;AN003; + +PSCP: MOV AX,WORD PTR COL + MOV SAVCR,AX + JMP SETCUR + +PRCP: MOV AX,SAVCR + MOV WORD PTR COL,AX + JMP SETCUR + +SGR: XOR CX,CX + XCHG CL,PRMCNT + CALL GETPTR + INC CX +SGR1: MOV AL,BYTE PTR [BX] + PUSH BX + MOV BX,OFFSET GRMODE +SGR2: MOV AH,BYTE PTR [BX] + ADD BX,3 + CMP AH,0FFH + JZ SGR3 + CMP AH,AL + JNZ SGR2 + MOV AX,WORD PTR [BX-2] + AND ATTR,AL + OR ATTR,AH +SGR3: POP BX + INC BX + LOOP SGR1 + JMP SETCUR + +ED: XOR CX,CX + MOV WORD PTR COL,CX + MOV DH,30 ; ;AN009; + MOV AL,MODE ; ;AN009; + CMP AL,11H ; ;AN009; + JE ERASE ; ;AN009; + CMP AL,12H ; ;AN009; + JE ERASE ; ;AN009; + .IF ; WGR ;AN000; + MOV DH,DEFAULT_LENGTH ; WGR ;AN000; + .ELSE ; WGR ;AN000; + MOV DH,BYTE PTR [REQ_TXT_LENGTH] ; WGR ;AN000; + .ENDIF ; WGR ;AN000; +ERASE: MOV DL,MAXCOL + .IF ; WGR if we are in a graphics mode.. ;AN000; + XOR BH,BH ; WGR then use 0 as attribute... ;AN000; + .ELSE ; WGR else... ;AN000; + MOV BH,ATTR ; WGR ...use active attribute ;AC000; + .ENDIF ; WGR ;AN000; + MOV AX,0600H + INT 16 +ED3: JMP SETCUR + +EL: MOV CX,WORD PTR COL + MOV DH,CH + JMP ERASE + +BIN2ASC:MOV DL,10 + INC AL + XOR AH,AH + DIV DL + ADD AX,'00' + RET +DSR: MOV AH,REQ_CRSR_POS ; WGR ;AN000; + PUSH BX ; WGR ;AN000; + XOR BH,BH ; WGR ;AN000; + INT 10H ; WGR ;AN000; + POP BX ; WGR ;AN000; + PUSH DX ; WGR ;AN000; + MOV AL,DH ;REPORT CURRENT CURSOR POSITION + CALL BIN2ASC + MOV WORD PTR REPORT+2,AX + POP DX ; WGR ;AN000; + MOV AL,DL ; WGR ;AN000; + CALL BIN2ASC + MOV WORD PTR REPORT+5,AX + MOV [KEYCNT],9 + MOV [KEYPTR],OFFSET REPORT +CPR: JMP S1A + +RM: MOV CL,1 + JMP SHORT SM1 + +SM: XOR CX,CX +SM1: MOV AL,DL + .IF OR ;; WGR check to see if valid mode.. ;AN000; + .IF AND ;; WGR (0-6,13-19) ;AN000; + .IF ;; WGR ;AN000; + .IF ;; WGR is this the LCD? ;AN000; + PUSH DS ;; WGR yes... ;AN000; + PUSH AX ;; WGR save mode ;AN000; + MOV AX,ROM_BIOS ;; WGR ;AN000; + MOV DS,AX ;; WGR get equipment status flag.. ;AN000; + MOV AX,DS:[EQUIP_FLAG] ;; WGR ;AN000; + AND AX,INIT_VID_MASK ;; WGR clear initial video bits.. ;AN000; + OR AX,LCD_COLOR_MODE ;; WGR .....set bits as color ;AN000; + MOV DS:[EQUIP_FLAG],AX ;; WGR replace updated flag. ;AN000; + POP AX ;; WGR restore mode. ;AN000; + POP DS ;; WGR ;AN000; + .ENDIF ;; WGR ;AN000; + MOV AH,SET_MODE ;; WGR yes....set mode.. ;AN000; + INT 10H ;; WGR ;AN000; + .ELSE ;; WGR no...check for 7 (wrap at EOL) ;AN000; + .IF ;; WGR ;AN000; + MOV [WRAP],CL ;; WGR yes....wrap... ;AN000; + .ENDIF ;; WGR ;AN000; + .ENDIF ;; WGR ;AN000; + JMP CPR + +KEYASN: XOR DX,DX + XCHG DL,PRMCNT ;GET CHARACTER COUNT + INC DX + INC DX + + CALL GETPTR + MOV AX,WORD PTR [BX] ;GET CHARACTER TO BE ASSIGNED + CALL SCAN ;LOOK IT UP + JNZ KEYAS1 + + MOV DI,BX ;DELETE OLD DEFINITION + SUB ASNPTR,CX + MOV KEYCNT,0 ; This delete code shuffles the + ; key definition table all around. + ; This will cause all sorts of trouble + ; if we are in the middle of expanding + ; one of the definitions being shuffled. + ; So shut off the expansion. + MOV SI,DI + ADD SI,CX + MOV CX,OFFSET BUF+ASNMAX + SUB CX,SI + CLD + PUSH ES ;SAVE USER'S ES + PUSH CS + POP ES ;SET UP ES ADDRESSABILITY + REP MOVSB + POP ES ;RESTORE ES + +KEYAS1: CALL GETPTR + CMP DL,3 + JB KEYAS3 + MOV BYTE PTR [BX-1],DL ;SET LENGTH + ADD ASNPTR,DX ;REMEMBER END OF LIST + ADD BX,DX + CMP ASNPTR,ASNMAX ; Too much??? + JB KEYAS3 ; No + SUB BX,DX ; Next three instructions undo the above + SUB ASNPTR,DX +KEYAS3: MOV BYTE PTR [BX-1],00 + MOV STATE,OFFSET S1 ;RETURN + RET + +GETPTR: MOV BX,ASNPTR + INC BX + ADD BX,PRMCNTW + CMP BX,ASNMAX + 8 + JB GET1 + DEC PRMCNT + JMP GETPTR +GET1: ADD BX,OFFSET BUF + RET + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; WGR ;AN000; +; WGR ;AN000; +; CHECK_FOR_REMAP: WGR ;AN000; +; WGR ;AN000; +; This function esnures that the keypacket WGR ;AN000; +; passed to it in AX is mapped to a standard INT16h call WGR ;AN000; +; WGR ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; WGR ;AN000; + ;AN000; +CHECK_FOR_REMAP PROC NEAR ; WGR ;AN000; + .IF ; WGR is this an extended key? ;AN000; + OR AH,AH ; WGR probably...but check for alpha character ;AN000; + .IF NZ ; WGR if it's not an alpha character ....then ;AN000; + XOR AL,AL ; WGR map extended to standard ;AN000; + .ENDIF ; WGR ;AN000; + .ENDIF ; WGR ;AN000; + RET ; WGR ;AN000; +CHECK_FOR_REMAP ENDP ; WGR ;AN000; + + +BUF DB 4,00,72H,16,0 + DB ASNMAX+8-5 DUP (?) + +CODE ENDS + END diff --git a/v4.0/src/DEV/ANSI/ANSI.INC b/v4.0/src/DEV/ANSI/ANSI.INC new file mode 100644 index 0000000..ff0a217 --- /dev/null +++ b/v4.0/src/DEV/ANSI/ANSI.INC @@ -0,0 +1,312 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Equates and Strucs. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;------------------------------------------------------------------------------ +;AN001; D425 For OS2 compatibiltiy box, /L option status query 01/14/88 J.K. +;AN002; D493 New INIT request structure for error message 02/25/88 J.K. +;AN003; P4934 Change ANSI 2F function number t0 1Ah 05/20/88 F.G. +;------------------------------------------------------------------------------ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; DEVICE Header DS:[SI] -- to locate the next CON header +; NEXT device header ES:[DI] +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +HP EQU DS:[SI] ; ;AN000; +NHD EQU ES:[DI] ; ;AN000; + ; +NAME_LEN EQU 8 ; ;AN000; + ; +DHS STRUC ; ;AN000; +DH_NEXTO DW ? ; offset of pointer to next header ;AN000; +DH_NEXTS DW ? ; segment of pointer to next header ;AN000; + DW ? ; attribute ;AN000; +DH_STRAO DW ? ; offset to strategy routine ;AN000; +DH_INTRO DW ? ; offset to interrupt routine ;AN000; +DH_NAME DB NAME_LEN DUP(0) ; device name in this header ;AN000; +DHS ENDS ; end of common portion ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; CON data structure CS:[BX] +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +CONPTR EQU CS:[BX] ; ;AN000; + ; STATES ;AN000; +BUF_DATA STRUC ; ;AN000; +DEV_HDRO DW -1 ; device driver header offset ;AN000; +DEV_HDRS DW -1 ; ;AN000; +CON_STRAO DW -1 ; dos CON strategy offset ;AN000; +CON_STRAS DW -1 ; ;AN000; +CON_INTRO DW -1 ; dos CON strategy offset ;AN000; +CON_INTRS DW -1 ; ;AN000; +BUF_DATA ENDS ; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +; +; INIT Structures and equates +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +ROM_BIOS EQU 40h ; Segment of ROM_BIOS data area ;AN000; +EQUIP_FLAG EQU 10h ; equipment flag. (for LCD) ;AN000; +KBD_FLAG_3 EQU 96h ; offset of KBD_FLAG_3 in data area ;AN000; +NUM_ROWS EQU 84h ; offset of number of rows in data area;AN000; +EXT16_FLAG EQU 00010000b ; mask for Extended INT16 bit ;AN000; +INIT_VID_MASK EQU 0FFCFh ; mask for equipment list ;AN000; +LCD_COLOR_MODE EQU 20h ; LCD as color ;AN000; +LCD_MONO_MODE EQU 30h ; LCD as MONOchrome ;AN000; +UNKNOWN_CMD EQU 8103H ; unknown command status byte ;AN000; +RC_EOL EQU -1 ; parser return code for EOL ;AN000; +RC_NO_ERROR EQU 0 ; parser return code for not in switch list ;AN000; +INVALID_PARM EQU 10 ; PARSE Invalid parameter message number ;AN000; +SSTRING EQU 3 ; PARSE Too many parameters message ;AN000; +FUNC_CALL EQU 1BH ; VGA functionality call ;AN000; +ALT_SELECT EQU 12H ; EGA alternate select call ;AN000; +EGA_INFO EQU 10H ; EGA return information subcall ;AN000; +ALT_PRT_SC EQU 20H ; select alternate print screen subcall;AN000; +MONOCHROME EQU 1 ; monochrome attached to EGA ;AN000; +COLOR EQU 0 ; some color attached to EGA ;AN000; +PS2_MONO EQU 7 ; display adapter types... ;AN000; +PS2_COLOR EQU 8 ; ;AN000; +MOD30_MONO EQU 0BH ; ;AN000; +MOD30_COLOR EQU 0CH ; ;AN000; +LCD_MODEL EQU 0F9H ; Convertible model byte value ;AN000; +GET_SYS_ID EQU 0C0H ; INT15H call for system identification;AN000; +GET_STATUS EQU 43H ; read system status (Convertible) ;AN000; +MONO_ADDRESS EQU 0B000H ; base address for monochrome ;AN000; +COLOR_ADDRESS EQU 0B800H ; base address for CGA ;AN000; +UNOCCUPIED EQU -1 ; value in VIDEO_MODE_TABLE if space unused ;AN000; +LCD_ACTIVE EQU 00000001B ; LCD adapter is present ;AN000; +MONO_ACTIVE EQU 00000010B ; monochrome adapter is present ;AN000; +CGA_ACTIVE EQU 00000100B ; CGA adapter is present ;AN000; +MCGA_ACTIVE EQU 00001000B ; MCGA is present ;AN000; +E5151_ACTIVE EQU 00010000B ; EGA with monochrome is present ;AN000; +E5153_ACTIVE EQU 00100000B ; EGA with color display is present ;AN000; +E5154_ACTIVE EQU 01000000B ; EGA with enhanced color display is present ;AN000; +VGA_ACTIVE EQU 10000000B ; VGA is present ;AN000; +INT10_LOW EQU (4*10H) ; interrupt 10 vector location ;AN000; +INT10_HI EQU (4*10H)+2 ; ;AN000; +INT2F_LOW EQU (4*2FH) ; interrupt 2F vector location ;AN000; +INT2F_HI EQU (4*2FH)+2 ; ;AN000; +ONE EQU 1 ; ;AN000; +THREE EQU 3 ; ;AN000; +EIGHT EQU 8 ; ;AN000; +NINE EQU 9 ; ;AN000; +FOURTEEN EQU 14 ; ;AN000; +REQ_CRSR_POS EQU 3 ; function call to return cursor position ;AN000; +MODE7 EQU 7 ; ;AN000; +MODE13 EQU 13 ; ;AN000; +MODE15 EQU 15 ; ;AN000; +MODE19 EQU 19 ; ;AN000; + ; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +; +; Request Header Structure (INIT) +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +INIT_REQ_HDR STRUC ; INIT Request header structure ;AN000; + DB 13 DUP(?) ; standard request header ;AN000; +NUM_UNITS DB ? ; number of units (N/A) ;AN000; +END_ADDRESS_O DW ? ; ending address of resident code ;AN000; +END_ADDRESS_S DW ? ; ;AN000; +ARG_PTR DD ? ; ptr. to remaining arguments ;AN000; +DRIVE_NUM DB ? ; drive number (N/A) ;AN000; +CONFIG_ERRMSG dw 0 ;Flag to control "Error in CONFIG.SYS.." msg.;AN002; +INIT_REQ_HDR ENDS ; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Information Block Structure +; (for functionality call) +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +INFO_BLOCK STRUC ; information block for functionality call ;AN000; +STATIC_ADDRESS DD ? ; address of static functionality table ;AN000; + DB 33 DUP(?) ; don't care ;AN000; +ACTIVE_DISPLAY DB ? ; active display code ;AN000; +ALT_DISPLAY DB ? ; alternate display code ;AN000; + DB 3 DUP(?) ; don't care ;AN000; +CURRENT_SCANS DB ? ; current number of scan lines ;AN000; + DB 2 DUP(?) ; don't care ;AN000; +MISC_INFO DB ? ; miscellaneous state information ;AN000; + DB 18 DUP(?) ; don't care ;AN000; +INFO_BLOCK ENDS ; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Video table entry structure +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +MODE_TABLE STRUC ; ;AN000; +V_MODE DB -1 ; video mode ;AN000; +D_MODE DB -1 ; display mode ;AN000; +RESERVED_BYTE DB 0 ; reserved ;AN000; +COLORS DW -1 ; colors ;AN000; +SCR_WIDTH DW -1 ; screen width (pels) ;AN000; +SCR_LENGTH DW -1 ; screen length (pels) ;AN000; +SCR_COLS DW -1 ; number columns ;AN000; +SCR_ROWS DW -1 ; number rows ;AN000; +MODE_TABLE ENDS ; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Structure of Static Block +; (for functionality call +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +STATIC_BLOCK STRUC ; format of static functionality table ;AN000; + DB 7 DUP(?) ; don't care ;AN000; +SCAN_TEXT DB ? ; available scan lines in text modes ;AN000; +STATIC_BLOCK ENDS ; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Structure of System ID call return block +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +SYS_ID STRUC ; format of return system config data ;AN000; + DW ? ; don't care ;AN000; +MODEL_BYTE DB ? ; model byte ;AN000; +SYS_ID ENDS ; ;AN000; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; INT2f Strucs and Equates +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +MULT_ANSI EQU 1Ah ; ANSI multiplex number ;AC003; +;Catagory code +INSTALL_CHECK EQU 0 ; install check for ANSI ;AN000; +IOCTL_2F EQU 1 ; 2F interface to IOCTL ;AN000; +DA_INFO_2F EQU 2h ;J.K. Information passing to ANSI. +;Subfunction code for IOCTL_2F +GET_SUBFUNC EQU 7FH ; WGR Same structure as GET_IOCTL(ANSI);AN000; + +;Info Struture for DA_INFO_2F. (DS:DX point to this packet) +;J.K. Note: For DOS 4.00, DA_INFO_PACKET is used by DISPLAY.SYS to signal ANSI.SYS that +;DISPLAY.SYS is calling/finishing INT 10h SET MODE call. ANSI.SYS needs this +;infomration since it also hooks INT 10h vector. +;For this DA_SETMODE_FLAG purpose, DA_INFO_LEVEL and DA_INFO_DIRECTION should always be +;set to 0. This can be extended for another information passing scheme between +;DISPLAY.SYS and ANSI.SYS in the future version. +;For DA_SETMODE_FLAG, DISPLAY.SYS should be extremely careful that when it calls +;with DA_SETMODE_FLAG =1, then it should calls with DA_SETMODE_FLAG=0 +;when it finished INT 10h function call. Otherwise, the system goes ..... +; +;D425. At the request of OS2 compatibility box, when the user ask to ANSI +; with DA_INFO_LEVEL=1, then ANSI sets DA_OPTION_L_STATE based on /L option +; status. + +DA_INFO_PACKET struc +DA_INFO_LEVEL db 0 ; 0=used for SET_MODE_FLAG 1=for OPTION_L_STATE +DA_SETMODE_FLAG db 0 ; 1: DISPLAY.SYS is calling INT 10h call, SET MODE. 0=finished. +DA_OPTION_L_STATE db 0 ; 1 = /L active, 0 = /L inactive +DA_INFO_PACKET ends + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; GENERIC IOCTL Strucs and Equates +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; ;AN000; +DISPLAY_TYPE EQU 3 ; MAJ_FUNC type for display ;AN000; +GET_FUNC EQU 7FH ; MIN_FUNC for get subfunction ;AN000; +SET_FUNC EQU 5FH ; MIN_FUNC for set subfunction ;AN000; +REQ_VID_MODE EQU 0FH ; request video mode INT10h function call ;AN000; +DONE EQU 0100H ; set done bit for IOCTL status ;AN000; +CMD_ERROR EQU 8000H ; set error bit for IOCTL status ;AN000; +INVALID_FUNC EQU 1 ; invalid function ;AN000; +NOT_SUPPORTED EQU 10 ; return code non-supported ioctl function ;AN000; +NOT_AVAILABLE EQU 12 ; return code for font not available ;AN000; +TEXT_MODE EQU 1 ; text mode = 1 in request packet ;AN000; +GRAPHICS_MODE EQU 2 ; graphics mode = 2 ;AN000; +DEFAULT_LENGTH EQU 25 ; normal screen length ;AN000; +OFF EQU 0000H ; ;AN000; +ON EQU 0001H ; ;AN000; +INT_BIT EQU 00100000b ; mask for int. bit from functionality call ;AN000; +FOUND EQU 1 ; flag value for FOUND ;AN000; +NOT_FOUND EQU 0 ; flag value for not FOUND ;AN000; +SET_MODE EQU 0 ; set mode INT10H function number ;AN000; +DISPLAY_CHECK EQU 0AD00H ; install check for DISPLAY.SYS ;AN000; +CHECK_ACTIVE EQU 0AD02H ; active code page check for DISPLAY.SY;AN000; +INSTALLED EQU 0FFH ; present in AL if installed ;AN000; +LOAD_8X8 EQU 1112H ; register value for 8x8 ROM load ;AN000; +SET_BLOCK_0 EQU 1103H ; activate block = 0. ;AN000; +CHECK_FOR_FONT EQU 0AD10H ; check for 8x8 RAM font - DISPLAY.SYS ;AN000; +SELECT_SCAN EQU 30H ; subfunction to set scan lines (VGA) ;AN000; +SET_INTENSIFY EQU 0 ; value to enable intensify. ;AN000; +SET_BLINK EQU 1 ; value to enable blink. ;AN000; +BLINK_TOGGLE EQU 1003H ; INT10 call to toggle int/blink bit. ;AN000; +CURSOR_FLAG EQU 87H ; cursor flag byte in ROM_BIOS ;AN000; +SET_CURSOR_CALL EQU 1 ; INT10 function call to set cursor typ;AN000; +VIDEO_MASK EQU 7FH ; turn of clear buffer bit of mode value ;AN000; +MULT_ANSI EQU 1Ah ; ANSI multiplex number ;AC003; +INSTALL_CHECK EQU 0 ; install check for ANSI ;AN000; +IOCTL_2F EQU 1 ; 2F interface to IOCTL ;AN000; +NOT_CY EQU 0FFFEH ; turn carry bit off ;AN000; +CY EQU 1 ; turn carry bit off ;AN000; +INVALID_FLAGS EQU 0FFFEH ; test for invalid flags in control word ;AN000; +TURN_OFF EQU 0FEH ; values to turn off and on cursor.. ;AN000; +TURN_ON EQU NOT TURN_OFF ; emulation ;AN000; +SUB_SIZE EQU 11 ; sublist size ;AN000; +LEFT_ASCIIZ EQU 00010000B ; left-aligned asciiz string ;AN000; +UNLIMITED EQU 0 ; unlimited message size. ;AN000; + ; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Request Header Structure (Generic IOCTL) +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +INIT_REQ_HDR STRUC ; ;AN000; + DB 13 DUP(?) ; standard request header ;AN000; +MAJ_FUNC DB ? ; major function ;AN000; +MIN_FUNC DB ? ; minor function ;AN000; +IOCTL_SI DW ? ; contents of SI ;AN000; +IOCTL_DI DW ? ; contents of DI ;AN000; +REQ_PCKT_PTR DD ? ; pointer to request packet ;AN000; +INIT_REQ_HDR ENDS ; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; REQUEST PACKET STRUCTURE (Generic IOCTL) +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +REQ_PCKT STRUC ; ;AN000; +INFO_LEVEL DB ? ; information level (should be 0) ;AN000; + DB ? ; reserved ;AN000; +DATA_LENGTH DW ? ; length of remaining data ;AN000; +RP_FLAGS DW ? ; control flags ;AN000; +RP_MODE DB ? ; display mode ;AN000; +RESERVED2 DB ? ; reserved ;AN000; +RP_COLORS DW ? ; # of colors ;AN000; +RP_WIDTH DW ? ; screen width ;AN000; +RP_LENGTH DW ? ; screen length ;AN000; +RP_COLS DW ? ; columns ;AN000; +RP_ROWS DW ? ; rows ;AN000; +REQ_PCKT ENDS ; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Scan Lines available structure +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +SCAN_LINE_STR STRUC ; ;AN000; +NUM_LINES DW ? ; number of scan lines ;AN000; +REP_1BH DB ? ; representation in 1Bh call ;AN000; +REP_12H DB ? ; representation in 12h call ;AN000; +SCAN_LINE_STR ENDS ; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; SUBLIST struc +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +SUB_STRUC STRUC ; ;AN000; + DB 2 DUP(?) ; ;AN000; +SUB_PTR_O DW ? ; ;AN000; +SUB_PTR_S DW ? ; ;AN000; +SUB_STRUC ENDS ; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; RESULT BUFFER struc +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +RESULT_STRUC STRUC ; ;AN000; +RESULT_TYPE DB ? ; ;AN000; + DB ? ; ;AN000; +RES_SYN_PTR DW ? ; ;AN000; +RES_PTR DD ? ; ;AN000; +RESULT_STRUC ENDS ; ;AN000; diff --git a/v4.0/src/DEV/ANSI/ANSI.LNK b/v4.0/src/DEV/ANSI/ANSI.LNK new file mode 100644 index 0000000..1099d81 --- /dev/null +++ b/v4.0/src/DEV/ANSI/ANSI.LNK @@ -0,0 +1,8 @@ +ANSI.OBJ+ + IOCTL.OBJ+ + ANSIINIT.OBJ+ + PARSER.OBJ +ANSI.EXE +ANSI.MAP /M +; + \ No newline at end of file diff --git a/v4.0/src/DEV/ANSI/ANSI.SKL b/v4.0/src/DEV/ANSI/ANSI.SKL new file mode 100644 index 0000000..d797678 --- /dev/null +++ b/v4.0/src/DEV/ANSI/ANSI.SKL @@ -0,0 +1,16 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Message Skeleton file for ANSI.SYS +; +; Author: WGR +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +:util ANSI ; utility name + +:class A +:use 1 COMMON1 ; 'Incorrect DOS version' +:def 10 "Invalid parameter - %1",CR,LF ; 'Invalid parameter' + +:end + \ No newline at end of file diff --git a/v4.0/src/DEV/ANSI/ANSIINIT.ASM b/v4.0/src/DEV/ANSI/ANSIINIT.ASM new file mode 100644 index 0000000..352150e --- /dev/null +++ b/v4.0/src/DEV/ANSI/ANSIINIT.ASM @@ -0,0 +1,413 @@ +PAGE ,132 +TITLE ANSI Console device CON$INIT routine + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; MODULE_NAME: CON$INIT +; +; FUNCTION: +; THIS PROCEDURE PERFORMS ALL NECESSARY INITIALIZATION ROUTINES +; FOR ANSI.SYS. +; +; THIS ROUTINE WAS SPLIT FROM THE ORIGINAL ANSI.ASM SOURCE FILE +; FOR RELEASE 4.00 OF DOS. ALL CHANGED LINES HAVE BEEN MARKED WITH +; WGR. NEW PROCS HAVE BEEN MARKED AS SUCH. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;AN001; P1767 VIDEO_MODE_TABLE not initialized correctly 10/16/87 J.K. +;AN002; P2617 Order dependecy problem with Display.sys 11/23/87 J.K. +;AN003; D479 An option to disable the extended keyboard functions 02/12/88 J.K. +;AN004; D493 New INIT request structure for error message 02/25/88 J.K. +;------------------------------------------------------------------------------- + +INCLUDE ANSI.INC ; WGR equates and strucs ;AN000; +.XLIST +INCLUDE STRUC.INC ; WGR structured macros ;AN000; +.LIST + +PUBLIC CON$INIT ; WGR ;AN000; + + +CODE SEGMENT PUBLIC BYTE + ASSUME CS:CODE,DS:CODE + +EXTRN VIDEO_MODE_TABLE:BYTE ; WGR ;AN000; +EXTRN FUNC_INFO:BYTE ; WGR ;AN000; +EXTRN HDWR_FLAG:WORD ; WGR ;AN000; +EXTRN VIDEO_TABLE_MAX:ABS ; WGR ;AN000; +EXTRN SCAN_LINES:BYTE ; WGR ;AN000; +EXTRN PTRSAV:DWORD ; WGR ;AN000; +EXTRN PARSE_PARM:NEAR ; WGR ;AN000; +EXTRN ERR2:NEAR ; WGR ;AN000; +EXTRN EXT_16:BYTE ; WGR ;AN000; +EXTRN BRKADR:ABS ; WGR ;AN000; +EXTRN BRKKY:NEAR ; WGR ;AN000; +EXTRN COUT:NEAR ; WGR ;AN000; +EXTRN BASE:WORD ; WGR ;AN000; +EXTRN MODE:BYTE ; WGR ;AN000; +EXTRN MAXCOL:BYTE ; WGR ;AN000; +EXTRN TRANS:ABS ; WGR ;AN000; +EXTRN STATUS:ABS ; WGR ;AN000; +EXTRN EXIT:NEAR ; WGR ;AN000; +EXTRN MAX_SCANS:BYTE ; WGR ;AN000; +EXTRN ROM_INT10:WORD ; WGR ;AN000; +EXTRN INT10_COM:NEAR ; WGR ;AN000; +EXTRN ROM_INT2F:WORD ; WGR ;AN000; +EXTRN INT2F_COM:NEAR ; WGR ;AN000; +EXTRN ABORT:BYTE ; WGR ;AN000; +extrn Display_Loaded_Before_me:byte ;AN002;Defined in IOCTL.ASM +extrn Switch_K:Byte ;AN003; + +INCLUDE ANSIVID.INC ; WGR video tables data ;AN000; + +CON$INIT: + LDS BX,CS:[PTRSAV] ; WGR establish addressability to request header ;AC000; + LDS SI,[BX].ARG_PTR ; WGR DS:SI now points to rest of DEVICE=statement;AN000; + CALL PARSE_PARM ; WGR parse DEVICE= command line ;AN000; + JNC CONT_INIT ; WGR no error in parse...continue install ;AN000; + LDS BX,CS:[PTRSAV] ; WGR prepare to abort install ;AC000; + XOR AX,AX ; WGR ;AC000; + MOV [BX].NUM_UNITS,AL ; WGR set number of units to zero ;AC000; + MOV [BX].END_ADDRESS_O,AX ; WGR set ending address offset to 0 ;AC000; + MOV [BX].END_ADDRESS_S,CS ; WGR set ending address segment to CS ;AC000; + mov word ptr [bx].CONFIG_ERRMSG, -1 ;AN004; Let IBMBIO display "Error in CONFIG.SYS..". + MOV AX,UNKNOWN_CMD ; WGR set error in status ;AC000; + MOV WORD PTR [BX].STATUS,AX ; WGR set error status ;AC000; + JMP ERR2 ; WGR prepare to exit ;AN000; + +CONT_INIT: ; WGR ;AN000; + PUSH CS ; WGR ;AN000; + POP DS ; WGR restore DS to ANSI segment ;AN000; + MOV AX,ROM_BIOS ; WGR ;AN000; + MOV ES,AX ; WGR DS now points to BIOS data area ;AN000; + MOV AH,ES:[KBD_FLAG_3] ; WGR load AH with KBD_FLAG_3 ;AN000; + .IF AND ; WGR see if extended INT16 is loaded ;AN000; + .IF ;The user does not want to disable the extended INT 16h ;AN003; + MOV EXT_16,ON ; WGR extended INT16 available, set flag ;AN000; + .ENDIF ; WGR ;AN000; + CALL DET_HDWR ; WGR procedure to determine video hardware status;AN000; + .IF ; WGR if we have EGA or better then.. ;AN000; + MOV AH,ALT_SELECT ; WGR issue select alternate print.. ;AN000; + MOV BL,ALT_PRT_SC ; WGR screen routine call.. ;AN000; + INT 10H ; WGR ;AN000; + .ENDIF + CALL LOAD_INT10 ; WGR load interrupt 10h handler ;AN000; + CALL LOAD_INT2F ; WGR load interrupt 2Fh handler ;AN000; + int 11h + and al,00110000b + cmp al,00110000b + jnz iscolor + mov [base],0b000h ;look for bw card +iscolor: + cmp al,00010000b ;look for 40 col mode + ja setbrk + mov [mode],0 + mov [maxcol],39 + +setbrk: + XOR BX,BX + MOV DS,BX + MOV BX,BRKADR + MOV WORD PTR [BX],OFFSET BRKKY + MOV WORD PTR [BX+2],CS + + MOV BX,29H*4 + MOV WORD PTR [BX],OFFSET COUT + MOV WORD PTR [BX+2],CS + + LDS BX,CS:[PTRSAV] + MOV WORD PTR [BX].TRANS,OFFSET CON$INIT ;SET BREAK ADDRESS + MOV [BX].TRANS+2,CS + JMP EXIT + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: DET_HDWR +; +; FUNCTION: +; THIS CODE DETERMINES WHAT VIDEO HARDWARE IS AVAILABLE. THIS INFORMATION +; IS USED TO LOAD APPROPRIATE VIDEO TABLES INTO MEMORY FOR USE IN THE +; GENERIC IOCTL. +; +; AT ENTRY: +; +; AT EXIT: +; NORMAL: FLAG WORD WILL CONTAIN BITS SET FOR THE APPROPRIATE +; TABLES. IN ADDITION, FOR VGA SUPPORT, A FLAG BYTE +; WILL CONTAIN THE AVAILABLE SCAN LINE SETTINGS FOR THE +; INSTALLED ADAPTER. +; VIDEO TABLES WILL BE LOADED INTO MEMORY REFLECTING +; APPLICABLE MODE SETTINGS AND SCREEN LINE LENGTHS. +; +; ERROR: N/A +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +DET_HDWR PROC NEAR ;AN000; + MOV AH,GET_SYS_ID ; see if this is a Convertible ;AN000; + INT 15H ; ;AN000; + .IF AND ; yes...check for LCD attached? ;AN000; + MOV AH,GET_STATUS ; system status will tell us ;AN000; + INT 15H ; ;AN000; + .IF ; if bit 0 = 0 then LCD.. ;AN000; + OR HDWR_FLAG,LCD_ACTIVE ; so ...set hdwr flag and... ;AN000; + LEA SI,COLOR_TABLE ; ;AN000; + MOV CX,COLOR_NUM ; load color table (for LCD) ;AN000; + CALL LOAD_TABLE ; ;AN000; + LEA SI,MONO_TABLE ; and mono table ;AN000; + MOV CX,MONO_NUM ; ;AN000; + CALL LOAD_TABLE ; ;AN000; + .ELSE ; not LCD...check for CGA and mono ;AN000; + MOV AX,MONO_ADDRESS ; write to mono buffer to see if present ;AN000; + CALL CHECK_BUF ; ;AN000; + .IF ; if present then... ;AN000; + OR HDWR_FLAG,MONO_ACTIVE ; set hdwr flag and.. ;AN000; + LEA SI,MONO_TABLE ; ;AN000; + MOV CX,MONO_NUM ; load mono table ;AN000; + CALL LOAD_TABLE ; ;AN000; + .ENDIF ; ;AN000; + MOV AX,COLOR_ADDRESS ; write to CGA buffer to see if present ;AN000; + CALL CHECK_BUF ; ;AN000; + .IF ; if present then.. ;AN000; + OR HDWR_FLAG,CGA_ACTIVE ; set hdwr flag and... ;AN000; + LEA SI,COLOR_TABLE ; ;AN000; + MOV CX,COLOR_NUM ; load color table ;AN000; + CALL LOAD_TABLE ; ;AN000; + .ENDIF ; ;AN000; + .ENDIF ; ;AN000; + PUSH CS ; setup addressiblity for ;AN000; + POP ES ; functionality call ;AN000; + XOR AX,AX ; ;AN000; + MOV AH,FUNC_CALL ; functionality call ;AN000; + XOR BX,BX ; implementation type 0 ;AN000; + LEA DI,FUNC_INFO ; block to hold data ;AN000; + INT 10H ; ;AN000; + .IF ; if call supported then.. ;AN000; + .IF ; test bit to see if VGA ;AN000; + OR HDWR_FLAG,VGA_ACTIVE ; yes ....so ;AN000; + LEA SI,COLOR_TABLE ; set hdwr flag and... ;AN000; + MOV CX,COLOR_NUM ; load color table +.. ;AN000; + CALL LOAD_TABLE ; ;AN000; + LEA SI,VGA_TABLE ; load VGA table ;AN000; + MOV CX,VGA_NUM ; ;AN000; + CALL LOAD_TABLE ; ;AN000; + .ELSE ; not VGA...then must be MCGA ;AN000; + .IF <[DI].ACTIVE_DISPLAY EQ MOD30_MONO> OR ;AN000; + .IF <[DI].ACTIVE_DISPLAY EQ MOD30_COLOR> OR ;AN000; + .IF <[DI].ALT_DISPLAY EQ MOD30_MONO> OR ;AN000; + .IF <[DI].ALT_DISPLAY EQ MOD30_COLOR> ;AN000; + OR HDWR_FLAG,MCGA_ACTIVE ; so...set hdwr flag and... ;AN000; + LEA SI,COLOR_TABLE ; ;AN000; + MOV CX,COLOR_NUM ; load color table +.. ;AN000; + CALL LOAD_TABLE ; ;AN000; + LEA SI,MCGA_TABLE ; load MCGA table ;AN000; + MOV CX,MCGA_NUM ; ;AN000; + CALL LOAD_TABLE ; ;AN000; + .ENDIF ; ;AN000; + .ENDIF ; ;AN000; + MOV AL,[DI].CURRENT_SCANS ; copy current scan line setting.. ;AN000; + MOV MAX_SCANS,AL ; as maximum text mode scan setting. ;AN000; + LES DI,[DI].STATIC_ADDRESS ; point to static functionality table ;AN000; + MOV AL,ES:[DI].SCAN_TEXT ; load available scan line flag byte.. ;AN000; + MOV SCAN_LINES,AL ; and store it in resident data. ;AN000; + .ELSE ; call not supported..try EGA ;AN000; + MOV AH,ALT_SELECT ; alternate select call ;AN000; + MOV BL,EGA_INFO ; get EGA information subcall ;AN000; + INT 10H ; ;AN000; + .IF ; check if call was valid ;AN000; + .IF ; yes...check for monochrome ;AN000; + OR HDWR_FLAG,E5151_ACTIVE ; ..5151 found so set hdwr flag and.. ;AN000; + LEA SI,EGA_5151_TABLE ; ;AN000; + MOV CX,EGA_5151_NUM ; load 5151 table. ;AN000; + CALL LOAD_TABLE ; ;AN000; + .ELSE ; ;AN000; + AND CL,0FH ; clear upper nibble of switch setting byte ;AN000; + .IF OR ; test for switch settings of 5154 ;AN000; + .IF ; ..5154 found.. ;AN000; + OR HDWR_FLAG,E5154_ACTIVE ; so..set hdwr flag and... ;AN000; + LEA SI,COLOR_TABLE ; ;AN000; + MOV CX,COLOR_NUM ; load color table +.. ;AN000; + CALL LOAD_TABLE ; ;AN000; + LEA SI,EGA_5154_TABLE ; load 5154 table ;AN000; + MOV CX,EGA_5154_NUM ; ;AN000; + CALL LOAD_TABLE ; ;AN000; + .ELSE ; 5154 not found...must be 5153... ;AN000; + OR HDWR_FLAG,E5153_ACTIVE ; so..set hdwr flag and... ;AN000; + LEA SI,COLOR_TABLE ; ;AN000; + MOV CX,COLOR_NUM ; load color table +.. ;AN000; + CALL LOAD_TABLE ; ;AN000; + LEA SI,EGA_5153_TABLE ; load 5153 table ;AN000; + MOV CX,EGA_5153_NUM ; ;AN000; + CALL LOAD_TABLE ; ;AN000; + .ENDIF ; ;AN000; + .ENDIF ; ;AN000; + .ENDIF ; ;AN000; + .ENDIF ; ;AN000; + RET +DET_HDWR ENDP + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: CHECK_BUF +; +; FUNCTION: +; THIS PROCEDURE WRITES TO THE VIDEO BUFFER AND READS THE DATA BACK +; AGAIN TO DETERMINE THE EXISTANCE OF THE VIDEO CARD. +; +; AT ENTRY: +; +; AT EXIT: +; NORMAL: AH EQ AL IF BUFFER PRESENT +; AH NE AL IF NO BUFFER +; +; ERROR: N/A +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +CHECK_BUF PROC NEAR ; write to video buffer to see if it is present ;AN000; + PUSH DS ; ;AN000; + MOV DS,AX ; load DS with address of buffer ;AN000; + MOV CH,DS:0 ; save buffer information (if present) ;AN000; + MOV AL,55H ; prepare to write sample data ;AN000; + MOV DS:0,AL ; write to buffer ;AN000; + PUSH BX ; terminate the bus so that lines.. ;AN000; + POP BX ; are reset ;AN000; + MOV AH,DS:0 ; bring sample data back... ;AN000; + MOV DS:0,CH ; repair damage to buffer ;AN000; + POP DS ; ;AN000; + RET ;AN000; +CHECK_BUF ENDP + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: LOAD_TABLE +; +; FUNCTION: +; THIS PROCEDURE COPIES ONE OF THE VIDEO TABLES INTO RESIDENT DATA. +; IT MAY BE REPEATED TO LOAD SEVERAL TABLES INTO THE SAME DATA SPACE. +; MATCHING MODES WILL BE OVERWRITTEN...THEREFORE..CARE MUST BE TAKEN +; IN LOAD ORDERING. +; +; AT ENTRY: +; SI: POINTS TO TOP OF TABLE TO COPY +; CX: NUMBER OF RECORDS TO COPY +; +; AT EXIT: +; NORMAL: TABLE POINTED TO BY SI IS COPIED INTO RESIDENT DATA AREA +; +; ERROR: N/A +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +LOAD_TABLE PROC NEAR ;AN000; + PUSH DI ; save DI ;AN000; + PUSH ES ; and ES ;AN000; + PUSH CS ; setup ES to code segment ;AN000; + POP ES ; ;AN000; + LEA DI,VIDEO_MODE_TABLE ; point DI to resident video table ;AN000; + .WHILE AND ; do for as many records as there are ;AN000; + .WHILE ; check to ensure other data not overwritten ;AN000; + MOV AL,[DI].V_MODE ; prepare to check resident table ;AN000; + .IF AND ; if this spot is occupied...and ;AN000; + .IF ; ...is not the same mode then... ;AN000; + ADD DI,TYPE MODE_TABLE ; do not touch...go to next mode ;AN000; + .ELSE ; can write at this location ;AN000; + PUSH CX ; save record count ;AN000; + MOV CX,TYPE MODE_TABLE ; load record length ;AN000; + REP MOVSB ; copy record to resident data ;AN000; + lea DI,VIDEO_MODE_TABLE ;AN001; Set DI to the top of the target again. + POP CX ; restore record count and.. ;AN000; + DEC CX ; decrement ;AN000; + .ENDIF ; ;AN000; + .ENDWHILE ; ;AN000; + POP ES ; restore.. ;AN000; + POP DI ; registers ;AN000; + RET ; ;AN000; +LOAD_TABLE ENDP + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: LOAD_INT10 +; +; FUNCTION: +; THIS PROCEDURE LOADS THE INTERRUPT HANDLER FOR INT10H +; +; AT ENTRY: +; +; AT EXIT: +; NORMAL: INTERRUPT 10H VECTOR POINTS TO INT10_COM. OLD INT 10H +; VECTOR STORED. +; +; ERROR: N/A +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +LOAD_INT10 PROC NEAR ;AN000; + PUSH ES ;AN000; + XOR AX,AX ; point ES to low.. ;AN000; + MOV ES,AX ; memory. ;AN000; + MOV CX,ES:WORD PTR INT10_LOW ; store original.. ;AN000; + MOV CS:ROM_INT10,CX ; interrupt 10h.. ;AN000; + MOV CX,ES:WORD PTR INT10_HI ; location.. ;AN000; + MOV CS:ROM_INT10+2,CX ; ;AN000; + CLI ; ;AN000; + MOV ES:WORD PTR INT10_LOW,OFFSET INT10_COM ; replace vector.. ;AN000; + MOV ES:WORD PTR INT10_HI,CS ; with our own.. ;AN000; + STI ; ;AN000; + mov ax, DISPLAY_CHECK ;AN002;DISPLAY.SYS already loaded? + int 2fh ;AN002; + cmp al, INSTALLED ;AN002; + jne L_INT10_Ret ;AN002; + mov cs:Display_Loaded_Before_Me,1 ;AN002; +L_INT10_Ret: ;AN002; + POP ES ; ;AN000; + RET ; ;AN000; +LOAD_INT10 ENDP + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: LOAD_INT2F +; +; FUNCTION: +; THIS PROCEDURE LOADS THE INTERRUPT HANDLER FOR INT2FH +; +; AT ENTRY: +; +; AT EXIT: +; NORMAL: INTERRUPT 2FH VECTOR POINTS TO INT2F_COM. OLD INT 2FH +; VECTOR STORED. +; +; ERROR: N/A +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +LOAD_INT2F PROC NEAR ;AN000; + PUSH ES ;AN000; + XOR AX,AX ; point ES to low.. ;AN000; + MOV ES,AX ; memory. ;AN000; + MOV AX,ES:WORD PTR INT2F_LOW ; store original.. ;AN000; + MOV CS:ROM_INT2F,AX ; interrupt 2Fh.. ;AN000; + MOV CX,ES:WORD PTR INT2F_HI ; location.. ;AN000; + MOV CS:ROM_INT2F+2,CX ; ;AN000; + OR AX,CX ; check if old int2F.. ;AN000; + .IF Z ; is 0. ;AN000; + MOV AX,OFFSET ABORT ; yes....point to.. ;AN000; + MOV CS:ROM_INT2F,AX ; IRET. ;AN000; + MOV AX,CS ; ;AN000; + MOV CS:ROM_INT2F+2,AX ; ;AN000; + .ENDIF ; ;AN000; + CLI ; ;AN000; + MOV ES:WORD PTR INT2F_LOW,OFFSET INT2F_COM ; replace vector.. ;AN000; + MOV ES:WORD PTR INT2F_HI,CS ; with our own.. ;AN000; + STI ; ;AN000; + POP ES ; ;AN000; + RET ; ;AN000; +LOAD_INT2F ENDP ;AN000; + + +CODE ENDS + END diff --git a/v4.0/src/DEV/ANSI/ANSIVID.INC b/v4.0/src/DEV/ANSI/ANSIVID.INC new file mode 100644 index 0000000..77adb52 --- /dev/null +++ b/v4.0/src/DEV/ANSI/ANSIVID.INC @@ -0,0 +1,54 @@ +VGA_TABLE LABEL BYTE ;AN000; + MODE_TABLE < 1, 1,, 16, -1, -1, 40, -1> ; mode 1 Ŀ To give preference;AN000; + MODE_TABLE < 0, 1,, 16, -1, -1, 40, -1> ; mode 0 of COxx over ;AN000; + MODE_TABLE < 3, 1,, 16, -1, -1, 80, -1> ; mode 3 BWxx. ;AN000; + MODE_TABLE < 2, 1,, 16, -1, -1, 80, -1> ; mode 2 (see text) ;AN000; + MODE_TABLE < 7, 1,, 0, -1, -1, 80, -1> ; mode 7 ;AN000; + MODE_TABLE <13, 2,, 16, 320, 200, 40, 25> ; mode 13 ;AN000; + MODE_TABLE <14, 2,, 16, 640, 200, 80, 25> ; mode 14 ;AN000; + MODE_TABLE <15, 2,, 0, 640, 350, 80, 25> ; mode 15 ;AN000; + MODE_TABLE <16, 2,, 16, 640, 350, 80, 25> ; mode 16 ;AN000; + MODE_TABLE <17, 2,, 2, 640, 480, 80, 30> ; mode 17 ;AN000; + MODE_TABLE <18, 2,, 16, 640, 480, 80, 30> ; mode 18 ;AN000; + MODE_TABLE <19, 2,,256, 320, 200, 40, 25> ; mode 19 ;AN000; +VGA_NUM EQU ($ - VGA_TABLE)/(TYPE MODE_TABLE) ;AN000; + +MCGA_TABLE LABEL BYTE ;AN000; + MODE_TABLE <17, 2,, 2, 640, 480, 80, 30> ; mode 17 ;AN000; + MODE_TABLE <19, 2,,256, 320, 200, 40, 25> ; mode 19 ;AN000; +MCGA_NUM EQU ($ - MCGA_TABLE)/(TYPE MODE_TABLE) ;AN000; + +EGA_5154_TABLE LABEL BYTE ;AN000; + MODE_TABLE < 1, 1,, 16, -1, -1, 40, 43> ; mode 1 Ŀ To give preference;AN000; + MODE_TABLE < 0, 1,, 16, -1, -1, 40, 43> ; mode 0 of COxx over ;AN000; + MODE_TABLE < 3, 1,, 16, -1, -1, 80, 43> ; mode 3 BWxx. ;AN000; + MODE_TABLE < 2, 1,, 16, -1, -1, 80, 43> ; mode 2 (see text) ;AN000; + MODE_TABLE <13, 2,, 16, 320, 200, 40, 25> ; mode 13 ;AN000; + MODE_TABLE <14, 2,, 16, 640, 200, 80, 25> ; mode 14 ;AN000; + MODE_TABLE <16, 2,, 16, 640, 350, 80, 25> ; mode 16 ;AN000; +EGA_5154_NUM EQU ($ - EGA_5154_TABLE)/(TYPE MODE_TABLE) ;AN000; + +EGA_5153_TABLE LABEL BYTE ;AN000; + MODE_TABLE <13, 2,, 16, 320, 200, 40, 25> ; mode 13 ;AN000; + MODE_TABLE <14, 2,, 16, 640, 200, 80, 25> ; mode 14 ;AN000; +EGA_5153_NUM EQU ($ - EGA_5153_TABLE)/(TYPE MODE_TABLE) ;AN000; + +EGA_5151_TABLE LABEL BYTE ;AN000; + MODE_TABLE < 7, 1,, 0, -1, -1, 80, 43> ; mode 7 ;AN000; + MODE_TABLE <15, 2,, 0, 640, 350, 80, 25> ; mode 15 ;AN000; +EGA_5151_NUM EQU ($ - EGA_5151_TABLE)/(TYPE MODE_TABLE) ;AN000; + +MONO_TABLE LABEL BYTE ;AN000; + MODE_TABLE < 7, 1,, 0, -1, -1, 80, 25> ; mode 7 ;AN000; +MONO_NUM EQU ($ - MONO_TABLE)/(TYPE MODE_TABLE) ;AN000; + +COLOR_TABLE LABEL BYTE ;AN000; + MODE_TABLE < 1, 1,, 16, -1, -1, 40, 25> ; mode 1 Ŀ To give preference;AN000; + MODE_TABLE < 0, 1,, 16, -1, -1, 40, 25> ; mode 0 of COxx over ;AN000; + MODE_TABLE < 3, 1,, 16, -1, -1, 80, 25> ; mode 3 BWxx. ;AN000; + MODE_TABLE < 2, 1,, 16, -1, -1, 80, 25> ; mode 2 (see text) ;AN000; + MODE_TABLE < 4, 2,, 4, 320, 200, 40, 25> ; mode 4 ;AN000; + MODE_TABLE < 5, 2,, 2, 320, 200, 40, 25> ; mode 5 ;AN000; + MODE_TABLE < 6, 2,, 2, 640, 200, 80, 25> ; mode 6 ;AN000; +COLOR_NUM EQU ($ - COLOR_TABLE)/(TYPE MODE_TABLE) ;AN000; + \ No newline at end of file diff --git a/v4.0/src/DEV/ANSI/IOCTL.ASM b/v4.0/src/DEV/ANSI/IOCTL.ASM new file mode 100644 index 0000000..506e06c --- /dev/null +++ b/v4.0/src/DEV/ANSI/IOCTL.ASM @@ -0,0 +1,1126 @@ +PAGE ,132 +TITLE ANSI Generic IOCTL Code + +;****************** START OF SPECIFICATIONS ************************** +; +; MODULE NAME: IOCTL.ASM +; +; DESCRIPTIVE NAME: PERFORM THE GENERIC IOCTL CALL IN ANSI.SYS +; +; FUNCTION: THE GENERIC DEVICE IOCTL IS USED TO SET AND GET THE +; MODE OF THE DISPLAY DEVICE ACCORDING TO PARAMETERS PASSED +; IN A BUFFER. ADDITIONALLY, THE CALL CAN TOGGLE THE +; USE OF THE INTENSITY BIT, AND CAN LOAD THE 8X8 CHARACTER +; SET, EFFECTIVELY GIVING MORE LINES PER SCREEN. THE +; AVAILABILITY OF THIS FUNCTION VARIES STRONGLY WITH HARDWARE +; ATTACHED. +; +; ENTRY POINT: GENERIC_IOCTL +; +; INPUT: LOCATION OF REQUEST PACKET STORED DURING STRATEGY CALL. +; +; AT EXIT: +; NORMAL: CARRY CLEAR - DEVICE CHARACTERISTICS SET +; +; ERROR: CARRY SET - ERROR CODE IN AX. +; AX = 1 - INVALID FUNCTION. EXTENDED ERROR = 20 +; AX = 10 - UNSUPPORTED FUNCTION ON CURRENT HARDWARE. +; EXTENDED ERROR = 29 +; AX = 12 - DISPLAY.SYS DOES NOT HAVE 8X8 RAM CHARACTER SET. +; EXTENDED ERROR = 31 +; +; INTERNAL REFERENCES: +; +; ROUTINES: GET_IOCTL - PERFORMS THE GET DEVICE CHARACTERISTICS +; SET_IOCTL - PERFORMS THE SET DEVICE CHARACTERISTICS +; TEST_LENGTH - TESTS FOR VALIDITY OF A SCREEN SIZE VALUE +; CTL_FLAG - READS THE CURRENT USE FOR THE INT/BLINK BIT +; SET_CTL_FLAG - SETS THE USE FOR THE INT/BLINK BIT +; GET_SEARCH - SEARCHES THE INTERNAL VIDEO TABLE FOR THE +; CURRENT MODE MATCH +; SET_SEARCH - SEARCHES THE INTERNAL VIDEO TABEL FOR THE +; CURRENT MODE MATCH +; SET_CURSOR_EMUL - SETS THE BIT THAT CONTROLS CURSOR EMULATION +; INT10_COM - INTERRUPT 10H HANDLER TO KEEP CURRENT SCREEN SIZE +; INT2F_COM - INTERRUPT 2FH INTERFACE TO GENERIC IOCTL +; MAP_DOWN - PERFORMS CURSOR TYPE MAPPING FOR EGA WITH MONOCHROME +; SET_VIDEO_MODE - SETS THE VIDEO MODE +; ROM_LOAD_8X8 - LOADS THE 8X8 CHARACTER SET. +; PROCESS_NORMAL - DOES THE SET PROCESS FOR ADAPTERS OTHER THAN +; THE VGA +; PROCESS_VGA - DOES THE SET PROCESS FOR THE VGA ADAPTER +; CHECK_FOR_DISPLAY - CHECKS FOR DISPLAY.SYS SUPPORT +; +; DATA AREAS: SCAN_LINE_TABLE - HOLDS SCAN LINE INFORMATION FOR PS/2 +; FUNC_INFO - BUFFER FOR PS/2 FUNCTIONALITY CALL. +; +; +; EXTERNAL REFERENCES: +; +; ROUTINES: INT 10H SERVICES +; +; DATA AREAS: VIDEO_MODE_TABLE - INTERNAL TABLE FOR CHARACTERISTICS TO MODE +; MATCH-UPS +; +; NOTES: +; +; REVISION HISTORY: +; +; Label: "DOS ANSI.SYS Device Driver" +; "Version 4.00 (C) Copyright 1988 Microsoft" +; "Licensed Material - Program Property of Microsoft" +; +;****************** END OF SPECIFICATIONS **************************** +;Modification history ********************************************************* +;AN001; P1350 Codepage switching not working on EGA 10/10/87 J.K. +;AN002; P1626 ANSI does not allow lines=43 with PS2,Monochrome 10/15/87 J.K. +;AN003; p1774 Lines=43 after selecting cp 850 does not work 10/20/87 J.K. +;AN004; p1740 MODE CON LINES command causes problem with PE2 w PS/210/24/87 J.K. +;AN005; p2167 Does'nt say EGA in medium resol. cannot do 43 lines 10/30/87 J.K. +;AN006; p2236 After esc [=0h, issuing INT10h,AH=fh returns mode=1. 11/3/87 J.K. +;AN007; p2305 With ANSI loaded, loading RDTE hangs the system 11/06/87 J.K. +;AN008; P2617 Order dependecy problem with Display.sys 11/23/87 J.K. +;AN009; p2716 HOT key of VITTORIA does not work properly 12/03/87 J.K. +;AN010; d398 /L option for Enforcing the number of lines 12/17/87 J.K. +;AN011; D425 For OS2 compatibiltiy box, /L option status query 01/14/88 J.K. +;****************************************************************************** + +INCLUDE ANSI.INC ;AN000; +.XLIST ;AN000; +INCLUDE STRUC.INC ;AN000; +.LIST ;AN000; + ;AN000; +PUBLIC GENERIC_IOCTL ;AN000; +PUBLIC FUNC_INFO ;AN000; +PUBLIC MAX_SCANS ;AN000; +PUBLIC INT10_COM ;AN000; +PUBLIC ROM_INT10 ;AN000; +PUBLIC INT2F_COM ;AN000; +PUBLIC ROM_INT2F ;AN000; +PUBLIC ABORT ;AN000; +PUBLIC REQ_TXT_LENGTH ;AN000; +PUBLIC GRAPHICS_FLAG ;AN000; +public Display_Loaded_Before_Me ;AN008; + ;AN000; +CODE SEGMENT PUBLIC BYTE ;AN000; + ASSUME CS:CODE,DS:CODE ;AN000; + ;AN000; +EXTRN PTRSAV:DWORD ;AN000; +EXTRN NO_OPERATION:NEAR ;AN000; +EXTRN ERR1:NEAR ;AN000; +EXTRN VIDEO_MODE_TABLE:BYTE ;AN000; +extrn MAX_VIDEO_TAB_NUM:ABS +EXTRN HDWR_FLAG:WORD ;AN000; +EXTRN SCAN_LINES:BYTE ;AN000; +extrn Switch_L:Byte ;AN010;Defined in ANSI.ASM + ;AN000; + ;AN000; +SCAN_LINE_TABLE LABEL BYTE ;AN000; + SCAN_LINE_STR <200,000000001B,0> ; 200 scan lines ;AN000; + SCAN_LINE_STR <344,000000010B,1> ; 350 scan lines ;AN000; + SCAN_LINE_STR <400,000000100B,2> ; 400 scan lines ;AN000; +SCANS_AVAILABLE EQU ($ - SCAN_LINE_TABLE)/TYPE SCAN_LINE_STR ;AN000; + ;AN000; +;This is used when ANSI calls Get_IOCTL, Set_IOCTL by itself. +In_Generic_IOCTL_flag db 0 ;AN004; +I_AM_IN_NOW EQU 00000001b ;AN004; +SET_MODE_BY_DISPLAY EQU 00000010b ;AN004;Display.sys calls Set mode INT 10h. +CALLED_BY_INT10COM EQU 00000100b ;AN009;To prevent from calling set mode int 10h again. + +INT10_V_Mode db 0ffh ;AN006;Used by INT10_COM + +My_IOCTL_Req_Packet REQ_PCKT <0,0,0Eh,0,?,0,?,?,?,?,?> ;AN004; + ;AN000; +FUNC_INFO INFO_BLOCK <> ; data block for functionality call ;AN000; +ROM_INT10 DW ? ; segment and offset of original.. ;AN000; + DW ? ; interrupt 10h vector. ;AN000; +ROM_INT2F DW ? ; segment and offset of original.. ;AN000; + DW ? ; interrupt 2Fh vector. ;AN000; +INTENSITY_FLAG DW OFF ; intensity flag initially off ;AN000; +REQ_TXT_LENGTH DW DEFAULT_LENGTH ; requested text screen length ;AN000; +SCAN_DESIRED DB 0 ; scan lines desired ;AN000; +MAX_SCANS DB 0 ; maximum scan line setting ;AN000; +GRAPHICS_FLAG DB TEXT_MODE ; flag for graphics mode ;AN000; +ERROR_FLAG DB OFF ; flag for error conditions ;AN000; +Display_Loaded_Before_Me db 0 ;AN008;flag +ANSI_SetMode_Call_Flag db 0 ;AN008;Ansi is issuing INT10,AH=0. + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: GENERIC_IOCTL +; +; FUNCTION: +; TO GET OR SET DEVICE CHARACTERISTICS ACCORDING TO THE BUFFER PASSED +; IN THE REQUEST PACKET. +; +; AT ENTRY: +; +; AT EXIT: +; NORMAL: CARRY CLEAR - DEVICE CHARACTERISTICS SET +; +; ERROR: CARRY SET - ERROR CODE IN AL. (SEE MODULE DESCRIPTION ABOVE). +; +; NOTE: THIS PROC IS PERFORMED AS A JMP AS WITH THE OLD ANSI CALLS. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +GENERIC_IOCTL: ; ;AN000; + LES BX,[PTRSAV] ; establish addressability to request header ;AN000; + .SELECT ; check for get or set subfunction ;AN000; + .WHEN ; is this the get subfunction? ;AN000; + LES DI,ES:[BX].REQ_PCKT_PTR ; point to request packet ;AN000; + CALL GET_IOCTL ; yes...execute routine ;AN000; + .WHEN ; is this the set subfunction? ;AN000; + LES DI,ES:[BX].REQ_PCKT_PTR ; point to request packet ;AN000; + CALL SET_IOCTL ; yes....execute routine ;AN000; + .OTHERWISE ; not for us....so.. ;AN000; + JMP NO_OPERATION ; call lower CON device ;AN000; + .ENDSELECT ; ;AN000; + .IF C ; error?.... ;AN000; + OR AX,CMD_ERROR ; yes...set error bit in status ;AN000; + .ENDIF ; ;AN000; + OR AX,DONE ; add done bit to status ;AN000; + JMP ERR1 ; return with status in AX ;AN000; + ;AN000; + ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: GET_IOCTL +; +; FUNCTION: +; THIS PROCEDURE RETURNS DEVICE CHARACTERISTICS. +; +; AT ENTRY: ES:DI POINTS TO REQUEST BUFFER +; +; AT EXIT: +; NORMAL: CARRY CLEAR - REQUEST BUFFER CONTAINS DEVICE CHARACTERISTICS +; +; ERROR: CARRY SET - ERROR CONDITION IN AX +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +GET_IOCTL PROC NEAR ;AN000; + .IF OR ; check for valid info level ;AN000; + .IF > ; and buffer size. ;AN000; + MOV AX,INVALID_FUNC ; not valid...unsupported ;AN000; + STC ; function..set error flag and ;AN000; + .ELSE ; ;AN000; + MOV ES:[DI].INFO_LEVEL+1,0 ; set reserved byte to 0. ;AN000; + MOV AH,REQ_VID_MODE ; request current video mode ;AN000; + INT 10H ; ;AN000; + AND AL,VIDEO_MASK ; ;AN000; + LEA SI,VIDEO_MODE_TABLE ; point to resident video table ;AN000; + CALL GET_SEARCH ; perform search ;AN000; + .IF C ; found? ;AN000; + MOV AX,NOT_SUPPORTED ; no....load unsupported function ;AN000; + .ELSE ; ;AN000; + push di ;AN001;AN003;Save Request Buffer pointer + MOV WORD PTR ES:[DI].DATA_LENGTH,(TYPE MODE_TABLE)+1 ;length of data is struc size ;AN000; + INC SI ; skip mode value ;AN000; + ADD DI,RP_FLAGS ; point to flag word ;AN000; + .IF ; if we have an EGA or better ;AN000; + CALL CTL_FLAG ; then ..process control flag ;AN000; + .ELSE ; else... ;AN000; + MOV WORD PTR ES:[DI],OFF ; we always have blink. ;AN000; + .ENDIF ; ;AN000; + INC DI ; point to next field.. ;AN000; + INC DI ; ..(display mode) ;AN000; + MOV CX,(TYPE MODE_TABLE)-1 ; load count ;AN000; + REP MOVSB ; transfer data from video table to request packet;AN000; + SUB SI,TYPE MODE_TABLE ; point back to start of mode data ;AN000; + .IF <[SI].D_MODE EQ TEXT_MODE> AND ; if we are in text mode and.. ;AN000; + .IF <[SI].SCR_ROWS NE DEFAULT_LENGTH> ; length <> 25 then we have an EGA or VGA ;AN000; + DEC DI ; point back to length entry in req packet ;AN000; + DEC DI ; ;AN000; + PUSH DS ; ;AN000; + MOV AX,ROM_BIOS ; load ROM BIOS data area segment ;AN000; + MOV DS,AX ; ;AN000; + MOV AL,BYTE PTR DS:[NUM_ROWS] ; load current number of rows ;AN000; + CBW ; ;AN000; + INC AX ; add 1 to row count ;AN000; + MOV WORD PTR ES:[DI],AX ; and copy to request packet ;AN000; + POP DS ; ;AN000; + .ENDIF ; ;AN000; + XOR AX,AX ; no errors ;AN000; + CLC ; clear error flag ;AN000; + pop di ;AN001; AN003;Restore Request Buffer pointer + .ENDIF ; ;AN000; + .ENDIF ; ;AN000; + RET ; return to calling module ;AN000; +GET_IOCTL ENDP ;AN000; + ;AN000; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: SET_IOCTL +; +; FUNCTION: +; THIS PROCEDURE SETS THE VIDEO MODE AND CHARACTER SET ACCORDING +; TO THE CHARACTERSTICS PROVIDED. +; +; AT ENTRY: +; ES:[DI] POINTS TO REQUEST BUFFER +; +; AT EXIT: +; NORMAL: CLEAR CARRY - VIDEO MODE SET +; +; ERROR: CARRY SET - ERROR CONDITION IN AX +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +SET_IOCTL PROC NEAR ;AN000; + or cs:In_Generic_IOCTL_Flag, I_AM_IN_NOW ;AN004; Signal GENERIC_IOCTL request being processed + MOV ERROR_FLAG,OFF ; clear any errors ;AN000; + .IF OR ; check for valid info level ;AN000; + .IF > OR ; and buffer size. ;AN000; + MOV AX,ES:[DI].RP_FLAGS ; test for invalid flags. ;AN000; + .IF OR ; ;AN000; + .IF AND ; if intensity is requested and.. ;AN000; + .IF ; hardware does not support it then.. ;AN000; + MOV AX,INVALID_FUNC ; not valid...unsupported.. ;AN000; + MOV ERROR_FLAG,ON ; function..set error and.. ;AN000; + .ELSE ; ;AN000; + CALL SET_SEARCH ; search table for match ;AN000; + .IF C ; if match not found then.. ;AN000; + MOV AX,NOT_SUPPORTED ; not supported.... ;AN000; + MOV ERROR_FLAG,ON ; ;AN000; + .ELSE ; ;AN000; + .IF <[SI].D_MODE EQ TEXT_MODE> ; is a text mode being requested? ;AN000; + PUSH REQ_TXT_LENGTH ; save old value in case of error ;AN000; + MOV AX,ES:[DI].RP_ROWS ; save new requested value. ;AN000; + MOV REQ_TXT_LENGTH,AX ; ;AN000; +; .IF <[SI].SCR_ROWS NE UNOCCUPIED> ; yes...check for VGA support.. ;AN000; +; CALL PROCESS_NORMAL ; no..process other adapters.. ;AN000; +; .ELSE ; VGA support available.. ;AN000; +; CALL PROCESS_VGA ; process the VGA support code. ;AN000; +; .ENDIF ; ;AN000; + .IF <[SI].SCR_ROWS E UNOCCUPIED> OR ;AN002; + .IF ;AN002; + call process_VGA ;AN002; + .ELSE ;AN002; + call process_Normal ;AN002; + .ENDIF ;AN002; + .IF ; if we had no errors then.. ;AN000; + POP AX ; discard saved text length ;AN000; + call DO_ROWS ;AN004; + .IF ; does hardware support gt 25 lines? ;AN000; + CALL SET_CURSOR_EMUL ; yes..ensure cursor emulation is.. ;AN000; + .ENDIF ; set accordingly. ;AN000; + .ELSE ; ;AN000; + POP REQ_TXT_LENGTH ; error...so restore old value. ;AN000; + .ENDIF ; ;AN000; + .ELSE ; request is for graphics mode ;AN000; + CALL SET_VIDEO_MODE ; so set video mode. ;AN000; + .ENDIF ; ;AN000; + .IF AND ; no errors? then.. ;AN000; + .IF AND ; for the EGA and better .... ;AN000; + .IF <[SI].V_MODE EQ TEXT_MODE> ; and in text mode do... ;AN000; + CALL SET_CTL_FLAG ; set intensity bit to control value ;AN000; + .ENDIF ; ;AN000; + .ENDIF ; ;AN000; + .ENDIF ; ;AN000; + and cs:In_Generic_IOCTL_Flag, NOT I_AM_IN_NOW ;AN004; Turn the flag off + .IF ; no errors? ;AN000; + XOR AX,AX ; clear error register ;AN000; + CLC ; clear error flag ;AN000; + .ELSE ; ;AN000; + STC ; ;AN000; + .ENDIF ; yes...set error flag ;AN000; + RET ; ;AN000; +SET_IOCTL ENDP ;AN000; + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: PROCESS_NORMAL +; +; FUNCTION: +; THIS PROCEDURE PROCESSES THE SET IOCTL FOR ADAPTERS OTHER THAN +; THE VGA. +; +; AT ENTRY: AX - SCREEN LENGTH DESIRED +; DS:SI - POINTS TO MODE RECORD IN VIDEO TABLE. +; +; AT EXIT: +; NORMAL: MODE SET +; +; ERROR: ERROR_FLAG IS ON. ERROR CODE IN AX. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +PROCESS_NORMAL PROC NEAR ;AN000; + .IF AND ; no..see if length requested.. ;AN000; + .IF ; is valid.... ;AN000; + MOV AX,NOT_SUPPORTED ; not valid....so ;AN000; + MOV ERROR_FLAG,ON ; set error flag and.. ;AN000; + .ELSE ; length is valid so.. ;AN000; + CALL CHECK_FOR_DISPLAY ; see if we need and have DISPLAY.SYS.. ;AN000; + .IF NC ; support...if no problems then.. ;AN000; + .IF ; yes...check for cursor emulation ;AN000; + CALL SET_CURSOR_EMUL ; ;AN000; + .ENDIF ; ;AN000; + CALL SET_VIDEO_MODE ; ..and set the mode. ;AN000; + .ELSE ; no.. ;AN000; + MOV AX,NOT_AVAILABLE ; font not available.. ;AN000; + MOV ERROR_FLAG,ON ; ;AN000; + .ENDIF ; ;AN000; + .ENDIF ; ;AN000; + RET +PROCESS_NORMAL ENDP + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: PROCESS_VGA +; +; FUNCTION: +; THIS PROCEDURE PROCESSES THE SET IOCTL FOR THE VGA ADAPTER +; +; AT ENTRY: AX - SCREEN LENGTH DESIRED +; DS:SI - POINTS TO MODE RECORD IN VIDEO TABLE. +; +; AT EXIT: +; NORMAL: MODE SET +; +; ERROR: ERROR_FLAG IS ON. ERROR CODE IN AX. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +PROCESS_VGA PROC NEAR ;AN000; + CALL TEST_LENGTH ; check to see if screen length ;AN000; + .IF C ; is applicable.... ;AN000; + MOV AX,NOT_SUPPORTED ; no..so set error condition ;AN000; + MOV ERROR_FLAG,ON ; ;AN000; + .ELSE ; ;AN000; + CALL CHECK_FOR_DISPLAY ; see if we need and have DISPLAY.SYS.. ;AN000; + .IF NC ; support.....yes so.. ;AN000; + .IF ; 25 lines requested? ;AN000; + MOV AL,MAX_SCANS ; desired scan setting should be.. ;AN000; + MOV SCAN_DESIRED,AL ; the maximum. ;AN000; + .ENDIF ; ;AN000; + MOV AH,ALT_SELECT ; set the appropriate number.. ;AN000; + MOV BL,SELECT_SCAN ; of scan lines.. ;AN000; + MOV AL,SCAN_DESIRED ; ;AN000; + INT 10H ; ;AN000; + CALL SET_VIDEO_MODE ; and set the mode. ;AN000; + .ELSE ; DISPLAY.SYS does not have the font. ;AN000; + MOV AX,NOT_AVAILABLE ; so...load error code.. ;AN000; + MOV ERROR_FLAG,ON ; ;AN000; + .ENDIF ; ;AN000; + .ENDIF ; ;AN000; + RET ;AN000; +PROCESS_VGA ENDP ;AN000; + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Procedure name: DO_ROWS +; Function: +; Only called for TEXT_MODE. +; If (REQ_TXT_LENGTH <> DEFAULT_LENGTH) & +; (DISPLAY.SYS not loaded or CODEPAGE not active) +; then +; LOAD ROM 8X8 charater. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +DO_ROWS proc near ;AN004; + .IF ;AN004; + push ds ;AN004; + push es ;AN004; + push di ;AN004; + push si ;AN004; + mov ax, DISPLAY_CHECK ;AN004; + int 2fh ;AN004; + .IF OR ;AN004; + mov ax, CHECK_ACTIVE ;AN004; + int 2fh ;AN004; + .IF C ;AN004; + call ROM_LOAD_8X8 ;AN004; + .ENDIF ;AN004; + pop si ;AN004; + pop di ;AN004; + pop es ;AN004; + pop ds ;AN004; + .ENDIF ;AN004; + ret ;AN004; +DO_ROWS endp ;AN004; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: TEST_LENGTH +; +; FUNCTION: +; THIS PROCEDURE ENSURES THAT THE SCREEN LENGTH REQUESTED CAN BE +; OBTAINED USING THE AVAILABLE SCAN LINE SETTINGS. (VGA ONLY!) +; +; AT ENTRY: +; +; +; AT EXIT: +; NORMAL: CARRY CLEAR - SCAN_DESIRED CONTAINS SETTING REQUIRED +; +; ERROR: CARRY SET +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +TEST_LENGTH PROC NEAR ;AN000; + push bp ;AN007; + MOV AX,REQ_TXT_LENGTH ; load AX with length requested ;AN000; + MOV BP,EIGHT ; ;AN000; + MUL BP ; mulitply by 8 to get scan lines ;AN000; + LEA BX,SCAN_LINE_TABLE ; load BX with scan line table start ;AN000; + MOV CX,SCANS_AVAILABLE ; total number of scan lines settings ;AN000; + MOV BP,NOT_FOUND ; set flag ;AN000; + .WHILE AND ; while not found and still valid.. ;AN000; + .WHILE ; settings left..do.. ;AN000; + .IF ; pointing at the right setting.. ;AN000; + MOV DL,[BX].REP_1BH ; ;AN000; + .IF ; does the hardware have it?.. ;AN000; + MOV BP,FOUND ; yes....found!! ;AN000; + .ELSE ; ;AN000; + XOR CX,CX ; no...set CX to exit loop. ;AN000; + .ENDIF ; ;AN000; + .ELSE ; ;AN000; + ADD BX,TYPE SCAN_LINE_STR ; not this setting..point to next ;AN000; + DEC CX ; record and decrement count ;AN000; + .ENDIF ; ;AN000; + .ENDWHILE ; ;AN000; + .IF ; was it found and available? ;AN000; + STC ; no....set error flag ;AN000; + .ELSE ; yes so..... ;AN000; + MOV CL,[BX].REP_12H ; store value to set it. ;AN000; + MOV SCAN_DESIRED,CL ; ;AN000; + CLC ; clear error flag ;AN000; + .ENDIF ; ;AN000; + pop bp ;AN007; + RET ; return to calling module ;AN000; +TEST_LENGTH ENDP ;AN000; + ;AN000; + ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: CTL_FLAG +; +; FUNCTION: +; THIS PROCEDURE RETURNS THE CURRENT USE FOR THE INTENSITY/BLINKING +; BIT. +; +; AT ENTRY: +; +; AT EXIT: +; NORMAL: +; VGA,MCGA: VALUE RETURNED FROM FUNCTIONALITY CALL +; EGA: VALUE LAST SET THROUGH IOCTL. DEFAULT IS BLINKING. +; CGA,MONO: BLINKING +; +; ERROR: N/A +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;AN000; +CTL_FLAG PROC NEAR ;AN000; + .IF ; VGA supported? ;AN000; + PUSH ES ; yes...prepare for ;AN000; + PUSH DI ; functionality call ;AN000; + PUSH DS ; ;AN000; + POP ES ; ;AN000; + LEA DI,FUNC_INFO ; point to data block ;AN000; + MOV AH,FUNC_CALL ; load function number ;AN000; + XOR BX,BX ; implementation type 0 ;AN000; + INT 10H ; ;AN000; + MOV AL,ES:[DI].MISC_INFO ; load misc info byte ;AN000; + .IF ; is blink bit set? ;AN000; + AND INTENSITY_FLAG,NOT ON ; yes....turn off intensity flag ;AN000; + .ELSE ; no... ;AN000; + OR INTENSITY_FLAG,ON ; ensure that intensity is set ;AN000; + .ENDIF ; ;AN000; + POP DI ; restore registers ;AN000; + POP ES ; ;AN000; + .ENDIF ; ;AN000; + MOV AX,INTENSITY_FLAG ; write the control flag.. ;AN000; + MOV ES:[DI],AX ; to the request packet ;AN000; + RET ; ;AN000; +CTL_FLAG ENDP ;AN000; + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: SET_CTL_FLAG +; +; FUNCTION: +; THIS PROCEDURE SET THE TOGGLE/INTENSITY BIT AS SPECIFIED IN THE +; CONTROL FLAG IOCTL SET SUBFUNCTION. THIS ROUTINE IS ONLY CALLED FOR +; AN EGA, MCGA, OR VGA. +; +; AT ENTRY: ES:DI POINTS TO REQUEST BUFFER +; +; AT EXIT: +; NORMAL: INTENSITY_FLAG SET APPROPRIATELY AND SYSTEM BIT SET +; +; ERROR: N/A +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +SET_CTL_FLAG PROC NEAR ;AN000; + .IF ;AN000; + OR INTENSITY_FLAG,ON ;AN000; + MOV BL,SET_INTENSIFY ;AN000; + .ELSE ;AN000; + AND INTENSITY_FLAG,NOT ON ;AN000; + MOV BL,SET_BLINK ;AN000; + .ENDIF ;AN000; + MOV AX,BLINK_TOGGLE ;AN000; + INT 10H ;AN000; + RET ;AN000; +SET_CTL_FLAG ENDP + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: SET_SEARCH +; +; FUNCTION: +; THIS PROCEDURE SEARCHES THE RESIDENT VIDEO TABLE IN ATTEMPT TO +; FIND A MODE THAT MATHCES THE CHARACTERISTICS REQUESTED. +; +; AT ENTRY: +; +; AT EXIT: +; NORMAL: CARRY CLEAR - SI POINTS TO APPLICABLE RECORD +; +; ERROR: CARRY SET +; +;AN006; When INT10_V_Mode <> 0FFH, then assumes that the user +; issuing INT10h, Set mode function call. Unlike Generic IOCTL +; set mode call, the user already has taken care of the video mode. +; So, we also find the matching V_MODE. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;AN000; +SET_SEARCH PROC NEAR ;AN000; + push bp ;AN007; + LEA SI,VIDEO_MODE_TABLE ; point to video table ;AN000; + MOV BP,NOT_FOUND ; set flag indicating not found ;AN000; + MOV CX,MAX_VIDEO_TAB_NUM ; load counter, # of tables ;AN000; + .WHILE AND ; while not found and we still.. ;AN000; + .WHILE <[SI].V_MODE NE UNOCCUPIED> AND ; have valid entries.. ;AN000; + .WHILE ; do... ;AN000; + mov al, cs:INT10_V_Mode ;AN006; + .if AND ;AN006;if issued by INT10h Set Mode call, + .if <[SI].V_MODE NE AL> ;AN006; and V_MODE <> AL + add si, type MODE_TABLE ;AN006; then, this is not the correct entry. + dec cx ;AN006;Let's find the next entry. + .else ;AN006; Else, continue... + MOV AL,ES:[DI].RP_MODE ; load register for compare. ;AN000; + .IF <[SI].D_MODE EQ AL> ; match?...... ;AN000; + MOV AX,ES:[DI].RP_COLORS ; yes...prepare next field ;AN000; + .IF <[SI].COLORS EQ AX> ; match?... ;AN000; + .IF ; yes...ensure reserved byte is 0 ;AN000; + .IF ; for graphics mode..check the following;AN000;. + MOV AX,ES:[DI].RP_WIDTH ; screen width. ;AN000; + .IF <[SI].SCR_WIDTH EQ AX> ; ;AN000; + MOV AX,ES:[DI].RP_LENGTH ; screen length ;AN000; + .IF <[SI].SCR_LENGTH EQ AX> ; (ignore #rows and #columns ;AN000; + MOV BP,FOUND ; found...set flag ;AN000; + .ENDIF ; ;AN000; + .ENDIF ; ;AN000; + .ELSE ; and for text check the columns.. ;AN000; + MOV AX,ES:[DI].RP_COLS ; the rows are matched in the main routine. ;AN000; + .IF <[SI].SCR_COLS EQ AX> ; ;AN000; + MOV BP,FOUND ; found...set flag ;AN000; + .ENDIF ; ;AN000; + .ENDIF ; ;AN000; + .ENDIF ; ;AN000; + .ENDIF ; ;AN000; + .ENDIF ; ;AN000; + ADD SI,TYPE MODE_TABLE ; point to next record and.. ;AN000; + DEC CX ; decrement count ;AN000; + .endif ;AN006; + .ENDWHILE ; ;AN000; + .IF ; if we never found it then.. ;AN000; + STC ; set error flag and.. ;AN000; + .ELSE ; ;AN000; + SUB SI,TYPE MODE_TABLE ; position us at the appropriate record ;AN000; + CLC ; clear error flag ;AN000; + .ENDIF ; ;AN000; + mov cs:INT10_V_Mode, 0FFh ;AN006; Done. Reset the value + pop bp ;AN007; + RET ; return to calling module ;AN000; +SET_SEARCH ENDP ;AN000; + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: GET_SEARCH +; +; FUNCTION: +; THIS PROCEDURE SEARCHES THE VIDEO TABLE LOOKING FOR A MATCHING +; VIDEO MODE. +; +; AT ENTRY: DS:SI POINTS TO VIDEO TABLE +; AL CONTAINS THE MODE REQUESTED +; +; AT EXIT: +; NORMAL: CARRY CLEAR, DS:SI POINTS TO MATCHING RECORD +; +; ERROR: CARRY SET +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +GET_SEARCH PROC NEAR ;AN000; + MOV CX,MAX_VIDEO_TAB_NUM ; # of total tables ;AN000; + .WHILE <[SI].V_MODE NE AL> AND ; while we are not pointing to ;AN000; + .WHILE <[SI].V_MODE NE UNOCCUPIED> AND ; the right mode and we are still ;AN000; + .WHILE ; looking at valid data..do.. ;AN000; + ADD SI,TYPE MODE_TABLE ; point to the next mode ;AN000; + DEC CX ; decrement counter ;AN000; + .ENDWHILE ; ;AN000; + .IF OR ; did we find the mode? ;AN000; + .IF <[SI].V_MODE EQ UNOCCUPIED> ; ;AN000; + STC ; no ...so set error flag ;AN000; + .ELSE ; ;AN000; + CLC ; yes...clear error flag ;AN000; + .ENDIF ; ;AN000; + RET ; ;AN000; +GET_SEARCH ENDP + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: SET_CURSOR_EMUL +; +; FUNCTION: +; THIS PROCEDURE SETS THE CURSOR EMULATION BIT OFF IN ROM BIOS. THIS +; IS TO PROVIDE A CURSOR ON THE EGA WITH THE 5154 LOADED WITH AN 8X8 +; CHARACTER SET. +; +; AT ENTRY: +; +; AT EXIT: +; NORMAL: CURSOR EMULATION BIT SET FOR APPLICABLE HARDWARE +; +; ERROR: N/A +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +SET_CURSOR_EMUL PROC NEAR ;AN000; + .IF ; EGA with 5154?.. ;AN000; + PUSH SI ; ;AN000; + PUSH DS ; yes..so.. ;AN000; + MOV AX,ROM_BIOS ; check cursor emulation.. ;AN000; + MOV DS,AX ; ;AN000; + MOV SI,CURSOR_FLAG ; ;AN000; + MOV AL,BYTE PTR [SI] ; ;AN000; + .IF gt 25 lines requested? ;AN000; + AND AL,TURN_OFF ; no....set it OFF ;AN000; + .ELSE ; ;AN000; + OR AL,TURN_ON ; yes...set it ON ;AN000; + .ENDIF ; ;AN000; + MOV BYTE PTR [SI],AL ; ;AN000; + POP DS ; ;AN000; + POP SI ; ;AN000; + .ENDIF ; ;AN000; + RET ; return to calling module ;AN000; +SET_CURSOR_EMUL ENDP ;AN000; + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: INT10_COM +; +; FUNCTION: +; THIS IS THE INTERRUPT 10H HANDLER TO CAPTURE THE FOLLOWING FUNCTIONS: +; +; AH=1H (SET CURSOR TYPE). CURSOR EMULATION IS PERFORMED IF WE HAVE +; AND EGA WITH A 5151 MONITOR, AND 43 LINES IS REQUESTED. +; +; AH=0H (SET MODE) SCREEN LENGTH IS MAINTAINED WHEN POSSIBLE. (IE. IN +; TEXT MODES ONLY.) +; AN004; Capturing Set Mode call and enforcing the # of Rows based on the +; previous Set_IOCTL request lines was a design mistake. ANSI cannot +; covers the all the application program out there which use INT 10h +; directly to make a full screen interface by their own way. +; This part of logic has been taken out by the management decision. +; Instead, for each set mdoe INT 10h function call, if it were not +; issued by SET_IOCTL procedures itself, or by DISPLAY.SYS program, +; then we assume that it was issued by an APPS, that usually does not +; know the new ANSI GET_IOCTL/SET_IOCTL interfaces. +; In this case, ANSI is going to call GET_IOCTL and SET_IOCTL function +; call - This is not to lose the local data consistency in ANSI. +; +; AT ENTRY: +; +; AT EXIT: +; NORMAL: +; +; ERROR: +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +INT10_COM PROC NEAR ;AN000; + STI ; restore interrupts ;AN000; + .IF AND ; ;AN000; + .IF ;AN000; + JMP DWORD PTR CS:ROM_INT10 ; no...pass it on. ;AN000; + .ENDIF ;AN000; + .IF ;Set cursor call? ;AN000; + PUSH AX ; ;AN000; + .IF AND ; yes...check if we have an ega.. ;AN000; + .IF AND ; ;AN000; + .IF AND ; with 5151..so perform cursor mapping ;AN000; + .IF ; ;AN000; + MOV AL,CH ; check for cursor.. ;AN000; +; AND AL,06H ; off emulation.!!!!!Wrong!!! TypeO error ;AN000; + and al, 60h ; off emulation. J.K. + .IF ; ;AN000; + MOV AL,CH ; start position for cursor ;AN000; + CALL MAP_DOWN ; ;AN000; + MOV CH,AL ; ;AN000; + MOV AL,CL ; end position for cursor ;AN000; + CALL MAP_DOWN ; ;AN000; + MOV CL,AL ; ;AN000; + .ENDIF ; ;AN000; + .ENDIF ; ;AN000; + POP AX ; ;AN000; + JMP DWORD PTR CS:ROM_INT10 ; continue interrupt processing ;AN000; + .ELSE NEAR ; must be set mode call.. ;AN000; + PUSHF ; prepare for IRET ;AN000; + mov cs:ANSI_SetMode_Call_Flag, 1 ;AN008; Used by INT2F_COM + CALL DWORD PTR CS:ROM_INT10 ; call INT10 routine ;AN000; + mov cs:ANSI_SetMode_Call_Flag, 0 ;AN008; Reset it + push bp ;AN007; + push es ;AN007; + PUSH DS ; ;AN000; + PUSH SI ; ;AN000; + PUSH DI ; ;AN000; + PUSH DX ; ;AN000; + PUSH CX ; ;AN000; + PUSH BX ; ;AN000; + PUSH AX ; ;AN000; + PUSH CS ; ;AN000; + POP DS ; ;AN000; + MOV AH,REQ_VID_MODE ; get current mode.. ;AN000; + PUSHF ; ;AN000; + CALL DWORD PTR CS:ROM_INT10 ; ;AN000; + AND AL,VIDEO_MASK ; mask bit 7 (refresh) ;AN000; + test In_Generic_IOCTL_Flag, (I_AM_IN_NOW + SET_MODE_BY_DISPLAY) ;AN004; Flag is on? + .IF Z AND ;AN010;AN004;If not (I_AM_IN_NOW or SET_MODE_BY_DISPLAY), + .if ;AN010; + push ax ;AN004;Save mode + push es ;AN004; + push cs ;AN004; + pop es ;AN004; + mov di, offset My_IOCTL_Req_Packet ;AN004; + mov INT10_V_Mode, al ;AN006;Save current mode for SET_SEARCH + call Get_IOCTL ;AN004; + .IF NC ;AN004; + mov di, offset MY_IOCTL_Req_Packet ;AN004; + or In_Generic_IOCTL_Flag, CALLED_BY_INT10COM ;AN009;Do not set mode INT 10h again. Already done. + call Set_IOCTL ;AN004; + and In_Generic_IOCTL_Flag, not CALLED_BY_INT10COM ;AN009; + .ENDIF ;AN004; + pop es ;AN004; + pop ax ;AN004;Restore mode + mov INT10_V_Mode, 0FFh ;AN006; + .ENDIF ;AN004; + LEA SI,VIDEO_MODE_TABLE ; ;AN000; + CALL GET_SEARCH ; look through table for mode selected. ;AN000; + .IF NC ; if found then.. ;AN000; + .IF <[SI].D_MODE NE TEXT_MODE> ; text mode?.... ;AN000; + MOV GRAPHICS_FLAG,GRAPHICS_MODE ; no...set graphics flag. ;AN000; + .ELSE ; ;AN000; + MOV GRAPHICS_FLAG,TEXT_MODE ; yes...set text flag.. ;AN000; + .ENDIF ; ;AN000; + .ENDIF ; ;AN000; + + test In_Generic_IOCTL_Flag, I_AM_IN_NOW ;AN010; + .if z AND ;AN010; + .if AND ; + .if ;AN010; + call DO_ROWS ;AN010; + .endif ;AN010; + +;AN004;The following has been taken out! +;AN004; .IF ; 25 lines active? ;AN000; +;AN004; MOV AX,DISPLAY_CHECK ; is DISPLAY.SYS there? ;AN000; +;AN004; INT 2FH ; ;AN000; +;AN004; .IF OR ; if not installed or.. ;AN000; +;AN004; MOV AX,CHECK_ACTIVE ; if a code page has not.. ;AN000; +;AN004; INT 2FH ; been selected then.. ;AN000; +;AN004; .IF C ; ;AN000; +;AN004; .IF ; is this a text mode? ;AN000; +;AN004; CALL ROM_LOAD_8X8 ; yes..load ROM 8x8 character set. ;AN000; +;AN004; .ENDIF ; ;AN000; +;AN004; .ENDIF ; ;AN000; +;AN004; .ENDIF ; ;AN000; +;AN004;Instead, for each SET mode function int 10h function call, if it is not +;AN004;issued by ANSI GET_IOCTL and SET_IOCTL procedure themselves, we assume +;AN004;that the APPS, which usually does not know the ANSI GET_IOCTL/SET_IOCTL +;AN004;interfaces, intend to change the screen mode. In this case, ANSI is +;AN004;kind enough to call GET_IOCTL and SET_IOCTL function call for themselves. + + POP AX ; ;AN000; + POP BX ; ;AN000; + POP CX ; ;AN000; + POP DX ; ;AN000; + POP DI ; ;AN000; + POP SI ; ;AN000; + POP DS ; ;AN000; + pop es ;AN007; + pop bp ;AN007; + .ENDIF ; ;AN000; + IRET ; ;AN000; +INT10_COM ENDP + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: INT2F_COM +; +; FUNCTION: +; THIS IS THE INTERRUPT 2FH HANDLER TO CAPTURE THE FOLLOWING FUNCTIONS: +; +; AX=1A00H INSTALL REQUEST. ANSI WILL RETURN AL=FFH IF LOADED. +; +; AH=1A01H THIS IS THE INT2FH INTERFACE TO THE GENERIC IOCTL. +; NOTE: THE GET CHARACTERISTICS FUNCTION CALL WILL RETURN +; THE REQ_TXT_LENGTH IN THE BUFFER AS OPPOSED TO +; THE ACTUAL HARDWARE SCREEN_LENGTH +; Ax=1A02h This is an information passing from DISPLAY.SYS about +; the INT 10h, SET MODE call. +; +; AT ENTRY: +; +; AT EXIT: +; NORMAL: +; +; ERROR: +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +INT2F_COM PROC NEAR ;AN000; + STI ; ;AN000; + .IF OR ; is this for ANSI? ;AN000; +; .IF ; ;AN000; + .IF ;AN004;=2h + JMP DWORD PTR CS:ROM_INT2F ; no....jump to old INT2F ;AN000; + .ENDIF ; ;AN000; + .SELECT ; ;AN000; + .WHEN NEAR ; if install check then.. ;AN000; + MOV AL,INSTALLED ; load value to indicate installed ;AN000; + CLC ; clear error flag. ;AN000; +; .WHEN ; request for IOCTL? ;AN000; + .WHEN NEAR ;AN004;IOCTL or INFO passing? + PUSH BP ; ;AN000; + PUSH AX ; s ;AN000; + PUSH CX ; a ;AN000; + PUSH DX ; v ;AN000; + PUSH DS ; e r ;AN000; + PUSH ES ; e ;AN000; + PUSH DI ; g ;AN000; + PUSH SI ; s. ;AN000; + PUSH BX ; ;AN000; + PUSH DS ; load ES with DS (for call) ;AN000; + POP ES ; ;AN000; + MOV DI,DX ; load DI with DX (for call) ;AN000; + PUSH CS ; setup local addressability ;AN000; + POP DS ; ;AN000; + .IF ;IOCTL request + .IF ; get function requested. ;AN000; + CALL GET_IOCTL ; ;AN000; + .IF NC AND ; if no error and... ;AN000; + .IF AND ; gt 25 lines supported and.. ;AN000; + .IF <[SI].D_MODE EQ TEXT_MODE> ; this is a text mode then.. ;AN000; + .if OR ;AN010; + .if OR ;AN008; if not originated by ANSI thru. AH=0, INT10, + .if ;AN008; or Display.sys not loaded before ANSI, + MOV BX,REQ_TXT_LENGTH ; then use REQ_TXT_LENGTH instead.. ;AN000; + MOV ES:[DI].RP_ROWS,BX ; + .endif + CLC ; ;AN000; + .ENDIF ; ;AN000; + .ELSEIF ; ;AN000; + CALL SET_IOCTL ; set function requested. ;AN000; + .ELSE ; invalid function... ;AN000; + MOV AX,INVALID_FUNC ; load error and... ;AN000; + STC ; set error flag. ;AN000; + .ENDIF ; ;AN000; + .ELSE ;AN004;Info. passing + .IF ;AN004; 0 = DA_SETMODE_FLAG request. + .IF ;AN004; + or cs:In_Generic_IOCTL_Flag, SET_MODE_BY_DISPLAY ;AN004;Turn the flag on + .ELSE ;AN004; + and cs:In_Generic_IOCTL_Flag, not SET_MODE_BY_DISPLAY ;AN004;Turn the flag off + .ENDIF ;AN004; + .ELSE + .IF ;AN011; 1 = DA_OPTION_L_STATE query + mov al, cs:[Switch_L] ;AN011; + mov es:[di].DA_OPTION_L_STATE, al ;AN011; + .ENDIF + .ENDIF ;AN004; + clc ;AN004;clear carry. There is no Error in DOS 4.00 for this call. + .ENDIF + POP BX ; restore all.. ;AN000; + POP SI ; ;AN000; + POP DI ; registers except.. ;AN000; + POP ES ; ;AN000; + POP DS ; BP. ;AN000; + POP DX ; ;AN000; + POP CX ; ;AN000; + PUSH AX ; save error condition ;AN000; + MOV BP,SP ; setup frame pointer ;AN000; + MOV AX,[BP+10] ; load stack flags ;AN000; + .IF NC ; carry set?.. ;AN000; + AND AX,NOT_CY ; no.. set carry off. ;AN000; + MOV [BP+10],AX ; put back on stack. ;AN000; + POP AX ; remove error flag from stack ;AN000; + POP AX ; no error so bring back function call ;AN000; + XCHG AH,AL ; exchange to show that ANSI present ;AN000; + .ELSE ; ;AN000; + OR AX,CY ; yes...set carry on. ;AN000; + MOV [BP+10],AX ; put back on stack. ;AN000; + POP AX ; restore error flag ;AN000; + POP BP ; pop off saved value of AX (destroyed) ;AN000; + .ENDIF ; ;AN000; + POP BP ; restore final register. ;AN000; + .ENDSELECT ; ;AN000; +ABORT: IRET ; ;AN000; +INT2F_COM ENDP ;AN000; + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: MAP_DOWN +; +; FUNCTION: +; THIS PROCEDURE MAPS THE CURSOR START (END) POSITION FROM A 14 PEL +; BOX SIZE TO AN 8 PEL BOX SIZE. +; +; AT ENTRY: AL HAS THE CURSOR START (END) TO BE MAPPED. +; +; AT EXIT: +; NORMAL: AL CONTAINS THE MAPPED POSITION FOR CURSOR START (END) +; +; ERROR: N/A +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +MAP_DOWN PROC NEAR ;AN000; + PUSH BX ; ;AN000; + XOR AH,AH ; clear upper byte of cursor position ;AN000; + MOV BL,EIGHT ; multiply by current box size. ;AN000; + PUSH DX ; al x ;AN000; + MUL BL ; ---- = --- ;AN000; + POP DX ; 14 8 ;AN000; + MOV BL,FOURTEEN ; ;AN000; + DIV BL ; divide by box size expected. ;AN000; + POP BX ; ;AN000; + RET ; ;AN000; +MAP_DOWN ENDP + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: SET_VIDEO_MODE +; +; FUNCTION: +; THIS PROCEDURE SETS THE VIDEO MODE SPECIFIED IN DS:[SI].V_MODE. +; +; AT ENTRY: DS:SI.V_MODE CONTAINS MODE NUMBER +; +; AT EXIT: +; NORMAL: MODE SET +; +; ERROR: N/A +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +SET_VIDEO_MODE PROC NEAR ;AN000; + .if ;AN009; + MOV AL,[SI].V_MODE ; ..issue set mode ;AN000; + .IF OR ; is this the LCD? ;AN000; + .IF ; or VGA (done for BRECON card) ;AN000; + PUSH DS ; yes... ;AN000; + MOV BL,AL ; save mode ;AN000; + MOV AX,ROM_BIOS ; ;AN000; + MOV DS,AX ; get equipment status flag.. ;AN000; + MOV AX,DS:[EQUIP_FLAG] ; ;AN000; + AND AX,INIT_VID_MASK ; clear initial video bits.. ;AN000; + .IF OR ; are we setting mono? ;AN000; + .IF ; ;AN000; + OR AX,LCD_MONO_MODE ; yes...set bits as mono ;AN000; + .ELSE ; ;AN000; + OR AX,LCD_COLOR_MODE ; no...set bits as color ;AN000; + .ENDIF ; ;AN000; + MOV DS:[EQUIP_FLAG],AX ; replace updated flag. ;AN000; + MOV AL,BL ; restore mode. ;AN000; + POP DS ; ;AN000; + .ENDIF ; ;AN000; + MOV AH,SET_MODE ; set mode ;AN000; + INT 10H ;AN000; + .endif ;AN009; + RET ;AN000; +SET_VIDEO_MODE ENDP ;AN000; + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: ROM_LOAD_8X8 +; +; FUNCTION: +; THIS PROCEDURE LOADS THE ROM 8X8 CHARACTER SET AND ACTIVATES BLOCK=0 +; FONT. +; +; AT ENTRY: +; +; AT EXIT: +; NORMAL: 8X8 ROM CHARACTER SET LOADED +; +; ERROR: N/A +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +ROM_LOAD_8X8 PROC NEAR ;AN000; + MOV AX,LOAD_8X8 ; load 8x8 ROM font ;AN000; + XOR BL,BL ; ;AN000; + PUSHF ;AN000; + CALL DWORD PTR CS:ROM_INT10 ;AN000; + MOV AX,SET_BLOCK_0 ; activate block = 0 ;AN000; + XOR BL,BL ;AN000; + PUSHF ;AN000; + CALL DWORD PTR CS:ROM_INT10 ;AN000; + RET ;AN000; +ROM_LOAD_8X8 ENDP ;AN000; + ;AN000; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: CHECK_FOR_DISPLAY +; +; FUNCTION: +; THIS PROCEDURE CHECKS TO SEE IF WE DISPLAY.SYS IS THERE, AND IF +; IT IS..IT HAS THE REQUIRED FONT. +; +; AT ENTRY: AX - DESIRED SCREEN LENGTH +; +; AT EXIT: +; NORMAL: CARRY CLEAR IF ALL OKAY +; +; ERROR: CARRY SET IF FONT NOT AVAILABLE. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +CHECK_FOR_DISPLAY PROC NEAR ;AN000; + .IF OR ; is it just 25 lines needed? ;AN000; + MOV AX,DISPLAY_CHECK ; ;AN000; + INT 2FH ; ;AN000; + .IF OR ; or is DISPLAY.SYS not there? ;AN000; + MOV AX,CHECK_FOR_FONT ; ;AN000; + INT 2FH ; or if it is does it have the.. ;AN000; + .IF NC ; 8X8 font then. ;AN000; + CLC ; clear carry ;AN000; + .ELSE ; ;AN000; + STC ; no font...set carry ;AN000; + .ENDIF ; ;AN000; + RET ; ;AN000; +CHECK_FOR_DISPLAY ENDP + +CODE ENDS + END diff --git a/v4.0/src/DEV/ANSI/MAKEFILE b/v4.0/src/DEV/ANSI/MAKEFILE new file mode 100644 index 0000000..f249f75 --- /dev/null +++ b/v4.0/src/DEV/ANSI/MAKEFILE @@ -0,0 +1,33 @@ +#*********************** Makefile for ansi.sys **************************** + +dos =..\..\dos +inc =..\..\inc +msg =..\..\messages + +# +####################### Dependencies Begin Here ########################## +# + +all: ansi.sys + +ansi.ctl: ansi.skl $(msg)\$(COUNTRY).msg + +ansi.obj: ansi.asm ansi.inc \ + $(inc)\vector.inc \ + $(inc)\mult.inc \ + $(inc)\struc.inc + +ioctl.obj: ioctl.asm ansi.inc \ + $(inc)\struc.inc + +ansiinit.obj: ansiinit.asm ansi.inc ansivid.inc \ + $(inc)\struc.inc + +parser.obj: parser.asm ansi.inc $(inc)\sysmsg.inc $(inc)\parse.asm \ + $(inc)\struc.inc ansi.ctl $(inc)\versiona.inc + +ansi.sys: ansi.obj ioctl.obj ansiinit.obj parser.obj ansi.lnk makefile + link @ansi.lnk + exe2bin ansi.exe ansi.sys + del ansi.exe + diff --git a/v4.0/src/DEV/ANSI/PARSER.ASM b/v4.0/src/DEV/ANSI/PARSER.ASM new file mode 100644 index 0000000..8136db6 --- /dev/null +++ b/v4.0/src/DEV/ANSI/PARSER.ASM @@ -0,0 +1,325 @@ +PAGE ,132 +TITLE PARSE CODE AND CONTROL BLOCKS FOR ANSI.SYS + +;****************** START OF SPECIFICATIONS ************************** +; +; MODULE NAME: PARSER.ASM +; +; DESCRIPTIVE NAME: PARSES THE DEVICE= STATEMENT IN CONFIG.SYS FOR +; ANSI.SYS +; +; FUNCTION: THE COMMAND LINE PASSED TO ANSI.SYS IN THE CONFIG.SYS +; STATEMENT IS PARSED TO CHECK FOR THE /X SWITCH. A FLAG +; IS CLEARED IF NOT FOUND. +; +; ENTRY POINT: PARSE_PARM +; +; INPUT: DS:SI POINTS TO EVERYTHING AFTER DEVICE= +; +; AT EXIT: +; NORMAL: SWITCH FLAGS WILL BE SET IF /X or /L IS FOUND +; +; ERROR: CARRY SET +; +; INTERNAL REFERENCES: +; +; ROUTINES: SYSLOADMSG - MESSAGE RETRIEVER LOADING CODE +; SYSDISPMSG - MESSAGE RETRIEVER DISPLAYING CODE +; PARM_ERROR - DISPLAYS ERROR MESSAGE +; SYSPARSE - PARSING CODE +; +; DATA AREAS: PARMS - PARSE CONTROL BLOCK FOR SYSPARSE +; +; EXTERNAL REFERENCES: +; +; ROUTINES: N/A +; +; DATA AREAS: SWITCH - BYTE FLAG FOR EXISTENCE OF SWITCH PARAMETER +; +; NOTES: +; +; REVISION HISTORY: +; A000 - DOS Version 4.00 +; +; Label: "DOS ANSI.SYS Device Driver" +; "Version 4.00 (C) Copyright 1988 Microsoft" +; "Licensed Material - Program Property of Microsoft" +; +;****************** END OF SPECIFICATIONS **************************** +;Modification history********************************************************** +;AN001; P1529 ANSI /x /y gives wrong error message 10/8/87 J.K. +;AN002; D397 /L option for "Enforcing" the line number 12/17/87 J.K. +;AN003; D479 An option to disable the extended keyboard functions 02/12/88 J.K. +;****************************************************************************** + + +INCLUDE ANSI.INC ; ANSI equates and structures ;AN000; +.XLIST +INCLUDE STRUC.INC ; Structured macros ;AN000; + +INCLUDE SYSMSG.INC ; Message retriever code ;AN000; +MSG_UTILNAME ; Let message retriever know its ANSI.SYS ;AN000; +.LIST + +PUBLIC PARSE_PARM ; near procedure for parsing DEVICE= statement ;AN000; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Set assemble switches for parse code that is not required!! +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +DateSW EQU 0 ;AN000; +TimeSW EQU 0 ;AN000; +CmpxSW EQU 0 ;AN000; +DrvSW EQU 0 ;AN000; +QusSW EQU 0 ;AN000; +NumSW EQU 0 ;AN000; +KeySW EQU 0 ;AN000; +Val1SW EQU 0 ;AN000; +Val2SW EQU 0 ;AN000; +Val3SW EQU 0 ;AN000; + + +CODE SEGMENT PUBLIC BYTE + ASSUME CS:CODE + +.XLIST +MSG_SERVICES ;AN000; +MSG_SERVICES ;AN000; +MSG_SERVICES ;AN000; +MSG_SERVICES ;AN000; +MSG_SERVICES ;AN000; + +INCLUDE PARSE.ASM ; Parsing code ;AN000; +.LIST + + +EXTRN SWITCH_X:BYTE ; /X switch flag ;AN000; +extrn Switch_L:Byte ;AN002; /L switch flag +extrn Switch_K:Byte ;AN003; /K switch + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PARM control blocks for ANSI +; Parsing DEVICE= statment from CONFIG.SYS +; +; DEVICE=[d:][path]ANSI.SYS [/X] +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;AN000; +PARMS LABEL WORD ;AN000; + DW PARMSX ;AN000; + DB 0 ; no extra delimeters or EOLs. ;AN000; + ;AN000; +PARMSX LABEL BYTE ;AN000; + DB 1,1 ;AN001; 1 valid positional operand + DW FILENAME ;AN001; filename + DB 1 ;AN002; 1 switche definition in the following + DW Switches ;AN002; + DB 0 ;AN001; no keywords + ;AN000; +FILENAME LABEL WORD ;AN000; + DW 0200H ; file spec ;AN000; + DW 0001H ; cap by file table ;AN000; + DW RESULT_BUF ; result ;AN000; + DW NOVALS ; no value checking done ;AN000; + DB 0 ; no switch/keyword synonyms ;AN000; + ;AN000; +Switches LABEL WORD ;AN000; + DW 0 ; switch with no value ;AN000; + DW 0 ; no functions ;AN000; + DW RESULT_BUF ; result ;AN000; + DW NOVALS ; no value checking done ;AN000; + DB 3 ;AN002;AN003; 3 switch synonym +X_SWITCH DB "/X",0 ;AN002; /X name +L_SWITCH DB "/L",0 ;AN002; /L +K_SWITCH DB "/K",0 ;AN003; /K + +NOVALS LABEL BYTE ;AN000; + DB 0 ; no value checking done ;AN000; + +RESULT_BUF LABEL BYTE ;AN000; + DB ? ; type returned (number, string, etc.) ;AN000; + DB ? ; matched item tag (if applicable) ;AN000; +SYNONYM_PTR DW 0 ; synonym ptr (if applicable) ;AN000; + DD ? ; value ;AN000; + ;AN000; +SUBLIST LABEL DWORD ; list for substitution ;AN000; + DB SUB_SIZE ;AN000; + DB 0 ;AN000; + DD ? ;AN000; + DB 1 ;AN000; + DB LEFT_ASCIIZ ;AN000; + DB UNLIMITED ;AN000; + DB 1 ;AN000; + DB " " ;AN000; + +Old_SI dw ? ;AN001; +Saved_Chr db 0 ;AN001; +Continue_Flag db ON ;AN002; +Parse_Err_Flag db OFF ;AN002; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: PARSE_PARM +; +; FUNCTION: +; THIS PROCEDURE PARSES THE DEVICE= PARAMETERS FROM THE INIT REQUEST +; BLOCK. ERROR MESSAGES ARE DISPLAYED ACCORDINGLY. +; +; AT ENTRY: DS:SI POINTS TO EVERYTHING AFTER THE DEVICE= STATEMENT +; +; AT EXIT: +; NORMAL: CARRY CLEAR - SWITCH FLAG BYTE SET TO 1 IF /X FOUND +; +; ERROR: CARRY SET +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +PARSE_PARM PROC NEAR ;AN000; + CALL SYSLOADMSG ; load message ;AN000; + .IF C NEAR ;AN000; + CALL SYSDISPMSG ; display error message ;AN000; + STC ; ensure carry still set ;AN000; + .ELSE NEAR ;AN000; + PUSH CS ; establish ES .. ;AN000; + POP ES ; addressability to data ;AN000; + LEA DI,PARMS ; point to PARMS control block ;AN000; + XOR CX,CX ; clear both CX and DX for ;AN000; + XOR DX,DX ; SYSPARSE ;AN000; + CALL SYSPARSE ; move pointer past file spec ;AN000; + mov Switch_L, OFF ;AN002; + mov Switch_X, OFF ;AN002; + .WHILE ;AN002; + mov Old_SI, SI ;AN001;to be use by PARM_ERROR + call SysParse ;AN002; + .IF ;AN002; + mov Continue_Flag, OFF ;AN002; + .ELSE ;AN002; + .IF ;AN002; + mov Continue_Flag, OFF ;AN002; + mov Switch_X, OFF ;AN002; + mov Switch_L, OFF ;AN002; + mov Switch_K, OFF ;AN003; + call Parm_Error ;AN002; + mov Parse_Err_Flag,ON;AN002; + .ELSE ;AN002; + .IF > ;AN002; + mov Switch_X, ON ;AN002; + .ELSE ;AN002; + .IF > ;AN003; + mov Switch_L, ON ;AN002; + .ELSE ;AN003;Must be /K option. + mov Switch_K, ON ;AN003;/K entered. + .ENDIF ;AN003; + .ENDIF ;AN002; + clc ;AN002; + .ENDIF ;AN002; + .ENDIF ;AN002; + .ENDWHILE ;AN002; + .IF ;AN002; + stc ;AN002; + .ELSE ;AN002; + clc ;AN002; + .ENDIF ;AN002; + .ENDIF ;AN002; + +; mov cs:Old_SI, SI ;AN001; Save pointer to parm +; CALL SYSPARSE ; look for /X switch ;AN000; +; .IF ; if EOL then.. ;AN000; +; MOV ES:SWITCH_X,0 ; no switch...clear flag ;AN000; +; CLC ; clear carry ;AN000; +; .ELSE ; else.. ;AN000; +; .IF ;AN001;If any error +; call parm_error ;AN001; the show the error msg +; stc ;AN001; +; .ELSE ; else..leave flag set.. ;AN000; +; mov cs:Old_SI, SI ;AN001; +; CALL SYSPARSE ; check for further parms ;AN000; +; .IF ; if other parms then... ;AN000; +; CALL PARM_ERROR ; display 'Invalid parameter' message ;AN000; +; STC ; error! ;AN000; +; .ELSE ; no other parms so.. ;AN000; +; CLC ; clear carry ;AN000; +; .ENDIF ; ;AN000; +; .ENDIF ; ;AN000; +; .ENDIF ; ;AN000; +; .ENDIF ; ;AN000; + + RET ;AN000; +PARSE_PARM ENDP ;AN000; + ;AN000; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: PARM_ERROR +; +; FUNCTION: +; LOADS AND DISPLAYS "Invalid parameter" MESSAGE +; +; AT ENTRY: +; DS:Old_SI -> parms that is invalid +; +; AT EXIT: +; NORMAL: ERROR MESSAGE DISPLAYED +; +; ERROR: N/A +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +PARM_ERROR PROC NEAR ;AN000; + PUSH CX ;AN000; + PUSH SI ;AN000; + PUSH ES ; ;AN000; + PUSH DS ; ;AN000; + +; PUSH CS ; ;AN000; +; POP DS ; establish addressability ;AN000; +; MOV BX,DX ; ;AN000; +; LES DX,[BX].RES_PTR ; find offending parameter ;AN000; + push ds ;AN001; + pop es ;AN001; + mov si, cs:Old_SI ;AN001;Now es:dx -> offending parms + push si ;AN001;Save it +Get_CR: + cmp byte ptr es:[si], 13 ;AN001;CR? + je Got_CR ;AN001; + inc si ;AN001; + jmp Get_CR ;AN001; +Got_CR: ;AN001; + inc si ;AN001; The next char. + mov al, byte ptr es:[si] ;AN001; + mov cs:Saved_Chr, al ;AN001; Save the next char + + mov byte ptr es:[si], 0 ;AN001; and make it an ASCIIZ + mov cs:Old_SI, si ;AN001; Set it again + pop dx ;AN001; saved SI -> DX + + push cs ;AN001; + pop ds ;AN001;for addressability + + LEA SI,SUBLIST ; ..and place the offset.. ;AN000; + MOV [SI].SUB_PTR_O,DX ; ..in the SUBLIST.. ;AN000; + MOV [SI].SUB_PTR_S,ES ; ;AN000; + MOV AX,INVALID_PARM ; load 'Invalid parameter' message number ;AN000; + MOV BX,STDERR ; to standard error ;AN000; + MOV CX,ONE ; 1 substitution ;AN000; + XOR DL,DL ; no input ;AN000; + MOV DH,UTILITY_MSG_CLASS ; parse error ;AN000; + CALL SYSDISPMSG ; display error message ;AN000; + mov si, cs:Old_SI ;AN001;restore the original char. + mov cl, cs:Saved_Chr ;AN001; + mov byte ptr es:[si], cl ;AN001; + + POP DS ;AN000; + POP ES ;AN000; + POP SI ;AN000; + POP CX ;AN000; + RET ;AN000; +PARM_ERROR ENDP + +include msgdcl.inc + +CODE ENDS + END diff --git a/v4.0/src/DEV/COUNTRY/MAKEFILE b/v4.0/src/DEV/COUNTRY/MAKEFILE new file mode 100644 index 0000000..cc7559e --- /dev/null +++ b/v4.0/src/DEV/COUNTRY/MAKEFILE @@ -0,0 +1,19 @@ +#************************ Makefile for Country.sys ************************ + +dos =..\..\dos +lib =..\..\lib +inc =..\..\inc + +# +######################## Dependencies begin here ########################## +# + +all: country.sys + +mkcntry.obj: mkcntry.asm mkcntry.inc + +mkcntry.exe: mkcntry.obj + link mkcntry; + +country.sys: mkcntry.exe + mkcntry diff --git a/v4.0/src/DEV/COUNTRY/MKCNTRY.ASM b/v4.0/src/DEV/COUNTRY/MKCNTRY.ASM new file mode 100644 index 0000000..985f140 --- /dev/null +++ b/v4.0/src/DEV/COUNTRY/MKCNTRY.ASM @@ -0,0 +1,2377 @@ + page 84,132 +; July 8, 1986 - updated Finland for 437 dcl. +; July 8, 1986 - updated Netherland for 437 dcl. +; July 8, 1986 - updated Italy for 437 dcl. +; July 8, 1986 - updated Canada for 863 dcl. +; July 8, 1986 - updated Belgium for 437 dcl. (except Collate) +; July 8, 1986 - updated AreaSouth for 437 dcl. +; July 8, 1986 - updated Switzerland for 437 dcl. +; July 8, 1986 - updated Norway for 865 dcl. +; July 8, 1986 - updated Denmark for 865 dcl. +; July 14, 1986 - updated Sweden for 437 dcl. +; July 8, 1986 - updated AFE for 850 dcl. +; July 8, 1986 - updated Finland for 850 dcl. +; July 8, 1986 - updated Netherland for 850 dcl. +; July 8, 1986 - updated Canada for 850 dcl. +; July 8, 1986 - updated Italy for 850 dcl. +; July 8, 1986 - updated UK for 850 dcl. +; July 8, 1986 - updated Norway for 850 dcl. +; July 8, 1986 - updated Denmark for 850 dcl. +; July 8, 1986 - updated US for 850 dcl. +; July 8, 1986 - updated Switzerland for 850 dcl. +; July 14, 1986 - updated Sweden for 850 dcl. +; July 14, 1986 - updated Belgium for 850 dcl. (except Collate) +; August 26,1986 - updated Belgium for 437 collate EMG +; August 27,1986 - updated Belgium for 850 collate EMG +; August 27,1986 - updated Area South for 437 EMG +; August 27,1986 - updated Area South for 864 EMG +; August 27,1986 - make all collates 256 bytes EMG +; August 27,1986 - updated Germany for 850 EMG +; August 27,1986 - updated Spain for 850 EMG +; August 28,1986 - updated Latin America for 850 EMG +; September 12, 1986 - updated SP,IS,CF,AS,PO,LA EMG +; October 2, 1986 - updated AS and IS EMG +; July 23,1987 - DCR to alter Germany collate table to match US 850 DCR037 +; CNS +; July 23,1987 - DCR to alter SWISS collate info and ucase table 850 & 437 +; DCR059--- CNS *** +; July 23,1987 - DCR to alter Denmark's primary codepage to 850 instead of +; 865 --- CNS *** +; NOvember 12,1987 - PTM2390 DBCS length of terminating value included for +; for DBCS countries +; - FILEUPCASE & UCASE swapped for 437 & 850 mapping incorrect +; - -ly for DOS 3.3 +; - Make the FUCASE & UCASE tables equivalent for 850 & 437 +; March 9, p3811, Finland to default to 850 now, w/437 as alternate code page +; +; March 30, p4072, LA wants to be same as Spain +; ***CNS +; April 14,1988 Re-adjust LA to match SPAIN which should have 850 as a +;PTM 4389 default instead of 437 for both countries +; +; create country.sys file +; +; + include mkcntry.inc +; +cseg segment para public 'code' + assume cs:cseg,ds:dseg +mkcdif proc far + mov ax,dseg ; establish addressability + mov ds,ax ; for ds + mov es,ax ; and es + lea dx,cdifname ; address of file name to create + xor cx,cx ; attrib = normal file + mov ah,3ch ; create function + int 21h ; create file + jnc create_ok ; jump if create successful + lea dx,crmsg + mov cx,crmlen + jmp wrt_msg +create_ok: + mov bx,ax ; save handle + mov ah,40h ; write function + mov cx,cdiend-cdinfo ; length of cdi + lea dx,cdinfo ; address of cdi + int 21h ; write cdi file + cmp ax,cx ; compare bytes written + jz write_ok ; jump if write was successful + lea dx,iomsg + mov cx,iomlen + jmp wrt_msg +write_ok: + mov ah,3eh ; close function + int 21h ; close cdi file + lea dx,succmsg + mov cx,smlen +wrt_msg: + mov bx,1 + mov ah,40h + int 21h + xor al,al + mov ah,4ch ; exit function + int 21h ; return to exec'ing program +mkcdif endp +cseg ends +; + page +; ----------------------------------------------------------- +; +; Data for COUNTRY.SYS file +; +; ----------------------------------------------------------- +dseg segment para +cdinfo label word + db 0ffh,'COUNTRY' ; signature + db 8 dup (0) ; reserved + dw PTRCNT ; number of pointers in header + db CIPTYPE ; type = country info pointer + dd offset cntryinfo ; pointer to country information +; +cntryinfo label word +cntrycnt=0 + dw finalCNT ; number of countries + ctryent ; United States + ctryent ; + ctryent ; United Kingdom + ctryent ; + ctryent ; France + ctryent ; + ctryent ; Germany + ctryent ; + ctryent ; + ctryent ; Spain + ctryent ; Italy + ctryent ; + ctryent ; Sweden + ctryent ; + ctryent ; Denmark + ctryent ; DCR060 CNS ***** ;AN000; + ctryent ; Switzerland + ctryent ; + ctryent ; Norway + ctryent ; + ctryent ; Netherlands + ctryent ; + ctryent ; Belgium + ctryent ; + ctryent ; Finland p3811, requested 850 default + ctryent ; Finland + ctryent ; Israel + ctryent ; + ctryent ; Canada French + ctryent ; + ctryent ; Area South (Arab States) + ctryent ; + ctryent ; Portugal + ctryent ; + ctryent ; + ctryent ; Latin America + ctryent ; International English + ctryent ; + ctryent ; Japan + ctryent ; + ctryent ; Korea + ctryent ; + ctryent ; PRC + ctryent ; + ctryent ; Taiwan + ctryent ; + + +dummy macro p +finalCNT equ p + endm + dummy %cntrycnt +; +uk437_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +uk850_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +fr437_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +fr850_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +gr437_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +gr850_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +sp437_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +sp850_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +it437_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +it850_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +sv437_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +sv850_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +dk850_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +dk865_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +sw437_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +sw850_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +no865_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +no850_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +nl437_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +nl850_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +be437_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +be850_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +fi437_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +fi850_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +us437_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +us850_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +is862_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +is850_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +ca863_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +ca850_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +as864_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +as850_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +po860_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +po850_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +la437_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +la850_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +jp932_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +jp437_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +ko934_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +ko437_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +pr936_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +pr437_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +ta938_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +ta437_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +afe437_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat +; +afe850_data label word + dw CDATAITEMS ; number of entries + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + ctrydat + page +; ---------------------------------------- +; +; World Trade Country Info Tables +; +; ---------------------------------------- +uk437_info label word + ctable <> + cinfo +; +fr437_info label word + ctable <> + cinfo +; +gr437_info label word + ctable <> + cinfo +; +sp437_info label word + ctable <> + cinfo +; +sp850_info label word + ctable <> + cinfo +; +it437_info label word + ctable <> + cinfo +; +sv437_info label word + ctable <> + cinfo +; +dk865_info label word + ctable <> + cinfo +; +sw437_info label word + ctable <> + cinfo +; +;*** CNS Change date separator from slash to period - DCR 357 +no865_info label word + ctable <> + cinfo ;AN000; +;*** CNS Change date separator from slash to period - DCR 357 +;*** Field #14 +; +nl437_info label word + ctable <> + cinfo +; +be437_info label word + ctable <> + cinfo +; +fi437_info label word + ctable <> + cinfo +; +jp437_info label word +ko437_info label word +pr437_info label word +ta437_info label word +us437_info label word + ctable <> + cinfo +; +is862_info label word + ctable <> + cinfo +; +ca863_info label word + ctable <> + cinfo +; +as864_info label word + ctable <> + cinfo +; +as850_info label word + ctable <> + cinfo +; +po860_info label word + ctable <> + cinfo +; +la437_info label word + ctable <> + cinfo +; +afe437_info label word + ctable <> + cinfo +; +jp932_info label word + ctable <> + cinfo +; +ko934_info label word + ctable <> + cinfo +; +pr936_info label word + ctable <> + cinfo +; +ta938_info label word + ctable <> + cinfo +; + page +; ------------------------------------------------ +; +; World Trade Collating sequence tables +; +; ------------------------------------------------ +; +; -------------------------------------------------------------------------- +; +; Collating Table Same for United States, United Kingdom, France, Germany, +; Italy, and International English +; -------------------------------------------------------------------------- +; +us_collate label word +; +uk_collate label word +; +fr_collate label word +; +gr_collate label word +; +it_collate label word +; +jp437_collate label word +; +ko437_collate label word +; +pr437_collate label word +; +ta437_collate label word +; +afe_collate label word + ctable <,'COLLATE',256> + db 0,1,2,3,4,5,6,7 + db 8,9,10,11,12,13,14,15 + db 16,17,18,19,20,21,22,23 + db 24,25,26,27,28,29,30,31 + db " ","!",'"',"#","$","%","&","'" + db "(",")","*","+",",","-",".","/" + db "0","1","2","3","4","5","6","7" + db "8","9",":",";","<","=",">","?" + db "@","A","B","C","D","E","F","G" + db "H","I","J","K","L","M","N","O" + db "P","Q","R","S","T","U","V","W" + db "X","Y","Z","[","\","]","^","_" + db "`","A","B","C","D","E","F","G" + db "H","I","J","K","L","M","N","O" + db "P","Q","R","S","T","U","V","W" + db "X","Y","Z","{","|","}","~",127 + db "C","U","E","A","A","A","A","C" + db "E","E","E","I","I","I","A","A" + db "E","A","A","O","O","O","U","U" + db "Y","O","U","$","$","$","$","$" + db "A","I","O","U","N","N",166,167 + db "?",169,170,171,172,"!",'"','"' + db 176,177,178,179,180,181,182,183 + db 184,185,186,187,188,189,190,191 + db 192,193,194,195,196,197,198,199 + db 200,201,202,203,204,205,206,207 + db 208,209,210,211,212,213,214,215 + db 216,217,218,219,220,221,222,223 + db 224,"S" + db 226,227,228,229,230,231 + db 232,233,234,235,236,237,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 + page + ; +; Netherland 437 Collate +; +nl_collate label word + ctable <,'COLLATE',256> + db 000,001,002,003,004,005,006,007 + db 008,009,010,011,012,013,014,015 + db 016,017,018,019,020,021,022,023 + db 024,025,026,027,028,029,030,031 + db 032,033,034,035,036,037,038,039 + db 040,041,042,043,044,045,046,047 + db 048,049,050,051,052,053,054,055 + db 056,057,058,059,060,061,062,063 + db 064,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,091,092,093,094,095 + db 096,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,123,124,125,126,127 + db 128,154,144,065,142,065,143,128 + db 069,069,069,073,073,073,142,143 + db 144,146,146,079,079,079,085,085 + db 152,079,085,155,156,157,158,159 + db 065,073,079,085,165,165,166,167 + db 168,169,170,171,172,173,174,175 + db 176,177,178,179,180,181,182,183 + db 184,185,186,187,188,189,190,191 + db 192,193,194,195,196,197,198,199 + db 200,201,202,203,204,205,206,207 + db 208,209,210,211,212,213,214,215 + db 216,217,218,219,220,221,222,223 + db 224,225,226,227,228,229,230,231 + db 232,233,234,235,236,237,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 + page +; +;la_collate label word +; ctable <,'COLLATE',256> +; db 000,001,002,003,004,005,006,007 +; db 008,009,010,011,012,013,014,015 +; db 016,017,018,019,020,021,022,023 +; db 024,025,026,027,028,029,030,031 +; db 032,033,034,035,036,037,038,039 +; db 040,041,042,043,044,045,046,047 +; db 048,049,050,051,052,053,054,055 +; db 056,057,058,059,060,061,062,063 +; db 064,065,066,067,068,069,070,071 +; db 072,073,074,075,076,077,078,079 +; db 080,081,082,083,084,085,086,087 +; db 088,089,090,091,092,093,094,095 +; db 096,065,066,067,068,069,070,071 +; db 072,073,074,075,076,077,078,079 +; db 080,081,082,083,084,085,086,087 +; db 088,089,090,123,124,125,126,127 +; db 128,"U","E","A","A","A","A",128 +; db "E","E","E","I","I","I","A","A" +; db "E","A","A","O","O","O","U","U" +; db "Y","O","U","$","$","$","$","$" +; db "A","I","O","U",165,165,166,167 +; db "?",169,170,171,172,"!",'"','"' +; db 176,177,178,179,180,181,182,183 +; db 184,185,186,187,188,189,190,191 +; db 192,193,194,195,196,197,198,199 +; db 200,201,202,203,204,205,206,207 +; db 208,209,210,211,212,213,214,215 +; db 216,217,218,219,220,221,222,223 +; db 224,"S" +; db 226,227,228,229,230,231 +; db 232,233,234,235,236,237,238,239 +; db 240,241,242,243,244,245,246,247 +; db 248,249,250,251,252,253,254,255 + page +la_collate label word ; new for DOS 4.0, wants same as spain +; +sp_collate label word ; new for DOS 4.0 + ctable <,'COLLATE',256> + db 000,150,151,152,153,154,155,156 ;7 + db 157,158,159,160,161,162,163,164 ;15 + db 165,166,167,168,169,170,171,172 ;23 + db 173,174,175,176,177,178,179,180 ;31 + db 000,060,061,062,063,064,065,000 ;39 + db 066,067,068,069,070,000,071,072 ;47 + db 034,035,036,037,038,039,040,041 ;55 + db 042,043,073,074,075,076,077,078 ;63 + db 079,001,002,003,006,008,009,010 ;71 + db 011,012,013,014,015,017,018,020 ;79 + db 021,022,023,024,026,028,029,030 ;87 + db 031,032,033,080,081,082,083,084 ;95 + db 085,001,002,003,006,008,009,010 ;103 + db 011,012,013,014,015,017,018,020 ;111 + db 021,022,023,024,026,028,029,030 ;119 + db 031,032,033,086,087,088,089,090 ;127 + db 004,028,008,001,001,001,001,004 ;135 + db 008,008,008,012,012,012,001,001 ;143 + db 008,001,001,020,020,020,028,028 ;151 + db 032,020,028,091,092,093,094,095 ;159 + db 001,012,020,028,019,019,001,020 ;167 + db 096,097,098,099,100,101,102,103 ;175 + db 104,105,106,107,108,181,182,183 ;183 + db 184,109,110,111,112,185,186,113 ;191 + db 114,115,116,117,118,119,187,188 ;199 + db 120,121,122,123,124,125,126,189 ;207 + db 190,191,192,193,194,195,196,197 ;215 + db 198,127,128,129,130,199,200,131 ;223 + db 201,025,202,203,204,205,132,206 ;231 + db 207,208,209,210,211,212,213,214 ;239 + db 215,133,216,217,218,219,134,220 ;247 + db 221,222,000,223,224,135,136,225 ;255 + page +; +dk_collate label word ; Denmark (dk) 865 + ctable <,'COLLATE',256> + db 000,001,002,003,004,005,006,007 + db 008,009,010,011,012,013,014,015 + db 016,017,018,019,020,021,022,023 + db 024,025,026,027,028,029,030,031 + db 032,033,034,035,036,037,038,039 + db 040,041,042,043,044,045,046,047 + db 048,049,050,051,052,053,054,055 + db 056,057,058,059,060,061,062,063 + db 064,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,040,047,041,094,095 + db 096,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,040,047,041,126,127 + db 067,089,069,065,091,065,093,067 + db 069,069,069,073,073,073,091,093 + db 069,091,091,079,092,079,085,085 + db 089,092,089,092,036,092,036,036 + db 065,073,079,085,078,078,065,079 + db 063,169,170,171,172,033,034,036 + db 176,177,178,179,180,181,182,183 + db 184,185,186,187,188,189,190,191 + db 192,193,194,195,196,197,198,199 + db 200,201,202,203,204,205,206,207 + db 208,209,210,211,212,213,214,215 + db 216,217,218,219,220,221,222,223 + db 224,083,226,227,228,229,230,231 + db 232,233,234,235,236,237,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 + page +; +no_collate label word ; Norway (no) 865 + ctable <,'COLLATE',256> + db 000,001,002,003,004,005,006,007 + db 008,009,010,011,012,013,014,015 + db 016,017,018,019,020,021,022,023 + db 024,025,026,027,028,029,030,031 + db 032,033,034,035,036,037,038,039 + db 040,041,042,043,044,045,046,047 + db 048,049,050,051,052,053,054,055 + db 056,057,058,059,060,061,062,063 + db 064,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,091,092,093,094,095 + db 096,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,123,124,125,126,127 + db 067,089,069,065,091,065,093,067 + db 069,069,069,073,073,073,091,093 + db 069,091,091,079,092,079,085,085 + db 089,092,089,092,036,092,036,036 + db 065,073,079,085,078,078,065,079 + db 063,169,170,171,172,033,034,036 + db 176,177,178,179,180,181,182,183 + db 184,185,186,187,188,189,190,191 + db 192,193,194,195,196,197,198,199 + db 200,201,202,203,204,205,206,207 + db 208,209,210,211,212,213,214,215 + db 216,217,218,219,220,221,222,223 + db 224,083,226,227,228,229,230,231 + db 232,233,234,235,236,237,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 + page +; +; Finland 437 Collate (same as Sweden) +; +fi_collate label word +; +sv_collate label word + ctable <,'COLLATE',256> + db 000,001,002,003,004,005,006,007 + db 008,009,010,011,012,013,014,015 + db 016,017,018,019,020,021,022,023 + db 024,025,026,027,028,029,030,031 + db 032,033,034,035,036,037,038,039 + db 040,041,042,043,044,045,046,047 + db 048,049,050,051,052,053,054,055 + db 056,057,058,059,060,061,062,063 + db 064,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,091,092,093,094,095 + db 096,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,123,124,125,126,127 + db 067,089,069,065,092,065,091,067 + db 069,069,069,073,073,073,092,091 + db 069,092,092,079,093,079,085,085 + db 089,093,089,036,036,036,036,036 + db 065,073,079,085,078,078,166,167 + db 063,169,170,171,172,033,034,034 + db 176,177,178,179,180,181,182,183 + db 184,185,186,187,188,189,190,191 + db 192,193,194,195,196,197,198,199 + db 200,201,202,203,204,205,206,207 + db 208,209,210,211,212,213,214,215 + db 216,217,218,219,220,221,222,223 + db 224,083,226,227,228,229,230,231 + db 232,233,234,235,236,237,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 + page +; +; Israel 862 collate +; +is_collate label word + ctable <,'COLLATE',256> + db 000,001,002,003,004,005,006,007 + db 008,009,010,011,012,013,014,015 + db 016,017,018,019,020,021,022,023 + db 024,025,026,027,028,029,030,031 + db 032,033,034,035,036,037,038,039 + db 040,041,042,043,044,045,046,047 + db 048,049,050,051,052,053,054,055 + db 056,057,058,059,060,061,062,063 + db 064,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,091,092,093,094,095 + db 096,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,123,124,125,126,127 + db 128,129,130,131,132,133,134,135 + db 136,137,138,139,140,141,142,143 + db 144,145,146,147,148,149,150,151 + db 152,153,154,036,036,036,036,036 + db 065,073,079,085,078,078,166,167 + db 063,169,170,171,172,033,034,034 + db 176,177,178,179,180,181,182,183 + db 184,185,186,187,188,189,190,191 + db 192,193,194,195,196,197,198,199 + db 200,201,202,203,204,205,206,207 + db 208,209,210,211,212,213,214,215 + db 216,217,218,219,220,221,222,223 + db 224,083,226,227,228,229,230,231 + db 232,233,234,235,236,237,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 + page +; +; Canada 863 Collate +; +ca_collate label word + ctable <,'COLLATE',256> + db 000,001,002,003,004,005,006,007 + db 008,009,010,011,012,013,014,015 + db 016,017,018,019,020,021,022,023 + db 024,025,026,027,028,029,030,031 + db 032,033,034,035,036,037,038,039 + db 040,041,042,043,044,045,046,047 + db 048,049,050,051,052,053,054,055 + db 056,057,058,059,060,061,062,063 + db 064,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,091,092,093,094,095 + db 096,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,123,124,125,126,127 + db 067,085,069,065,065,065,134,067 + db 069,069,069,073,073,141,065,143 + db 069,069,069,079,069,073,085,085 + db 152,079,085,155,156,085,085,159 + db 160,161,079,085,164,165,166,167 + db 073,169,170,171,172,173,174,175 + db 176,177,178,179,180,181,182,183 + db 184,185,186,187,188,189,190,191 + db 192,193,194,195,196,197,198,199 + db 200,201,202,203,204,205,206,207 + db 208,209,210,211,212,213,214,215 + db 216,217,218,219,220,221,222,223 + db 224,225,226,227,228,229,230,231 + db 232,233,234,235,236,237,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 + page +; +; Portugal 860 collating +; +po_collate label word + ctable <,'COLLATE',256> + db 000,001,002,003,004,005,006,007 + db 008,009,010,011,012,013,014,015 + db 016,017,018,019,020,021,022,023 + db 024,025,026,027,028,029,030,031 + db 032,033,034,035,036,037,038,039 + db 040,041,042,043,044,045,046,047 + db 048,049,050,051,052,053,054,055 + db 056,057,058,059,060,061,062,063 + db 064,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,091,092,093,094,095 + db 096,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,123,124,125,126,127 + db 067,085,069,065,065,065,065,067 + db 069,069,069,073,079,073,065,065 + db 069,065,069,079,079,079,085,085 + db 073,079,085,036,036,085,036,079 + db 065,073,079,085,078,078,166,167 + db 063,079,170,171,172,033,034,034 + db 176,177,178,179,180,181,182,183 + db 184,185,186,187,188,189,190,191 + db 192,193,194,195,196,197,198,199 + db 200,201,202,203,204,205,206,207 + db 208,209,210,211,212,213,214,215 + db 216,217,218,219,220,221,222,223 + db 224,083,226,227,228,229,230,231 + db 232,233,234,235,236,237,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 + page +; +sw_collate label word + ctable <,'COLLATE',256> + db 001,200,201,202,203,204,205,206 + db 207,208,209,210,211,212,213,214 + db 215,216,217,218,140,141,219,220 + db 221,222,223,224,225,226,227,228 + db 001,060,061,062,063,064,065,066 ;DCR059 CNS ****** ;AN000; + db 067,068,069,070,071,072,073,074 + db 032,033,034,035,036,037,038,039 + db 040,041,075,076,077,078,079,080 + db 081,002,003,004,005,007,008,009 + db 010,011,012,013,014,015,016,018 + db 019,020,021,022,024,026,027,028 + db 029,030,031,082,083,084,052,085 + db 051,002,003,004,005,007,008,009 + db 010,011,012,013,014,015,016,018 + db 019,020,021,022,024,026,027,028 + db 029,030,031,086,087,088,054,089 + db 004,026,007,002,002,002,002,004 + db 007,007,007,011,011,011,002,002 + db 007,002,002,018,018,018,026,026 + db 030,018,026,111,090,112,150,092 + db 002,011,018,026,017,017,002,018 + db 093,151,095,096,097,098,099,100 + db 101,102,103,104,105,152,153,154 + db 155,107,108,109,110,156,157,113 + db 114,115,116,117,118,119,158,159 + db 120,121,122,123,124,125,126,160 + db 161,162,163,164,165,166,167,168 + db 169,128,129,130,131,170,171,133 + db 172,023,173,174,175,176,134,177 + db 178,179,180,181,182,183,184,185 + db 186,137,187,188,189,190,142,191 + db 143,192,144,193,194,147,148,001 + page +; +be_collate label word + ctable <,'COLLATE',256> + db 255,255,255,255,255,255,255,255 + db 255,255,255,255,255,255,255,255 + db 255,255,255,255,255,255,255,255 + db 255,255,255,255,255,255,255,255 + db 255,033,034,035,036,037,038,255 + db 040,041,042,043,044,255,046,047 + db 048,049,050,051,052,053,054,055 + db 056,057,058,059,060,061,062,063 + db 064,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,091,092,093,094,095 + db 096,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,123,124,125,126,127 + db 067,085,069,065,065,065,065,067 + db 069,069,069,073,073,073,065,065 + db 069,065,065,079,079,079,085,085 + db 089,079,085,155,156,157,158,159 + db 065,073,079,085,078,078,166,167 + db 168,169,170,171,172,173,174,175 + db 255,255,255,255,255,255,255,255 + db 255,255,255,255,255,255,255,255 + db 255,255,255,255,255,255,255,255 + db 255,255,255,255,255,255,255,255 + db 255,255,255,255,255,255,255,255 + db 255,255,255,255,255,255,255,255 + db 224,083,226,227,228,229,230,231 + db 232,233,234,235,236,237,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,255,255 + page +; +; Area South 864 Collate +; +as_collate label word + ctable <,'COLLATE',256> + db 000,001,002,003,004,005,006,007 + db 008,009,010,011,012,013,014,015 + db 016,017,018,019,020,021,022,023 + db 024,025,026,027,028,029,030,031 + db 032,033,034,035,036,037,038,039 + db 040,041,042,043,044,045,046,047 + db 048,049,050,051,052,053,054,055 + db 056,057,058,059,060,061,062,063 + db 064,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,091,092,093,094,095 + db 096,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,123,124,125,126,127 + db 128,129,130,131,132,133,134,135 + db 136,137,138,139,140,141,142,143 + db 144,145,146,147,148,149,150,151 + db 152,233,234,251,255,235,236,179 + db 153,154,182,155,156,184,253,254 + db 188,189,192,194,163,196,198,200 + db 164,165,166,167,168,169,170,171 + db 172,173,224,174,206,208,210,175 + db 157,180,181,183,185,217,186,187 + db 190,191,193,195,197,199,201,202 + db 203,204,205,207,209,211,213,214 + db 215,218,222,158,159,160,161,216 + db 178,225,227,229,237,239,241,243 + db 245,246,250,212,219,221,220,238 + db 177,176,240,242,244,247,249,223 + db 226,231,232,230,228,248,162,255 + + + page +; +; ----------------------------------------- +; +; Collating Tables for Code Page 850 +; +; ----------------------------------------- +; +fr850_collate label word +; +ca850_collate label word +; +us850_collate label word +; +uk850_collate label word +; +it850_collate label word +; +;;sp850_collate label word ; spain now has there own +; +is850_collate label word +; +po850_collate label word +; +;;la850_collate label word ; wants same as spain +; +as850_collate label word +; +gr850_collate label word ;omitted tobe consistent with US DCR +; +afe850_collate label word + ctable <,'COLLATE',256> + db 000,001,002,003,004,005,006,007 + db 008,009,010,011,012,013,014,015 + db 016,017,018,019,020,021,022,023 + db 024,025,026,027,028,029,030,031 + db 032,033,034,035,036,037,038,039 + db 040,041,042,043,044,045,046,047 + db 048,049,050,051,052,053,054,055 + db 056,057,058,059,060,061,062,063 + db 064,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,091,092,093,094,095 + db 096,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,123,124,125,126,127 + db 067,085,069,065,065,065,065,067 + db 069,069,069,073,073,073,065,065 + db 069,065,065,079,079,079,085,085 + db 089,079,085,079,036,079,158,036 + db 065,073,079,085,078,078,166,167 + db 063,169,170,171,172,033,034,034 + db 176,177,178,179,180,065,065,065 + db 184,185,186,187,188,036,036,191 + db 192,193,194,195,196,197,065,065 + db 200,201,202,203,204,205,206,036 + db 068,068,069,069,069,073,073,073 + db 073,217,218,219,220,221,073,223 + db 079,083,079,079,079,079,230,232 + db 232,085,085,085,089,089,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 + page + +;formerly GERMAN COLLATE TABLE DCR0037 +; ctable <,'COLLATE',256> +; db 000,001,002,003,004,005,006,007 +; db 008,009,010,011,012,013,014,015 +; db 016,017,018,019,020,021,022,023 +; db 024,025,026,027,028,029,030,031 +; db 032,033,034,035,036,037,038,039 +; db 040,041,042,043,044,045,046,047 +; db 048,049,050,051,052,053,054,055 +; db 056,057,058,059,060,061,062,063 +; db 064,065,066,067,068,069,070,071 +; db 072,073,074,075,076,077,078,079 +; db 080,081,082,083,084,085,086,087 +; db 088,089,090,091,092,093,094,095 +; db 096,065,066,067,068,069,070,071 +; db 072,073,074,075,076,077,078,079 +; db 080,081,082,083,084,085,086,087 +; db 088,089,090,123,124,125,126,127 +; db 067,117,069,065,097,065,065,067 +; db 069,069,069,073,073,073,065,065 +; db 069,065,065,079,111,079,085,085 +; db 089,079,085,079,036,079,158,036 +; db 065,073,079,085,078,078,166,167 +; db 063,169,170,171,172,033,034,034 +; db 176,177,178,179,180,065,065,065 +; db 184,185,186,187,188,036,036,191 +; db 192,193,194,195,196,197,065,065 +; db 200,201,202,203,204,205,206,036 +; db 068,068,069,069,069,073,073,073 +; db 073,217,218,219,220,221,073,223 +; db 079,115,079,079,079,079,230,232 +; db 232,085,085,085,089,089,238,239 +; db 240,241,242,243,244,245,246,247 +; db 248,249,250,251,252,253,254,255 + page +; +nl850_collate label word + ctable <,'COLLATE',256> + db 000,001,002,003,004,005,006,007 + db 008,009,010,011,012,013,014,015 + db 016,017,018,019,020,021,022,023 + db 024,025,026,027,028,029,030,031 + db 032,033,034,035,036,037,038,039 + db 040,041,042,043,044,045,046,047 + db 048,049,050,051,052,053,054,055 + db 056,057,058,059,060,061,062,063 + db 064,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,091,092,093,094,095 + db 096,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,123,124,125,126,127 + db 067,085,069,065,065,065,143,067 + db 069,069,069,073,073,073,065,143 + db 069,146,146,079,079,079,085,085 + db 152,079,085,079,156,079,158,159 + db 065,073,079,085,165,165,166,167 + db 168,169,170,171,172,173,174,175 + db 176,177,178,179,180,065,065,065 + db 184,185,186,187,188,189,190,191 + db 192,193,194,195,196,197,065,065 + db 200,201,202,203,204,205,206,207 + db 209,209,069,069,069,073,073,073 + db 073,217,218,219,220,221,073,223 + db 079,225,079,079,079,079,230,232 + db 232,085,085,085,089,089,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 + page +; +dk850_collate label word + ctable <,'COLLATE',256> + db 000,001,002,003,004,005,006,007 + db 008,009,010,011,012,013,014,015 + db 016,017,018,019,020,021,022,023 + db 024,025,026,027,028,029,030,031 + db 032,033,034,035,036,037,038,039 + db 040,041,042,043,044,045,046,047 + db 048,049,050,051,052,053,054,055 + db 056,057,058,059,060,061,062,063 + db 064,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,040,047,041,094,095 + db 096,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,040,047,041,126,127 + db 067,089,069,065,091,065,093,067 + db 069,069,069,073,073,073,091,093 + db 069,091,091,079,092,079,085,085 + db 089,092,089,092,036,092,158,036 + db 065,073,079,085,078,078,065,079 + db 063,169,170,171,172,033,034,034 + db 176,177,178,179,180,065,065,065 + db 184,185,186,187,188,036,036,191 + db 192,193,194,195,196,197,065,065 + db 200,201,202,203,204,205,206,036 + db 068,068,069,069,069,073,073,073 + db 073,217,218,219,220,221,073,223 + db 079,083,079,079,079,079,230,080 + db 080,085,085,085,089,089,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 + page +; +no850_collate label word + ctable <,'COLLATE',256> + db 000,001,002,003,004,005,006,007 + db 008,009,010,011,012,013,014,015 + db 016,017,018,019,020,021,022,023 + db 024,025,026,027,028,029,030,031 + db 032,033,034,035,036,037,038,039 + db 040,041,042,043,044,045,046,047 + db 048,049,050,051,052,053,054,055 + db 056,057,058,059,060,061,062,063 + db 064,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,091,092,093,094,095 + db 096,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,123,124,125,126,127 + db 067,085,069,065,091,065,093,067 + db 069,069,069,073,073,073,091,093 + db 069,091,091,079,092,079,085,085 + db 089,092,089,092,036,092,158,036 + db 065,073,079,085,078,078,065,079 + db 063,169,170,171,172,033,034,034 + db 176,177,178,179,180,065,065,065 + db 184,185,186,187,188,036,036,191 + db 192,193,194,195,196,197,065,065 + db 200,201,202,203,204,205,206,036 + db 068,068,069,069,069,073,073,073 + db 073,217,218,219,220,221,073,223 + db 079,083,079,079,079,079,230,080 + db 080,085,085,085,089,089,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 + page +; +sv850_collate label word + ctable <,'COLLATE',256> + db 000,001,002,003,004,005,006,007 + db 008,009,010,011,012,013,014,015 + db 016,017,018,019,020,021,022,023 + db 024,025,026,027,028,029,030,031 + db 032,033,034,035,036,037,038,039 + db 040,041,042,043,044,045,046,047 + db 048,049,050,051,052,053,054,055 + db 056,057,058,059,060,061,062,063 + db 064,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,091,092,093,094,095 + db 096,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,123,124,125,126,127 + db 067,089,069,065,092,065,091,067 + db 069,069,069,073,073,073,092,091 + db 069,092,092,079,093,079,085,085 + db 089,093,089,093,036,093,158,036 + db 065,073,079,085,078,078,166,167 + db 063,169,170,171,172,033,034,034 + db 176,177,178,179,180,065,065,065 + db 184,185,186,187,188,036,036,191 + db 192,193,194,195,196,197,065,065 + db 200,201,202,203,204,205,206,036 + db 068,068,069,069,069,073,073,073 + db 073,217,218,219,220,221,073,223 + db 079,083,079,079,093,093,230,232 + db 232,085,085,085,089,089,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 + page +; +fi850_collate label word + ctable <,'COLLATE',256> + db 000,001,002,003,004,005,006,007 + db 008,009,010,011,012,013,014,015 + db 016,017,018,019,020,021,022,023 + db 024,025,026,027,028,029,030,031 + db 032,033,034,035,036,037,038,039 + db 040,041,042,043,044,045,046,047 + db 048,049,050,051,052,053,054,055 + db 056,057,058,059,060,061,062,063 + db 064,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,091,092,093,094,095 + db 096,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,123,124,125,126,127 + db 067,089,069,065,092,065,091,067 + db 069,069,069,073,073,073,092,091 + db 069,092,092,079,093,079,085,085 + db 089,093,089,093,036,093,158,036 + db 065,073,079,085,078,078,166,167 + db 063,169,170,171,172,033,034,034 + db 176,177,178,179,180,065,065,065 + db 184,185,186,187,188,036,036,191 + db 192,193,194,195,196,197,065,065 + db 200,201,202,203,204,205,206,036 + db 068,068,069,069,069,073,073,073 + db 073,217,218,219,220,221,073,223 + db 079,083,079,079,079,079,230,232 + db 232,085,085,085,089,089,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 + page +; +sw850_collate label word + ctable <,'COLLATE',256> + + db 224,225,226,227,228,229,230,231 + db 232,233,234,235,236,237,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 + db 000,165,168,133,185,134,135,169 + db 170,171,136,158,172,174,175,176 + db 117,118,120,122,124,125,126,127 + db 128,129,177,178,160,161,162,179 + db 137,002,018,020,024,028,038,040 + db 042,044,055,057,059,061,063,067 + db 081,083,085,087,090,094,104,106 + db 108,110,115,138,139,140,191,173 + db 190,003,019,021,025,029,039,041 + db 043,056,045,058,060,062,064,068 + db 082,084,086,088,091,095,105,107 + db 109,111,116,142,143,144,193,157 + db 022,103,031,009,011,007,015,023 + db 035,037,033,053,051,049,010,014 + db 030,017,016,074,076,072,101,099 + db 114,075,102,080,184,079,164,188 + db 005,047,070,097,066,065,149,148 + db 180,154,156,131,130,166,181,182 + db 207,208,209,206,204,004,008,006 + db 153,210,211,212,213,186,187,198 + db 197,202,201,203,205,200,013,012 + db 214,215,216,217,218,219,220,183 + db 027,026,034,036,032,054,046,050 + db 052,199,196,223,221,155,048,222 + db 069,089,073,071,078,077,146,092 + db 093,096,100,098,113,112,145,189 + db 167,159,141,132,151,150,163,194 + db 147,192,195,119,123,121,152,001 + +; db 001,200,201,202,203,204,205,206 +; db 207,208,209,210,211,212,213,214 +; db 215,216,217,218,140,141,219,220 +; db 221,222,223,224,225,226,227,228 +; db 001,060,061,062,063,064,065,066 +; db 067,068,069,070,071,072,073,074 +; db 032,033,034,035,036,037,038,039 +; db 040,041,075,076,077,078,079,080 +; db 081,002,003,004,005,007,008,009 +; db 010,011,012,013,014,015,016,018 +; db 019,020,021,022,024,026,027,028 +; db 029,030,031,082,083,084,052,085 +; db 051,002,003,004,005,007,008,009 +; db 010,011,012,013,014,015,016,018 +; db 019,020,021,022,024,026,027,028 +; db 029,030,031,086,087,088,054,089 +; db 004,026,007,002,002,002,002,004 +; db 007,007,007,011,011,011,002,002 +; db 007,002,002,018,018,018,026,026 +; db 030,018,026,018,090,018,091,092 +; db 002,011,018,026,017,017,002,018 +; db 093,094,095,096,097,098,099,100 +; db 101,102,103,104,105,002,002,002 +; db 106,107,108,109,110,111,112,113 +; db 114,115,116,117,118,119,002,002 +; db 120,121,122,123,124,125,126,127 +; db 006,006,007,007,007,011,011,011 +; db 011,128,129,130,131,132,011,133 +; db 018,023,018,018,018,018,134,025 +; db 025,026,026,026,030,030,135,050 +; db 136,137,138,139,140,141,142,055 +; db 143,053,144,145,146,147,148,001 + page +; +be850_collate label word + ctable <,'COLLATE',256> + db 255,255,255,255,255,255,255,255 + db 255,255,255,255,255,255,255,255 + db 255,255,255,255,255,255,255,255 + db 255,255,255,255,255,255,255,255 + db 255,033,034,035,036,037,038,255 + db 040,041,042,043,044,255,046,047 + db 048,049,050,051,052,053,054,055 + db 056,057,058,059,060,061,062,063 + db 064,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,091,092,093,094,095 + db 096,065,066,067,068,069,070,071 + db 072,073,074,075,076,077,078,079 + db 080,081,082,083,084,085,086,087 + db 088,089,090,123,124,125,126,127 + db 067,085,069,065,065,065,065,067 + db 069,069,069,073,073,073,065,065 + db 069,065,065,079,079,079,085,085 + db 089,079,085,079,156,079,158,159 + db 065,073,079,085,078,164,166,167 + db 168,169,170,171,172,173,174,175 + db 255,255,255,255,255,065,065,065 + db 184,255,255,255,255,189,190,255 + db 255,255,255,255,255,255,065,065 + db 255,255,255,255,255,255,255,207 + db 068,068,069,069,069,073,073,073 + db 073,255,255,255,255,221,073,255 + db 079,083,079,079,079,079,230,084 + db 084,085,085,085,089,089,238,239 + db 255,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,255,255 + page + +la850_collate label word ; wants same as spain +; +sp850_collate label word ; new for DOS 4.0 + ctable <,'COLLATE',256> + db 000,150,151,152,153,154,155,156 ;7 + db 157,158,159,160,161,162,163,164 ;15 + db 165,166,167,168,169,170,171,172 ;23 + db 173,174,175,176,177,178,179,180 ;31 + db 000,060,061,062,063,064,065,000 ;39 + db 066,067,068,069,070,000,071,072 ;47 + db 034,035,036,037,038,039,040,041 ;55 + db 042,043,073,074,075,076,077,078 ;63 + db 079,001,002,003,006,008,009,010 ;71 + db 011,012,013,014,015,017,018,020 ;79 + db 021,022,023,024,026,028,029,030 ;87 + db 031,032,033,080,081,082,083,084 ;95 + db 085,001,002,003,006,008,009,010 ;103 + db 011,012,013,014,015,017,018,020 ;111 + db 021,022,023,024,026,028,029,030 ;119 + db 031,032,033,086,087,088,089,090 ;127 + db 004,028,008,001,001,001,001,004 ;135 + db 008,008,008,012,012,012,001,001 ;143 + db 008,001,001,020,020,020,028,028 ;151 + db 032,020,028,020,092,020,094,095 ;159 + db 001,012,020,028,019,019,001,020 ;167 + db 096,097,098,099,100,101,102,103 ;175 + db 104,105,106,107,108,001,001,001 ;183 + db 184,109,110,001,001,091,093,113 ;191 + db 114,115,116,117,118,119,187,188 ;199 + db 120,121,122,123,124,125,126,189 ;207 + db 007,007,008,008,008,012,012,012 ;215 + db 012,127,128,129,130,199,012,131 ;223 + db 020,025,020,020,020,020,132,027 ;231 + db 027,028,028,028,032,032,213,214 ;239 + db 000,133,216,217,218,219,134,220 ;247 + db 221,222,000,223,224,135,136,225 ;255 + + page +; +jp932_collate label word + ctable <,'COLLATE',256> + db 0,1,2,3,4,5,6,7 + db 8,9,10,11,12,13,14,15 + db 16,17,18,19,20,21,22,23 + db 24,25,26,27,28,29,30,31 + db " ","!",'"',"#","$","%","&","'" + db "(",")","*","+",",","-",".","/" + db "0","1","2","3","4","5","6","7" + db "8","9",":",";","<","=",">","?" + db "@","A","B","C","D","E","F","G" + db "H","I","J","K","L","M","N","O" + db "P","Q","R","S","T","U","V","W" + db "X","Y","Z","[","\","]","^","_" + db "`","A","B","C","D","E","F","G" + db "H","I","J","K","L","M","N","O" + db "P","Q","R","S","T","U","V","W" + db "X","Y","Z","{","|","}","~",127 + db 128,193,194,195,196,197,198,199 + db 200,201,202,203,204,205,206,207 + db 208,209,210,211,212,213,214,215 + db 216,217,218,219,220,221,222,223 + db 129,130,131,132,133,189,134,135 + db 136,137,138,139,140,141,142,143 + db 144,145,146,147,148,149,150,151 + db 152,153,154,155,156,157,158,159 + db 160,161,162,163,164,165,166,167 + db 168,169,170,171,172,173,174,175 + db 176,177,178,179,180,181,182,183 + db 184,185,186,187,188,190,191,192 + db 224,225,226,227,228,229,230,231 + db 232,233,234,235,236,237,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 + page +; +ko934_collate label word + ctable <,'COLLATE',256> + db 0,1,2,3,4,5,6,7 + db 8,9,10,11,12,13,14,15 + db 16,17,18,19,20,21,22,23 + db 24,25,26,27,28,29,30,31 + db " ","!",'"',"#","$","%","&","'" + db "(",")","*","+",",","-",".","/" + db "0","1","2","3","4","5","6","7" + db "8","9",":",";","<","=",">","?" + db "@","A","B","C","D","E","F","G" + db "H","I","J","K","L","M","N","O" + db "P","Q","R","S","T","U","V","W" + db "X","Y","Z","[","\","]","^","_" + db "`","A","B","C","D","E","F","G" + db "H","I","J","K","L","M","N","O" + db "P","Q","R","S","T","U","V","W" + db "X","Y","Z","{","|","}","~",127 + db 128,190,191,192,193,194,195,196 + db 197,198,199,200,201,202,203,204 + db 205,206,207,208,209,210,211,212 + db 213,214,215,216,217,218,219,220 + db 221,222,223,224,225,226,227,228 + db 229,230,231,232,233,234,235,236 + db 237,238,239,240,241,242,243,244 + db 245,246,247,248,249,250,251,252 + db 129,130,131,132,133,134,135,136 + db 137,138,139,140,141,142,143,144 + db 145,146,147,148,149,150,151,152 + db 153,154,155,156,157,158,159,160 + db 161,162,163,164,165,166,167,168 + db 169,170,171,172,173,174,175,176 + db 177,178,179,180,181,182,183,184 + db 185,186,187,188,189,253,254,255 + + page +; +pr936_collate label word +; +ta938_collate label word + ctable <,'COLLATE',256> + db 0,1,2,3,4,5,6,7 + db 8,9,10,11,12,13,14,15 + db 16,17,18,19,20,21,22,23 + db 24,25,26,27,28,29,30,31 + db " ","!",'"',"#","$","%","&","'" + db "(",")","*","+",",","-",".","/" + db "0","1","2","3","4","5","6","7" + db "8","9",":",";","<","=",">","?" + db "@","A","B","C","D","E","F","G" + db "H","I","J","K","L","M","N","O" + db "P","Q","R","S","T","U","V","W" + db "X","Y","Z","[","\","]","^","_" + db "`","A","B","C","D","E","F","G" + db "H","I","J","K","L","M","N","O" + db "P","Q","R","S","T","U","V","W" + db "X","Y","Z","{","|","}","~",127 + db 128,129,130,131,132,133,134,135 + db 136,137,138,139,140,141,142,143 + db 144,145,146,147,148,149,150,151 + db 152,153,154,155,156,157,158,159 + db 160,161,162,163,164,165,166,167 + db 168,169,170,171,172,173,174,175 + db 176,177,178,179,180,181,182,183 + db 184,185,186,187,188,189,190,191 + db 192,193,194,195,196,197,198,199 + db 200,201,202,203,204,205,206,207 + db 208,209,210,211,212,213,214,215 + db 216,217,218,219,220,221,222,223 + db 224,225,226,227,228,229,230,231 + db 232,233,234,235,236,237,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 + + page +; +; --------------------------------------------------------------- +; +; World Trade Case Mappings +; +; --------------------------------------------------------------- +; +us_ucase label word +; +uk_ucase label word +; +fr_ucase label word +; +gr_ucase label word +; +sp_ucase label word +; +la_ucase label word +; +it_ucase label word +; +afe_ucase label word +; +as_ucase label word +; +jp437_ucase label word +; +ko437_ucase label word +; +pr437_ucase label word +; +ta437_ucase label word + ctable <,'UCASE ',128> +;***CNS PTM2390 table omitted ;AN000; +;***CNS restored for PTM 2575 to establish consistent and maintain 3.3 & +;under compatibility + db 128,154,069,065,142,065,143,128 + db 069,069,069,073,073,073,142,143 + db 144,146,146,079,153,079,085,085 + db 089,153,154,155,156,157,158,159 + db 065,073,079,085,165,165,166,167 + db 168,169,170,171,172,173,174,175 + db 176,177,178,179,180,181,182,183 + db 184,185,186,187,188,189,190,191 + db 192,193,194,195,196,197,198,199 + db 200,201,202,203,204,205,206,207 + db 208,209,210,211,212,213,214,215 + db 216,217,218,219,220,221,222,223 + db 224,225,226,227,228,229,230,231 + db 232,233,234,235,236,237,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 +;***CNS PTM2390 table omitted +;**CNS replacement +; db 067,085,069,065,065,065,065,067 ;AD000; +; db 069,069,069,073,073,073,065,065 ;AD000; +; db 069,146,146,079,079,079,085,085 ;AD000; +; db 089,079,085,079,156,079,158,159 ;AD000; +; db 065,073,079,085,165,165,166,167 ;AD000; +; db 168,169,170,171,172,173,174,175 ;AD000; +; db 176,177,178,179,180,065,065,065 ;AD000; +; db 184,185,186,187,188,189,190,191 ;AD000; +; db 192,193,194,195,196,197,065,065 ;AD000; +; db 200,201,202,203,204,205,206,207 ;AD000; +; db 209,209,069,069,069,073,073,073 ;AD000; +; db 073,217,218,219,220,221,073,223 ;AD000; +; db 079,225,079,079,079,079,230,232 ;AD000; +; db 232,085,085,085,089,089,238,239 ;AD000; +; db 240,241,242,243,244,245,246,247 ;AD000; +; db 248,249,250,251,252,253,254,255 ;AD000; +; +page +; Canadian French Code Page 863 +; +ca_ucase label word + ctable <,'UCASE ',128> + db 067,085,069,065,065,065,134,067 + db 069,069,069,073,073,141,065,143 + db 069,069,069,079,069,073,085,085 + db 152,079,085,155,156,085,085,159 + db 160,161,079,085,164,165,166,167 + db 073,169,170,171,172,173,174,175 + db 176,177,178,179,180,181,182,183 + db 184,185,186,187,188,189,190,191 + db 192,193,194,195,196,197,198,199 + db 200,201,202,203,204,205,206,207 + db 208,209,210,211,212,213,214,215 + db 216,217,218,219,220,221,222,223 + db 224,225,226,227,228,229,230,231 + db 232,233,234,235,236,237,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 +page +; Denmark (Da) case mapping for 865 +; +dk_ucase label word +; +; Norway (No) case mapping for 865 +; +no_ucase label word + ctable <,'UCASE ',128> + db 128,154,144,065,142,065,143,128 + db 069,069,069,073,073,073,142,143 + db 144,146,146,079,153,079,085,085 + db 089,153,154,157,156,157,158,159 + db 065,073,079,085,165,165,166,167 + db 168,169,170,171,172,173,174,175 + db 176,177,178,179,180,181,182,183 + db 184,185,186,187,188,189,190,191 + db 192,193,194,195,196,197,198,199 + db 200,201,202,203,204,205,206,207 + db 208,209,210,211,212,213,214,215 + db 216,217,218,219,220,221,222,223 + db 224,225,226,227,228,229,230,231 + db 232,233,234,235,236,237,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 +page +; Belgium (Be) case mapping for 437 +; +be_ucase label word +; +; Finland (Fi) case mapping for 437 +; +fi_ucase label word +; +; Sweden (Sv) case mapping +; +sv_ucase label word + ctable <,'UCASE ',128> + db 128,154,144,065,142,065,143,128 + db 069,069,069,073,073,073,142,143 + db 144,146,146,079,153,079,085,085 + db 089,153,154,155,156,157,158,159 + db 065,073,079,085,165,165,166,167 + db 168,169,170,171,172,173,174,175 + db 176,177,178,179,180,181,182,183 + db 184,185,186,187,188,189,190,191 + db 192,193,194,195,196,197,198,199 + db 200,201,202,203,204,205,206,207 + db 208,209,210,211,212,213,214,215 + db 216,217,218,219,220,221,222,223 + db 224,225,226,227,228,229,230,231 + db 232,233,234,235,236,237,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 +page +; Switzerland case mapping for 437 +; +sw_ucase label word + ctable <,'UCASE ',128> + db 128,154,144,065,142,065,143,128 + db 069,069,069,073,073,073,142,143 + db 144,146,146,079,153,079,085,085 + db 089,153,154,155,156,157,158,159 + db 065,073,079,085,165,165,166,167 ;AN000;;DCR 059 CNS *** + db 168,169,170,171,172,173,174,175 + db 176,177,178,179,180,181,182,183 + db 184,185,186,187,188,189,190,191 + db 192,193,194,195,196,197,198,199 + db 200,201,202,203,204,205,206,207 + db 208,209,210,211,212,213,214,215 + db 216,217,218,219,220,221,222,223 + db 224,225,226,227,228,229,230,231 + db 232,233,234,235,236,237,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 +page +; +; Netherlands case mapping for 437 +; +nl_ucase label word + ctable <,'UCASE ',128> + db 128,085,069,065,065,065,143,128 + db 069,069,069,073,073,073,065,143 + db 069,146,146,079,079,079,085,085 + db 152,079,085,155,156,157,158,159 + db 065,073,079,085,165,165,166,167 + db 168,169,170,171,172,173,174,175 + db 176,177,178,179,180,181,182,183 + db 184,185,186,187,188,189,190,191 + db 192,193,194,195,196,197,198,199 + db 200,201,202,203,204,205,206,207 + db 208,209,210,211,212,213,214,215 + db 216,217,218,219,220,221,222,223 + db 224,225,226,227,228,229,230,231 + db 232,233,234,235,236,237,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 +page +; +; Portuguese (Po) case mapping +; +po_ucase label word + ctable <,'UCASE ',128> + db 128,154,144,143,142,145,134,128 + db 137,137,146,139,140,152,142,143 + db 144,145,146,140,153,169,150,157 + db 152,153,154,155,156,157,158,159 + db 134,139,159,150,165,165,166,167 + db 168,169,170,171,172,173,174,175 + db 176,177,178,179,180,181,182,183 + db 184,185,186,187,188,189,190,191 + db 192,193,194,195,196,197,198,199 + db 200,201,202,203,204,205,206,207 + db 208,209,210,211,212,213,214,215 + db 216,217,218,219,220,221,222,223 + db 224,225,226,227,228,229,230,231 + db 232,233,234,235,236,237,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 +page +; +; Is case mapping +; +is_ucase label word + ctable <,'UCASE ',128> + db 128,129,130,131,132,133,134,135 + db 136,137,138,139,140,141,142,143 + db 144,145,146,147,148,149,150,151 + db 152,153,154,155,156,157,158,159 + db 065,073,079,085,165,165,166,167 + db 168,169,170,171,172,173,174,175 + db 176,177,178,179,180,181,182,183 + db 184,185,186,187,188,189,190,191 + db 192,193,194,195,196,197,198,199 + db 200,201,202,203,204,205,206,207 + db 208,209,210,211,212,213,214,215 + db 216,217,218,219,220,221,222,223 + db 224,225,226,227,228,229,230,231 + db 232,233,234,235,236,237,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 +page +; +us850_ucase label word +; +afe850_ucase label word +; +uk850_ucase label word +; +fr850_ucase label word +; +it850_ucase label word +; +is850_ucase label word +; +as850_ucase label word +; +po850_ucase label word +; +ca850_ucase label word + ctable <,'UCASE ',128> +;**CNS replacement + db 067,085,069,065,065,065,065,067 + db 069,069,069,073,073,073,065,065 + db 069,146,146,079,079,079,085,085 + db 089,079,085,079,156,079,158,159 + db 065,073,079,085,165,165,166,167 + db 168,169,170,171,172,173,174,175 + db 176,177,178,179,180,065,065,065 + db 184,185,186,187,188,189,190,191 + db 192,193,194,195,196,197,065,065 + db 200,201,202,203,204,205,206,207 + db 209,209,069,069,069,073,073,073 + db 073,217,218,219,220,221,073,223 + db 079,225,079,079,079,079,230,232 + db 232,085,085,085,089,089,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 +; +;***CNS PTM2390 table omitted +; db 128,154,069,065,142,065,143,128 ;AN000; +; db 069,069,069,073,073,073,142,143 ;AN000; +; db 144,146,146,079,153,079,085,085 ;AN000; +; db 089,153,154,155,156,157,158,159 ;AN000; +; db 065,073,079,085,165,165,166,167 ;AN000; +; db 168,169,170,171,172,173,174,175 ;AN000; +; db 176,177,178,179,180,181,182,183 ;AN000; +; db 184,185,186,187,188,189,190,191 ;AN000; +; db 192,193,194,195,196,197,198,199 ;AN000; +; db 200,201,202,203,204,205,206,207 ;AN000; +; db 208,209,210,211,212,213,214,215 ;AN000; +; db 216,217,218,219,220,221,222,223 ;AN000; +; db 224,225,226,227,228,229,230,231 ;AN000; +; db 232,233,234,235,236,237,238,239 ;AN000; +; db 240,241,242,243,244,245,246,247 ;AN000; +; db 248,249,250,251,252,253,254,255 ;AN000; +;***CNS PTM2390 table omitted +; +;;la850_ucase label word - LA wants same as spain +; +;; sp850_ucase label word - changed for 4.0 +; ctable <,'UCASE ',128> +; db 128,085,069,065,065,065,065,128 +; db 069,069,069,073,073,073,065,065 +; db 069,146,146,079,079,079,085,085 +; db 089,079,085,079,156,079,158,159 +; db 065,073,079,085,165,165,166,167 +; db 168,169,170,171,172,173,174,175 +; db 176,177,178,179,180,065,065,065 +; db 184,185,186,187,188,189,190,191 +; db 192,193,194,195,196,197,065,065 +; db 200,201,202,203,204,205,206,207 +; db 209,209,069,069,069,073,073,073 +; db 073,217,218,219,220,221,073,223 +; db 079,225,079,079,079,079,230,232 +; db 232,085,085,085,089,089,238,239 +; db 240,241,242,243,244,245,246,247 +; db 248,249,250,251,252,253,254,255 +; +gr850_ucase label word + ctable <,'UCASE ',128> + db 067,154,069,065,142,065,065,067 + db 069,069,069,073,073,073,142,065 + db 069,146,146,079,153,079,085,085 + db 089,153,154,079,156,079,158,159 + db 065,073,079,085,165,165,166,167 + db 168,169,170,171,172,173,174,175 + db 176,177,178,179,180,065,065,065 + db 184,185,186,187,188,189,190,191 + db 192,193,194,195,196,197,065,065 + db 200,201,202,203,204,205,206,207 + db 209,209,069,069,069,073,073,073 + db 073,217,218,219,220,221,073,223 + db 079,225,079,079,079,079,230,232 + db 232,085,085,085,089,089,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 +page +; +; LA case mapping for 850, new for DOS 4.0 to be same as Spain +; +la850_ucase label word +; +; Spain (sp) case mapping for 850, new for DOS 4.0 +; +sp850_ucase label word +; +; Belgium (Be) case mapping for 850 +; +be850_ucase label word +; +; Finland (Fi) case mapping for 850 +; +fi850_ucase label word +; +; Sweden (Sv) case mapping for 850 +; +sv850_ucase label word +; +; Denmark (Da) case mapping for 850 +; +dk850_ucase label word +; +; Norway (No) case mapping for 850 +; +no850_ucase label word + ctable <,'UCASE ',128> + db 128,154,144,182,142,183,143,128 + db 210,211,212,216,215,222,142,143 + db 144,146,146,226,153,227,234,235 + db 089,153,154,157,156,157,158,159 + db 181,214,224,233,165,165,166,167 + db 168,169,170,171,172,173,174,175 + db 176,177,178,179,180,181,182,183 + db 184,185,186,187,188,189,190,191 + db 192,193,194,195,196,197,199,199 + db 200,201,202,203,204,205,206,207 + db 209,209,210,211,212,073,214,215 + db 216,217,218,219,220,221,222,223 + db 224,225,226,227,229,229,230,232 + db 232,233,234,235,237,237,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 +page +; Switzerland (Sw) Case mapping (850) +; +sw850_ucase label word + ctable <,'UCASE ',128> + db 128,154,144,182,142,183,143,128 + db 210,211,212,216,215,222,142,143 + db 144,146,146,226,153,227,234,235 + db 089,153,154,157,156,157,158,159 + db 181,214,224,233,165,165,166,167 ;DCR059 CNS ** ;AN000; + db 168,169,170,171,172,173,174,175 + db 176,177,178,179,180,181,182,183 + db 184,185,186,187,188,189,190,191 + db 192,193,194,195,196,197,199,199 + db 200,201,202,203,204,205,206,207 + db 209,209,210,211,212,073,214,215 + db 216,217,218,219,220,221,222,223 + db 224,225,226,227,229,229,230,232 + db 232,233,234,235,237,237,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 +; +; Netherlands (Nl) case mapping 850 +; +nl850_ucase label word + ctable <,'UCASE ',128> + db 128,085,069,065,065,065,143,128 + db 069,069,069,073,073,073,065,143 + db 069,146,146,079,079,079,085,085 + db 152,079,085,079,156,079,158,159 + db 065,073,079,085,165,165,166,167 + db 168,169,170,171,172,173,174,175 + db 176,177,178,179,180,065,065,065 + db 184,185,186,187,188,189,190,191 + db 192,193,194,195,196,197,065,065 + db 200,201,202,203,204,205,206,207 + db 209,209,069,069,069,073,073,073 + db 073,217,218,219,220,221,073,223 + db 079,225,079,079,079,079,230,232 + db 232,085,085,085,089,089,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 +page +; +; Japan case mapping 932 +; +jp932_ucase label word +; +ko934_ucase label word +; +pr936_ucase label word +; +ta938_ucase label word + ctable <,'UCASE ',128> + db 128,129,130,131,132,133,134,135 + db 136,137,138,139,140,141,142,143 + db 144,145,146,147,148,149,150,151 + db 152,153,154,155,156,157,158,159 + db 160,161,162,163,164,165,166,167 + db 168,169,170,171,172,173,174,175 + db 176,177,178,179,180,181,182,183 + db 184,185,186,187,188,189,190,191 + db 192,193,194,195,196,197,198,199 + db 200,201,202,203,204,205,206,207 + db 208,209,210,211,212,213,214,215 + db 216,217,218,219,220,221,222,223 + db 224,225,226,227,228,229,230,231 + db 232,233,234,235,236,237,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 +page +; ---------------------------------------------------------------------------- +; +; World Trade Mono Case Filename Character Tables +; +; Currently all countries have same (4/14/86) +; +; +; ---------------------------------------------------------------------------- +uk_ucfile label word +fr_ucfile label word +gr_ucfile label word +sp_ucfile label word +it_ucfile label word +sv_ucfile label word +dk_ucfile label word +sw_ucfile label word +no_ucfile label word +nl_ucfile label word +be_ucfile label word +fi_ucfile label word +is_ucfile label word +ca_ucfile label word +as_ucfile label word +po_ucfile label word +us_ucfile label word +la_ucfile label word +afe_ucfile label word + ctable <,'FUCASE ',128> + db 128,129,130,131,132,133,134,135 + db 136,137,138,139,140,141,142,143 + db 144,145,146,147,148,149,150,151 + db 152,153,154,155,156,157,158,159 + db 160,161,162,163,164,165,166,167 + db 168,169,170,171,172,173,174,175 + db 176,177,178,179,180,181,182,183 + db 184,185,186,187,188,189,190,191 + db 192,193,194,195,196,197,198,199 + db 200,201,202,203,204,205,206,207 + db 208,209,210,211,212,213,214,215 + db 216,217,218,219,220,221,222,223 + db 224,225,226,227,228,229,230,231 + db 232,233,234,235,236,237,238,239 + db 240,241,242,243,244,245,246,247 + db 248,249,250,251,252,253,254,255 + page +; ---------------------------------------------------------------------------- +; +; World Trade Valid Filename Character Tables +; +; Currently all countries have same (4/14/86) +; +; +; ---------------------------------------------------------------------------- +uk_flist label word +fr_flist label word +gr_flist label word +sp_flist label word +it_flist label word +sv_flist label word +dk_flist label word +sw_flist label word +no_flist label word +nl_flist label word +be_flist label word +fi_flist label word +is_flist label word +ca_flist label word +as_flist label word +po_flist label word +us_flist label word +la_flist label word +afe_flist label word +jp437_flist label word +jp932_flist label word +ko437_flist label word +ko934_flist label word +pr437_flist label word +pr936_flist label word +ta437_flist label word +ta938_flist label word + ctable <,'FCHAR ',fclend-fclbegin> +fclbegin label word + db 1,0,255 ; include all + db 0,0,20h ; exclude 0 - 20h + db 2,14,'."/\[]:|<>+=;,' ; exclude 14 special chars +fclend label word + page +; ---------------------------------------------------------------------------- +; +; World Trade DBCS Tables +; +; Currently all countries have same (4/14/86) +; +; +; ---------------------------------------------------------------------------- +; ;***CNS +uk_dbcs label word ;AN000; +fr_dbcs label word ;AN000; +gr_dbcs label word ;AN000; +sp_dbcs label word ;AN000; +it_dbcs label word ;AN000; +sv_dbcs label word ;AN000; +dk_dbcs label word ;AN000; +sw_dbcs label word ;AN000; +no_dbcs label word ;AN000; +nl_dbcs label word ;AN000; +be_dbcs label word ;AN000; +fi_dbcs label word ;AN000; +is_dbcs label word ;AN000; +ca_dbcs label word ;AN000; +as_dbcs label word ;AN000; +po_dbcs label word ;AN000; +us_dbcs label word ;AN000; +la_dbcs label word ;AN000; +afe_dbcs label word ;AN000; +jp437_dbcs label word ;AN000; +ko437_dbcs label word ;AN000; +pr437_dbcs label word ;AN000; +ta437_dbcs label word ;AN000; + ctable <,'DBCS ',dbcsterm-dbcsbegin> ;AN000; +dbcsbegin label word ;AN000; +dbcsterm db 0,0 ;AN000; +dbcsend label word ;AN000; +; +; Japan DBCS lead byte table +; +jp932_dbcs label word ;AN000; + ctable <,'DBCS ',db932end-db932bgn> ;AN000; +db932bgn label word ;AN000; + db 081h,09Fh ;AN000; + db 0E0h,0FCh ;AN000; +db932term db 000h,000h ;AN000; +db932end equ $ ;AN000; +; +; Korea DBCS lead byte table +; +ko934_dbcs label word ;AN000; + ctable <,'DBCS ',db934end-db934bgn> ;AN000; +db934bgn label word ;AN000; + db 081h,0BFh ;AN000; +db934term db 000h,000h ;AN000; +db934end equ $ ;AN000; +; +; PRC and Taiwan DBCS lead byte table +; +pr936_dbcs label word ;AN000; +ta938_dbcs label word ;AN000; + ctable <,'DBCS ',db936end-db936bgn> ;AN000; +db936bgn label word ;AN000; + db 081h,0FCh ;AN000; +db936term db 000h,000h ;AN000; +db936end equ $ ;AN000; + +page +; --------------------------------------------------------------- +; +; END OF CDI SEGMENT +; +; --------------------------------------------------------------- + + +include copyrigh.inc + +cdiend label word +; +cdifname equ $ + db 'COUNTRY.SYS',0 +; +crmsg equ $ + db 'Create failed',13,10 +crmlen equ $-crmsg +; +succmsg equ $ + db 'COUNTRY.SYS created',13,10 +smlen equ $-succmsg +; +iomsg equ $ + db 'I/O error writing COUNTRY.SYS',13,10 +iomlen equ $-iomsg +dseg ends +; +sseg segment stack + db 128 dup(0) +sseg ends + end mkcdif diff --git a/v4.0/src/DEV/COUNTRY/MKCNTRY.INC b/v4.0/src/DEV/COUNTRY/MKCNTRY.INC new file mode 100644 index 0000000..a9721ed --- /dev/null +++ b/v4.0/src/DEV/COUNTRY/MKCNTRY.INC @@ -0,0 +1,140 @@ +; +; include file for create cdi file +; +PTRCNT EQU 1 ; NUMBER OF POINTERS +CIPTYPE EQU 1 ; TYPE FOR COUNTRY INFO POINTER +; CNTRYCNT EQU 18 ; NUMBER OF COUNTRIES SUPPORTED +CENTRYSIZE EQU (TYPE CTRYSTR)-2 ; SIZE OF COUNTRY ENTRY +CDATASIZE EQU (TYPE CTRYDAT)-2 ; SIZE OF COUNTRY DATA +HR12 EQU 0 ; 12 HOUR TIME FORMAT +HR24 EQU 1 ; 24 HOUR TIME FORMAT +; +; entry type symbols +; +SETCOUNTRYINFO EQU 1 +SETUCASE EQU 2 +SETLCASE EQU 3 +SETUCASEFILE EQU 4 +SETFILELIST EQU 5 +SETCOLLATE EQU 6 +SETDBCS EQU 7 + +CDATAITEMS EQU SETDBCS - 1 ; NUMBER OF ENTRIES IN COUNTRY DATA + +; +; country id's +; +CID_UK EQU 044 ; United Kingdom +CID_FR EQU 033 ; France +CID_GR EQU 049 ; Germany +CID_SP EQU 034 ; Spain +CID_IT EQU 039 ; Italy +CID_SV EQU 046 ; Sweden +CID_AFE EQU 061 ; International English +CID_DK EQU 045 ; Denmark +CID_SW EQU 041 ; Switzerland +CID_NO EQU 047 ; Norway +CID_NL EQU 031 ; Netherlands +CID_BE EQU 032 ; Belgium +CID_FI EQU 358 ; Finland +CID_US EQU 001 ; United States +CID_IS EQU 972 ; Israel +CID_CA EQU 002 ; Canadian French +CID_AS EQU 785 ; Area South (Saudi Arabia) +CID_PO EQU 351 ; Portugal +CID_LA EQU 003 ; Latin America +CID_JP EQU 081 ; Japan 2/17/KK +CID_KO EQU 082 ; Korea 2/17/KK +CID_PR EQU 086 ; PRC 2/17/KK +CID_TA EQU 088 ; Taiwan 2/17/KK +CID_XX EQU 000 ; Dummy entry +; +; country code pages +; +CP_UK EQU 437 +CP_FR EQU 437 +CP_GR EQU 437 +CP_SP EQU 437 +CP_IT EQU 437 +CP_SV EQU 437 +CP_AFE EQU 437 +CP_DA EQU 865 +CP_SW EQU 437 +CP_NO EQU 865 +CP_NL EQU 437 +CP_BE EQU 437 +CP_FI EQU 437 +CP_US EQU 437 +CP_IS EQU 862 +CP_CA EQU 863 +CP_AS EQU 864 +CP_PO EQU 860 +CP_JP EQU 932 ; Japan 2/17/KK +CP_KO EQU 934 ; Korea 2/17/KK +CP_PR EQU 936 ; PRC 2/17/KK +CP_TA EQU 938 ; Taiwan 2/17/KK +; +; date formats +; +DATE_MDY EQU 0 +DATE_DMY EQU 1 +DATE_YMD EQU 2 +; +CTRYSTR STRUC +ESIZE DW 0 ; SIZE OF ENTRY +CNTRYID DW 0 ; COUNTRY ID +CODPAGE DW 0 ; CODE PAGE ID +RESV1 DW 0 ; RESERVED +RESV2 DW 0 ; RESERVED +CDPOINT DW 0 ; POINTER TO COUNTRY DATA + DW 0 +CTRYSTR ENDS + +CTRYENT MACRO PARMS + CTRYSTR +CNTRYCNT = CNTRYCNT+1 + ENDM +; +CTRYDAT STRUC + DW 0 + DB 0 + DB 0 + DW 0 + DW 0 +CTRYDAT ENDS +; +CINFO STRUC + DW 0 ; COUNTRY ID + DW 0 ; CODE PAGE + DW 0 ; DATE FORMAT + DB 0 ; CURRENCY SYMBOL (5 BYTES) + DB 0 + DB 0 + DB 0 + DB 0 + DB 0 ; 1000 SEPARATOR + DB 0 + DB 0 ; DECIMAL SEPARATOR + DB 0 + DB 0 ; DATE SEPARATOR + DB 0 + DB 0 ; TIME SEPARATOR + DB 0 + DB 0 ; CURRENCY FORMAT FLAGS + DB 0 ; DIGITS IN CURRENCY + DB 0 ; TIME FORMAT + DD 0 ; RESERVED + DB 0 ; DATA LIST SEPARATOR + DB 0 + DW 5 DUP (0) ; RESERVED +CINFO ENDS +; +CINFOSIZE EQU TYPE CINFO ; SIZE OF COUNTRY INFO TABLE +; +CTABLE STRUC + DB 0FFh + DB 'CTYINFO' + DW CINFOSIZE +CTABLE ENDS +; + diff --git a/v4.0/src/DEV/DISPLAY/CPS-FUNC.INC b/v4.0/src/DEV/DISPLAY/CPS-FUNC.INC new file mode 100644 index 0000000..91bb3c6 --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/CPS-FUNC.INC @@ -0,0 +1,728 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; CODE PAGE DRIVER FUNCTIONS +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +IF1 ; + %OUT . CPS-FUNC.INC +ENDIF ; + ; +CP_FUNCTION LABEL BYTE ; + DW 4CH,OFFSET DESIGNATE_BEGIN ; + DW 4DH,OFFSET DESIGNATE_END ; + DW 4AH,OFFSET INVOKE_CP ; + DW 6AH,OFFSET QUERY_CP ; + DW 6BH,OFFSET QUERY_CP_LIST ; +NUM_CP_FUNCTION EQU ($-CP_FUNCTION)/4 ; + ; +DESG_SEMAPHORE DB 0 ; TEMPORARY +G_IOCTL_SEMA DB 0 ; SEMAPHORE TO INDICATE IF CPS IS BUSY! + ; +CHAR_HEIGHT DB 8 ; + DB 14 ; + DB 16 ; + DB 19 ; + DB 0 ; + DB 0 ; + DB 0 ; + DB 0 ; +NUM_CHAR_HEIGHT EQU ($-CHAR_HEIGHT) ; + ; + ; +GENERIC_IOCTL PROC ; CON OUTPUT + CLI ;S; + MOV SI,SP ;S; + MOV CS:OLD_STACK_O,SI ;S; + MOV SI,SS ;S; + MOV CS:OLD_STACK_S,SI ;S; + MOV AX,OFFSET STACK_START ;S; + MOV SI,CS ;S; + MOV SS,SI ;S; + MOV SP,AX ;S; + STI ;S; + PUSH DS ; + ; + PUSH CS ; + POP DS ; FROM HERE IN, DS=CS + ; + LES DI,DWORD PTR BUF.RH_PTRO; GET RH + ; +GI_1: MOV AL,RH.MINOR_F ; PUT MINOR VERSION IN AL + XOR AH,AH ; CLEAR OUT HIGH BYTE FOR COMPARES + ; + PUSH DI ; SAVE POINTER!!! + PUSH ES ; + PUSH CS ; + POP ES ; + MOV CX,NUM_CP_FUNCTION ; + MOV DI,OFFSET CP_FUNCTION ; +GI_1A: SCASW ; SEARCH THROUGH THE LIST OF VALID FN's + JE GI_2 ; + INC DI ; + INC DI ; + LOOP GI_1A ; + POP ES ; + POP DI ; + JUMP GI_3 ; NOT FOUND! +GI_2: POP ES ; + MOV SI,DI ; + POP DI ; + ; + MOV G_IOCTL_SEMA,ONE ; SEMAPHORE TO INDICATE CALLS ARE BUSY! + CALL [SI] ; JMP OFF TO THE APPROPRIATE CALL! + MOV G_IOCTL_SEMA,ZERO ; SEMAPHORE TO INDICATE CALLS ARE DONE! + STC ; SET CY not TO TRY ATTACHED CON! + JUMP GI_4 ; +GI_3: CLC ; CLEAR CY TO TRY ATTACHED CON! +GI_4: POP DS ; + CLI ;S; + MOV AX,CS:OLD_STACK_O ;S; + MOV SI,CS:OLD_STACK_S ;S; + MOV SS,SI ;S; + MOV SP,AX ;S; + STI ;S; + RET ; +GENERIC_IOCTL ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; DESIGNATE BEGIN +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +DESIGNATE_BEGIN PROC ; + LES DI,RH.REQUEST_PACKET ; AND DI TO POINT TO REQUEST PACKET + MOV CX,RH.DESG_N ; MOVE THE NUMBER OF CODE PAGES DESIG'ed + ; + OR CX,CX ; + JZ DB_0C ; CHECK IF ZERO CP's DESIGNATED + ; IF SO, THEN THIS IS THE REFRESH CALL +DB_0: CMP CX,CPD_DESG_N ; CHECK IF NUMBER > # CONFIGed + JA DB_0B ; + JUMP DB_1B ; + ; +DB_0D: OR BUF.STATUS,EIGHT ; Error>> KEYBOARD ERROR!! + RET ; +DB_2D: POP CX ; RESTORE STACK ELEMENTS + POP BX ; + POP CX ; RESTORE STACK ELEMENTS + POP BX ; +DB_0B: OR BUF.STATUS,TEN ; Error>> DEVICE ERROR!! + RET ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; REFRESH ACTIVE CODE PAGE TO DISPLAY +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +DB_0C: MOV DESG_SEMAPHORE,TWO ; SET REFRESH COMMENCED + MOV CPD_REQ_DESG,CX ; SAVE NUMBER OF REQUESTED CP'S (0) + MOV DX,CPD_ACTIVE ; THIS IS THE REFRESH CALL + CMP DX,-1 ; CHECK IF THE ACTIVE_CP = INVALID + JE DB_0B ; + CLC ; CLEAR OUT THE CARRY FLAG + CALL SIGNAL_KBD_INVK ; + JC DB_0D ; IF CY SET, THEN KEYBOARD IS WRONG + CALL TEST_CP ; + JC DB_0B ; + CALL INVOKE_DATA ; + JC DB_0B ; + RET ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; THIS SECTION FORMS THE NEW DESIGNATE CP LIST IN THE +; CPD_TEMP_DESG. AT THE SAME TIME THE TOTAL NUMBER OF +; REQUESTED CP's ARE FOUND. +; +; DX will contain the real CP's to load +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +DB_1B: CLD ; SET DIRECTION FORWARD + PUSH ES ; + PUSH CX ; + PUSH DI ; + PUSH CS ; + POP ES ; + MOV CX,CPD_DESG_N ; + INC CX ; ACCOUNT FOR NUMBER OF CPS + LEA SI,CPD_DESG_N ; COPY PREPARED CP LIST TO TEMP BUFFER + LEA DI,CPD_TEMP_DESG ; + REP MOVSW ; + POP DI ; + POP CX ; + POP ES ; + ; + XOR DX,DX ; SET COUNT OF CP's TO PREPARE = 0 + PUSH CX ; + PUSH BX ; + MOV CPD_REQ_DESG,CX ; SAVE NUMBER OF REQUESTED CP'S + MOV SI,2 ; + MOV BX,SI ; +DB_1: MOV AX,RH.DESG_N[BX] ; GET REQUESTED CP + CMP AX,-1 ; TEST IF REQUESTED IS PLACE HOLDER.. + JE DB_1A ; + INC DX ; ADD ONE TO THE # VALID DESG + MOV CPD_TEMP_DESG[SI],AX ; OVERLAY THE NEWER CP INTO TEMP BUFFER +DB_1A: MOV CPD_REQ_DESG[SI],AX ; COPY TO THE REQ DESG LIST + INC SI ; + INC SI ; + INC BX ; + INC BX ; + LOOP DB_1 ; + POP BX ; + POP CX ; + ; + OR DX,DX ; ARE THERE NO CP's TO PREPARE? + JZ DB_0B ; IF NONE TO DESG, THEN ERROR!! +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; THIS SECTION CHECKS THE LIST OF DESIGed CP's IN THE +; TEMP BUFFER AND SETS AN ERROR FOR DUPLICATES. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +DB_2: PUSH BX ; CHECK THE DESIGNATE LIST FOR DUP's + PUSH CX ; AND FOR INVALIDS + MOV CX,CPD_TEMP_DESG ; + DEC CX ; NORMALIZE + JZ DB_3 ; IF ZERO, THEN NONE TO COMPARE + MOV BX,2 ; SET BX TO START OF LIST.... + MOV SI,2 ; SETUP SI READY TO MOVE DESG LIST IN! +DB_2A: PUSH BX ; + PUSH CX ; + MOV AX,CPD_TEMP_DESG[BX] ; GET CP DESGINATED + CMP AX,-1 ; TEST IF ENTRY = -1 + JE DB_2E ; IF SO, THEN SKIP +DB_2B: CMP CX,1 ; TEST IF IT IS THE ONLY ONE TO COMPARE + JE DB_2E ; AGAINST! + INC BX ; ADVANCE POINTER TO NEXT CP DESIGNATED + INC BX ; + CMP AX,CPD_TEMP_DESG[BX] ; CHECK IF NEXT CP's = ONE TESTED + JNE DB_2C ; IF error, THEN GET OUT + JUMP DB_2D ; + ; +DB_2C: LOOP DB_2B ; +DB_2E: POP CX ; + POP BX ; + INC BX ; + INC BX ; + OR CX,CX ; + JE DB_3 ; TEST IF ONLY ONE CP SPECIFIED + LOOP DB_2A ; + ; +DB_3: POP CX ; + POP BX ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; NOW, THE TEMPORARY BUFFER CONTAINS THE NEW LIST +; OF DESGINATED CODE PAGES. COPY THIS TO THE +; PREPARED CP LIST. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + PUSH ES ; NOW ALL TESTS ARE SUCCESSFUL, + PUSH CX ; + PUSH DI ; + PUSH CS ; + POP ES ; + MOV CX,CPD_DESG_N ; + INC CX ; ACCOUNT FOR NUMBER OF CPS + LEA SI,CPD_TEMP_DESG ; COPY TEMP BUFFER INTO NEW CP LIST + LEA DI,CPD_DESG_N ; + REP MOVSW ; + POP DI ; + POP CX ; + POP ES ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; NOW THAT THE LIST IS VALID, THE FONT PARSER & PARSING TABLES +; ARE PREPARED FOR INITIALIZATION OF DESIGNATION. +; +; DX is the number of valid CP's +; CX is the number of CP's desginated +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + PUSH BX ; + PUSH ES ; + PUSH DI ; + ; CX=#DESGed, BX=pnter DESG LIST + MOV BX,2 ; SET BX TO POINT TO FIRST CP DESGed + LEA DI,FTABLE ; SET DI TO POINT TO MAIN PARSER TABLE + PUSH CS ; + POP ES ; INITIALIZE ES=CS + MOV [DI].FLAG,FLAG_RESTART ; SETUP UP MAIN TABLE FOR F-PARSER.SRC + MOV [DI].BUFFER_LEN,0 ; PREPARING FOR START OF DESIGNATION + MOV [DI].NUM_FTBLK,DX ; DX=#DESG TO PARSE OUT + ; + LEA SI,CPD_CLASS ; SET DI TO POINT TO (EGA,LCD) CLASSES + LEA DI,FTB1 ; SET DI TO POINT TO FIRST PARSING TABLE + ; +DB_4: MOV AX,CPD_REQ_DESG[BX] ; + CMP AX,-1 ; CHECK FOR PLACE HOLDER + JE DB_5 ; + MOV [DI].FTB_CP,AX ; COPY THE DESG CP VALUE INTO THE TABLE + PUSH CX ; AND ALSO THE CPD_CLASS + PUSH SI ; + PUSH DI ; + LEA DI,[DI].FTB_TID ; + MOV CX,8 ; + REP MOVSB ; + POP DI ; + POP SI ; + POP CX ; + ; + ADD DI,TYPE FTBLK ; MOVE POINTERS TO NEXT PARSING TABLE +DB_5: INC BX ; + INC BX ; ADVANCE BX TO NEXT DESG CP + LOOP DB_4 ; + ; + POP DI ; + POP ES ; + POP BX ; + ; + CALL FONT_PARSER ; CALL FONT PARSER TO INITIALIZE WRITES +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; THIS WILL COPY THE START LOCATION OF THE FONTS (set by INIT) +; INTO THE START LOCATION FOR THE DESIGNATE WRITE, WHICH FOLLOWS! +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + PUSH SI ; + PUSH DI ; + PUSH ES ; + PUSH CS ; + POP ES ; SET EXTRA SEG ES = CS + LEA SI,CPD_FONT_PNTER ; + LEA DI,CPD_FONT_WRITE ; + MOV CX,CPD_DESG_N ; GET NUMBER OF DESIGNATES + ADD CX,CX ; DOUBLE FOR SEG:OFFSET + REP MOVSW ; COPY FONT START LOC's TO START WRITE + XOR DI,DI ; + LEA SI,CPD_FONT_DATA ; SET THE FONT_DATA COUNTERS BACK TO 0 + MOV CX,CPD_DESG_N ; +DB_6: MOV [SI],DI ; + INC SI ; + INC SI ; + LOOP DB_6 ; + POP ES ; + POP DI ; + POP SI ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; CREATE THE FONT_PRIORITY TABLE +; +; THIS IS USED TO PLACE PRIORITY ON THE FONTS BEING DESIGNATED +; ESPECIALLY WHEN THE NUMBER OF DESIGNATED FONTS < FONTS IN THE +; xxx.CPI FILE. THIS IS USED TO SELECT THE NEEDED FONTS FOR +; CP SUPPORT. +; +; RULE: PRIORITY 1 = ACTIVE MODE's FONT RESOLUTION +; PRIORITY 2 = FONT RESOLUTION (non-repeats) OF ALL DISPLAY +; MODES - STARTING FROM MODE (0) - MODE (?) +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + PUSH AX ; + PUSH BX ; + PUSH CX ; + PUSH SI ; + PUSH DI ; + ; + LEA DI,FONT_PRIORITY ; + MOV CX,CPD_FONTS_N ; GET THE NUMBER OF SPECIFIED FONTS + ; + PUSH ES ; + PUSH DI ; + PUSH CX ; OVER-WRITE THE TABLE WITH 0FFH's + PUSH CS ; + POP ES ; + MOV AL,-1 ; + REP STOSB ; + POP CX ; + POP DI ; + POP ES ; + ; + XOR AH,AH ; AH=0 FOR MODE SET, AL=MODE_TYPE + MOV AL,MODE_VALUE ; + MOV SI,AX ; ESTABLISH INDEX INTO LOAD_MECH table + MOV AL,[SI].FONT_SIZE ; GET FONT_SIZE FOR THIS MODE_VALUE + OR AL,AL ; TEST FOR FONT_VALUE=0 + JNZ DB_8 ; + CALL ASK_BIOS_FONT_SIZE ; GET BIOS TO INDICATE FONT_SIZE +DB_8: MOV CS:[DI],AL ; PUT ACTIVE FONT RESOLUTION INTO 1ST! + INC DI ; ADVANCE POINTER TO NEXT POSITION + DEC CX ; SUBTRACT ONE FONT RESOLUTION... + JZ DB_A ; IF THERE WAS ONLY 1 FONT...THEN DONE + ; + XOR SI,SI ; START WITH MODE = 0 +DB_8A: PUSH CX ; + PUSH DI ; + MOV CX,NUM_FONT_PRIORITY ; + LEA DI,FONT_PRIORITY ; SET DI TO START OF TABLE + MOV AL,[SI].FONT_SIZE ; GET FONT SIZE FOR THIS MODE + CMP AL,-1 ; TEST FOR INVALID FONT SIZE + JE DB_9 ; IF SO, THEN TRY NEXT VALUE + OR AL,AL ; TEST FOR FONT_VALUE=0 + JNZ DB_8C ; + ; OTHERWISE, ONLY EGA BIOS WOULD KNOW!!! + CMP SI,EIGHT ; ONLY EIGHT DIFFERENT FONTS PERMITTED!! + JAE DB_9 ; + ; + PUSH CX ; + CALL ASK_BIOS_SCAN_LINES ; GET ENCODED SCAN LINES VALUE!!! + JC DB_9 ; + MOV CX,SI ; PUT INDEX INTO CX + INC CL ; NORMALIZE INDEX VALUE (1-8) + SAR AL,CL ; + POP CX ; + JNC DB_9 ; + MOV AL,CS:CHAR_HEIGHT[SI] ; + ; +DB_8C: CMP AL,CS:[DI] ; + JE DB_9 ; IF EQUAL, THEN ALREADY IN TABLE + INC DI ; OTHERWISE, TAKE THIS MODES FONT RES + LOOP DB_8C ; AND COMPARE AGAINST NEXT PRIOR.VALUE + ; + POP DI ; NEW RESOLUTION FOUND...ADD TO LIST + POP CX ; + MOV CS:[DI],AL ; PUT NEW VALUE IN THE TABLE + INC DI ; AND ADVANCE FOR NEXT FONT RESOLUTION + JUMP DB_9A ; LOOP WILL DECREMENT #FONTS TO FIND +DB_9: POP DI ; + POP CX ; + INC CX ; MATCH FOUND..SO LEAVE #FONT TO PRIOR. +DB_9A: INC SI ; POINT TO NEXT DISPLAY MODE + CMP SI,NUM_FONT_SIZES ; + JAE DB_A ; + LOOP DB_8A ; CONTINUE UNTIL THE #FONTS DESIGNATED + ; HAVE BEEN PRIORITIZED OR ALL MODES +DB_A: POP DI ; ARE CHECKED OUT! + POP SI ; + POP CX ; + POP BX ; + POP AX ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + MOV DESG_SEMAPHORE,ONE ; SET DESIGNATION TO COMMENCE... + RET ; +DESIGNATE_BEGIN ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; DESIGNATE END +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +DESIGNATE_END PROC ; + CMP DESG_SEMAPHORE,ZERO ; TEST IF DESG_SEMAPHORE = DATA WRITTEN + JE DE_1 ; + ; + CMP CPD_REQ_DESG,ZERO ; TEST IF ZERO CP's REQUESTED (REFRESH) + JE DE_0 ; + ; + CALL VERIFY_FPARSER ; CALL ROUTINE TO VERIFY THAT THE + JC DE_2 ; FONT PARSER FINISHED OK... + ; + PUSH ES ; NOW THE DESIGNATE IS OVER... + PUSH DI ; + MOV CX,CPD_ACTIVE ; CHECK IF ACTIVE_CP IS STILL VALID! + CALL FIND_CP ; TRY AND FIND CPD_ACTIVE? + POP DI ; + POP ES ; + JNC DE_0 ; + MOV CX,-1 ; + MOV CPD_ACTIVE,CX ; +DE_0: MOV DESG_SEMAPHORE,ZERO ; + RET ; + ; +DE_1: OR BUF.STATUS,TWELVE ; Error>> NO DESGINATE START + JUMP DE_0 ; +DE_2: CALL HANDLE_WRITE_ERROR ; RESET ALL DESIGNATED INFORMATION + OR BUF.STATUS,FAIL ; Error>> FONT DATA IS BAD + JUMP DE_0 ; +DESIGNATE_END ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; INVOKE +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +INVOKE_CP PROC ; + LES DI,RH.REQUEST_PACKET ; AND DI TO POINT TO REQUEST PACKET + MOV CX,RH.INVK_LENGTH ; GET LENGTH OF REMAINING HEADER + ; + CMP CX,TWO ; TEST IF LENGTH OF TABLE IS GREATER + JNE ICP_2 ; THAN ONE CP! + ; + MOV CX,RH.INVK_CP ; GET THE CODE PAGE TO INVOKE + MOV DX,CX ; SAVE CP VALUE + CMP CX,-1 ; TEST FOR INVALID CODE PAGE! + JE ICP_1A ; + ; + PUSH CPD_ACTIVE ; SAVE ACTIVE_CP, FOR POSSIBLE USE... + MOV CPD_ACTIVE,CX ; + CALL TEST_CP ; TRY AND LOAD THE REQUESTED CP + POP CX ; + JC ICP_1AA ; IF ERROR, THEN RESTORE OLD CP + ; + CMP CX,CPD_ACTIVE ; TEST IF OLD CP=ACTIVE!!! + JE ICP_0A ; + ; + CALL INVOKE_DATA ; IF EVERYTHING OK, THEN LOAD DATA + JC ICP_2A ; + ; +ICP_0A: CALL SIGNAL_KBD_INVK ; DX CONTAINS CODEPAGE + JC ICP_1 ; IF CY THEN ERROR + RET ; + ; +ICP_1: OR BUF.STATUS,EIGHT ; Error>> KEYB ERROR + RET ; +ICP_1AA:MOV CPD_ACTIVE,CX ; PUT OLD CP BACK ACTIVE +ICP_1A: OR BUF.STATUS,SEVEN ; Error>> CODE PAGE NOT FOUND + RET ; +ICP_2A: MOV CPD_ACTIVE,CX ; +ICP_2: OR BUF.STATUS,TEN ; Error>> DEVICE ERROR + RET ; +INVOKE_CP ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; QUERY +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +QUERY_CP PROC ; + LES DI,RH.REQUEST_PACKET ; SETUP ADDRESSING TO HEADER + ; + MOV CX,TWO ; + MOV RH.INVK_LENGTH,CX ; CREATE RETURN 'N' VALUE + ; + CALL TEST_CP ; FIND OUT IF CP DATA IS OK! + MOV CX,CPD_ACTIVE ; + JNC QCP_A ; + MOV CX,-1 ; MAKE THE ACTIVE REPONSE AS INVALID + ; +QCP_A: MOV RH.INVK_CP,CX ; SET THE CODE PAGE IN HEADER + CMP CX,-1 ; TEST IF NO CP SPECIFIED? + JE QCP_0 ; + RET ; + ; +QCP_0: OR BUF.STATUS,SEVEN ; Error>> NOT CODE PAGE SPECIFIED + RET ; +QUERY_CP ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; QUERY LIST +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +QUERY_CP_LIST PROC ; + LES DI,RH.REQUEST_PACKET ; AND DI TO POINT TO REQUEST PACKET + ; + MOV CX,CPD_HDWR_N ; + MOV RH.QLST_N_HDWR,CX ; + ADD CX,CPD_DESG_N ; + ADD CX,TWO ; ACCOUNT FOR LENGTH OF 'N's + ADD CX,CX ; + MOV RH.QLST_LENGTH,CX ; CREATE RETURN TABLE LENGTH + ; + PUSH AX ; + PUSH BX ; + PUSH SI ; + MOV CX,CPD_HDWR_N ; + MOV BX,2 ; + OR CX,CX ; + JE QCP_3 ; +QCP_2: MOV AX,CPD_HDWR_N[BX] ; + MOV RH.QLST_N_HDWR[BX],AX ; + INC BX ; + INC BX ; + LOOP QCP_2 ; + ; +QCP_3: MOV CX,CPD_DESG_N ; SET TABLE ENTRY FOR DESIGNATE + MOV RH.QLST_N_HDWR[BX],CX ; + INC BX ; + INC BX ; + ; + OR CX,CX ; + JE QCP_4A ; + MOV SI,2 ; +QCP_4: MOV AX,CPD_DESG_N[SI] ; + MOV RH.QLST_N_HDWR[BX],AX ; + INC BX ; + INC BX ; + INC SI ; + INC SI ; + LOOP QCP_4 ; +QCP_4A: POP SI ; + POP BX ; + POP AX ; + RET ; +QCP_5: OR BUF.STATUS,SEVEN ; Error>> NO CODE PAGE INVOKED + RET ; +QCP_6: OR BUF.STATUS,TEN ; Error>> DEVICE ERROR + RET ; +QUERY_CP_LIST ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; GET HARDWARE CODE PAGE TABLE +; +; INPUT: +; none +; OUTPUT: +; SI = pointer to HARDWARE table (n,h_cp1,h_cp2,...) +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +GET_HDWR_CP PROC ; + LEA SI,CP_PNTER_TABLE ; + MOV SI,[SI].HDWR_CP_STRUC ; + RET ; +GET_HDWR_CP ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; GET DESIGNATE CODE PAGE TABLE +; +; INPUT: none +; OUTPUT: SI = pointer to DESIGNATE table (n,d_cp1,d_cp2,...) +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +GET_DESG_CP PROC ; + LEA SI,CP_PNTER_TABLE ; + MOV SI,[SI].DESG_CP_STRUC ; + RET ; +GET_DESG_CP ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; GET FONT POINTER TABLE +; +; INPUT: +; none +; OUTPUT: +; SI = pointer to FONTS table (pnter_cp1,pnter_cp2,...) +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +GET_FONT_CP PROC ; + LEA SI,CP_PNTER_TABLE ; + MOV SI,[SI].FONT_CP_STRUC ; + RET ; +GET_FONT_CP ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; GET WRITE POINTER +; +; INPUT: +; none +; OUTPUT: +; SI = pointer to WRITE pointers +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +GET_WRITE_PNTR PROC ; + LEA SI,CP_PNTER_TABLE ; + MOV SI,[SI].WRITE_DATA_STRUC; + RET ; +GET_WRITE_PNTR ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; FIND ACTIVE CODE PAGE +; +; INPUT: +; CX = code page to find +; OUTPUT: +; 'CY' = 0 if found, 1 if NOT +; CX = 0 for hdwr, 1 for designated +; ES : DI = pointer to FONT data table +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +FIND_CP PROC ; + PUSH AX ; + PUSH BX ; + PUSH SI ; + MOV AX,CX ; + CALL GET_DESG_CP ; SET BX TO DESG TABLE INFO + MOV CX,[SI] ; GET THE NUMBER OF DESG CP's + OR CX,CX ; + JZ FCP_1 ; MOVE ONTO DESG TEST WITH 0 CP's + MOV BX,TWO ; ELSE, USE SI TO POINT TO 1ST CP +FCP_0: CMP AX,[SI+BX] ; SEARCH FOR CP MATCH + JE FCP_4 ; CP MATCHED!! SET DESG INFO & EXIT + INC BX ; ADVANCE SI POINTER TO NEXT CP + INC BX ; + LOOP FCP_0 ; CHECK ACROSS ALL CP's IN TABLE +FCP_1: CALL GET_HDWR_CP ; NOW, REPEAT SAME OPERATION + MOV CX,[SI] ; WITH THE HARDWARE CP's + OR CX,CX ; + JZ FCP_3 ; IF THIS FAR, THEN SET ERROR FOR + INC SI ; + INC SI ; ADVANCE POINTER BY TWO...SINCE + MOV BX,ZERO ; PNTER'S DON'T HAVE 'n'... +FCP_2: CMP AX,[SI+BX] ; SEARCH AGAIN FOR CP MATCH + JE FCP_5 ; CP MATCHED!! SET HDWR INFO & EXIT + INC BX ; ADVANCE SI POINTER TO NEXT CP + INC BX ; + LOOP FCP_2 ; REPEAT FOR ALL CP ENTRIES +FCP_3: XOR CX,CX ; SET RETURN VALUES TO ZERO + XOR DI,DI ; + POP SI ; + POP BX ; + POP AX ; + STC ; CY=1 FOR ERROR + RET ; EXIT +FCP_4: MOV CX,ONE ; DESIGNATED CODE PAGE FOUND + CALL GET_FONT_CP ; SET THE BX VALUE TO THE FONT DATA + SUB BX,2 ; NORMALIZE BX VALUE;;;;;;;;;;;;;;; + ADD SI,BX ; FORMULATE THE SI INDEX BY ADDING + ADD SI,BX ; BX INDEX x 2 (dword FONT_PNTER) + MOV DI,[SI] ; TAKE OFFSET DATA FROM font_table + MOV ES,[SI+2] ; AND SEGMENT ALSO! + POP SI ; + POP BX ; + POP AX ; + CLC ; CY=0 FOR OK! + RET ; EXIT +FCP_5: XOR CX,CX ; HARDWARE CODE PAGE FOUND + XOR DI,DI ; + POP SI ; + POP BX ; + POP AX ; + CLC ; + RET ; EXIT +FIND_CP ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; VERIFY_FPARSER A ROUTINE THAT CHECKS THE +; FONT_BLOCKS FOR INCOMPLETE DESIGNATES? +; IF SO, THEN AN ERROR OCCURRED... +; +; INPUT: +; FONT_PARSER should be completed parsing +; +; OUTPUT: +; CY = 0 if all is correct +; 1 if one or more designates are incomplete +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +VERIFY_FPARSER PROC ; + PUSH AX ; + PUSH CX ; + PUSH ES ; + PUSH DI ; + ; + PUSH CS ; + POP ES ; + ; + MOV CX,CPD_REQ_DESG ; CX = REQUESTED DESG CP's + LEA DI,FTB1 ; SET DI TO POINT TO FIRST PARSING TABLE + ; +VFP_4: MOV AX,[DI].FTB_STATUS ; GET STATUS OF PARSING TABLE #n + CMP AX,FSTAT_COMPLETE ; FIND OUT IF THIS CP COMPLETED? + JE VFP_6 ; + ; + CMP AX,FSTAT_FONT ; CHECK IF AT LEAST THE FONT DATA FOUND + JNE VFP_8 ; IF NOT, THEN AN ERROR OCCURRED.... + CMP [DI].FTB_DLEFT,ZERO ; IF SO, THEN NO DATA CAN BE LEFT.... + JNE VFP_8 ; OTHERWISE ANOTHER ERROR ? +VFP_6: ADD DI,TYPE FTBLK ; MOVE POINTERS TO NEXT PARSING TABLE + LOOP VFP_4 ; + CLC ; + JUMP VFP_9 ; + ; +VFP_8: STC ; +VFP_9: POP DI ; + POP ES ; + POP CX ; + POP AX ; + RET ; +VERIFY_FPARSER ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + \ No newline at end of file diff --git a/v4.0/src/DEV/DISPLAY/DEF-EQU.INC b/v4.0/src/DEV/DISPLAY/DEF-EQU.INC new file mode 100644 index 0000000..03e2cdb --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/DEF-EQU.INC @@ -0,0 +1,290 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; *** DEF-EQU *** DEF-EQU *** DEF-EQU *** +; +; EQU's, STRUC's, and OTHER +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;Modification history ********************************************************* +;AN001; D358 New device driver INIT function package 12/07/87 J.K. +;AN002; D493 Undo D358 02/24/88 J.K. +;AN003; D4934 Change ANSI 2F function number to 1Ah 05/20/88 F.G. +;****************************************************************************** +IF1 ; + %OUT . DEF-EQU .INC +ENDIF ; +ZERO EQU 0H ; +ONE EQU 1H ; +TWO EQU 2H ; +THREE EQU 3H ; +FOUR EQU 4H ; +FIVE EQU 5H ; +SIX EQU 6H ; +SEVEN EQU 7H ; +EIGHT EQU 8H ; +NINE EQU 9H ; +TEN EQU 0AH ; +ELEVEN EQU 0BH ; +TWELVE EQU 0CH ; + ; +FAIL EQU 8000H ; fail in designate + ; +NOT_CY EQU 0FFFEH ; +CY EQU ONE ; + ; +ID_IOCTL EQU 5 ; MAJOR FNCT # FOR 'other' DEVICE + ; +RH EQU ES:[DI] ; addressability to Request Header + ; +RHC STRUC ; fields common to all request types + DB ? ; length of Request Header + DB ? ; unit code (subunit) +RHC_CMD DB ? ; command code +RHC_STA DW ? ; status + DQ ? ; reserved for DOS +RHC ENDS ; end of common portion + ; +CMD_INPUT EQU 4 ; RHC_CMD is INPUT request + ; + ; Status values for RHC_STA +STAT_DONE EQU 0001H ; function complete - high order byte +STAT_CMDERR EQU 8000H ; Error code +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; DEVICE Header DS:[SI] -- to locate the next CON header +; NEXT device header ES:[DI] +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +HP EQU DS:[SI] ; +NHD EQU ES:[DI] ; + ; +NAME_LEN EQU 8 ; + ; +DHS STRUC ; +DH_NEXTO DW ? ; offset of pointer to next header +DH_NEXTS DW ? ; segment of pointer to next header + DW ? ; attribute +DH_STRAO DW ? ; offset to strategy routine +DH_INTRO DW ? ; offset to interrupt routine +DH_NAME DB NAME_LEN DUP(0) ; device name in this header +DHS ENDS ; end of common portion +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Request Header for INIT +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +RH0 STRUC ; + DB (TYPE RHC) DUP (?) ; + ; +RH0_UNIT DB ? ; not used for CHAR devices +RH0_ENDO DW ? ; offset of ending address +RH0_ENDS DW ? ; segment of ending address +RH0_BPBA DD ? ; POINTER TO BPB FOR CHAR DEVICES + db ? ; +RH0 ENDS ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Request Header for IOCTL +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +RH3 STRUC ; + DB (TYPE RHC) DUP (?) ; common portion + ; + ; + DB ? ; media descriptor +RH3_DTAO DW ? ; offset of transfer address +RH3_DTAS DW ? ; segment of transfer address +RH3_CNT DW ? ; byte count +RH3 ENDS ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; IOCTL header format +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +RH_IOCTL STRUC ; +STATIC_RH DB 13 DUP(?) ; STANDARD STATIC REQUEST HEADER +MAJOR_F DB ? ; MAJOR FUNCTION CALL (SEE DOS 3.30) +MINOR_F DB ? ; MINOR FUNCTION CALL (SEE DOS 3.30) +CONTENT_SI DW ? ; CONTENTS OF SI +CONTENT_DI DW ? ; CONTENTS OF DI +REQUEST_PACKET DD ? ; POINTER TO GENERIC IOCTL REQ. PACKET +RH_IOCTL ENDS ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; DESIGNATE BUFFER FORMAT +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +DESG_BUFFER STRUC ; +DESG_CARTRIDGE DW ? ; 0=NO CARTRIDGE, 1=CARTRIDGE +DESG_LENGTH DW ? ; LENGTH OF REMAINING HEADER +DESG_N DW ? ; NUMBER OF CP's DESIGNATED +DESG_CP DW ? ; FIRST CP DESIGNATED +DESG_BUFFER ENDS ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; INVOKE BUFFER FORMAT +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +INVK_BUFFER STRUC ; +INVK_LENGTH DW ? ; LENGTH OF REMAINING HEADER +INVK_CP DW ? ; CP TO INVOKE +INVK_BUFFER ENDS ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; QUERY LIST BUFFER FORMAT +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +QLST_BUFFER STRUC ; +QLST_LENGTH DW ? ; LENGTH OF REMAINING HEADER +QLST_N_HDWR DW ? ; NUMBER OF HARDWARE CP's +QLST_HDWR_CP DW ? ; FIRST HDWR CODE PAGE +QLST_N_DESG DW ? ; NUMBER OF DESIGNATED CP's +QLST_DESG_CP DW ? ; DESINATED CODE PAGES + ; ...there is more data to be + ; filled in by the DRIVER +QLST_BUFFER ENDS ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PARSER STRUC STATEMENTS +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +PARSE_TABLE1 STRUC ; [[[ TABLE 1 ]]] +NUM_DEVICES DW ? ; NUMBER OF DEVICES TO SUPPORT +DEVICE1_OFFSET DW ? ; (hopefully) CON!!! +PARSE_TABLE1 ENDS ; + ; +PARSE_TABLE2 STRUC ; [[[ TABLE 2 ]]] +NUM_ITEMS DW ? ; NUMBER OF ITEMS CREATED BY THE +OFFSET_LIST DW ? ; THE 1ST OFFSET OF [ TABLE 2 ] +PARSE_TABLE2 ENDS ; PARSER! +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; CODE PAGE POINTER STRUCTURE +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +CP_PNTER_STRUC STRUC ; +HDWR_CP_STRUC DW ? ; +DESG_CP_STRUC DW ? ; +FONT_CP_STRUC DW ? ; +WRITE_DATA_STRUC DW ? ; +FONT_DATA_STRUC DW ? ; +CP_PNTER_STRUC ENDS ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; CON data structure CS:[BX] +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +BUF EQU CS:[BX] ; + ; STATES +BUF_DATA STRUC ; +DEV_HDRO DW -1 ; device driver header offset +DEV_HDRS DW -1 ; +CON_STRAO DW -1 ; dos CON strategy offset +CON_STRAS DW -1 ; +CON_INTRO DW -1 ; dos CON strategy offset +CON_INTRS DW -1 ; +RH_PTRO DW -1 ; request header offset +RH_PTRS DW -1 ; segment +STATE DW ? ; +STATUS DW ? ; +BUF_DATA ENDS ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; General Constants +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +INT_2F_LOW EQU (4*2FH) ; INTERRUPT 2FH CON/KEYB COMMUNICATION +INT_2F_HI EQU (4*2FH)+2 ; +INT_43_LOW EQU (4*43H) ; INTERRUPT 43H 0-255 CHARACTER VECTOR +INT_43_HI EQU (4*43H)+2 ; +INT_44_LOW EQU (4*44H) ; INTERRUPT 44H 0-255 CHARACTER VECTOR +INT_44_HI EQU (4*44H)+2 ; +INT_1F_LOW EQU (4*1FH) ; INTERRUPT 1FH EXTENDED CHARACTER SUPPORT +INT_1F_HI EQU (4*1FH)+2 ; +INT_10_LOW EQU (4*10H) ; INTERRUPT 10H fix FOR PALACE +INT_10_HI EQU (4*10H)+2 ; +GET_MODE EQU 0FH ; WGR ;AN000; +ON EQU 1 ; WGR ;AN000; +OFF EQU 0 ; WGR ;AN000; +RECALC_ON EQU 0010H ; WGR ;AN000; +VIDEO_CTRL EQU 487H ; WGR ;AN000; +ANSI_BUF_SIZE EQU 14 ; WGR ;AN000; +DEFAULT_LEN EQU 25 ; WGR ;AN000; +NUMBER EQU 1 ; WGR ;AN000; +STRING EQU 3 ; WGR ;AN000; +COMPLEX EQU 4 ; WGR ;AN000; +RC_EOL EQU -1 ; WGR ;AN000; +RC_NO_ERROR EQU 0 ; WGR ;AN000; +FUNC_CALL EQU 1BH ; WGR ;AN000; +VGA_FOUND EQU 00000001B ; WGR ;AN000; +EGA_FOUND EQU 00000001B ; WGR ;AN000; +LCD_FOUND EQU 00000010B ; WGR ;AN000; +CGA_FOUND EQU 00000100B ; WGR ;AN000; +MONO_FOUND EQU 00001000B ; WGR ;AN000; +ALT_SELECT EQU 12H ; WGR ;AN000; +EGA_INFO_CALL EQU 10H ; WGR ;AN000; +GET_SYS_ID EQU 0C0H ; WGR ;AN000; +GET_STATUS EQU 43H ; WGR ;AN000; +LCD_MODEL EQU 0F9H ; WGR ;AN000; +COLOR_ADDRESS EQU 0B800H ; WGR ;AN000; +MONO_ADDRESS EQU 0B000H ; WGR ;AN000; +ERROR_1 EQU 2 ; WGR ;AN000; +ERROR_2 EQU 12 ; WGR ;AN000; +ERROR_3 EQU 8 ; WGR ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; *** INT 2Fh used +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +ANSI_2F EQU 1Ah ; WGR Muliflex number for ANSI ;AC003; +;Catagory code +IOCTL_2F EQU 1h ; +DA_INFO_2F EQU 2h ;J.K. Information passing to ANSI. +;Subfunction code for IOCTL_2F +GET_SUBFUNC EQU 7FH ; WGR Same structure as GET_IOCTL(ANSI);AN000; + +;Info Struture for DA_INFO_2F. (DS:DX point to this packet) +;J.K. Note: For DOS 4.00, DA_INFO_PACKET is used to signal ANSI.SYS that +;DISPLAY.SYS is calling/finishing INT 10h SET MODE call. ANSI.SYS needs this +;infomration since it also hooks INT 10h vector. +;For this DA_SETMODE_FLAG purpose, DA_INFO_LEVEL and DA_INFO_DIRECTION should always be +;set to 0. This can be extended for another information passing scheme between +;DISPLAY.SYS and ANSI.SYS in the future version. +;For DA_SETMODE_FLAG, DISPLAY.SYS should be extremely careful that when it calls +;with DA_SETMODE_FLAG =1, then it should calls with DA_SETMODE_FLAG=0 +;when it finished INT 10h function call. Otherwise, the system goes ..... +DA_INFO_PACKET struc +DA_INFO_LEVEL db 0 ; 0 for DA_SETMODE_FLAG, 1 for DA_OPTION_L_STATE query (for OS2 compat. box). +DA_SETMODE_FLAG db 0 ; 1: DISPLAY.SYS is calling INT 10h call, SET MODE. 0= finished. +DA_OPTION_L_STATE db 0 ; on return from ANSI, 1 = ANSI /L option active, 0 = inactive. +DA_INFO_PACKET ends + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; *** DEF-EQU *** DEF-EQU *** DEF-EQU *** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Information Block Structure +; (for functionality call) +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +INFO_BLOCK STRUC ; info block for functionality call ;AN000; +STATIC_ADDRESS DD ? ; address of static functionality table;AN000; + DB 33 DUP(?) ; don't care ;AN000; +ACTIVE_DISPLAY DB ? ; active display code ;AN000; +ALT_DISPLAY DB ? ; alternate display code ;AN000; + DB 3 DUP(?) ; don't care ;AN000; +CURRENT_SCANS DB ? ; current number of scan lines ;AN000; + DB 2 DUP(?) ; don't care ;AN000; +MISC_INFO DB ? ; miscellaneous state information ;AN000; + DB 18 DUP(?) ; don't care ;AN000; +INFO_BLOCK ENDS ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Structure of System ID call return block +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +SYS_ID STRUC ; format of return system config data ;AN000; + DW ? ; don't care ;AN000; +MODEL_BYTE DB ? ; model byte ;AN000; +SYS_ID ENDS ; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/v4.0/src/DEV/DISPLAY/DISPLAY.ASM b/v4.0/src/DEV/DISPLAY/DISPLAY.ASM new file mode 100644 index 0000000..16738b7 --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/DISPLAY.ASM @@ -0,0 +1,388 @@ +PAGE ,132 +TITLE DOS - CONSOLE Code Page Switching Device Driver +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; FILENAME: DISPLAY.ASM +; PROGRAM: DISPLAY.SYS (Main module) +; LINK PROCEDURE: Linkk +; INSTALLATION: +; +; This routine is structured as a DOS Device Driver. +; IE it is installed via the CONFIG.SYS command: +; DEVICE=DISPLAY.SYS +; +; The following device commands are supported: +; +; 00 hex - INIT +; ------------- +; Install the CON device driver. This is used for downloading of +; the character sets (various Code Pages) according to the respective +; display adapter. The interface provided by the video BIOS is used +; to download a block of 256 characters (in various resolutions - ie. +; 8x8, 8x14, and 8x16). Also, the interrupt 2F hex is chained for +; communication between the CON device driver and the keyboard routine. +; +; Refer to INIT.ASM for code +; +; 13 hex - GENERIC IOCTL +; ---------------------- +; INVOKE +; ------ +; Invoke is use to activate the appropriate CP font. The mechanism +; is based soley on the code page value passed from the MODE & CHCP +; commands. Once a CP ahs benn INVOKED, it is loaded for ALL display +; modes on the respective display adapter - ONLY IF the proper font +; resolution can be accessed. +; +; Refer to CPS-FUNC.INC for code +; +; DESIGNATE START +; --------------- +; Designate start passes the list of designated code pages to load. +; It is sent just prior to the IOCTL WRITE calls containing the 'CPI' +; files. The list of designated code pages is check for duplicates +; and for invalids (-1). +; +; Refer to CPS-FUNC.INC for code +; +; DESIGNATE STOP +; -------------- +; Once the data (for a DESIGNATION) has been routed to the CPS driver, +; it is followed by a DESIGNATE STOP command. This confirms the completion +; of the DESIGNATE procedure. If there was an error detected during the +; DESIGNATE procedure, it must be followed by a DESIGNATE STOP. +; +; Refer to CPS-FUNC.INC for code +; +; +; 0C hex - IOCTL OUTPUT +; --------------------- +; Following a DESIGNATE START, the contents of the specified data file +; (expected .CPI format) is copied by DOS to the CPS driver. This is +; via the GENERIC IOCTL WRITE calls. During these calls, the data is +; parsed by the FONT-PARSER (F-PARSER.SRC) to select the CP and fonts +; required. +; +; Refer to CPS-FUNC.INC for code +; +; +; (C)Copyright 1988 Microsoft +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Request Header (Common portion) +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +IF1 ; + %OUT .Compiling: DISPLAY.ASM + %OUT . CPS-CON driver + %OUT . Version 3.30 + %OUT .Include Files: +ENDIF ; + INCLUDE MACROS.INC ; + INCLUDE DEF-EQU.INC ; + ; + PUBLIC EOF_MARKER ; + PUBLIC CPD_ACTIVE ; + PUBLIC CPD_CLASS ; + PUBLIC CPD_HDWR_N_MAX ; + PUBLIC CPD_DESG_N_MAX ; + PUBLIC CPD_HDWR_N ; + PUBLIC CPD_DESG_N ; + PUBLIC CPD_FONTS_N ; + PUBLIC CPD_FONT_PNTER ; + PUBLIC IRPT_2 ; + PUBLIC IRPT_CMD_EXIT ; + PUBLIC DEV_HDR ; + EXTRN INIT:NEAR ; + ; +CODE SEGMENT BYTE PUBLIC 'CODE' ; + ASSUME CS:CODE,DS:CODE ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;**************************************** +;** Resident Code ** +;**************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +START EQU $ ; begin resident data & code +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; DEVICE HEADER - must be at offset zero within device driver +; (DHS is defined according to this structure) +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ORG 0000H ; + ; +DEV_HDR:DD -1 ; Pointer to next device header + DW 0C053H ; Attribute (Char device) + DW OFFSET STRATEGY ; Pnter to device "strategy" + DW OFFSET INTERRUPT ; Pnter to device "interrupt" + DB 'CON ' ; Device name + ; and of course a descriptive name + ; which can be viewed by a TYPE! +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Console Description Table +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +.XLIST ; +STACK_END DW 1FFH+60H DUP(0) ; 200H + 'my' needs (re/ DOS 3.30 ref) +STACK_START DW 0 ; +OLD_STACK_S DW ? ; +OLD_STACK_O DW ? ; +.LIST ; + ; +BUF1: BUF_DATA <> ; exclude PAR_EXTRACTO + ; +CP_PNTER_TABLE DW OFFSET CPD_HDWR_N ; TABLE OF POINTERS TO CP INFO + DW OFFSET CPD_DESG_N ; + DW OFFSET CPD_FONT_PNTER; + DW OFFSET CPD_FONT_WRITE; + DW OFFSET CPD_FONT_DATA ; + ; +CPD_TABLE LABEL WORD ; TABLE DATA INFO FOR CP's +CPD_ACTIVE DW -1 ; TEMPORARY +CPD_CLASS DB '........' ; THIS IS SET TO (EGA, LCD) +CPD_FONTS_N DW -1 ; +CPD_HDWR_N DW 0 ; + DW 12 DUP(-1) ; (HDWR_CP's) (MAX=12) +CPD_HDWR_N_MAX EQU ($-CPD_HDWR_N)/2-1 ; +CPD_DESG_N DW -1 ; # OF DESIG CP's + DW 12 DUP(-1) ; (DESG CP's) (MAX=12) +CPD_DESG_N_MAX EQU ($-CPD_DESG_N)/2-1 ; +CPD_FONT_PNTER DW 12 DUP(0,0) ; SEG_OFFSET POINTER TO DATA BUFFERS +CPD_FONT_WRITE DW 12 DUP(0,0) ; SEG_OFFSET OF FONTS BEING WRITTEN +CPD_FONT_DATA DW 12 DUP(0) ; COUNT OF FONT DATA TO SKIP/COPY! +FONT_PRIORITY DB 8 DUP(-1) ; USED TO CLASSIFY FONT PRIORITY +NUM_FONT_PRIORITY EQU ($-FONT_PRIORITY) ; DURING A DESIGNATION +CPD_TEMP_DESG DW 0 ; # OF DESIG CP's TEMP BUFFER + DW 12 DUP(-1) ; (DESG CP's) (MAX=12) +CPD_REQ_DESG DW 0 ; # OF DESIG CP's REQUESTED + DW 12 DUP(-1) ; (DESG CP's) (MAX=12) +;;;;;;; + +ANSI_DA_INFO DA_INFO_PACKET <> ;J.K. Information packet to ANSI used for MODE SET INT10 call. + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; CON Device "strategy" entry point +; Retain the Request Header address for use by Interrupt routine +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ASSUME DS:NOTHING ; +STRATEGY PROC FAR ; + PUSH BX ; + PUSH BX ; + LEA BX, BUF1 ; BUF = BUF1 CS:[BX] + POP BUF.RH_PTRO ; OFFSET OF REQUEST HEADER + MOV BUF.RH_PTRS,ES ; SEGMENT + POP BX ; + RET ; +STRATEGY ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Table of command processing routine entry points +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +CMD_TABLE LABEL WORD ; + DW OFFSET INIT ; 0 - Initialization + DW OFFSET NO_OPERATION ; 1 - Media check + DW OFFSET NO_OPERATION ; 2 - Build BPB + DW OFFSET NO_OPERATION ; 3 - IOCTL input + DW OFFSET NO_OPERATION ; 4 - Input + DW OFFSET NO_OPERATION ; 5 - Non destructive input no wait + DW OFFSET NO_OPERATION ; 6 - Input status + DW OFFSET NO_OPERATION ; 7 - Input flush + DW OFFSET NO_OPERATION ; 8 - Write + DW OFFSET NO_OPERATION ; 9 - Output with verify + DW OFFSET NO_OPERATION ; A - Output status + DW OFFSET NO_OPERATION ; B - Output flush + DW OFFSET DESG_WRITE ; C - IOCTL output + DW OFFSET NO_OPERATION ; D - Device OPEN + DW OFFSET NO_OPERATION ; E - Device CLOSE + DW OFFSET NO_OPERATION ; F - Removable media + DW OFFSET NO_OPERATION ; 10 - Removable media + DW OFFSET NO_OPERATION ; 11 - Removable media + DW OFFSET NO_OPERATION ; 12 - Removable media + DW OFFSET GENERIC_IOCTL ; 13 - Removable media +MAX_CMD EQU ($-CMD_TABLE)/2 ; highest valid command follows +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; CON Device "interrupt" entry point +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +INTERRUPT PROC FAR ; device interrupt entry point + PUSH AX ; + PUSH BX ; + PUSH CX ; + PUSH DI ; + PUSH SI ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Common interrupt entry : +; at entry, BUFn (CS:BX) of CON is defined +; +; Check if header link has to be set +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + LEA BX, BUF1 ; + MOV DI,OFFSET DEV_HDR ; CON Device header + ; + MOV BUF.DEV_HDRO,DI ; + MOV BUF.DEV_HDRS,CS ; + CLD ; all moves forward + ; + CMP BUF.CON_STRAO, -1 ; + JNE L4 ; has been linked to DOS CON + CMP BUF.CON_STRAS, -1 ; + JNE L4 ; has been linked to DOS CON + ; next device header : ES:[DI] + LDS SI,DWORD PTR BUF.DEV_HDRO; + LES DI,DWORD PTR HP.DH_NEXTO; + ; +;$SEARCH WHILE ; pointer to next device header is NOT +L1: ; + PUSH ES ; -1 + POP AX ; + CMP AX,-1 ; +;$LEAVE E, AND ; leave if both offset and segment are + JNE NOT0FFFF ; + ; + CMP DI,-1 ; 0FFFFH +;$LEAVE E ; + JE L4 ; +NOT0FFFF: ; + PUSH DI ; + PUSH SI ; + MOV CX,NAME_LEN ; + LEA DI,NHD.DH_NAME ; + LEA SI,HP.DH_NAME ; + REPE CMPSB ; + POP SI ; + POP DI ; + AND CX,CX ; +;$EXITIF Z ; Exit if name is found in linked hd. + JNZ L3 ; Name is not found + ; Name is found in the linked header + MOV AX,NHD.DH_STRAO ; Get the STRATEGY address + MOV BUF.CON_STRAO,AX ; + MOV AX,ES ; +X1: MOV BUF.CON_STRAS,AX ; + ; + MOV AX,NHD.DH_INTRO ; Get the INTERRUPT address + MOV BUF.CON_INTRO,AX ; + MOV AX,ES ; +X2: MOV BUF.CON_INTRS,AX ; + ; +;$ORELSE ; FInd next header to have the same + JMP L4 ; Device Name +L3: ; + LES DI,DWORD PTR NHD.DH_NEXTO; +;$ENDLOOP ; + JMP L1 ; +L4: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; COMMAND REQUEST +; ES:DI REQUEST HEADER +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + LES DI,DWORD PTR BUF.RH_PTRO; GET RH ADDRESS PASSED TO + ; "STRATEGY" INTO ES:DI + MOV AL,RH.RHC_CMD ; COMMAND CODE FROM REQUEST HEADER + CBW ; ZERO AH (IF AL > 7FH, NEXT COMPARE + ; WILL CATCH THAT ERROR) + CMP AL,MAX_CMD ; IF COMMAND CODE IS TOO HIGH + JAE L6 ; JUMP TO ERROR ROUTINE + ; + ADD AX,AX ; DOUBLE COMMAND CODE FOR TABLE OFFSET + MOV SI,AX ; PUT INTO INDEX REGISTER FOR JMP + ; + CALL CS:CMD_TABLE[SI] ; CALL ROUTINE TO HANDLE THE COMMAND + JC IRPT_CMD_EXIT ; CY=1 IF NO PASS_CONTROL REQ'D + CALL PASS_CONTROL ; + JUMP IRPT_2 ; + ; +L6: CALL PASS_CONTROL ; CALL ROUTINE TO HANDLE THE COMMAND +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; At entry to command processing routine +; +; ES:DI = Request Header address +; CS:BX = Buffer for CON +; CS = code segment address +; AX = 0 +; +; top of stack is return address, IRPT_CMD_EXIT +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +IRPT_CMD_EXIT: ; RETURN FROM COMMAND ROUTINE + LES DI,DWORD PTR BUF.RH_PTRO; RESTORE ES:DI AS REQUEST HEADER PTR + XOR AX,AX ; + OR AX,BUF.STATUS ; + JE IRPT_0 ; + XOR BUF.STATUS,AX ; SET STATUS BACK TO OK! + OR AX,STAT_CMDERR ; + JUMP IRPT_1 ; +IRPT_0: OR AH,STAT_DONE ; ADD "DONE" BIT TO STATUS WORD +IRPT_1: MOV RH.RHC_STA,AX ; STORE STATUS INTO REQUEST HEADER +IRPT_2: POP SI ; RESTORE REGISTERS + POP DI ; + POP CX ; + POP BX ; + POP AX ; + RET ; +INTERRUPT ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PASS CONTROL +; +; This calls the attached device to perform any further +; action on the call! +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +PASS_CONTROL PROC ; + PUSH BX ; + PUSH BX ; + POP SI ; + LES BX,DWORD PTR BUF.RH_PTRO; pass the request header to the + CALL DWORD PTR CS:[SI].CON_STRAO ; CON strategy routine. + POP BX ; + CALL DWORD PTR BUF.CON_INTRO ; interrupt the CON + RET ; +PASS_CONTROL ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +NO_OPERATION PROC ; + CLC ; + RET ; +NO_OPERATION ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PULL IN THE CODE PAGE FUNCTION CODE +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + INCLUDE INT2FCOM.INC ; + INCLUDE INT10COM.INC ; + INCLUDE CPS-FUNC.INC ; + INCLUDE WRITE.INC ; SPECIAL MARKER IN WRITE.INC + INCLUDE F-PARSER.INC ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Adjust the assembly-time instruction counter to a paragraph +; boundary +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + IF ($-START) MOD 16 ; + ORG ($-START)+16-(($-START) MOD 16); + ENDIF ; +EOF_MARKER EQU $ ; end of resident code +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; END-OF-CODE +; +;;;;;;;;;;;;;;;;; +CODE ENDS ; + END ; +;;;;;;;;;;;;;;;;; diff --git a/v4.0/src/DEV/DISPLAY/DISPLAY.LNK b/v4.0/src/DEV/DISPLAY/DISPLAY.LNK new file mode 100644 index 0000000..e46ab3f --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/DISPLAY.LNK @@ -0,0 +1,4 @@ +DISPLAY.OBJ+ +INIT.OBJ+ +PARSER.OBJ +DISPLAY.EXE; diff --git a/v4.0/src/DEV/DISPLAY/DISPLAY.SKL b/v4.0/src/DEV/DISPLAY/DISPLAY.SKL new file mode 100644 index 0000000..985006a --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/DISPLAY.SKL @@ -0,0 +1,15 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Message Skeleton file for DISPLAY.SYS +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +:util DISPLAY ; utility name + +:class A +:use 1 COMMON1 +:def 2 "%1 code page driver cannot be initialized",CR,LF,BELL +:def 8 "Insufficient memory",CR,LF,BELL +:def 12 "Invalid syntax on DISPLAY.SYS code page driver",CR,LF,BELL + +:end diff --git a/v4.0/src/DEV/DISPLAY/DISPMES.ASM b/v4.0/src/DEV/DISPLAY/DISPMES.ASM new file mode 100644 index 0000000..3f7c551 --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/DISPMES.ASM @@ -0,0 +1,17 @@ +CODE SEGMENT BYTE PUBLIC 'CODE' ; + ASSUME CS:CODE,DS:CODE ; + ; +CR EQU 13 ; +LF EQU 10 ; + ; + PUBLIC ERROR_1B ; + PUBLIC ERROR_1A ; + PUBLIC ERROR_2 ; + PUBLIC ERROR_3 ; +;; PUBLIC MSG_4 ; + ; +INCLUDE DISPMES.INC + ; +CODE ENDS ; + END ; + \ No newline at end of file diff --git a/v4.0/src/DEV/DISPLAY/EGA/437-8X14.ASM b/v4.0/src/DEV/DISPLAY/EGA/437-8X14.ASM new file mode 100644 index 0000000..e723b78 --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/EGA/437-8X14.ASM @@ -0,0 +1,269 @@ +;*************************************************** +; CHARACTER FONT FILE +; Source Assembler File +; +; CODE PAGE: 437 +; FONT RESOLUTION: 8 x 14 +; +; DATE CREATED:05-28-1987 +; +; +; Output file from: MULTIFON, Version 1A +; +;*************************************************** + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #0 + Db 000h,000h,000h,07Eh,081h,0A5h,081h,081h,0BDh,099h,081h,07Eh,000h,000h ; Hex #1 + Db 000h,000h,000h,07Eh,0FFh,0DBh,0FFh,0FFh,0C3h,0E7h,0FFh,07Eh,000h,000h ; Hex #2 + Db 000h,000h,000h,000h,06Ch,0FEh,0FEh,0FEh,0FEh,07Ch,038h,010h,000h,000h ; Hex #3 + Db 000h,000h,000h,000h,010h,038h,07Ch,0FEh,07Ch,038h,010h,000h,000h,000h ; Hex #4 + Db 000h,000h,000h,018h,03Ch,03Ch,0E7h,0E7h,0E7h,018h,018h,03Ch,000h,000h ; Hex #5 + Db 000h,000h,000h,018h,03Ch,07Eh,0FFh,0FFh,07Eh,018h,018h,03Ch,000h,000h ; Hex #6 + Db 000h,000h,000h,000h,000h,000h,018h,03Ch,03Ch,018h,000h,000h,000h,000h ; Hex #7 + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0E7h,0C3h,0C3h,0E7h,0FFh,0FFh,0FFh,0FFh ; Hex #8 + Db 000h,000h,000h,000h,000h,03Ch,066h,042h,042h,066h,03Ch,000h,000h,000h ; Hex #9 + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0C3h,099h,0BDh,0BDh,099h,0C3h,0FFh,0FFh,0FFh ; Hex #A + Db 000h,000h,000h,01Eh,00Eh,01Ah,032h,078h,0CCh,0CCh,0CCh,078h,000h,000h ; Hex #B + Db 000h,000h,000h,03Ch,066h,066h,066h,03Ch,018h,07Eh,018h,018h,000h,000h ; Hex #C + Db 000h,000h,000h,03Fh,033h,03Fh,030h,030h,030h,070h,0F0h,0E0h,000h,000h ; Hex #D + Db 000h,000h,000h,07Fh,063h,07Fh,063h,063h,063h,067h,0E7h,0E6h,0C0h,000h ; Hex #E + Db 000h,000h,000h,018h,018h,0DBh,03Ch,0E7h,03Ch,0DBh,018h,018h,000h,000h ; Hex #F + Db 000h,000h,000h,080h,0C0h,0E0h,0F8h,0FEh,0F8h,0E0h,0C0h,080h,000h,000h ; Hex #10 + Db 000h,000h,000h,002h,006h,00Eh,03Eh,0FEh,03Eh,00Eh,006h,002h,000h,000h ; Hex #11 + Db 000h,000h,000h,018h,03Ch,07Eh,018h,018h,018h,07Eh,03Ch,018h,000h,000h ; Hex #12 + Db 000h,000h,000h,066h,066h,066h,066h,066h,066h,000h,066h,066h,000h,000h ; Hex #13 + Db 000h,000h,000h,07Fh,0DBh,0DBh,0DBh,07Bh,01Bh,01Bh,01Bh,01Bh,000h,000h ; Hex #14 + Db 000h,000h,07Ch,0C6h,060h,038h,06Ch,0C6h,0C6h,06Ch,038h,00Ch,0C6h,07Ch ; Hex #15 + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,0FEh,0FEh,0FEh,000h,000h ; Hex #16 + Db 000h,000h,000h,018h,03Ch,07Eh,018h,018h,018h,07Eh,03Ch,018h,07Eh,000h ; Hex #17 + Db 000h,000h,000h,018h,03Ch,07Eh,018h,018h,018h,018h,018h,018h,000h,000h ; Hex #18 + Db 000h,000h,000h,018h,018h,018h,018h,018h,018h,07Eh,03Ch,018h,000h,000h ; Hex #19 + Db 000h,000h,000h,000h,000h,018h,00Ch,0FEh,00Ch,018h,000h,000h,000h,000h ; Hex #1A + Db 000h,000h,000h,000h,000h,030h,060h,0FEh,060h,030h,000h,000h,000h,000h ; Hex #1B + Db 000h,000h,000h,000h,000h,000h,0C0h,0C0h,0C0h,0FEh,000h,000h,000h,000h ; Hex #1C + Db 000h,000h,000h,000h,000h,028h,06Ch,0FEh,06Ch,028h,000h,000h,000h,000h ; Hex #1D + Db 000h,000h,000h,000h,010h,038h,038h,07Ch,07Ch,0FEh,0FEh,000h,000h,000h ; Hex #1E + Db 000h,000h,000h,000h,0FEh,0FEh,07Ch,07Ch,038h,038h,010h,000h,000h,000h ; Hex #1F + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #20 + Db 000h,000h,000h,018h,03Ch,03Ch,03Ch,018h,018h,000h,018h,018h,000h,000h ; Hex #21 + Db 000h,066h,066h,066h,024h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #22 + Db 000h,000h,000h,06Ch,06Ch,0FEh,06Ch,06Ch,06Ch,0FEh,06Ch,06Ch,000h,000h ; Hex #23 + Db 000h,018h,018h,07Ch,0C6h,0C2h,0C0h,07Ch,006h,086h,0C6h,07Ch,018h,018h ; Hex #24 + Db 000h,000h,000h,000h,000h,0C2h,0C6h,00Ch,018h,030h,066h,0C6h,000h,000h ; Hex #25 + Db 000h,000h,000h,038h,06Ch,06Ch,038h,076h,0DCh,0CCh,0CCh,076h,000h,000h ; Hex #26 + Db 000h,018h,018h,018h,030h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #27 + Db 000h,000h,000h,00Ch,018h,030h,030h,030h,030h,030h,018h,00Ch,000h,000h ; Hex #28 + Db 000h,000h,000h,030h,018h,00Ch,00Ch,00Ch,00Ch,00Ch,018h,030h,000h,000h ; Hex #29 + Db 000h,000h,000h,000h,000h,066h,03Ch,0FFh,03Ch,066h,000h,000h,000h,000h ; Hex #2A + Db 000h,000h,000h,000h,000h,018h,018h,07Eh,018h,018h,000h,000h,000h,000h ; Hex #2B + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,018h,018h,018h,030h,000h ; Hex #2C + Db 000h,000h,000h,000h,000h,000h,000h,0FEh,000h,000h,000h,000h,000h,000h ; Hex #2D + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,018h,018h,000h,000h ; Hex #2E + Db 000h,000h,000h,002h,006h,00Ch,018h,030h,060h,0C0h,080h,000h,000h,000h ; Hex #2F + Db 000h,000h,000h,038h,06Ch,0C6h,0C6h,0D6h,0C6h,0C6h,06Ch,038h,000h,000h ; Hex #30 + Db 000h,000h,000h,018h,038h,078h,018h,018h,018h,018h,018h,07Eh,000h,000h ; Hex #31 + Db 000h,000h,000h,07Ch,0C6h,006h,00Ch,018h,030h,060h,0C6h,0FEh,000h,000h ; Hex #32 + Db 000h,000h,000h,07Ch,0C6h,006h,006h,03Ch,006h,006h,0C6h,07Ch,000h,000h ; Hex #33 + Db 000h,000h,000h,00Ch,01Ch,03Ch,06Ch,0CCh,0FEh,00Ch,00Ch,01Eh,000h,000h ; Hex #34 + Db 000h,000h,000h,0FEh,0C0h,0C0h,0C0h,0FCh,006h,006h,0C6h,07Ch,000h,000h ; Hex #35 + Db 000h,000h,000h,038h,060h,0C0h,0C0h,0FCh,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #36 + Db 000h,000h,000h,0FEh,0C6h,006h,00Ch,018h,030h,030h,030h,030h,000h,000h ; Hex #37 + Db 000h,000h,000h,07Ch,0C6h,0C6h,0C6h,07Ch,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #38 + Db 000h,000h,000h,07Ch,0C6h,0C6h,0C6h,07Eh,006h,006h,00Ch,078h,000h,000h ; Hex #39 + Db 000h,000h,000h,000h,018h,018h,000h,000h,000h,018h,018h,000h,000h,000h ; Hex #3A + Db 000h,000h,000h,000h,018h,018h,000h,000h,000h,018h,018h,030h,000h,000h ; Hex #3B + Db 000h,000h,000h,00Ch,018h,030h,060h,0C0h,060h,030h,018h,00Ch,000h,000h ; Hex #3C + Db 000h,000h,000h,000h,000h,000h,07Eh,000h,000h,07Eh,000h,000h,000h,000h ; Hex #3D + Db 000h,000h,000h,060h,030h,018h,00Ch,006h,00Ch,018h,030h,060h,000h,000h ; Hex #3E + Db 000h,000h,000h,07Ch,0C6h,0C6h,00Ch,018h,018h,000h,018h,018h,000h,000h ; Hex #3F + Db 000h,000h,000h,07Ch,0C6h,0C6h,0DEh,0DEh,0DEh,0DCh,0C0h,07Ch,000h,000h ; Hex #40 + Db 000h,000h,000h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h,000h ; Hex #41 + Db 000h,000h,000h,0FCh,066h,066h,066h,07Ch,066h,066h,066h,0FCh,000h,000h ; Hex #42 + Db 000h,000h,000h,03Ch,066h,0C2h,0C0h,0C0h,0C0h,0C2h,066h,03Ch,000h,000h ; Hex #43 + Db 000h,000h,000h,0F8h,06Ch,066h,066h,066h,066h,066h,06Ch,0F8h,000h,000h ; Hex #44 + Db 000h,000h,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h ; Hex #45 + Db 000h,000h,000h,0FEh,066h,062h,068h,078h,068h,060h,060h,0F0h,000h,000h ; Hex #46 + Db 000h,000h,000h,03Ch,066h,0C2h,0C0h,0C0h,0DEh,0C6h,066h,03Ah,000h,000h ; Hex #47 + Db 000h,000h,000h,0C6h,0C6h,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,0C6h,000h,000h ; Hex #48 + Db 000h,000h,000h,03Ch,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #49 + Db 000h,000h,000h,01Eh,00Ch,00Ch,00Ch,00Ch,00Ch,0CCh,0CCh,078h,000h,000h ; Hex #4A + Db 000h,000h,000h,0E6h,066h,06Ch,06Ch,078h,06Ch,06Ch,066h,0E6h,000h,000h ; Hex #4B + Db 000h,000h,000h,0F0h,060h,060h,060h,060h,060h,062h,066h,0FEh,000h,000h ; Hex #4C + Db 000h,000h,000h,0C6h,0EEh,0FEh,0D6h,0C6h,0C6h,0C6h,0C6h,0C6h,000h,000h ; Hex #4D + Db 000h,000h,000h,0C6h,0E6h,0F6h,0FEh,0DEh,0CEh,0C6h,0C6h,0C6h,000h,000h ; Hex #4E + Db 000h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #4F + Db 000h,000h,000h,0FCh,066h,066h,066h,07Ch,060h,060h,060h,0F0h,000h,000h ; Hex #50 + Db 000h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0D6h,0DEh,07Ch,00Eh,000h ; Hex #51 + Db 000h,000h,000h,0FCh,066h,066h,066h,07Ch,06Ch,066h,066h,0E6h,000h,000h ; Hex #52 + Db 000h,000h,000h,07Ch,0C6h,0C6h,060h,038h,00Ch,0C6h,0C6h,07Ch,000h,000h ; Hex #53 + Db 000h,000h,000h,07Eh,07Eh,05Ah,018h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #54 + Db 000h,000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #55 + Db 000h,000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,06Ch,038h,010h,000h,000h ; Hex #56 + Db 000h,000h,000h,0C6h,0C6h,0C6h,0C6h,0D6h,0D6h,0FEh,06Ch,06Ch,000h,000h ; Hex #57 + Db 000h,000h,000h,0C6h,0C6h,0C6h,07Ch,038h,07Ch,0C6h,0C6h,0C6h,000h,000h ; Hex #58 + Db 000h,000h,000h,066h,066h,066h,066h,03Ch,018h,018h,018h,03Ch,000h,000h ; Hex #59 + Db 000h,000h,000h,0FEh,0C6h,08Ch,018h,030h,060h,0C2h,0C6h,0FEh,000h,000h ; Hex #5A + Db 000h,000h,000h,03Ch,030h,030h,030h,030h,030h,030h,030h,03Ch,000h,000h ; Hex #5B + Db 000h,000h,000h,080h,0C0h,0E0h,070h,038h,01Ch,00Eh,006h,002h,000h,000h ; Hex #5C + Db 000h,000h,000h,03Ch,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,03Ch,000h,000h ; Hex #5D + Db 010h,038h,06Ch,0C6h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #5E + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,0FFh ; Hex #5F + Db 000h,030h,018h,00Ch,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #60 + Db 000h,000h,000h,000h,000h,000h,078h,00Ch,07Ch,0CCh,0CCh,076h,000h,000h ; Hex #61 + Db 000h,000h,000h,0E0h,060h,060h,078h,06Ch,066h,066h,066h,07Ch,000h,000h ; Hex #62 + Db 000h,000h,000h,000h,000h,000h,07Ch,0C6h,0C0h,0C0h,0C6h,07Ch,000h,000h ; Hex #63 + Db 000h,000h,000h,01Ch,00Ch,00Ch,03Ch,06Ch,0CCh,0CCh,0CCh,076h,000h,000h ; Hex #64 + Db 000h,000h,000h,000h,000h,000h,07Ch,0C6h,0FEh,0C0h,0C6h,07Ch,000h,000h ; Hex #65 + Db 000h,000h,000h,01Ch,036h,032h,030h,07Ch,030h,030h,030h,078h,000h,000h ; Hex #66 + Db 000h,000h,000h,000h,000h,000h,076h,0CCh,0CCh,0CCh,07Ch,00Ch,0CCh,078h ; Hex #67 + Db 000h,000h,000h,0E0h,060h,060h,06Ch,076h,066h,066h,066h,0E6h,000h,000h ; Hex #68 + Db 000h,000h,000h,018h,018h,000h,038h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #69 + Db 000h,000h,000h,006h,006h,000h,00Eh,006h,006h,006h,006h,066h,066h,03Ch ; Hex #6A + Db 000h,000h,000h,0E0h,060h,060h,066h,06Ch,078h,06Ch,066h,0E6h,000h,000h ; Hex #6B + Db 000h,000h,000h,038h,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #6C + Db 000h,000h,000h,000h,000h,000h,0ECh,0FEh,0D6h,0D6h,0D6h,0D6h,000h,000h ; Hex #6D + Db 000h,000h,000h,000h,000h,000h,0DCh,066h,066h,066h,066h,066h,000h,000h ; Hex #6E + Db 000h,000h,000h,000h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #6F + Db 000h,000h,000h,000h,000h,000h,0DCh,066h,066h,066h,07Ch,060h,060h,0F0h ; Hex #70 + Db 000h,000h,000h,000h,000h,000h,076h,0CCh,0CCh,0CCh,07Ch,00Ch,00Ch,01Eh ; Hex #71 + Db 000h,000h,000h,000h,000h,000h,0DCh,076h,066h,060h,060h,0F0h,000h,000h ; Hex #72 + Db 000h,000h,000h,000h,000h,000h,07Ch,0C6h,070h,01Ch,0C6h,07Ch,000h,000h ; Hex #73 + Db 000h,000h,000h,010h,030h,030h,0FCh,030h,030h,030h,036h,01Ch,000h,000h ; Hex #74 + Db 000h,000h,000h,000h,000h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h ; Hex #75 + Db 000h,000h,000h,000h,000h,000h,0C6h,0C6h,0C6h,06Ch,038h,010h,000h,000h ; Hex #76 + Db 000h,000h,000h,000h,000h,000h,0C6h,0C6h,0D6h,0D6h,0FEh,06Ch,000h,000h ; Hex #77 + Db 000h,000h,000h,000h,000h,000h,0C6h,06Ch,038h,038h,06Ch,0C6h,000h,000h ; Hex #78 + Db 000h,000h,000h,000h,000h,000h,0C6h,0C6h,0C6h,0C6h,07Eh,006h,00Ch,078h ; Hex #79 + Db 000h,000h,000h,000h,000h,000h,0FEh,0CCh,018h,030h,066h,0FEh,000h,000h ; Hex #7A + Db 000h,000h,000h,00Eh,018h,018h,018h,070h,018h,018h,018h,00Eh,000h,000h ; Hex #7B + Db 000h,000h,000h,018h,018h,018h,018h,018h,018h,018h,018h,018h,000h,000h ; Hex #7C + Db 000h,000h,000h,070h,018h,018h,018h,00Eh,018h,018h,018h,070h,000h,000h ; Hex #7D + Db 000h,076h,0DCh,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #7E + Db 000h,000h,000h,000h,000h,010h,038h,06Ch,0C6h,0C6h,0FEh,000h,000h,000h ; Hex #7F + Db 000h,000h,000h,03Ch,066h,0C2h,0C0h,0C0h,0C0h,0C2h,066h,03Ch,00Ch,078h ; Hex #80 + Db 000h,000h,000h,0CCh,000h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h ; Hex #81 + Db 000h,000h,00Ch,018h,030h,000h,07Ch,0C6h,0FEh,0C0h,0C6h,07Ch,000h,000h ; Hex #82 + Db 000h,000h,010h,038h,06Ch,000h,078h,00Ch,07Ch,0CCh,0CCh,076h,000h,000h ; Hex #83 + Db 000h,000h,000h,0C6h,000h,000h,078h,00Ch,07Ch,0CCh,0CCh,076h,000h,000h ; Hex #84 + Db 000h,000h,060h,030h,018h,000h,078h,00Ch,07Ch,0CCh,0CCh,076h,000h,000h ; Hex #85 + Db 000h,000h,038h,06Ch,038h,000h,078h,00Ch,07Ch,0CCh,0CCh,076h,000h,000h ; Hex #86 + Db 000h,000h,000h,000h,000h,000h,07Ch,0C6h,0C0h,0C0h,0C6h,07Ch,00Ch,078h ; Hex #87 + Db 000h,000h,010h,038h,06Ch,000h,07Ch,0C6h,0FEh,0C0h,0C6h,07Ch,000h,000h ; Hex #88 + Db 000h,000h,000h,0C6h,000h,000h,07Ch,0C6h,0FEh,0C0h,0C6h,07Ch,000h,000h ; Hex #89 + Db 000h,000h,060h,030h,018h,000h,07Ch,0C6h,0FEh,0C0h,0C6h,07Ch,000h,000h ; Hex #8A + Db 000h,000h,000h,066h,000h,000h,038h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #8B + Db 000h,000h,018h,03Ch,066h,000h,038h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #8C + Db 000h,000h,060h,030h,018h,000h,038h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #8D + Db 000h,0C6h,000h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h,000h ; Hex #8E + Db 038h,06Ch,038h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h,000h ; Hex #8F + Db 00Ch,018h,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h ; Hex #90 + Db 000h,000h,000h,000h,000h,000h,0ECh,036h,076h,0DCh,0D8h,06Eh,000h,000h ; Hex #91 + Db 000h,000h,000h,03Eh,06Ch,0CCh,0CCh,0FEh,0CCh,0CCh,0CCh,0CEh,000h,000h ; Hex #92 + Db 000h,000h,010h,038h,06Ch,000h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #93 + Db 000h,000h,000h,0C6h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #94 + Db 000h,000h,060h,030h,018h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #95 + Db 000h,000h,030h,078h,0CCh,000h,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h ; Hex #96 + Db 000h,000h,060h,030h,018h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h ; Hex #97 + Db 000h,000h,000h,0C6h,000h,000h,0C6h,0C6h,0C6h,0C6h,07Eh,006h,00Ch,078h ; Hex #98 + Db 000h,0C6h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #99 + Db 000h,0C6h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #9A + Db 000h,000h,018h,018h,07Ch,0C6h,0C0h,0C0h,0C6h,07Ch,018h,018h,000h,000h ; Hex #9B + Db 000h,000h,038h,06Ch,064h,060h,0F0h,060h,060h,060h,0E6h,0FCh,000h,000h ; Hex #9C + Db 000h,000h,000h,066h,066h,03Ch,018h,07Eh,018h,07Eh,018h,018h,000h,000h ; Hex #9D + Db 000h,000h,0FCh,066h,066h,07Ch,062h,066h,06Fh,066h,066h,0F3h,000h,000h ; Hex #9E + Db 000h,000h,00Eh,01Bh,018h,018h,018h,07Eh,018h,018h,018h,0D8h,070h,000h ; Hex #9F + Db 000h,000h,00Ch,018h,030h,000h,078h,00Ch,07Ch,0CCh,0CCh,076h,000h,000h ; Hex #A0 + Db 000h,000h,00Ch,018h,030h,000h,038h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #A1 + Db 000h,000h,00Ch,018h,030h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #A2 + Db 000h,000h,00Ch,018h,030h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h ; Hex #A3 + Db 000h,000h,000h,076h,0DCh,000h,0DCh,066h,066h,066h,066h,066h,000h,000h ; Hex #A4 + Db 076h,0DCh,000h,0C6h,0E6h,0F6h,0FEh,0DEh,0CEh,0C6h,0C6h,0C6h,000h,000h ; Hex #A5 + Db 000h,000h,03Ch,06Ch,06Ch,03Eh,000h,07Eh,000h,000h,000h,000h,000h,000h ; Hex #A6 + Db 000h,000h,038h,06Ch,06Ch,038h,000h,07Ch,000h,000h,000h,000h,000h,000h ; Hex #A7 + Db 000h,000h,000h,030h,030h,000h,030h,030h,060h,0C6h,0C6h,07Ch,000h,000h ; Hex #A8 + Db 000h,000h,000h,000h,000h,000h,000h,0FEh,0C0h,0C0h,0C0h,000h,000h,000h ; Hex #A9 + Db 000h,000h,000h,000h,000h,000h,000h,0FEh,006h,006h,006h,000h,000h,000h ; Hex #AA + Db 000h,000h,060h,0E0h,063h,066h,06Ch,018h,030h,06Eh,0C3h,006h,00Ch,01Fh ; Hex #AB + Db 000h,000h,060h,0E0h,063h,066h,06Ch,01Ah,036h,06Eh,0DAh,03Fh,006h,006h ; Hex #AC + Db 000h,000h,000h,018h,018h,000h,018h,018h,03Ch,03Ch,03Ch,018h,000h,000h ; Hex #AD + Db 000h,000h,000h,000h,000h,036h,06Ch,0D8h,06Ch,036h,000h,000h,000h,000h ; Hex #AE + Db 000h,000h,000h,000h,000h,0D8h,06Ch,036h,06Ch,0D8h,000h,000h,000h,000h ; Hex #AF + Db 011h,044h,011h,044h,011h,044h,011h,044h,011h,044h,011h,044h,011h,044h ; Hex #B0 + Db 055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh ; Hex #B1 + Db 0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h ; Hex #B2 + Db 018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B3 + Db 018h,018h,018h,018h,018h,018h,018h,0F8h,018h,018h,018h,018h,018h,018h ; Hex #B4 + Db 018h,018h,018h,018h,018h,0F8h,018h,0F8h,018h,018h,018h,018h,018h,018h ; Hex #B5 + Db 036h,036h,036h,036h,036h,036h,036h,0F6h,036h,036h,036h,036h,036h,036h ; Hex #B6 + Db 000h,000h,000h,000h,000h,000h,000h,0FEh,036h,036h,036h,036h,036h,036h ; Hex #B7 + Db 000h,000h,000h,000h,000h,0F8h,018h,0F8h,018h,018h,018h,018h,018h,018h ; Hex #B8 + Db 036h,036h,036h,036h,036h,0F6h,006h,0F6h,036h,036h,036h,036h,036h,036h ; Hex #B9 + Db 036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #BA + Db 000h,000h,000h,000h,000h,0FEh,006h,0F6h,036h,036h,036h,036h,036h,036h ; Hex #BB + Db 036h,036h,036h,036h,036h,0F6h,006h,0FEh,000h,000h,000h,000h,000h,000h ; Hex #BC + Db 036h,036h,036h,036h,036h,036h,036h,0FEh,000h,000h,000h,000h,000h,000h ; Hex #BD + Db 018h,018h,018h,018h,018h,0F8h,018h,0F8h,000h,000h,000h,000h,000h,000h ; Hex #BE + Db 000h,000h,000h,000h,000h,000h,000h,0F8h,018h,018h,018h,018h,018h,018h ; Hex #BF + Db 018h,018h,018h,018h,018h,018h,018h,01Fh,000h,000h,000h,000h,000h,000h ; Hex #C0 + Db 018h,018h,018h,018h,018h,018h,018h,0FFh,000h,000h,000h,000h,000h,000h ; Hex #C1 + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,018h,018h,018h,018h,018h,018h ; Hex #C2 + Db 018h,018h,018h,018h,018h,018h,018h,01Fh,018h,018h,018h,018h,018h,018h ; Hex #C3 + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,000h,000h,000h,000h,000h,000h ; Hex #C4 + Db 018h,018h,018h,018h,018h,018h,018h,0FFh,018h,018h,018h,018h,018h,018h ; Hex #C5 + Db 018h,018h,018h,018h,018h,01Fh,018h,01Fh,018h,018h,018h,018h,018h,018h ; Hex #C6 + Db 036h,036h,036h,036h,036h,036h,036h,037h,036h,036h,036h,036h,036h,036h ; Hex #C7 + Db 036h,036h,036h,036h,036h,037h,030h,03Fh,000h,000h,000h,000h,000h,000h ; Hex #C8 + Db 000h,000h,000h,000h,000h,03Fh,030h,037h,036h,036h,036h,036h,036h,036h ; Hex #C9 + Db 036h,036h,036h,036h,036h,0F7h,000h,0FFh,000h,000h,000h,000h,000h,000h ; Hex #CA + Db 000h,000h,000h,000h,000h,0FFh,000h,0F7h,036h,036h,036h,036h,036h,036h ; Hex #CB + Db 036h,036h,036h,036h,036h,037h,030h,037h,036h,036h,036h,036h,036h,036h ; Hex #CC + Db 000h,000h,000h,000h,000h,0FFh,000h,0FFh,000h,000h,000h,000h,000h,000h ; Hex #CD + Db 036h,036h,036h,036h,036h,0F7h,000h,0F7h,036h,036h,036h,036h,036h,036h ; Hex #CE + Db 018h,018h,018h,018h,018h,0FFh,000h,0FFh,000h,000h,000h,000h,000h,000h ; Hex #CF + Db 036h,036h,036h,036h,036h,036h,036h,0FFh,000h,000h,000h,000h,000h,000h ; Hex #D0 + Db 000h,000h,000h,000h,000h,0FFh,000h,0FFh,018h,018h,018h,018h,018h,018h ; Hex #D1 + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,036h,036h,036h,036h,036h,036h ; Hex #D2 + Db 036h,036h,036h,036h,036h,036h,036h,03Fh,000h,000h,000h,000h,000h,000h ; Hex #D3 + Db 018h,018h,018h,018h,018h,01Fh,018h,01Fh,000h,000h,000h,000h,000h,000h ; Hex #D4 + Db 000h,000h,000h,000h,000h,01Fh,018h,01Fh,018h,018h,018h,018h,018h,018h ; Hex #D5 + Db 000h,000h,000h,000h,000h,000h,000h,03Fh,036h,036h,036h,036h,036h,036h ; Hex #D6 + Db 036h,036h,036h,036h,036h,036h,036h,0FFh,036h,036h,036h,036h,036h,036h ; Hex #D7 + Db 018h,018h,018h,018h,018h,0FFh,018h,0FFh,018h,018h,018h,018h,018h,018h ; Hex #D8 + Db 018h,018h,018h,018h,018h,018h,018h,0F8h,000h,000h,000h,000h,000h,000h ; Hex #D9 + Db 000h,000h,000h,000h,000h,000h,000h,01Fh,018h,018h,018h,018h,018h,018h ; Hex #DA + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #DB + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #DC + Db 0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h ; Hex #DD + Db 00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh ; Hex #DE + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,000h,000h,000h,000h,000h,000h,000h ; Hex #DF + Db 000h,000h,000h,000h,000h,000h,076h,0DCh,0D8h,0D8h,0DCh,076h,000h,000h ; Hex #E0 + Db 000h,000h,000h,078h,0CCh,0CCh,0CCh,0D8h,0CCh,0C6h,0C6h,0CCh,000h,000h ; Hex #E1 + Db 000h,000h,000h,0FEh,0C6h,0C6h,0C0h,0C0h,0C0h,0C0h,0C0h,0C0h,000h,000h ; Hex #E2 + Db 000h,000h,000h,000h,000h,000h,0FEh,06Ch,06Ch,06Ch,06Ch,06Ch,000h,000h ; Hex #E3 + Db 000h,000h,000h,0FEh,0C6h,060h,030h,018h,030h,060h,0C6h,0FEh,000h,000h ; Hex #E4 + Db 000h,000h,000h,000h,000h,000h,07Eh,0D8h,0D8h,0D8h,0D8h,070h,000h,000h ; Hex #E5 + Db 000h,000h,000h,000h,000h,000h,066h,066h,066h,066h,066h,07Ch,060h,0C0h ; Hex #E6 + Db 000h,000h,000h,000h,000h,076h,0DCh,018h,018h,018h,018h,018h,000h,000h ; Hex #E7 + Db 000h,000h,000h,07Eh,018h,03Ch,066h,066h,066h,03Ch,018h,07Eh,000h,000h ; Hex #E8 + Db 000h,000h,000h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,06Ch,038h,000h,000h ; Hex #E9 + Db 000h,000h,000h,038h,06Ch,0C6h,0C6h,0C6h,06Ch,06Ch,06Ch,0EEh,000h,000h ; Hex #EA + Db 000h,000h,000h,01Eh,030h,018h,00Ch,03Eh,066h,066h,066h,03Ch,000h,000h ; Hex #EB + Db 000h,000h,000h,000h,000h,000h,07Eh,0DBh,0DBh,07Eh,000h,000h,000h,000h ; Hex #EC + Db 000h,000h,000h,003h,006h,07Eh,0DBh,0DBh,0F3h,07Eh,060h,0C0h,000h,000h ; Hex #ED + Db 000h,000h,000h,01Eh,030h,060h,060h,07Eh,060h,060h,030h,01Eh,000h,000h ; Hex #EE + Db 000h,000h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,000h,000h ; Hex #EF + Db 000h,000h,000h,000h,0FEh,000h,000h,0FEh,000h,000h,0FEh,000h,000h,000h ; Hex #F0 + Db 000h,000h,000h,000h,018h,018h,07Eh,018h,018h,000h,000h,07Eh,000h,000h ; Hex #F1 + Db 000h,000h,000h,030h,018h,00Ch,006h,00Ch,018h,030h,000h,07Eh,000h,000h ; Hex #F2 + Db 000h,000h,000h,00Ch,018h,030h,060h,030h,018h,00Ch,000h,07Eh,000h,000h ; Hex #F3 + Db 000h,000h,00Eh,01Bh,01Bh,018h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #F4 + Db 018h,018h,018h,018h,018h,018h,018h,018h,0D8h,0D8h,070h,000h,000h,000h ; Hex #F5 + Db 000h,000h,000h,000h,000h,018h,000h,07Eh,000h,018h,000h,000h,000h,000h ; Hex #F6 + Db 000h,000h,000h,000h,000h,076h,0DCh,000h,076h,0DCh,000h,000h,000h,000h ; Hex #F7 + Db 000h,038h,06Ch,06Ch,038h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #F8 + Db 000h,000h,000h,000h,000h,000h,000h,018h,018h,000h,000h,000h,000h,000h ; Hex #F9 + Db 000h,000h,000h,000h,000h,000h,000h,018h,000h,000h,000h,000h,000h,000h ; Hex #FA + Db 000h,00Fh,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,0ECh,06Ch,03Ch,01Ch,000h,000h ; Hex #FB + Db 000h,06Ch,036h,036h,036h,036h,036h,000h,000h,000h,000h,000h,000h,000h ; Hex #FC + Db 000h,03Ch,066h,00Ch,018h,032h,07Eh,000h,000h,000h,000h,000h,000h,000h ; Hex #FD + Db 000h,000h,000h,000h,000h,07Eh,07Eh,07Eh,07Eh,07Eh,07Eh,000h,000h,000h ; Hex #FE + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FF diff --git a/v4.0/src/DEV/DISPLAY/EGA/437-8X16.ASM b/v4.0/src/DEV/DISPLAY/EGA/437-8X16.ASM new file mode 100644 index 0000000..636a006 --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/EGA/437-8X16.ASM @@ -0,0 +1,269 @@ +;*************************************************** +; CHARACTER FONT FILE +; Source Assembler File +; +; CODE PAGE: 437 +; FONT RESOLUTION: 8 x 16 +; +; DATE CREATED:05-28-1987 +; +; +; Output file from: MULTIFON, Version 1A +; +;*************************************************** + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #0 + Db 000h,000h,07Eh,081h,0A5h,081h,081h,0BDh,099h,081h,081h,07Eh,000h,000h,000h,000h ; Hex #1 + Db 000h,000h,07Eh,0FFh,0DBh,0FFh,0FFh,0C3h,0E7h,0FFh,0FFh,07Eh,000h,000h,000h,000h ; Hex #2 + Db 000h,000h,000h,000h,06Ch,0FEh,0FEh,0FEh,0FEh,07Ch,038h,010h,000h,000h,000h,000h ; Hex #3 + Db 000h,000h,000h,000h,010h,038h,07Ch,0FEh,07Ch,038h,010h,000h,000h,000h,000h,000h ; Hex #4 + Db 000h,000h,000h,018h,03Ch,03Ch,0E7h,0E7h,0E7h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #5 + Db 000h,000h,000h,018h,03Ch,07Eh,0FFh,0FFh,07Eh,018h,018h,03Ch,000h,000h,000h,000h ; Hex #6 + Db 000h,000h,000h,000h,000h,000h,018h,03Ch,03Ch,018h,000h,000h,000h,000h,000h,000h ; Hex #7 + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0E7h,0C3h,0C3h,0E7h,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #8 + Db 000h,000h,000h,000h,000h,03Ch,066h,042h,042h,066h,03Ch,000h,000h,000h,000h,000h ; Hex #9 + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0C3h,099h,0BDh,0BDh,099h,0C3h,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #A + Db 000h,000h,01Eh,00Eh,01Ah,032h,078h,0CCh,0CCh,0CCh,0CCh,078h,000h,000h,000h,000h ; Hex #B + Db 000h,000h,03Ch,066h,066h,066h,066h,03Ch,018h,07Eh,018h,018h,000h,000h,000h,000h ; Hex #C + Db 000h,000h,03Fh,033h,03Fh,030h,030h,030h,030h,070h,0F0h,0E0h,000h,000h,000h,000h ; Hex #D + Db 000h,000h,07Fh,063h,07Fh,063h,063h,063h,063h,067h,0E7h,0E6h,0C0h,000h,000h,000h ; Hex #E + Db 000h,000h,000h,018h,018h,0DBh,03Ch,0E7h,03Ch,0DBh,018h,018h,000h,000h,000h,000h ; Hex #F + Db 000h,080h,0C0h,0E0h,0F0h,0F8h,0FEh,0F8h,0F0h,0E0h,0C0h,080h,000h,000h,000h,000h ; Hex #10 + Db 000h,002h,006h,00Eh,01Eh,03Eh,0FEh,03Eh,01Eh,00Eh,006h,002h,000h,000h,000h,000h ; Hex #11 + Db 000h,000h,018h,03Ch,07Eh,018h,018h,018h,07Eh,03Ch,018h,000h,000h,000h,000h,000h ; Hex #12 + Db 000h,000h,066h,066h,066h,066h,066h,066h,066h,000h,066h,066h,000h,000h,000h,000h ; Hex #13 + Db 000h,000h,07Fh,0DBh,0DBh,0DBh,07Bh,01Bh,01Bh,01Bh,01Bh,01Bh,000h,000h,000h,000h ; Hex #14 + Db 000h,07Ch,0C6h,060h,038h,06Ch,0C6h,0C6h,06Ch,038h,00Ch,0C6h,07Ch,000h,000h,000h ; Hex #15 + Db 000h,000h,000h,000h,000h,000h,000h,000h,0FEh,0FEh,0FEh,0FEh,000h,000h,000h,000h ; Hex #16 + Db 000h,000h,018h,03Ch,07Eh,018h,018h,018h,07Eh,03Ch,018h,07Eh,000h,000h,000h,000h ; Hex #17 + Db 000h,000h,018h,03Ch,07Eh,018h,018h,018h,018h,018h,018h,018h,000h,000h,000h,000h ; Hex #18 + Db 000h,000h,018h,018h,018h,018h,018h,018h,018h,07Eh,03Ch,018h,000h,000h,000h,000h ; Hex #19 + Db 000h,000h,000h,000h,000h,018h,00Ch,0FEh,00Ch,018h,000h,000h,000h,000h,000h,000h ; Hex #1A + Db 000h,000h,000h,000h,000h,030h,060h,0FEh,060h,030h,000h,000h,000h,000h,000h,000h ; Hex #1B + Db 000h,000h,000h,000h,000h,000h,0C0h,0C0h,0C0h,0FEh,000h,000h,000h,000h,000h,000h ; Hex #1C + Db 000h,000h,000h,000h,000h,028h,06Ch,0FEh,06Ch,028h,000h,000h,000h,000h,000h,000h ; Hex #1D + Db 000h,000h,000h,000h,010h,038h,038h,07Ch,07Ch,0FEh,0FEh,000h,000h,000h,000h,000h ; Hex #1E + Db 000h,000h,000h,000h,0FEh,0FEh,07Ch,07Ch,038h,038h,010h,000h,000h,000h,000h,000h ; Hex #1F + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #20 + Db 000h,000h,018h,03Ch,03Ch,03Ch,018h,018h,018h,000h,018h,018h,000h,000h,000h,000h ; Hex #21 + Db 000h,066h,066h,066h,024h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #22 + Db 000h,000h,000h,06Ch,06Ch,0FEh,06Ch,06Ch,06Ch,0FEh,06Ch,06Ch,000h,000h,000h,000h ; Hex #23 + Db 018h,018h,07Ch,0C6h,0C2h,0C0h,07Ch,006h,006h,086h,0C6h,07Ch,018h,018h,000h,000h ; Hex #24 + Db 000h,000h,000h,000h,0C2h,0C6h,00Ch,018h,030h,060h,0C6h,086h,000h,000h,000h,000h ; Hex #25 + Db 000h,000h,038h,06Ch,06Ch,038h,076h,0DCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #26 + Db 000h,030h,030h,030h,060h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #27 + Db 000h,000h,00Ch,018h,030h,030h,030h,030h,030h,030h,018h,00Ch,000h,000h,000h,000h ; Hex #28 + Db 000h,000h,030h,018h,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,018h,030h,000h,000h,000h,000h ; Hex #29 + Db 000h,000h,000h,000h,000h,066h,03Ch,0FFh,03Ch,066h,000h,000h,000h,000h,000h,000h ; Hex #2A + Db 000h,000h,000h,000h,000h,018h,018h,07Eh,018h,018h,000h,000h,000h,000h,000h,000h ; Hex #2B + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,018h,018h,018h,030h,000h,000h,000h ; Hex #2C + Db 000h,000h,000h,000h,000h,000h,000h,0FEh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #2D + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,018h,018h,000h,000h,000h,000h ; Hex #2E + Db 000h,000h,000h,000h,002h,006h,00Ch,018h,030h,060h,0C0h,080h,000h,000h,000h,000h ; Hex #2F + Db 000h,000h,038h,06Ch,0C6h,0C6h,0D6h,0D6h,0C6h,0C6h,06Ch,038h,000h,000h,000h,000h ; Hex #30 + Db 000h,000h,018h,038h,078h,018h,018h,018h,018h,018h,018h,07Eh,000h,000h,000h,000h ; Hex #31 + Db 000h,000h,07Ch,0C6h,006h,00Ch,018h,030h,060h,0C0h,0C6h,0FEh,000h,000h,000h,000h ; Hex #32 + Db 000h,000h,07Ch,0C6h,006h,006h,03Ch,006h,006h,006h,0C6h,07Ch,000h,000h,000h,000h ; Hex #33 + Db 000h,000h,00Ch,01Ch,03Ch,06Ch,0CCh,0FEh,00Ch,00Ch,00Ch,01Eh,000h,000h,000h,000h ; Hex #34 + Db 000h,000h,0FEh,0C0h,0C0h,0C0h,0FCh,006h,006h,006h,0C6h,07Ch,000h,000h,000h,000h ; Hex #35 + Db 000h,000h,038h,060h,0C0h,0C0h,0FCh,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #36 + Db 000h,000h,0FEh,0C6h,006h,006h,00Ch,018h,030h,030h,030h,030h,000h,000h,000h,000h ; Hex #37 + Db 000h,000h,07Ch,0C6h,0C6h,0C6h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #38 + Db 000h,000h,07Ch,0C6h,0C6h,0C6h,07Eh,006h,006h,006h,00Ch,078h,000h,000h,000h,000h ; Hex #39 + Db 000h,000h,000h,000h,018h,018h,000h,000h,000h,018h,018h,000h,000h,000h,000h,000h ; Hex #3A + Db 000h,000h,000h,000h,018h,018h,000h,000h,000h,018h,018h,030h,000h,000h,000h,000h ; Hex #3B + Db 000h,000h,000h,006h,00Ch,018h,030h,060h,030h,018h,00Ch,006h,000h,000h,000h,000h ; Hex #3C + Db 000h,000h,000h,000h,000h,07Eh,000h,000h,07Eh,000h,000h,000h,000h,000h,000h,000h ; Hex #3D + Db 000h,000h,000h,060h,030h,018h,00Ch,006h,00Ch,018h,030h,060h,000h,000h,000h,000h ; Hex #3E + Db 000h,000h,07Ch,0C6h,0C6h,00Ch,018h,018h,018h,000h,018h,018h,000h,000h,000h,000h ; Hex #3F + Db 000h,000h,000h,07Ch,0C6h,0C6h,0DEh,0DEh,0DEh,0DCh,0C0h,07Ch,000h,000h,000h,000h ; Hex #40 + Db 000h,000h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #41 + Db 000h,000h,0FCh,066h,066h,066h,07Ch,066h,066h,066h,066h,0FCh,000h,000h,000h,000h ; Hex #42 + Db 000h,000h,03Ch,066h,0C2h,0C0h,0C0h,0C0h,0C0h,0C2h,066h,03Ch,000h,000h,000h,000h ; Hex #43 + Db 000h,000h,0F8h,06Ch,066h,066h,066h,066h,066h,066h,06Ch,0F8h,000h,000h,000h,000h ; Hex #44 + Db 000h,000h,0FEh,066h,062h,068h,078h,068h,060h,062h,066h,0FEh,000h,000h,000h,000h ; Hex #45 + Db 000h,000h,0FEh,066h,062h,068h,078h,068h,060h,060h,060h,0F0h,000h,000h,000h,000h ; Hex #46 + Db 000h,000h,03Ch,066h,0C2h,0C0h,0C0h,0DEh,0C6h,0C6h,066h,03Ah,000h,000h,000h,000h ; Hex #47 + Db 000h,000h,0C6h,0C6h,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #48 + Db 000h,000h,03Ch,018h,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #49 + Db 000h,000h,01Eh,00Ch,00Ch,00Ch,00Ch,00Ch,0CCh,0CCh,0CCh,078h,000h,000h,000h,000h ; Hex #4A + Db 000h,000h,0E6h,066h,066h,06Ch,078h,078h,06Ch,066h,066h,0E6h,000h,000h,000h,000h ; Hex #4B + Db 000h,000h,0F0h,060h,060h,060h,060h,060h,060h,062h,066h,0FEh,000h,000h,000h,000h ; Hex #4C + Db 000h,000h,0C6h,0EEh,0FEh,0FEh,0D6h,0C6h,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #4D + Db 000h,000h,0C6h,0E6h,0F6h,0FEh,0DEh,0CEh,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #4E + Db 000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #4F + Db 000h,000h,0FCh,066h,066h,066h,07Ch,060h,060h,060h,060h,0F0h,000h,000h,000h,000h ; Hex #50 + Db 000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0D6h,0DEh,07Ch,00Ch,00Eh,000h,000h ; Hex #51 + Db 000h,000h,0FCh,066h,066h,066h,07Ch,06Ch,066h,066h,066h,0E6h,000h,000h,000h,000h ; Hex #52 + Db 000h,000h,07Ch,0C6h,0C6h,060h,038h,00Ch,006h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #53 + Db 000h,000h,07Eh,07Eh,05Ah,018h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #54 + Db 000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #55 + Db 000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,06Ch,038h,010h,000h,000h,000h,000h ; Hex #56 + Db 000h,000h,0C6h,0C6h,0C6h,0C6h,0D6h,0D6h,0D6h,0FEh,0EEh,06Ch,000h,000h,000h,000h ; Hex #57 + Db 000h,000h,0C6h,0C6h,06Ch,07Ch,038h,038h,07Ch,06Ch,0C6h,0C6h,000h,000h,000h,000h ; Hex #58 + Db 000h,000h,066h,066h,066h,066h,03Ch,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #59 + Db 000h,000h,0FEh,0C6h,086h,00Ch,018h,030h,060h,0C2h,0C6h,0FEh,000h,000h,000h,000h ; Hex #5A + Db 000h,000h,03Ch,030h,030h,030h,030h,030h,030h,030h,030h,03Ch,000h,000h,000h,000h ; Hex #5B + Db 000h,000h,000h,080h,0C0h,0E0h,070h,038h,01Ch,00Eh,006h,002h,000h,000h,000h,000h ; Hex #5C + Db 000h,000h,03Ch,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,03Ch,000h,000h,000h,000h ; Hex #5D + Db 010h,038h,06Ch,0C6h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #5E + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,0FFh,000h,000h ; Hex #5F + Db 000h,030h,018h,00Ch,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #60 + Db 000h,000h,000h,000h,000h,078h,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #61 + Db 000h,000h,0E0h,060h,060h,078h,06Ch,066h,066h,066h,066h,07Ch,000h,000h,000h,000h ; Hex #62 + Db 000h,000h,000h,000h,000h,07Ch,0C6h,0C0h,0C0h,0C0h,0C6h,07Ch,000h,000h,000h,000h ; Hex #63 + Db 000h,000h,01Ch,00Ch,00Ch,03Ch,06Ch,0CCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #64 + Db 000h,000h,000h,000h,000h,07Ch,0C6h,0FEh,0C0h,0C0h,0C6h,07Ch,000h,000h,000h,000h ; Hex #65 + Db 000h,000h,01Ch,036h,032h,030h,078h,030h,030h,030h,030h,078h,000h,000h,000h,000h ; Hex #66 + Db 000h,000h,000h,000h,000h,076h,0CCh,0CCh,0CCh,0CCh,0CCh,07Ch,00Ch,0CCh,078h,000h ; Hex #67 + Db 000h,000h,0E0h,060h,060h,06Ch,076h,066h,066h,066h,066h,0E6h,000h,000h,000h,000h ; Hex #68 + Db 000h,000h,018h,018h,000h,038h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #69 + Db 000h,000h,006h,006h,000h,00Eh,006h,006h,006h,006h,006h,006h,066h,066h,03Ch,000h ; Hex #6A + Db 000h,000h,0E0h,060h,060h,066h,06Ch,078h,078h,06Ch,066h,0E6h,000h,000h,000h,000h ; Hex #6B + Db 000h,000h,038h,018h,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #6C + Db 000h,000h,000h,000h,000h,0ECh,0FEh,0D6h,0D6h,0D6h,0D6h,0C6h,000h,000h,000h,000h ; Hex #6D + Db 000h,000h,000h,000h,000h,0DCh,066h,066h,066h,066h,066h,066h,000h,000h,000h,000h ; Hex #6E + Db 000h,000h,000h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #6F + Db 000h,000h,000h,000h,000h,0DCh,066h,066h,066h,066h,066h,07Ch,060h,060h,0F0h,000h ; Hex #70 + Db 000h,000h,000h,000h,000h,076h,0CCh,0CCh,0CCh,0CCh,0CCh,07Ch,00Ch,00Ch,01Eh,000h ; Hex #71 + Db 000h,000h,000h,000h,000h,0DCh,076h,066h,060h,060h,060h,0F0h,000h,000h,000h,000h ; Hex #72 + Db 000h,000h,000h,000h,000h,07Ch,0C6h,060h,038h,00Ch,0C6h,07Ch,000h,000h,000h,000h ; Hex #73 + Db 000h,000h,010h,030h,030h,0FCh,030h,030h,030h,030h,036h,01Ch,000h,000h,000h,000h ; Hex #74 + Db 000h,000h,000h,000h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #75 + Db 000h,000h,000h,000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,06Ch,038h,000h,000h,000h,000h ; Hex #76 + Db 000h,000h,000h,000h,000h,0C6h,0C6h,0D6h,0D6h,0D6h,0FEh,06Ch,000h,000h,000h,000h ; Hex #77 + Db 000h,000h,000h,000h,000h,0C6h,06Ch,038h,038h,038h,06Ch,0C6h,000h,000h,000h,000h ; Hex #78 + Db 000h,000h,000h,000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Eh,006h,00Ch,0F8h,000h ; Hex #79 + Db 000h,000h,000h,000h,000h,0FEh,0CCh,018h,030h,060h,0C6h,0FEh,000h,000h,000h,000h ; Hex #7A + Db 000h,000h,00Eh,018h,018h,018h,070h,018h,018h,018h,018h,00Eh,000h,000h,000h,000h ; Hex #7B + Db 000h,000h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,000h,000h,000h,000h ; Hex #7C + Db 000h,000h,070h,018h,018h,018h,00Eh,018h,018h,018h,018h,070h,000h,000h,000h,000h ; Hex #7D + Db 000h,076h,0DCh,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #7E + Db 000h,000h,000h,000h,010h,038h,06Ch,0C6h,0C6h,0C6h,0FEh,000h,000h,000h,000h,000h ; Hex #7F + Db 000h,000h,03Ch,066h,0C2h,0C0h,0C0h,0C0h,0C0h,0C2h,066h,03Ch,018h,070h,000h,000h ; Hex #80 + Db 000h,000h,0CCh,000h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #81 + Db 000h,00Ch,018h,030h,000h,07Ch,0C6h,0FEh,0C0h,0C0h,0C6h,07Ch,000h,000h,000h,000h ; Hex #82 + Db 000h,010h,038h,06Ch,000h,078h,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #83 + Db 000h,000h,0CCh,000h,000h,078h,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #84 + Db 000h,060h,030h,018h,000h,078h,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #85 + Db 000h,038h,06Ch,038h,000h,078h,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #86 + Db 000h,000h,000h,000h,000h,07Ch,0C6h,0C0h,0C0h,0C0h,0C6h,07Ch,018h,070h,000h,000h ; Hex #87 + Db 000h,010h,038h,06Ch,000h,07Ch,0C6h,0FEh,0C0h,0C0h,0C6h,07Ch,000h,000h,000h,000h ; Hex #88 + Db 000h,000h,0C6h,000h,000h,07Ch,0C6h,0FEh,0C0h,0C0h,0C6h,07Ch,000h,000h,000h,000h ; Hex #89 + Db 000h,060h,030h,018h,000h,07Ch,0C6h,0FEh,0C0h,0C0h,0C6h,07Ch,000h,000h,000h,000h ; Hex #8A + Db 000h,000h,066h,000h,000h,038h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #8B + Db 000h,018h,03Ch,066h,000h,038h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #8C + Db 000h,060h,030h,018h,000h,038h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #8D + Db 000h,0C6h,000h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #8E + Db 038h,06Ch,038h,010h,038h,06Ch,0C6h,0FEh,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #8F + Db 00Ch,018h,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h,000h,000h ; Hex #90 + Db 000h,000h,000h,000h,000h,0ECh,036h,036h,07Eh,0D8h,0D8h,06Eh,000h,000h,000h,000h ; Hex #91 + Db 000h,000h,03Eh,06Ch,0CCh,0CCh,0FEh,0CCh,0CCh,0CCh,0CCh,0CEh,000h,000h,000h,000h ; Hex #92 + Db 000h,010h,038h,06Ch,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #93 + Db 000h,000h,0C6h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #94 + Db 000h,060h,030h,018h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #95 + Db 000h,030h,078h,0CCh,000h,0CCh,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #96 + Db 000h,060h,030h,018h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #97 + Db 000h,000h,0C6h,000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Eh,006h,00Ch,078h,000h ; Hex #98 + Db 000h,0C6h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #99 + Db 000h,0C6h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #9A + Db 000h,018h,018h,07Ch,0C6h,0C0h,0C0h,0C0h,0C6h,07Ch,018h,018h,000h,000h,000h,000h ; Hex #9B + Db 000h,038h,06Ch,064h,060h,0F0h,060h,060h,060h,060h,0E6h,0FCh,000h,000h,000h,000h ; Hex #9C + Db 000h,000h,066h,066h,03Ch,018h,07Eh,018h,07Eh,018h,018h,018h,000h,000h,000h,000h ; Hex #9D + Db 000h,0F8h,0CCh,0CCh,0F8h,0C4h,0CCh,0DEh,0CCh,0CCh,0CCh,0C6h,000h,000h,000h,000h ; Hex #9E + Db 000h,00Eh,01Bh,018h,018h,018h,07Eh,018h,018h,018h,0D8h,070h,000h,000h,000h,000h ; Hex #9F + Db 000h,018h,030h,060h,000h,078h,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #A0 + Db 000h,00Ch,018h,030h,000h,038h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #A1 + Db 000h,018h,030h,060h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #A2 + Db 000h,018h,030h,060h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #A3 + Db 000h,000h,076h,0DCh,000h,0DCh,066h,066h,066h,066h,066h,066h,000h,000h,000h,000h ; Hex #A4 + Db 076h,0DCh,000h,0C6h,0E6h,0F6h,0FEh,0DEh,0CEh,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #A5 + Db 000h,000h,03Ch,06Ch,06Ch,03Eh,000h,07Eh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #A6 + Db 000h,000h,038h,06Ch,06Ch,038h,000h,07Ch,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #A7 + Db 000h,000h,030h,030h,000h,030h,030h,060h,0C0h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #A8 + Db 000h,000h,000h,000h,000h,000h,0FEh,0C0h,0C0h,0C0h,0C0h,000h,000h,000h,000h,000h ; Hex #A9 + Db 000h,000h,000h,000h,000h,000h,0FEh,006h,006h,006h,006h,000h,000h,000h,000h,000h ; Hex #AA + Db 000h,060h,0E0h,062h,066h,06Ch,018h,030h,060h,0DCh,086h,00Ch,018h,03Eh,000h,000h ; Hex #AB + Db 000h,060h,0E0h,062h,066h,06Ch,018h,030h,066h,0CEh,09Ah,03Fh,006h,006h,000h,000h ; Hex #AC + Db 000h,000h,018h,018h,000h,018h,018h,018h,03Ch,03Ch,03Ch,018h,000h,000h,000h,000h ; Hex #AD + Db 000h,000h,000h,000h,000h,036h,06Ch,0D8h,06Ch,036h,000h,000h,000h,000h,000h,000h ; Hex #AE + Db 000h,000h,000h,000h,000h,0D8h,06Ch,036h,06Ch,0D8h,000h,000h,000h,000h,000h,000h ; Hex #AF + Db 011h,044h,011h,044h,011h,044h,011h,044h,011h,044h,011h,044h,011h,044h,011h,044h ; Hex #B0 + Db 055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh ; Hex #B1 + Db 0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h ; Hex #B2 + Db 018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B3 + Db 018h,018h,018h,018h,018h,018h,018h,0F8h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B4 + Db 018h,018h,018h,018h,018h,0F8h,018h,0F8h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B5 + Db 036h,036h,036h,036h,036h,036h,036h,0F6h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #B6 + Db 000h,000h,000h,000h,000h,000h,000h,0FEh,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #B7 + Db 000h,000h,000h,000h,000h,0F8h,018h,0F8h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B8 + Db 036h,036h,036h,036h,036h,0F6h,006h,0F6h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #B9 + Db 036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #BA + Db 000h,000h,000h,000h,000h,0FEh,006h,0F6h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #BB + Db 036h,036h,036h,036h,036h,0F6h,006h,0FEh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #BC + Db 036h,036h,036h,036h,036h,036h,036h,0FEh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #BD + Db 018h,018h,018h,018h,018h,0F8h,018h,0F8h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #BE + Db 000h,000h,000h,000h,000h,000h,000h,0F8h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #BF + Db 018h,018h,018h,018h,018h,018h,018h,01Fh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #C0 + Db 018h,018h,018h,018h,018h,018h,018h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #C1 + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #C2 + Db 018h,018h,018h,018h,018h,018h,018h,01Fh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #C3 + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #C4 + Db 018h,018h,018h,018h,018h,018h,018h,0FFh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #C5 + Db 018h,018h,018h,018h,018h,01Fh,018h,01Fh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #C6 + Db 036h,036h,036h,036h,036h,036h,036h,037h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #C7 + Db 036h,036h,036h,036h,036h,037h,030h,03Fh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #C8 + Db 000h,000h,000h,000h,000h,03Fh,030h,037h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #C9 + Db 036h,036h,036h,036h,036h,0F7h,000h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #CA + Db 000h,000h,000h,000h,000h,0FFh,000h,0F7h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #CB + Db 036h,036h,036h,036h,036h,037h,030h,037h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #CC + Db 000h,000h,000h,000h,000h,0FFh,000h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #CD + Db 036h,036h,036h,036h,036h,0F7h,000h,0F7h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #CE + Db 018h,018h,018h,018h,018h,0FFh,000h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #CF + Db 036h,036h,036h,036h,036h,036h,036h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #D0 + Db 000h,000h,000h,000h,000h,0FFh,000h,0FFh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #D1 + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #D2 + Db 036h,036h,036h,036h,036h,036h,036h,03Fh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #D3 + Db 018h,018h,018h,018h,018h,01Fh,018h,01Fh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #D4 + Db 000h,000h,000h,000h,000h,01Fh,018h,01Fh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #D5 + Db 000h,000h,000h,000h,000h,000h,000h,03Fh,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #D6 + Db 036h,036h,036h,036h,036h,036h,036h,0FFh,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #D7 + Db 018h,018h,018h,018h,018h,0FFh,018h,0FFh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #D8 + Db 018h,018h,018h,018h,018h,018h,018h,0F8h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #D9 + Db 000h,000h,000h,000h,000h,000h,000h,01Fh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #DA + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #DB + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #DC + Db 0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h ; Hex #DD + Db 00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh ; Hex #DE + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #DF + Db 000h,000h,000h,000h,000h,076h,0DCh,0D8h,0D8h,0D8h,0DCh,076h,000h,000h,000h,000h ; Hex #E0 + Db 000h,000h,078h,0CCh,0CCh,0CCh,0D8h,0CCh,0C6h,0C6h,0C6h,0CCh,000h,000h,000h,000h ; Hex #E1 + Db 000h,000h,0FEh,0C6h,0C6h,0C0h,0C0h,0C0h,0C0h,0C0h,0C0h,0C0h,000h,000h,000h,000h ; Hex #E2 + Db 000h,000h,000h,000h,000h,0FEh,06Ch,06Ch,06Ch,06Ch,06Ch,06Ch,000h,000h,000h,000h ; Hex #E3 + Db 000h,000h,0FEh,0C6h,060h,030h,018h,018h,030h,060h,0C6h,0FEh,000h,000h,000h,000h ; Hex #E4 + Db 000h,000h,000h,000h,000h,07Eh,0D8h,0D8h,0D8h,0D8h,0D8h,070h,000h,000h,000h,000h ; Hex #E5 + Db 000h,000h,000h,000h,000h,066h,066h,066h,066h,066h,066h,07Ch,060h,060h,0C0h,000h ; Hex #E6 + Db 000h,000h,000h,000h,076h,0DCh,018h,018h,018h,018h,018h,018h,000h,000h,000h,000h ; Hex #E7 + Db 000h,000h,07Eh,018h,03Ch,066h,066h,066h,066h,03Ch,018h,07Eh,000h,000h,000h,000h ; Hex #E8 + Db 000h,000h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,06Ch,038h,000h,000h,000h,000h ; Hex #E9 + Db 000h,000h,038h,06Ch,0C6h,0C6h,0C6h,06Ch,06Ch,06Ch,06Ch,0EEh,000h,000h,000h,000h ; Hex #EA + Db 000h,000h,01Eh,030h,018h,00Ch,03Eh,066h,066h,066h,066h,03Ch,000h,000h,000h,000h ; Hex #EB + Db 000h,000h,000h,000h,000h,07Eh,0DBh,0DBh,0DBh,07Eh,000h,000h,000h,000h,000h,000h ; Hex #EC + Db 000h,000h,000h,003h,006h,07Eh,0DBh,0DBh,0F3h,07Eh,060h,0C0h,000h,000h,000h,000h ; Hex #ED + Db 000h,000h,01Ch,030h,060h,060h,07Ch,060h,060h,060h,030h,01Ch,000h,000h,000h,000h ; Hex #EE + Db 000h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #EF + Db 000h,000h,000h,000h,0FEh,000h,000h,0FEh,000h,000h,0FEh,000h,000h,000h,000h,000h ; Hex #F0 + Db 000h,000h,000h,000h,018h,018h,07Eh,018h,018h,000h,000h,07Eh,000h,000h,000h,000h ; Hex #F1 + Db 000h,000h,000h,030h,018h,00Ch,006h,00Ch,018h,030h,000h,07Eh,000h,000h,000h,000h ; Hex #F2 + Db 000h,000h,000h,00Ch,018h,030h,060h,030h,018h,00Ch,000h,07Eh,000h,000h,000h,000h ; Hex #F3 + Db 000h,000h,00Eh,01Bh,01Bh,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #F4 + Db 018h,018h,018h,018h,018h,018h,018h,018h,018h,0D8h,0D8h,0D8h,070h,000h,000h,000h ; Hex #F5 + Db 000h,000h,000h,000h,000h,018h,000h,07Eh,000h,018h,000h,000h,000h,000h,000h,000h ; Hex #F6 + Db 000h,000h,000h,000h,000h,076h,0DCh,000h,076h,0DCh,000h,000h,000h,000h,000h,000h ; Hex #F7 + Db 000h,038h,06Ch,06Ch,038h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #F8 + Db 000h,000h,000h,000h,000h,000h,000h,018h,018h,000h,000h,000h,000h,000h,000h,000h ; Hex #F9 + Db 000h,000h,000h,000h,000h,000h,000h,018h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FA + Db 000h,00Fh,00Ch,00Ch,00Ch,00Ch,00Ch,0ECh,06Ch,06Ch,03Ch,01Ch,000h,000h,000h,000h ; Hex #FB + Db 000h,06Ch,036h,036h,036h,036h,036h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FC + Db 000h,03Ch,066h,00Ch,018h,032h,07Eh,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FD + Db 000h,000h,000h,000h,07Eh,07Eh,07Eh,07Eh,07Eh,07Eh,07Eh,000h,000h,000h,000h,000h ; Hex #FE + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FF diff --git a/v4.0/src/DEV/DISPLAY/EGA/437-8X8.ASM b/v4.0/src/DEV/DISPLAY/EGA/437-8X8.ASM new file mode 100644 index 0000000..08d3f7e --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/EGA/437-8X8.ASM @@ -0,0 +1,270 @@ +;*************************************************** +; CHARACTER FONT FILE +; Source Assembler File +; +; CODE PAGE: 437 +; FONT RESOLUTION: 8 x 8 +; +; DATE CREATED:05-28-1987 +; +; +; Output file from: MULTIFON, Version 1A +; +;*************************************************** + Db 000h,000h,000h,000h,000h,000h,000h,000h ; Hex #0 + Db 07Eh,081h,0A5h,081h,0BDh,099h,081h,07Eh ; Hex #1 + Db 07Eh,0FFh,0DBh,0FFh,0C3h,0E7h,0FFh,07Eh ; Hex #2 + Db 06Ch,0FEh,0FEh,0FEh,07Ch,038h,010h,000h ; Hex #3 + Db 010h,038h,07Ch,0FEh,07Ch,038h,010h,000h ; Hex #4 + Db 038h,07Ch,038h,0FEh,0FEh,0D6h,010h,038h ; Hex #5 + Db 010h,038h,07Ch,0FEh,0FEh,07Ch,010h,038h ; Hex #6 + Db 000h,000h,018h,03Ch,03Ch,018h,000h,000h ; Hex #7 + Db 0FFh,0FFh,0E7h,0C3h,0C3h,0E7h,0FFh,0FFh ; Hex #8 + Db 000h,03Ch,066h,042h,042h,066h,03Ch,000h ; Hex #9 + Db 0FFh,0C3h,099h,0BDh,0BDh,099h,0C3h,0FFh ; Hex #A + Db 00Fh,007h,00Fh,07Dh,0CCh,0CCh,0CCh,078h ; Hex #B + Db 03Ch,066h,066h,066h,03Ch,018h,07Eh,018h ; Hex #C + Db 03Fh,033h,03Fh,030h,030h,070h,0F0h,0E0h ; Hex #D + Db 07Fh,063h,07Fh,063h,063h,067h,0E6h,0C0h ; Hex #E + Db 018h,0DBh,03Ch,0E7h,0E7h,03Ch,0DBh,018h ; Hex #F + Db 080h,0E0h,0F8h,0FEh,0F8h,0E0h,080h,000h ; Hex #10 + Db 002h,00Eh,03Eh,0FEh,03Eh,00Eh,002h,000h ; Hex #11 + Db 018h,03Ch,07Eh,018h,018h,07Eh,03Ch,018h ; Hex #12 + Db 066h,066h,066h,066h,066h,000h,066h,000h ; Hex #13 + Db 07Fh,0DBh,0DBh,07Bh,01Bh,01Bh,01Bh,000h ; Hex #14 + Db 03Eh,061h,03Ch,066h,066h,03Ch,086h,07Ch ; Hex #15 + Db 000h,000h,000h,000h,07Eh,07Eh,07Eh,000h ; Hex #16 + Db 018h,03Ch,07Eh,018h,07Eh,03Ch,018h,0FFh ; Hex #17 + Db 018h,03Ch,07Eh,018h,018h,018h,018h,000h ; Hex #18 + Db 018h,018h,018h,018h,07Eh,03Ch,018h,000h ; Hex #19 + Db 000h,018h,00Ch,0FEh,00Ch,018h,000h,000h ; Hex #1A + Db 000h,030h,060h,0FEh,060h,030h,000h,000h ; Hex #1B + Db 000h,000h,0C0h,0C0h,0C0h,0FEh,000h,000h ; Hex #1C + Db 000h,024h,066h,0FFh,066h,024h,000h,000h ; Hex #1D + Db 000h,018h,03Ch,07Eh,0FFh,0FFh,000h,000h ; Hex #1E + Db 000h,0FFh,0FFh,07Eh,03Ch,018h,000h,000h ; Hex #1F + Db 000h,000h,000h,000h,000h,000h,000h,000h ; Hex #20 + Db 018h,03Ch,03Ch,018h,018h,000h,018h,000h ; Hex #21 + Db 066h,066h,024h,000h,000h,000h,000h,000h ; Hex #22 + Db 06Ch,06Ch,0FEh,06Ch,0FEh,06Ch,06Ch,000h ; Hex #23 + Db 018h,03Eh,060h,03Ch,006h,07Ch,018h,000h ; Hex #24 + Db 000h,0C6h,0CCh,018h,030h,066h,0C6h,000h ; Hex #25 + Db 038h,06Ch,038h,076h,0DCh,0CCh,076h,000h ; Hex #26 + Db 018h,018h,030h,000h,000h,000h,000h,000h ; Hex #27 + Db 00Ch,018h,030h,030h,030h,018h,00Ch,000h ; Hex #28 + Db 030h,018h,00Ch,00Ch,00Ch,018h,030h,000h ; Hex #29 + Db 000h,066h,03Ch,0FFh,03Ch,066h,000h,000h ; Hex #2A + Db 000h,018h,018h,07Eh,018h,018h,000h,000h ; Hex #2B + Db 000h,000h,000h,000h,000h,018h,018h,030h ; Hex #2C + Db 000h,000h,000h,07Eh,000h,000h,000h,000h ; Hex #2D + Db 000h,000h,000h,000h,000h,018h,018h,000h ; Hex #2E + Db 006h,00Ch,018h,030h,060h,0C0h,080h,000h ; Hex #2F + Db 038h,06Ch,0C6h,0D6h,0C6h,06Ch,038h,000h ; Hex #30 + Db 018h,038h,018h,018h,018h,018h,07Eh,000h ; Hex #31 + Db 07Ch,0C6h,006h,01Ch,030h,066h,0FEh,000h ; Hex #32 + Db 07Ch,0C6h,006h,03Ch,006h,0C6h,07Ch,000h ; Hex #33 + Db 01Ch,03Ch,06Ch,0CCh,0FEh,00Ch,01Eh,000h ; Hex #34 + Db 0FEh,0C0h,0C0h,0FCh,006h,0C6h,07Ch,000h ; Hex #35 + Db 038h,060h,0C0h,0FCh,0C6h,0C6h,07Ch,000h ; Hex #36 + Db 0FEh,0C6h,00Ch,018h,030h,030h,030h,000h ; Hex #37 + Db 07Ch,0C6h,0C6h,07Ch,0C6h,0C6h,07Ch,000h ; Hex #38 + Db 07Ch,0C6h,0C6h,07Eh,006h,00Ch,078h,000h ; Hex #39 + Db 000h,018h,018h,000h,000h,018h,018h,000h ; Hex #3A + Db 000h,018h,018h,000h,000h,018h,018h,030h ; Hex #3B + Db 006h,00Ch,018h,030h,018h,00Ch,006h,000h ; Hex #3C + Db 000h,000h,07Eh,000h,000h,07Eh,000h,000h ; Hex #3D + Db 060h,030h,018h,00Ch,018h,030h,060h,000h ; Hex #3E + Db 07Ch,0C6h,00Ch,018h,018h,000h,018h,000h ; Hex #3F + Db 07Ch,0C6h,0DEh,0DEh,0DEh,0C0h,078h,000h ; Hex #40 + Db 038h,06Ch,0C6h,0FEh,0C6h,0C6h,0C6h,000h ; Hex #41 + Db 0FCh,066h,066h,07Ch,066h,066h,0FCh,000h ; Hex #42 + Db 03Ch,066h,0C0h,0C0h,0C0h,066h,03Ch,000h ; Hex #43 + Db 0F8h,06Ch,066h,066h,066h,06Ch,0F8h,000h ; Hex #44 + Db 0FEh,062h,068h,078h,068h,062h,0FEh,000h ; Hex #45 + Db 0FEh,062h,068h,078h,068h,060h,0F0h,000h ; Hex #46 + Db 03Ch,066h,0C0h,0C0h,0CEh,066h,03Ah,000h ; Hex #47 + Db 0C6h,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h ; Hex #48 + Db 03Ch,018h,018h,018h,018h,018h,03Ch,000h ; Hex #49 + Db 01Eh,00Ch,00Ch,00Ch,0CCh,0CCh,078h,000h ; Hex #4A + Db 0E6h,066h,06Ch,078h,06Ch,066h,0E6h,000h ; Hex #4B + Db 0F0h,060h,060h,060h,062h,066h,0FEh,000h ; Hex #4C + Db 0C6h,0EEh,0FEh,0FEh,0D6h,0C6h,0C6h,000h ; Hex #4D + Db 0C6h,0E6h,0F6h,0DEh,0CEh,0C6h,0C6h,000h ; Hex #4E + Db 07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h ; Hex #4F + Db 0FCh,066h,066h,07Ch,060h,060h,0F0h,000h ; Hex #50 + Db 07Ch,0C6h,0C6h,0C6h,0C6h,0CEh,07Ch,00Eh ; Hex #51 + Db 0FCh,066h,066h,07Ch,06Ch,066h,0E6h,000h ; Hex #52 + Db 03Ch,066h,030h,018h,00Ch,066h,03Ch,000h ; Hex #53 + Db 07Eh,07Eh,05Ah,018h,018h,018h,03Ch,000h ; Hex #54 + Db 0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h ; Hex #55 + Db 0C6h,0C6h,0C6h,0C6h,0C6h,06Ch,038h,000h ; Hex #56 + Db 0C6h,0C6h,0C6h,0D6h,0D6h,0FEh,06Ch,000h ; Hex #57 + Db 0C6h,0C6h,06Ch,038h,06Ch,0C6h,0C6h,000h ; Hex #58 + Db 066h,066h,066h,03Ch,018h,018h,03Ch,000h ; Hex #59 + Db 0FEh,0C6h,08Ch,018h,032h,066h,0FEh,000h ; Hex #5A + Db 03Ch,030h,030h,030h,030h,030h,03Ch,000h ; Hex #5B + Db 0C0h,060h,030h,018h,00Ch,006h,002h,000h ; Hex #5C + Db 03Ch,00Ch,00Ch,00Ch,00Ch,00Ch,03Ch,000h ; Hex #5D + Db 010h,038h,06Ch,0C6h,000h,000h,000h,000h ; Hex #5E + Db 000h,000h,000h,000h,000h,000h,000h,0FFh ; Hex #5F + Db 030h,018h,00Ch,000h,000h,000h,000h,000h ; Hex #60 + Db 000h,000h,078h,00Ch,07Ch,0CCh,076h,000h ; Hex #61 + Db 0E0h,060h,07Ch,066h,066h,066h,0DCh,000h ; Hex #62 + Db 000h,000h,07Ch,0C6h,0C0h,0C6h,07Ch,000h ; Hex #63 + Db 01Ch,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h ; Hex #64 + Db 000h,000h,07Ch,0C6h,0FEh,0C0h,07Ch,000h ; Hex #65 + Db 03Ch,066h,060h,0F8h,060h,060h,0F0h,000h ; Hex #66 + Db 000h,000h,076h,0CCh,0CCh,07Ch,00Ch,0F8h ; Hex #67 + Db 0E0h,060h,06Ch,076h,066h,066h,0E6h,000h ; Hex #68 + Db 018h,000h,038h,018h,018h,018h,03Ch,000h ; Hex #69 + Db 006h,000h,006h,006h,006h,066h,066h,03Ch ; Hex #6A + Db 0E0h,060h,066h,06Ch,078h,06Ch,0E6h,000h ; Hex #6B + Db 038h,018h,018h,018h,018h,018h,03Ch,000h ; Hex #6C + Db 000h,000h,0ECh,0FEh,0D6h,0D6h,0D6h,000h ; Hex #6D + Db 000h,000h,0DCh,066h,066h,066h,066h,000h ; Hex #6E + Db 000h,000h,07Ch,0C6h,0C6h,0C6h,07Ch,000h ; Hex #6F + Db 000h,000h,0DCh,066h,066h,07Ch,060h,0F0h ; Hex #70 + Db 000h,000h,076h,0CCh,0CCh,07Ch,00Ch,01Eh ; Hex #71 + Db 000h,000h,0DCh,076h,060h,060h,0F0h,000h ; Hex #72 + Db 000h,000h,07Eh,0C0h,07Ch,006h,0FCh,000h ; Hex #73 + Db 030h,030h,0FCh,030h,030h,036h,01Ch,000h ; Hex #74 + Db 000h,000h,0CCh,0CCh,0CCh,0CCh,076h,000h ; Hex #75 + Db 000h,000h,0C6h,0C6h,0C6h,06Ch,038h,000h ; Hex #76 + Db 000h,000h,0C6h,0D6h,0D6h,0FEh,06Ch,000h ; Hex #77 + Db 000h,000h,0C6h,06Ch,038h,06Ch,0C6h,000h ; Hex #78 + Db 000h,000h,0C6h,0C6h,0C6h,07Eh,006h,0FCh ; Hex #79 + Db 000h,000h,07Eh,04Ch,018h,032h,07Eh,000h ; Hex #7A + Db 00Eh,018h,018h,070h,018h,018h,00Eh,000h ; Hex #7B + Db 018h,018h,018h,018h,018h,018h,018h,000h ; Hex #7C + Db 070h,018h,018h,00Eh,018h,018h,070h,000h ; Hex #7D + Db 076h,0DCh,000h,000h,000h,000h,000h,000h ; Hex #7E + Db 000h,010h,038h,06Ch,0C6h,0C6h,0FEh,000h ; Hex #7F + Db 07Ch,0C6h,0C0h,0C0h,0C6h,07Ch,00Ch,078h ; Hex #80 + Db 0CCh,000h,0CCh,0CCh,0CCh,0CCh,076h,000h ; Hex #81 + Db 00Ch,018h,07Ch,0C6h,0FEh,0C0h,07Ch,000h ; Hex #82 + Db 07Ch,082h,078h,00Ch,07Ch,0CCh,076h,000h ; Hex #83 + Db 0C6h,000h,078h,00Ch,07Ch,0CCh,076h,000h ; Hex #84 + Db 030h,018h,078h,00Ch,07Ch,0CCh,076h,000h ; Hex #85 + Db 030h,030h,078h,00Ch,07Ch,0CCh,076h,000h ; Hex #86 + Db 000h,000h,07Eh,0C0h,0C0h,07Eh,00Ch,038h ; Hex #87 + Db 07Ch,082h,07Ch,0C6h,0FEh,0C0h,07Ch,000h ; Hex #88 + Db 0C6h,000h,07Ch,0C6h,0FEh,0C0h,07Ch,000h ; Hex #89 + Db 030h,018h,07Ch,0C6h,0FEh,0C0h,07Ch,000h ; Hex #8A + Db 066h,000h,038h,018h,018h,018h,03Ch,000h ; Hex #8B + Db 07Ch,082h,038h,018h,018h,018h,03Ch,000h ; Hex #8C + Db 030h,018h,000h,038h,018h,018h,03Ch,000h ; Hex #8D + Db 0C6h,038h,06Ch,0C6h,0FEh,0C6h,0C6h,000h ; Hex #8E + Db 038h,06Ch,07Ch,0C6h,0FEh,0C6h,0C6h,000h ; Hex #8F + Db 018h,030h,0FEh,0C0h,0F8h,0C0h,0FEh,000h ; Hex #90 + Db 000h,000h,07Eh,018h,07Eh,0D8h,07Eh,000h ; Hex #91 + Db 03Eh,06Ch,0CCh,0FEh,0CCh,0CCh,0CEh,000h ; Hex #92 + Db 07Ch,082h,07Ch,0C6h,0C6h,0C6h,07Ch,000h ; Hex #93 + Db 0C6h,000h,07Ch,0C6h,0C6h,0C6h,07Ch,000h ; Hex #94 + Db 030h,018h,07Ch,0C6h,0C6h,0C6h,07Ch,000h ; Hex #95 + Db 078h,084h,000h,0CCh,0CCh,0CCh,076h,000h ; Hex #96 + Db 060h,030h,0CCh,0CCh,0CCh,0CCh,076h,000h ; Hex #97 + Db 0C6h,000h,0C6h,0C6h,0C6h,07Eh,006h,0FCh ; Hex #98 + Db 0C6h,038h,06Ch,0C6h,0C6h,06Ch,038h,000h ; Hex #99 + Db 0C6h,000h,0C6h,0C6h,0C6h,0C6h,07Ch,000h ; Hex #9A + Db 018h,018h,07Eh,0C0h,0C0h,07Eh,018h,018h ; Hex #9B + Db 038h,06Ch,064h,0F0h,060h,066h,0FCh,000h ; Hex #9C + Db 066h,066h,03Ch,07Eh,018h,07Eh,018h,018h ; Hex #9D + Db 0F8h,0CCh,0CCh,0FAh,0C6h,0CFh,0C6h,0C7h ; Hex #9E + Db 00Eh,01Bh,018h,03Ch,018h,0D8h,070h,000h ; Hex #9F + Db 018h,030h,078h,00Ch,07Ch,0CCh,076h,000h ; Hex #A0 + Db 00Ch,018h,000h,038h,018h,018h,03Ch,000h ; Hex #A1 + Db 00Ch,018h,07Ch,0C6h,0C6h,0C6h,07Ch,000h ; Hex #A2 + Db 018h,030h,0CCh,0CCh,0CCh,0CCh,076h,000h ; Hex #A3 + Db 076h,0DCh,000h,0DCh,066h,066h,066h,000h ; Hex #A4 + Db 076h,0DCh,000h,0E6h,0F6h,0DEh,0CEh,000h ; Hex #A5 + Db 03Ch,06Ch,06Ch,03Eh,000h,07Eh,000h,000h ; Hex #A6 + Db 038h,06Ch,06Ch,038h,000h,07Ch,000h,000h ; Hex #A7 + Db 018h,000h,018h,018h,030h,063h,03Eh,000h ; Hex #A8 + Db 000h,000h,000h,0FEh,0C0h,0C0h,000h,000h ; Hex #A9 + Db 000h,000h,000h,0FEh,006h,006h,000h,000h ; Hex #AA + Db 063h,0E6h,06Ch,07Eh,033h,066h,0CCh,00Fh ; Hex #AB + Db 063h,0E6h,06Ch,07Ah,036h,06Ah,0DFh,006h ; Hex #AC + Db 018h,000h,018h,018h,03Ch,03Ch,018h,000h ; Hex #AD + Db 000h,033h,066h,0CCh,066h,033h,000h,000h ; Hex #AE + Db 000h,0CCh,066h,033h,066h,0CCh,000h,000h ; Hex #AF + Db 022h,088h,022h,088h,022h,088h,022h,088h ; Hex #B0 + Db 055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh ; Hex #B1 + Db 077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh ; Hex #B2 + Db 018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B3 + Db 018h,018h,018h,018h,0F8h,018h,018h,018h ; Hex #B4 + Db 018h,018h,0F8h,018h,0F8h,018h,018h,018h ; Hex #B5 + Db 036h,036h,036h,036h,0F6h,036h,036h,036h ; Hex #B6 + Db 000h,000h,000h,000h,0FEh,036h,036h,036h ; Hex #B7 + Db 000h,000h,0F8h,018h,0F8h,018h,018h,018h ; Hex #B8 + Db 036h,036h,0F6h,006h,0F6h,036h,036h,036h ; Hex #B9 + Db 036h,036h,036h,036h,036h,036h,036h,036h ; Hex #BA + Db 000h,000h,0FEh,006h,0F6h,036h,036h,036h ; Hex #BB + Db 036h,036h,0F6h,006h,0FEh,000h,000h,000h ; Hex #BC + Db 036h,036h,036h,036h,0FEh,000h,000h,000h ; Hex #BD + Db 018h,018h,0F8h,018h,0F8h,000h,000h,000h ; Hex #BE + Db 000h,000h,000h,000h,0F8h,018h,018h,018h ; Hex #BF + Db 018h,018h,018h,018h,01Fh,000h,000h,000h ; Hex #C0 + Db 018h,018h,018h,018h,0FFh,000h,000h,000h ; Hex #C1 + Db 000h,000h,000h,000h,0FFh,018h,018h,018h ; Hex #C2 + Db 018h,018h,018h,018h,01Fh,018h,018h,018h ; Hex #C3 + Db 000h,000h,000h,000h,0FFh,000h,000h,000h ; Hex #C4 + Db 018h,018h,018h,018h,0FFh,018h,018h,018h ; Hex #C5 + Db 018h,018h,01Fh,018h,01Fh,018h,018h,018h ; Hex #C6 + Db 036h,036h,036h,036h,037h,036h,036h,036h ; Hex #C7 + Db 036h,036h,037h,030h,03Fh,000h,000h,000h ; Hex #C8 + Db 000h,000h,03Fh,030h,037h,036h,036h,036h ; Hex #C9 + Db 036h,036h,0F7h,000h,0FFh,000h,000h,000h ; Hex #CA + Db 000h,000h,0FFh,000h,0F7h,036h,036h,036h ; Hex #CB + Db 036h,036h,037h,030h,037h,036h,036h,036h ; Hex #CC + Db 000h,000h,0FFh,000h,0FFh,000h,000h,000h ; Hex #CD + Db 036h,036h,0F7h,000h,0F7h,036h,036h,036h ; Hex #CE + Db 018h,018h,0FFh,000h,0FFh,000h,000h,000h ; Hex #CF + Db 036h,036h,036h,036h,0FFh,000h,000h,000h ; Hex #D0 + Db 000h,000h,0FFh,000h,0FFh,018h,018h,018h ; Hex #D1 + Db 000h,000h,000h,000h,0FFh,036h,036h,036h ; Hex #D2 + Db 036h,036h,036h,036h,03Fh,000h,000h,000h ; Hex #D3 + Db 018h,018h,01Fh,018h,01Fh,000h,000h,000h ; Hex #D4 + Db 000h,000h,01Fh,018h,01Fh,018h,018h,018h ; Hex #D5 + Db 000h,000h,000h,000h,03Fh,036h,036h,036h ; Hex #D6 + Db 036h,036h,036h,036h,0FFh,036h,036h,036h ; Hex #D7 + Db 018h,018h,0FFh,018h,0FFh,018h,018h,018h ; Hex #D8 + Db 018h,018h,018h,018h,0F8h,000h,000h,000h ; Hex #D9 + Db 000h,000h,000h,000h,01Fh,018h,018h,018h ; Hex #DA + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #DB + Db 000h,000h,000h,000h,0FFh,0FFh,0FFh,0FFh ; Hex #DC + Db 0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h ; Hex #DD + Db 00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh ; Hex #DE + Db 0FFh,0FFh,0FFh,0FFh,000h,000h,000h,000h ; Hex #DF + Db 000h,000h,076h,0DCh,0C8h,0DCh,076h,000h ; Hex #E0 + Db 078h,0CCh,0CCh,0D8h,0CCh,0C6h,0CCh,000h ; Hex #E1 + Db 0FEh,0C6h,0C0h,0C0h,0C0h,0C0h,0C0h,000h ; Hex #E2 + Db 000h,000h,0FEh,06Ch,06Ch,06Ch,06Ch,000h ; Hex #E3 + Db 0FEh,0C6h,060h,030h,060h,0C6h,0FEh,000h ; Hex #E4 + Db 000h,000h,07Eh,0D8h,0D8h,0D8h,070h,000h ; Hex #E5 + Db 000h,000h,066h,066h,066h,066h,07Ch,0C0h ; Hex #E6 + Db 000h,076h,0DCh,018h,018h,018h,018h,000h ; Hex #E7 + Db 07Eh,018h,03Ch,066h,066h,03Ch,018h,07Eh ; Hex #E8 + Db 038h,06Ch,0C6h,0FEh,0C6h,06Ch,038h,000h ; Hex #E9 + Db 038h,06Ch,0C6h,0C6h,06Ch,06Ch,0EEh,000h ; Hex #EA + Db 00Eh,018h,00Ch,03Eh,066h,066h,03Ch,000h ; Hex #EB + Db 000h,000h,07Eh,0DBh,0DBh,07Eh,000h,000h ; Hex #EC + Db 006h,00Ch,07Eh,0DBh,0DBh,07Eh,060h,0C0h ; Hex #ED + Db 01Eh,030h,060h,07Eh,060h,030h,01Eh,000h ; Hex #EE + Db 000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,000h ; Hex #EF + Db 000h,0FEh,000h,0FEh,000h,0FEh,000h,000h ; Hex #F0 + Db 018h,018h,07Eh,018h,018h,000h,07Eh,000h ; Hex #F1 + Db 030h,018h,00Ch,018h,030h,000h,07Eh,000h ; Hex #F2 + Db 00Ch,018h,030h,018h,00Ch,000h,07Eh,000h ; Hex #F3 + Db 00Eh,01Bh,01Bh,018h,018h,018h,018h,018h ; Hex #F4 + Db 018h,018h,018h,018h,018h,0D8h,0D8h,070h ; Hex #F5 + Db 000h,018h,000h,07Eh,000h,018h,000h,000h ; Hex #F6 + Db 000h,076h,0DCh,000h,076h,0DCh,000h,000h ; Hex #F7 + Db 038h,06Ch,06Ch,038h,000h,000h,000h,000h ; Hex #F8 + Db 000h,000h,000h,018h,018h,000h,000h,000h ; Hex #F9 + Db 000h,000h,000h,018h,000h,000h,000h,000h ; Hex #FA + Db 00Fh,00Ch,00Ch,00Ch,0ECh,06Ch,03Ch,01Ch ; Hex #FB + Db 06Ch,036h,036h,036h,036h,000h,000h,000h ; Hex #FC + Db 078h,00Ch,018h,030h,07Ch,000h,000h,000h ; Hex #FD + Db 000h,000h,03Ch,03Ch,03Ch,03Ch,000h,000h ; Hex #FE + Db 000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FF + diff --git a/v4.0/src/DEV/DISPLAY/EGA/437-CPI.ASM b/v4.0/src/DEV/DISPLAY/EGA/437-CPI.ASM new file mode 100644 index 0000000..6a44e43 --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/EGA/437-CPI.ASM @@ -0,0 +1,49 @@ +CODE SEGMENT BYTE PUBLIC 'CODE' + ASSUME CS:CODE,DS:CODE + +IF1 + %OUT EGA.CPI creation file + %OUT . + %OUT CP SRC files: + %OUT . + %OUT . CODE PAGE: 437 +ENDIF + +EGA437: DW LEN_437 ; SIZE OF ENTRY HEADER + DW POST_EGA437,0 ; POINTER TO NEXT HEADER + DW 1 ; DEVICE TYPE + DB "EGA " ; DEVICE SUBTYPE ID + DW 437 ; CODE PAGE ID + DW 3 DUP(0) ; RESERVED + DW OFFSET DATA437,0 ; POINTER TO FONTS +LEN_437 EQU ($-EGA437) ; + ; +DATA437:DW 1 ; CART/NON-CART + DW 3 ; # OF FONTS + DW LEN_D437 ; LENGTH OF DATA +D437: ; + DB 16,8 ; CHARACTER BOX SIZE + DB 0,0 ; ASPECT RATIO (UNUSED) + DW 256 ; NUMBER OF CHARACTERS + ; + INCLUDE 437-8X16.ASM ; + ; + DB 14,8 ; CHARACTER BOX SIZE + DB 0,0 ; ASPECT RATIO (UNUSED) + DW 256 ; NUMBER OF CHARACTERS + ; + INCLUDE 437-8X14.ASM ; + ; + DB 8,8 ; CHARACTER BOX SIZE + DB 0,0 ; ASPECT RATIO (UNUSED) + DW 256 ; NUMBER OF CHARACTERS + ; + INCLUDE 437-8X8.ASM ; + ; +LEN_D437 EQU ($-D437) ; + ; +POST_EGA437 EQU $ ; + ; +CODE ENDS ; + END ; + \ No newline at end of file diff --git a/v4.0/src/DEV/DISPLAY/EGA/850-8X14.ASM b/v4.0/src/DEV/DISPLAY/EGA/850-8X14.ASM new file mode 100644 index 0000000..10d6568 --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/EGA/850-8X14.ASM @@ -0,0 +1,270 @@ +;*************************************************** +; CHARACTER FONT FILE +; Source Assembler File +; +; CODE PAGE: 850 +; FONT RESOLUTION: 8 x 14 +; +; DATE CREATED:05-28-1987 +; +; +; Output file from: MULTIFON, Version 1A +; +;*************************************************** + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #0 + Db 000h,000h,000h,07Eh,081h,0A5h,081h,081h,0BDh,099h,081h,07Eh,000h,000h ; Hex #1 + Db 000h,000h,000h,07Eh,0FFh,0DBh,0FFh,0FFh,0C3h,0E7h,0FFh,07Eh,000h,000h ; Hex #2 + Db 000h,000h,000h,000h,06Ch,0FEh,0FEh,0FEh,0FEh,07Ch,038h,010h,000h,000h ; Hex #3 + Db 000h,000h,000h,000h,010h,038h,07Ch,0FEh,07Ch,038h,010h,000h,000h,000h ; Hex #4 + Db 000h,000h,000h,018h,03Ch,03Ch,0E7h,0E7h,0E7h,018h,018h,03Ch,000h,000h ; Hex #5 + Db 000h,000h,000h,018h,03Ch,07Eh,0FFh,0FFh,07Eh,018h,018h,03Ch,000h,000h ; Hex #6 + Db 000h,000h,000h,000h,000h,000h,018h,03Ch,03Ch,018h,000h,000h,000h,000h ; Hex #7 + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0E7h,0C3h,0C3h,0E7h,0FFh,0FFh,0FFh,0FFh ; Hex #8 + Db 000h,000h,000h,000h,000h,03Ch,066h,042h,042h,066h,03Ch,000h,000h,000h ; Hex #9 + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0C3h,099h,0BDh,0BDh,099h,0C3h,0FFh,0FFh,0FFh ; Hex #A + Db 000h,000h,000h,01Eh,00Eh,01Ah,032h,078h,0CCh,0CCh,0CCh,078h,000h,000h ; Hex #B + Db 000h,000h,000h,03Ch,066h,066h,066h,03Ch,018h,07Eh,018h,018h,000h,000h ; Hex #C + Db 000h,000h,000h,03Fh,033h,03Fh,030h,030h,030h,070h,0F0h,0E0h,000h,000h ; Hex #D + Db 000h,000h,000h,07Fh,063h,07Fh,063h,063h,063h,067h,0E7h,0E6h,0C0h,000h ; Hex #E + Db 000h,000h,000h,018h,018h,0DBh,03Ch,0E7h,03Ch,0DBh,018h,018h,000h,000h ; Hex #F + Db 000h,000h,000h,080h,0C0h,0E0h,0F8h,0FEh,0F8h,0E0h,0C0h,080h,000h,000h ; Hex #10 + Db 000h,000h,000h,002h,006h,00Eh,03Eh,0FEh,03Eh,00Eh,006h,002h,000h,000h ; Hex #11 + Db 000h,000h,000h,018h,03Ch,07Eh,018h,018h,018h,07Eh,03Ch,018h,000h,000h ; Hex #12 + Db 000h,000h,000h,066h,066h,066h,066h,066h,066h,000h,066h,066h,000h,000h ; Hex #13 + Db 000h,000h,000h,07Fh,0DBh,0DBh,0DBh,07Bh,01Bh,01Bh,01Bh,01Bh,000h,000h ; Hex #14 + Db 000h,000h,07Ch,0C6h,060h,038h,06Ch,0C6h,0C6h,06Ch,038h,00Ch,0C6h,07Ch ; Hex #15 + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,0FEh,0FEh,0FEh,000h,000h ; Hex #16 + Db 000h,000h,000h,018h,03Ch,07Eh,018h,018h,018h,07Eh,03Ch,018h,07Eh,000h ; Hex #17 + Db 000h,000h,000h,018h,03Ch,07Eh,018h,018h,018h,018h,018h,018h,000h,000h ; Hex #18 + Db 000h,000h,000h,018h,018h,018h,018h,018h,018h,07Eh,03Ch,018h,000h,000h ; Hex #19 + Db 000h,000h,000h,000h,000h,018h,00Ch,0FEh,00Ch,018h,000h,000h,000h,000h ; Hex #1A + Db 000h,000h,000h,000h,000h,030h,060h,0FEh,060h,030h,000h,000h,000h,000h ; Hex #1B + Db 000h,000h,000h,000h,000h,000h,0C0h,0C0h,0C0h,0FEh,000h,000h,000h,000h ; Hex #1C + Db 000h,000h,000h,000h,000h,028h,06Ch,0FEh,06Ch,028h,000h,000h,000h,000h ; Hex #1D + Db 000h,000h,000h,000h,010h,038h,038h,07Ch,07Ch,0FEh,0FEh,000h,000h,000h ; Hex #1E + Db 000h,000h,000h,000h,0FEh,0FEh,07Ch,07Ch,038h,038h,010h,000h,000h,000h ; Hex #1F + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #20 + Db 000h,000h,000h,018h,03Ch,03Ch,03Ch,018h,018h,000h,018h,018h,000h,000h ; Hex #21 + Db 000h,066h,066h,066h,024h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #22 + Db 000h,000h,000h,06Ch,06Ch,0FEh,06Ch,06Ch,06Ch,0FEh,06Ch,06Ch,000h,000h ; Hex #23 + Db 000h,018h,018h,07Ch,0C6h,0C2h,0C0h,07Ch,006h,086h,0C6h,07Ch,018h,018h ; Hex #24 + Db 000h,000h,000h,000h,000h,0C2h,0C6h,00Ch,018h,030h,066h,0C6h,000h,000h ; Hex #25 + Db 000h,000h,000h,038h,06Ch,06Ch,038h,076h,0DCh,0CCh,0CCh,076h,000h,000h ; Hex #26 + Db 000h,018h,018h,018h,030h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #27 + Db 000h,000h,000h,00Ch,018h,030h,030h,030h,030h,030h,018h,00Ch,000h,000h ; Hex #28 + Db 000h,000h,000h,030h,018h,00Ch,00Ch,00Ch,00Ch,00Ch,018h,030h,000h,000h ; Hex #29 + Db 000h,000h,000h,000h,000h,066h,03Ch,0FFh,03Ch,066h,000h,000h,000h,000h ; Hex #2A + Db 000h,000h,000h,000h,000h,018h,018h,07Eh,018h,018h,000h,000h,000h,000h ; Hex #2B + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,018h,018h,018h,030h,000h ; Hex #2C + Db 000h,000h,000h,000h,000h,000h,000h,0FEh,000h,000h,000h,000h,000h,000h ; Hex #2D + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,018h,018h,000h,000h ; Hex #2E + Db 000h,000h,000h,002h,006h,00Ch,018h,030h,060h,0C0h,080h,000h,000h,000h ; Hex #2F + Db 000h,000h,000h,038h,06Ch,0C6h,0C6h,0D6h,0C6h,0C6h,06Ch,038h,000h,000h ; Hex #30 + Db 000h,000h,000h,018h,038h,078h,018h,018h,018h,018h,018h,07Eh,000h,000h ; Hex #31 + Db 000h,000h,000h,07Ch,0C6h,006h,00Ch,018h,030h,060h,0C6h,0FEh,000h,000h ; Hex #32 + Db 000h,000h,000h,07Ch,0C6h,006h,006h,03Ch,006h,006h,0C6h,07Ch,000h,000h ; Hex #33 + Db 000h,000h,000h,00Ch,01Ch,03Ch,06Ch,0CCh,0FEh,00Ch,00Ch,01Eh,000h,000h ; Hex #34 + Db 000h,000h,000h,0FEh,0C0h,0C0h,0C0h,0FCh,006h,006h,0C6h,07Ch,000h,000h ; Hex #35 + Db 000h,000h,000h,038h,060h,0C0h,0C0h,0FCh,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #36 + Db 000h,000h,000h,0FEh,0C6h,006h,00Ch,018h,030h,030h,030h,030h,000h,000h ; Hex #37 + Db 000h,000h,000h,07Ch,0C6h,0C6h,0C6h,07Ch,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #38 + Db 000h,000h,000h,07Ch,0C6h,0C6h,0C6h,07Eh,006h,006h,00Ch,078h,000h,000h ; Hex #39 + Db 000h,000h,000h,000h,018h,018h,000h,000h,000h,018h,018h,000h,000h,000h ; Hex #3A + Db 000h,000h,000h,000h,018h,018h,000h,000h,000h,018h,018h,030h,000h,000h ; Hex #3B + Db 000h,000h,000h,00Ch,018h,030h,060h,0C0h,060h,030h,018h,00Ch,000h,000h ; Hex #3C + Db 000h,000h,000h,000h,000h,000h,07Eh,000h,000h,07Eh,000h,000h,000h,000h ; Hex #3D + Db 000h,000h,000h,060h,030h,018h,00Ch,006h,00Ch,018h,030h,060h,000h,000h ; Hex #3E + Db 000h,000h,000h,07Ch,0C6h,0C6h,00Ch,018h,018h,000h,018h,018h,000h,000h ; Hex #3F + Db 000h,000h,000h,07Ch,0C6h,0C6h,0DEh,0DEh,0DEh,0DCh,0C0h,07Ch,000h,000h ; Hex #40 + Db 000h,000h,000h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h,000h ; Hex #41 + Db 000h,000h,000h,0FCh,066h,066h,066h,07Ch,066h,066h,066h,0FCh,000h,000h ; Hex #42 + Db 000h,000h,000h,03Ch,066h,0C2h,0C0h,0C0h,0C0h,0C2h,066h,03Ch,000h,000h ; Hex #43 + Db 000h,000h,000h,0F8h,06Ch,066h,066h,066h,066h,066h,06Ch,0F8h,000h,000h ; Hex #44 + Db 000h,000h,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h ; Hex #45 + Db 000h,000h,000h,0FEh,066h,062h,068h,078h,068h,060h,060h,0F0h,000h,000h ; Hex #46 + Db 000h,000h,000h,03Ch,066h,0C2h,0C0h,0C0h,0DEh,0C6h,066h,03Ah,000h,000h ; Hex #47 + Db 000h,000h,000h,0C6h,0C6h,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,0C6h,000h,000h ; Hex #48 + Db 000h,000h,000h,03Ch,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #49 + Db 000h,000h,000h,01Eh,00Ch,00Ch,00Ch,00Ch,00Ch,0CCh,0CCh,078h,000h,000h ; Hex #4A + Db 000h,000h,000h,0E6h,066h,06Ch,06Ch,078h,06Ch,06Ch,066h,0E6h,000h,000h ; Hex #4B + Db 000h,000h,000h,0F0h,060h,060h,060h,060h,060h,062h,066h,0FEh,000h,000h ; Hex #4C + Db 000h,000h,000h,0C6h,0EEh,0FEh,0D6h,0C6h,0C6h,0C6h,0C6h,0C6h,000h,000h ; Hex #4D + Db 000h,000h,000h,0C6h,0E6h,0F6h,0FEh,0DEh,0CEh,0C6h,0C6h,0C6h,000h,000h ; Hex #4E + Db 000h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #4F + Db 000h,000h,000h,0FCh,066h,066h,066h,07Ch,060h,060h,060h,0F0h,000h,000h ; Hex #50 + Db 000h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0D6h,0DEh,07Ch,00Eh,000h ; Hex #51 + Db 000h,000h,000h,0FCh,066h,066h,066h,07Ch,06Ch,066h,066h,0E6h,000h,000h ; Hex #52 + Db 000h,000h,000h,07Ch,0C6h,0C6h,060h,038h,00Ch,0C6h,0C6h,07Ch,000h,000h ; Hex #53 + Db 000h,000h,000h,07Eh,07Eh,05Ah,018h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #54 + Db 000h,000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #55 + Db 000h,000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,06Ch,038h,010h,000h,000h ; Hex #56 + Db 000h,000h,000h,0C6h,0C6h,0C6h,0C6h,0D6h,0D6h,0FEh,06Ch,06Ch,000h,000h ; Hex #57 + Db 000h,000h,000h,0C6h,0C6h,0C6h,07Ch,038h,07Ch,0C6h,0C6h,0C6h,000h,000h ; Hex #58 + Db 000h,000h,000h,066h,066h,066h,066h,03Ch,018h,018h,018h,03Ch,000h,000h ; Hex #59 + Db 000h,000h,000h,0FEh,0C6h,08Ch,018h,030h,060h,0C2h,0C6h,0FEh,000h,000h ; Hex #5A + Db 000h,000h,000h,03Ch,030h,030h,030h,030h,030h,030h,030h,03Ch,000h,000h ; Hex #5B + Db 000h,000h,000h,080h,0C0h,0E0h,070h,038h,01Ch,00Eh,006h,002h,000h,000h ; Hex #5C + Db 000h,000h,000h,03Ch,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,03Ch,000h,000h ; Hex #5D + Db 010h,038h,06Ch,0C6h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #5E + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,0FFh ; Hex #5F + Db 000h,030h,018h,00Ch,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #60 + Db 000h,000h,000h,000h,000h,000h,078h,00Ch,07Ch,0CCh,0CCh,076h,000h,000h ; Hex #61 + Db 000h,000h,000h,0E0h,060h,060h,078h,06Ch,066h,066h,066h,07Ch,000h,000h ; Hex #62 + Db 000h,000h,000h,000h,000h,000h,07Ch,0C6h,0C0h,0C0h,0C6h,07Ch,000h,000h ; Hex #63 + Db 000h,000h,000h,01Ch,00Ch,00Ch,03Ch,06Ch,0CCh,0CCh,0CCh,076h,000h,000h ; Hex #64 + Db 000h,000h,000h,000h,000h,000h,07Ch,0C6h,0FEh,0C0h,0C6h,07Ch,000h,000h ; Hex #65 + Db 000h,000h,000h,01Ch,036h,032h,030h,07Ch,030h,030h,030h,078h,000h,000h ; Hex #66 + Db 000h,000h,000h,000h,000h,000h,076h,0CCh,0CCh,0CCh,07Ch,00Ch,0CCh,078h ; Hex #67 + Db 000h,000h,000h,0E0h,060h,060h,06Ch,076h,066h,066h,066h,0E6h,000h,000h ; Hex #68 + Db 000h,000h,000h,018h,018h,000h,038h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #69 + Db 000h,000h,000h,006h,006h,000h,00Eh,006h,006h,006h,006h,066h,066h,03Ch ; Hex #6A + Db 000h,000h,000h,0E0h,060h,060h,066h,06Ch,078h,06Ch,066h,0E6h,000h,000h ; Hex #6B + Db 000h,000h,000h,038h,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #6C + Db 000h,000h,000h,000h,000h,000h,0ECh,0FEh,0D6h,0D6h,0D6h,0D6h,000h,000h ; Hex #6D + Db 000h,000h,000h,000h,000h,000h,0DCh,066h,066h,066h,066h,066h,000h,000h ; Hex #6E + Db 000h,000h,000h,000h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #6F + Db 000h,000h,000h,000h,000h,000h,0DCh,066h,066h,066h,07Ch,060h,060h,0F0h ; Hex #70 + Db 000h,000h,000h,000h,000h,000h,076h,0CCh,0CCh,0CCh,07Ch,00Ch,00Ch,01Eh ; Hex #71 + Db 000h,000h,000h,000h,000h,000h,0DCh,076h,066h,060h,060h,0F0h,000h,000h ; Hex #72 + Db 000h,000h,000h,000h,000h,000h,07Ch,0C6h,070h,01Ch,0C6h,07Ch,000h,000h ; Hex #73 + Db 000h,000h,000h,010h,030h,030h,0FCh,030h,030h,030h,036h,01Ch,000h,000h ; Hex #74 + Db 000h,000h,000h,000h,000h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h ; Hex #75 + Db 000h,000h,000h,000h,000h,000h,0C6h,0C6h,0C6h,06Ch,038h,010h,000h,000h ; Hex #76 + Db 000h,000h,000h,000h,000h,000h,0C6h,0C6h,0D6h,0D6h,0FEh,06Ch,000h,000h ; Hex #77 + Db 000h,000h,000h,000h,000h,000h,0C6h,06Ch,038h,038h,06Ch,0C6h,000h,000h ; Hex #78 + Db 000h,000h,000h,000h,000h,000h,0C6h,0C6h,0C6h,0C6h,07Eh,006h,00Ch,078h ; Hex #79 + Db 000h,000h,000h,000h,000h,000h,0FEh,0CCh,018h,030h,066h,0FEh,000h,000h ; Hex #7A + Db 000h,000h,000h,00Eh,018h,018h,018h,070h,018h,018h,018h,00Eh,000h,000h ; Hex #7B + Db 000h,000h,000h,018h,018h,018h,018h,018h,018h,018h,018h,018h,000h,000h ; Hex #7C + Db 000h,000h,000h,070h,018h,018h,018h,00Eh,018h,018h,018h,070h,000h,000h ; Hex #7D + Db 000h,076h,0DCh,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #7E + Db 000h,000h,000h,000h,000h,010h,038h,06Ch,0C6h,0C6h,0FEh,000h,000h,000h ; Hex #7F + Db 000h,000h,000h,03Ch,066h,0C2h,0C0h,0C0h,0C0h,0C2h,066h,03Ch,00Ch,078h ; Hex #80 + Db 000h,000h,000h,0CCh,000h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h ; Hex #81 + Db 000h,000h,00Ch,018h,030h,000h,07Ch,0C6h,0FEh,0C0h,0C6h,07Ch,000h,000h ; Hex #82 + Db 000h,000h,010h,038h,06Ch,000h,078h,00Ch,07Ch,0CCh,0CCh,076h,000h,000h ; Hex #83 + Db 000h,000h,000h,0C6h,000h,000h,078h,00Ch,07Ch,0CCh,0CCh,076h,000h,000h ; Hex #84 + Db 000h,000h,060h,030h,018h,000h,078h,00Ch,07Ch,0CCh,0CCh,076h,000h,000h ; Hex #85 + Db 000h,000h,038h,06Ch,038h,000h,078h,00Ch,07Ch,0CCh,0CCh,076h,000h,000h ; Hex #86 + Db 000h,000h,000h,000h,000h,000h,07Ch,0C6h,0C0h,0C0h,0C6h,07Ch,00Ch,078h ; Hex #87 + Db 000h,000h,010h,038h,06Ch,000h,07Ch,0C6h,0FEh,0C0h,0C6h,07Ch,000h,000h ; Hex #88 + Db 000h,000h,000h,0C6h,000h,000h,07Ch,0C6h,0FEh,0C0h,0C6h,07Ch,000h,000h ; Hex #89 + Db 000h,000h,060h,030h,018h,000h,07Ch,0C6h,0FEh,0C0h,0C6h,07Ch,000h,000h ; Hex #8A + Db 000h,000h,000h,066h,000h,000h,038h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #8B + Db 000h,000h,018h,03Ch,066h,000h,038h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #8C + Db 000h,000h,060h,030h,018h,000h,038h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #8D + Db 000h,0C6h,000h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h,000h ; Hex #8E + Db 038h,06Ch,038h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h,000h ; Hex #8F + Db 00Ch,018h,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h ; Hex #90 + Db 000h,000h,000h,000h,000h,000h,0ECh,036h,076h,0DCh,0D8h,06Eh,000h,000h ; Hex #91 + Db 000h,000h,000h,03Eh,06Ch,0CCh,0CCh,0FEh,0CCh,0CCh,0CCh,0CEh,000h,000h ; Hex #92 + Db 000h,000h,010h,038h,06Ch,000h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #93 + Db 000h,000h,000h,0C6h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #94 + Db 000h,000h,060h,030h,018h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #95 + Db 000h,000h,030h,078h,0CCh,000h,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h ; Hex #96 + Db 000h,000h,060h,030h,018h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h ; Hex #97 + Db 000h,000h,000h,0C6h,000h,000h,0C6h,0C6h,0C6h,0C6h,07Eh,006h,00Ch,078h ; Hex #98 + Db 000h,0C6h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #99 + Db 000h,0C6h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #9A + Db 000h,000h,000h,000h,000h,000h,07Ch,0CEh,0DEh,0F6h,0E6h,07Ch,000h,000h ; Hex #9B + Db 000h,000h,038h,06Ch,064h,060h,0F0h,060h,060h,060h,0E6h,0FCh,000h,000h ; Hex #9C + Db 000h,000h,004h,07Ch,0CEh,0CEh,0D6h,0D6h,0D6h,0E6h,0E6h,07Ch,040h,000h ; Hex #9D + Db 000h,000h,000h,000h,000h,0C6h,06Ch,038h,038h,06Ch,0C6h,000h,000h,000h ; Hex #9E + Db 000h,000h,00Eh,01Bh,018h,018h,018h,07Eh,018h,018h,018h,0D8h,070h,000h ; Hex #9F + Db 000h,000h,00Ch,018h,030h,000h,078h,00Ch,07Ch,0CCh,0CCh,076h,000h,000h ; Hex #A0 + Db 000h,000h,00Ch,018h,030h,000h,038h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #A1 + Db 000h,000h,00Ch,018h,030h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #A2 + Db 000h,000h,00Ch,018h,030h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h ; Hex #A3 + Db 000h,000h,000h,076h,0DCh,000h,0DCh,066h,066h,066h,066h,066h,000h,000h ; Hex #A4 + Db 076h,0DCh,000h,0C6h,0E6h,0F6h,0FEh,0DEh,0CEh,0C6h,0C6h,0C6h,000h,000h ; Hex #A5 + Db 000h,000h,03Ch,06Ch,06Ch,03Eh,000h,07Eh,000h,000h,000h,000h,000h,000h ; Hex #A6 + Db 000h,000h,038h,06Ch,06Ch,038h,000h,07Ch,000h,000h,000h,000h,000h,000h ; Hex #A7 + Db 000h,000h,000h,030h,030h,000h,030h,030h,060h,0C6h,0C6h,07Ch,000h,000h ; Hex #A8 + Db 000h,000h,000h,038h,044h,0BAh,0AAh,0B2h,0AAh,0AAh,044h,038h,000h,000h ; Hex #A9 + Db 000h,000h,000h,000h,000h,000h,000h,0FEh,006h,006h,006h,000h,000h,000h ; Hex #AA + Db 000h,000h,060h,0E0h,063h,066h,06Ch,018h,030h,06Eh,0C3h,006h,00Ch,01Fh ; Hex #AB + Db 000h,000h,060h,0E0h,063h,066h,06Ch,01Ah,036h,06Eh,0DAh,03Fh,006h,006h ; Hex #AC + Db 000h,000h,000h,018h,018h,000h,018h,018h,03Ch,03Ch,03Ch,018h,000h,000h ; Hex #AD + Db 000h,000h,000h,000h,000h,036h,06Ch,0D8h,06Ch,036h,000h,000h,000h,000h ; Hex #AE + Db 000h,000h,000h,000h,000h,0D8h,06Ch,036h,06Ch,0D8h,000h,000h,000h,000h ; Hex #AF + Db 011h,044h,011h,044h,011h,044h,011h,044h,011h,044h,011h,044h,011h,044h ; Hex #B0 + Db 055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh ; Hex #B1 + Db 0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h ; Hex #B2 + Db 018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B3 + Db 018h,018h,018h,018h,018h,018h,018h,0F8h,018h,018h,018h,018h,018h,018h ; Hex #B4 + Db 030h,060h,0C0h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h,000h ; Hex #B5 + Db 038h,06Ch,0C6h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h,000h ; Hex #B6 + Db 018h,00Ch,006h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h,000h ; Hex #B7 + Db 000h,000h,000h,038h,044h,09Ah,0A2h,0A2h,0A2h,09Ah,044h,038h,000h,000h ; Hex #B8 + Db 036h,036h,036h,036h,036h,0F6h,006h,0F6h,036h,036h,036h,036h,036h,036h ; Hex #B9 + Db 036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #BA + Db 000h,000h,000h,000h,000h,0FEh,006h,0F6h,036h,036h,036h,036h,036h,036h ; Hex #BB + Db 036h,036h,036h,036h,036h,0F6h,006h,0FEh,000h,000h,000h,000h,000h,000h ; Hex #BC + Db 000h,000h,018h,018h,07Ch,0C6h,0C0h,0C0h,0C6h,07Ch,018h,018h,000h,000h ; Hex #BD + Db 000h,000h,000h,066h,066h,03Ch,018h,07Eh,018h,07Eh,018h,018h,000h,000h ; Hex #BE + Db 000h,000h,000h,000h,000h,000h,000h,0F8h,018h,018h,018h,018h,018h,018h ; Hex #BF + Db 018h,018h,018h,018h,018h,018h,018h,01Fh,000h,000h,000h,000h,000h,000h ; Hex #C0 + Db 018h,018h,018h,018h,018h,018h,018h,0FFh,000h,000h,000h,000h,000h,000h ; Hex #C1 + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,018h,018h,018h,018h,018h,018h ; Hex #C2 + Db 018h,018h,018h,018h,018h,018h,018h,01Fh,018h,018h,018h,018h,018h,018h ; Hex #C3 + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,000h,000h,000h,000h,000h,000h ; Hex #C4 + Db 018h,018h,018h,018h,018h,018h,018h,0FFh,018h,018h,018h,018h,018h,018h ; Hex #C5 + Db 000h,000h,000h,076h,0DCh,000h,078h,00Ch,07Ch,0CCh,0CCh,076h,000h,000h ; Hex #C6 + Db 076h,0DCh,000h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h,000h ; Hex #C7 + Db 036h,036h,036h,036h,036h,037h,030h,03Fh,000h,000h,000h,000h,000h,000h ; Hex #C8 + Db 000h,000h,000h,000h,000h,03Fh,030h,037h,036h,036h,036h,036h,036h,036h ; Hex #C9 + Db 036h,036h,036h,036h,036h,0F7h,000h,0FFh,000h,000h,000h,000h,000h,000h ; Hex #CA + Db 000h,000h,000h,000h,000h,0FFh,000h,0F7h,036h,036h,036h,036h,036h,036h ; Hex #CB + Db 036h,036h,036h,036h,036h,037h,030h,037h,036h,036h,036h,036h,036h,036h ; Hex #CC + Db 000h,000h,000h,000h,000h,0FFh,000h,0FFh,000h,000h,000h,000h,000h,000h ; Hex #CD + Db 036h,036h,036h,036h,036h,0F7h,000h,0F7h,036h,036h,036h,036h,036h,036h ; Hex #CE + Db 000h,000h,000h,000h,000h,0C6h,07Ch,0C6h,0C6h,0C6h,07Ch,0C6h,000h,000h ; Hex #CF + Db 000h,000h,000h,034h,018h,02Ch,006h,03Eh,066h,066h,066h,03Ch,000h,000h ; Hex #D0 + Db 000h,000h,000h,0F8h,06Ch,066h,066h,0F6h,066h,066h,06Ch,0F8h,000h,000h ; Hex #D1 + Db 038h,06Ch,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h ; Hex #D2 + Db 000h,0C6h,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h ; Hex #D3 + Db 030h,018h,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h ; Hex #D4 + Db 000h,000h,000h,000h,000h,000h,038h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #D5 + Db 00Ch,018h,000h,03Ch,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #D6 + Db 03Ch,066h,000h,03Ch,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #D7 + Db 000h,066h,000h,03Ch,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #D8 + Db 018h,018h,018h,018h,018h,018h,018h,0F8h,000h,000h,000h,000h,000h,000h ; Hex #D9 + Db 000h,000h,000h,000h,000h,000h,000h,01Fh,018h,018h,018h,018h,018h,018h ; Hex #DA + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #DB + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #DC + Db 000h,000h,018h,018h,018h,018h,000h,000h,000h,018h,018h,018h,018h,000h ; Hex #DD + Db 030h,018h,000h,03Ch,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #DE + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,000h,000h,000h,000h,000h,000h,000h ; Hex #DF + Db 018h,030h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #E0 + Db 000h,000h,000h,078h,0CCh,0CCh,0CCh,0D8h,0CCh,0C6h,0C6h,0CCh,000h,000h ; Hex #E1 + Db 038h,06Ch,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #E2 + Db 030h,018h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #E3 + Db 000h,000h,000h,076h,0DCh,000h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #E4 + Db 076h,0DCh,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #E5 + Db 000h,000h,000h,000h,000h,000h,066h,066h,066h,066h,066h,07Ch,060h,0C0h ; Hex #E6 + Db 000h,000h,000h,0E0h,060h,060h,07Ch,066h,066h,066h,066h,07Ch,060h,0F0h ; Hex #E7 + Db 000h,000h,000h,0F0h,060h,07Ch,066h,066h,066h,07Ch,060h,0F0h,000h,000h ; Hex #E8 + Db 018h,030h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #E9 + Db 038h,06Ch,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #EA + Db 030h,018h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #EB + Db 000h,000h,00Ch,018h,030h,000h,0C6h,0C6h,0C6h,0C6h,07Eh,006h,00Ch,0F8h ; Hex #EC + Db 00Ch,018h,000h,066h,066h,066h,066h,03Ch,018h,018h,018h,03Ch,000h,000h ; Hex #ED + Db 000h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #EE + Db 000h,00Ch,018h,030h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #EF + Db 000h,000h,000h,000h,000h,000h,000h,0FEh,000h,000h,000h,000h,000h,000h ; Hex #F0 + Db 000h,000h,000h,000h,018h,018h,07Eh,018h,018h,000h,000h,07Eh,000h,000h ; Hex #F1 + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,0FFh,000h,0FFh ; Hex #F2 + Db 000h,0E0h,030h,063h,036h,0ECh,018h,036h,06Eh,0DAh,03Fh,006h,006h,000h ; Hex #F3 + Db 000h,000h,000h,07Fh,0DBh,0DBh,0DBh,07Bh,01Bh,01Bh,01Bh,01Bh,000h,000h ; Hex #F4 + Db 000h,000h,07Ch,0C6h,060h,038h,06Ch,0C6h,0C6h,06Ch,038h,00Ch,0C6h,07Ch ; Hex #F5 + Db 000h,000h,000h,000h,000h,018h,000h,07Eh,000h,018h,000h,000h,000h,000h ; Hex #F6 + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,018h,00Ch,078h ; Hex #F7 + Db 000h,038h,06Ch,06Ch,038h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #F8 + Db 000h,0C6h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #F9 + Db 000h,000h,000h,000h,000h,000h,000h,018h,000h,000h,000h,000h,000h,000h ; Hex #FA + Db 000h,018h,038h,018h,018h,018h,03Ch,000h,000h,000h,000h,000h,000h,000h ; Hex #FB + Db 000h,078h,00Ch,038h,00Ch,00Ch,078h,000h,000h,000h,000h,000h,000h,000h ; Hex #FC + Db 000h,03Ch,066h,00Ch,018h,032h,07Eh,000h,000h,000h,000h,000h,000h,000h ; Hex #FD + Db 000h,000h,000h,000h,000h,07Eh,07Eh,07Eh,07Eh,07Eh,07Eh,000h,000h,000h ; Hex #FE + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FF + diff --git a/v4.0/src/DEV/DISPLAY/EGA/850-8X16.ASM b/v4.0/src/DEV/DISPLAY/EGA/850-8X16.ASM new file mode 100644 index 0000000..e5155ab --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/EGA/850-8X16.ASM @@ -0,0 +1,270 @@ +;*************************************************** +; CHARACTER FONT FILE +; Source Assembler File +; +; CODE PAGE: 850 +; FONT RESOLUTION: 8 x 16 +; +; DATE CREATED:05-28-1987 +; +; +; Output file from: MULTIFON, Version 1A +; +;*************************************************** + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #0 + Db 000h,000h,07Eh,081h,0A5h,081h,081h,0BDh,099h,081h,081h,07Eh,000h,000h,000h,000h ; Hex #1 + Db 000h,000h,07Eh,0FFh,0DBh,0FFh,0FFh,0C3h,0E7h,0FFh,0FFh,07Eh,000h,000h,000h,000h ; Hex #2 + Db 000h,000h,000h,000h,06Ch,0FEh,0FEh,0FEh,0FEh,07Ch,038h,010h,000h,000h,000h,000h ; Hex #3 + Db 000h,000h,000h,000h,010h,038h,07Ch,0FEh,07Ch,038h,010h,000h,000h,000h,000h,000h ; Hex #4 + Db 000h,000h,000h,018h,03Ch,03Ch,0E7h,0E7h,0E7h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #5 + Db 000h,000h,000h,018h,03Ch,07Eh,0FFh,0FFh,07Eh,018h,018h,03Ch,000h,000h,000h,000h ; Hex #6 + Db 000h,000h,000h,000h,000h,000h,018h,03Ch,03Ch,018h,000h,000h,000h,000h,000h,000h ; Hex #7 + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0E7h,0C3h,0C3h,0E7h,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #8 + Db 000h,000h,000h,000h,000h,03Ch,066h,042h,042h,066h,03Ch,000h,000h,000h,000h,000h ; Hex #9 + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0C3h,099h,0BDh,0BDh,099h,0C3h,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #A + Db 000h,000h,01Eh,00Eh,01Ah,032h,078h,0CCh,0CCh,0CCh,0CCh,078h,000h,000h,000h,000h ; Hex #B + Db 000h,000h,03Ch,066h,066h,066h,066h,03Ch,018h,07Eh,018h,018h,000h,000h,000h,000h ; Hex #C + Db 000h,000h,03Fh,033h,03Fh,030h,030h,030h,030h,070h,0F0h,0E0h,000h,000h,000h,000h ; Hex #D + Db 000h,000h,07Fh,063h,07Fh,063h,063h,063h,063h,067h,0E7h,0E6h,0C0h,000h,000h,000h ; Hex #E + Db 000h,000h,000h,018h,018h,0DBh,03Ch,0E7h,03Ch,0DBh,018h,018h,000h,000h,000h,000h ; Hex #F + Db 000h,080h,0C0h,0E0h,0F0h,0F8h,0FEh,0F8h,0F0h,0E0h,0C0h,080h,000h,000h,000h,000h ; Hex #10 + Db 000h,002h,006h,00Eh,01Eh,03Eh,0FEh,03Eh,01Eh,00Eh,006h,002h,000h,000h,000h,000h ; Hex #11 + Db 000h,000h,018h,03Ch,07Eh,018h,018h,018h,07Eh,03Ch,018h,000h,000h,000h,000h,000h ; Hex #12 + Db 000h,000h,066h,066h,066h,066h,066h,066h,066h,000h,066h,066h,000h,000h,000h,000h ; Hex #13 + Db 000h,000h,07Fh,0DBh,0DBh,0DBh,07Bh,01Bh,01Bh,01Bh,01Bh,01Bh,000h,000h,000h,000h ; Hex #14 + Db 000h,07Ch,0C6h,060h,038h,06Ch,0C6h,0C6h,06Ch,038h,00Ch,0C6h,07Ch,000h,000h,000h ; Hex #15 + Db 000h,000h,000h,000h,000h,000h,000h,000h,0FEh,0FEh,0FEh,0FEh,000h,000h,000h,000h ; Hex #16 + Db 000h,000h,018h,03Ch,07Eh,018h,018h,018h,07Eh,03Ch,018h,07Eh,000h,000h,000h,000h ; Hex #17 + Db 000h,000h,018h,03Ch,07Eh,018h,018h,018h,018h,018h,018h,018h,000h,000h,000h,000h ; Hex #18 + Db 000h,000h,018h,018h,018h,018h,018h,018h,018h,07Eh,03Ch,018h,000h,000h,000h,000h ; Hex #19 + Db 000h,000h,000h,000h,000h,018h,00Ch,0FEh,00Ch,018h,000h,000h,000h,000h,000h,000h ; Hex #1A + Db 000h,000h,000h,000h,000h,030h,060h,0FEh,060h,030h,000h,000h,000h,000h,000h,000h ; Hex #1B + Db 000h,000h,000h,000h,000h,000h,0C0h,0C0h,0C0h,0FEh,000h,000h,000h,000h,000h,000h ; Hex #1C + Db 000h,000h,000h,000h,000h,028h,06Ch,0FEh,06Ch,028h,000h,000h,000h,000h,000h,000h ; Hex #1D + Db 000h,000h,000h,000h,010h,038h,038h,07Ch,07Ch,0FEh,0FEh,000h,000h,000h,000h,000h ; Hex #1E + Db 000h,000h,000h,000h,0FEh,0FEh,07Ch,07Ch,038h,038h,010h,000h,000h,000h,000h,000h ; Hex #1F + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #20 + Db 000h,000h,018h,03Ch,03Ch,03Ch,018h,018h,018h,000h,018h,018h,000h,000h,000h,000h ; Hex #21 + Db 000h,066h,066h,066h,024h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #22 + Db 000h,000h,000h,06Ch,06Ch,0FEh,06Ch,06Ch,06Ch,0FEh,06Ch,06Ch,000h,000h,000h,000h ; Hex #23 + Db 018h,018h,07Ch,0C6h,0C2h,0C0h,07Ch,006h,006h,086h,0C6h,07Ch,018h,018h,000h,000h ; Hex #24 + Db 000h,000h,000h,000h,0C2h,0C6h,00Ch,018h,030h,060h,0C6h,086h,000h,000h,000h,000h ; Hex #25 + Db 000h,000h,038h,06Ch,06Ch,038h,076h,0DCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #26 + Db 000h,030h,030h,030h,060h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #27 + Db 000h,000h,00Ch,018h,030h,030h,030h,030h,030h,030h,018h,00Ch,000h,000h,000h,000h ; Hex #28 + Db 000h,000h,030h,018h,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,018h,030h,000h,000h,000h,000h ; Hex #29 + Db 000h,000h,000h,000h,000h,066h,03Ch,0FFh,03Ch,066h,000h,000h,000h,000h,000h,000h ; Hex #2A + Db 000h,000h,000h,000h,000h,018h,018h,07Eh,018h,018h,000h,000h,000h,000h,000h,000h ; Hex #2B + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,018h,018h,018h,030h,000h,000h,000h ; Hex #2C + Db 000h,000h,000h,000h,000h,000h,000h,0FEh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #2D + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,018h,018h,000h,000h,000h,000h ; Hex #2E + Db 000h,000h,000h,000h,002h,006h,00Ch,018h,030h,060h,0C0h,080h,000h,000h,000h,000h ; Hex #2F + Db 000h,000h,038h,06Ch,0C6h,0C6h,0D6h,0D6h,0C6h,0C6h,06Ch,038h,000h,000h,000h,000h ; Hex #30 + Db 000h,000h,018h,038h,078h,018h,018h,018h,018h,018h,018h,07Eh,000h,000h,000h,000h ; Hex #31 + Db 000h,000h,07Ch,0C6h,006h,00Ch,018h,030h,060h,0C0h,0C6h,0FEh,000h,000h,000h,000h ; Hex #32 + Db 000h,000h,07Ch,0C6h,006h,006h,03Ch,006h,006h,006h,0C6h,07Ch,000h,000h,000h,000h ; Hex #33 + Db 000h,000h,00Ch,01Ch,03Ch,06Ch,0CCh,0FEh,00Ch,00Ch,00Ch,01Eh,000h,000h,000h,000h ; Hex #34 + Db 000h,000h,0FEh,0C0h,0C0h,0C0h,0FCh,006h,006h,006h,0C6h,07Ch,000h,000h,000h,000h ; Hex #35 + Db 000h,000h,038h,060h,0C0h,0C0h,0FCh,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #36 + Db 000h,000h,0FEh,0C6h,006h,006h,00Ch,018h,030h,030h,030h,030h,000h,000h,000h,000h ; Hex #37 + Db 000h,000h,07Ch,0C6h,0C6h,0C6h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #38 + Db 000h,000h,07Ch,0C6h,0C6h,0C6h,07Eh,006h,006h,006h,00Ch,078h,000h,000h,000h,000h ; Hex #39 + Db 000h,000h,000h,000h,018h,018h,000h,000h,000h,018h,018h,000h,000h,000h,000h,000h ; Hex #3A + Db 000h,000h,000h,000h,018h,018h,000h,000h,000h,018h,018h,030h,000h,000h,000h,000h ; Hex #3B + Db 000h,000h,000h,006h,00Ch,018h,030h,060h,030h,018h,00Ch,006h,000h,000h,000h,000h ; Hex #3C + Db 000h,000h,000h,000h,000h,07Eh,000h,000h,07Eh,000h,000h,000h,000h,000h,000h,000h ; Hex #3D + Db 000h,000h,000h,060h,030h,018h,00Ch,006h,00Ch,018h,030h,060h,000h,000h,000h,000h ; Hex #3E + Db 000h,000h,07Ch,0C6h,0C6h,00Ch,018h,018h,018h,000h,018h,018h,000h,000h,000h,000h ; Hex #3F + Db 000h,000h,000h,07Ch,0C6h,0C6h,0DEh,0DEh,0DEh,0DCh,0C0h,07Ch,000h,000h,000h,000h ; Hex #40 + Db 000h,000h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #41 + Db 000h,000h,0FCh,066h,066h,066h,07Ch,066h,066h,066h,066h,0FCh,000h,000h,000h,000h ; Hex #42 + Db 000h,000h,03Ch,066h,0C2h,0C0h,0C0h,0C0h,0C0h,0C2h,066h,03Ch,000h,000h,000h,000h ; Hex #43 + Db 000h,000h,0F8h,06Ch,066h,066h,066h,066h,066h,066h,06Ch,0F8h,000h,000h,000h,000h ; Hex #44 + Db 000h,000h,0FEh,066h,062h,068h,078h,068h,060h,062h,066h,0FEh,000h,000h,000h,000h ; Hex #45 + Db 000h,000h,0FEh,066h,062h,068h,078h,068h,060h,060h,060h,0F0h,000h,000h,000h,000h ; Hex #46 + Db 000h,000h,03Ch,066h,0C2h,0C0h,0C0h,0DEh,0C6h,0C6h,066h,03Ah,000h,000h,000h,000h ; Hex #47 + Db 000h,000h,0C6h,0C6h,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #48 + Db 000h,000h,03Ch,018h,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #49 + Db 000h,000h,01Eh,00Ch,00Ch,00Ch,00Ch,00Ch,0CCh,0CCh,0CCh,078h,000h,000h,000h,000h ; Hex #4A + Db 000h,000h,0E6h,066h,066h,06Ch,078h,078h,06Ch,066h,066h,0E6h,000h,000h,000h,000h ; Hex #4B + Db 000h,000h,0F0h,060h,060h,060h,060h,060h,060h,062h,066h,0FEh,000h,000h,000h,000h ; Hex #4C + Db 000h,000h,0C6h,0EEh,0FEh,0FEh,0D6h,0C6h,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #4D + Db 000h,000h,0C6h,0E6h,0F6h,0FEh,0DEh,0CEh,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #4E + Db 000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #4F + Db 000h,000h,0FCh,066h,066h,066h,07Ch,060h,060h,060h,060h,0F0h,000h,000h,000h,000h ; Hex #50 + Db 000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0D6h,0DEh,07Ch,00Ch,00Eh,000h,000h ; Hex #51 + Db 000h,000h,0FCh,066h,066h,066h,07Ch,06Ch,066h,066h,066h,0E6h,000h,000h,000h,000h ; Hex #52 + Db 000h,000h,07Ch,0C6h,0C6h,060h,038h,00Ch,006h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #53 + Db 000h,000h,07Eh,07Eh,05Ah,018h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #54 + Db 000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #55 + Db 000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,06Ch,038h,010h,000h,000h,000h,000h ; Hex #56 + Db 000h,000h,0C6h,0C6h,0C6h,0C6h,0D6h,0D6h,0D6h,0FEh,0EEh,06Ch,000h,000h,000h,000h ; Hex #57 + Db 000h,000h,0C6h,0C6h,06Ch,07Ch,038h,038h,07Ch,06Ch,0C6h,0C6h,000h,000h,000h,000h ; Hex #58 + Db 000h,000h,066h,066h,066h,066h,03Ch,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #59 + Db 000h,000h,0FEh,0C6h,086h,00Ch,018h,030h,060h,0C2h,0C6h,0FEh,000h,000h,000h,000h ; Hex #5A + Db 000h,000h,03Ch,030h,030h,030h,030h,030h,030h,030h,030h,03Ch,000h,000h,000h,000h ; Hex #5B + Db 000h,000h,000h,080h,0C0h,0E0h,070h,038h,01Ch,00Eh,006h,002h,000h,000h,000h,000h ; Hex #5C + Db 000h,000h,03Ch,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,03Ch,000h,000h,000h,000h ; Hex #5D + Db 010h,038h,06Ch,0C6h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #5E + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,0FFh,000h,000h ; Hex #5F + Db 000h,030h,018h,00Ch,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #60 + Db 000h,000h,000h,000h,000h,078h,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #61 + Db 000h,000h,0E0h,060h,060h,078h,06Ch,066h,066h,066h,066h,07Ch,000h,000h,000h,000h ; Hex #62 + Db 000h,000h,000h,000h,000h,07Ch,0C6h,0C0h,0C0h,0C0h,0C6h,07Ch,000h,000h,000h,000h ; Hex #63 + Db 000h,000h,01Ch,00Ch,00Ch,03Ch,06Ch,0CCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #64 + Db 000h,000h,000h,000h,000h,07Ch,0C6h,0FEh,0C0h,0C0h,0C6h,07Ch,000h,000h,000h,000h ; Hex #65 + Db 000h,000h,01Ch,036h,032h,030h,078h,030h,030h,030h,030h,078h,000h,000h,000h,000h ; Hex #66 + Db 000h,000h,000h,000h,000h,076h,0CCh,0CCh,0CCh,0CCh,0CCh,07Ch,00Ch,0CCh,078h,000h ; Hex #67 + Db 000h,000h,0E0h,060h,060h,06Ch,076h,066h,066h,066h,066h,0E6h,000h,000h,000h,000h ; Hex #68 + Db 000h,000h,018h,018h,000h,038h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #69 + Db 000h,000h,006h,006h,000h,00Eh,006h,006h,006h,006h,006h,006h,066h,066h,03Ch,000h ; Hex #6A + Db 000h,000h,0E0h,060h,060h,066h,06Ch,078h,078h,06Ch,066h,0E6h,000h,000h,000h,000h ; Hex #6B + Db 000h,000h,038h,018h,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #6C + Db 000h,000h,000h,000h,000h,0ECh,0FEh,0D6h,0D6h,0D6h,0D6h,0C6h,000h,000h,000h,000h ; Hex #6D + Db 000h,000h,000h,000h,000h,0DCh,066h,066h,066h,066h,066h,066h,000h,000h,000h,000h ; Hex #6E + Db 000h,000h,000h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #6F + Db 000h,000h,000h,000h,000h,0DCh,066h,066h,066h,066h,066h,07Ch,060h,060h,0F0h,000h ; Hex #70 + Db 000h,000h,000h,000h,000h,076h,0CCh,0CCh,0CCh,0CCh,0CCh,07Ch,00Ch,00Ch,01Eh,000h ; Hex #71 + Db 000h,000h,000h,000h,000h,0DCh,076h,066h,060h,060h,060h,0F0h,000h,000h,000h,000h ; Hex #72 + Db 000h,000h,000h,000h,000h,07Ch,0C6h,060h,038h,00Ch,0C6h,07Ch,000h,000h,000h,000h ; Hex #73 + Db 000h,000h,010h,030h,030h,0FCh,030h,030h,030h,030h,036h,01Ch,000h,000h,000h,000h ; Hex #74 + Db 000h,000h,000h,000h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #75 + Db 000h,000h,000h,000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,06Ch,038h,000h,000h,000h,000h ; Hex #76 + Db 000h,000h,000h,000h,000h,0C6h,0C6h,0D6h,0D6h,0D6h,0FEh,06Ch,000h,000h,000h,000h ; Hex #77 + Db 000h,000h,000h,000h,000h,0C6h,06Ch,038h,038h,038h,06Ch,0C6h,000h,000h,000h,000h ; Hex #78 + Db 000h,000h,000h,000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Eh,006h,00Ch,0F8h,000h ; Hex #79 + Db 000h,000h,000h,000h,000h,0FEh,0CCh,018h,030h,060h,0C6h,0FEh,000h,000h,000h,000h ; Hex #7A + Db 000h,000h,00Eh,018h,018h,018h,070h,018h,018h,018h,018h,00Eh,000h,000h,000h,000h ; Hex #7B + Db 000h,000h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,000h,000h,000h,000h ; Hex #7C + Db 000h,000h,070h,018h,018h,018h,00Eh,018h,018h,018h,018h,070h,000h,000h,000h,000h ; Hex #7D + Db 000h,076h,0DCh,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #7E + Db 000h,000h,000h,000h,010h,038h,06Ch,0C6h,0C6h,0C6h,0FEh,000h,000h,000h,000h,000h ; Hex #7F + Db 000h,000h,03Ch,066h,0C2h,0C0h,0C0h,0C0h,0C0h,0C2h,066h,03Ch,018h,070h,000h,000h ; Hex #80 + Db 000h,000h,0CCh,000h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #81 + Db 000h,00Ch,018h,030h,000h,07Ch,0C6h,0FEh,0C0h,0C0h,0C6h,07Ch,000h,000h,000h,000h ; Hex #82 + Db 000h,010h,038h,06Ch,000h,078h,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #83 + Db 000h,000h,0CCh,000h,000h,078h,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #84 + Db 000h,060h,030h,018h,000h,078h,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #85 + Db 000h,038h,06Ch,038h,000h,078h,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #86 + Db 000h,000h,000h,000h,000h,07Ch,0C6h,0C0h,0C0h,0C0h,0C6h,07Ch,018h,070h,000h,000h ; Hex #87 + Db 000h,010h,038h,06Ch,000h,07Ch,0C6h,0FEh,0C0h,0C0h,0C6h,07Ch,000h,000h,000h,000h ; Hex #88 + Db 000h,000h,0C6h,000h,000h,07Ch,0C6h,0FEh,0C0h,0C0h,0C6h,07Ch,000h,000h,000h,000h ; Hex #89 + Db 000h,060h,030h,018h,000h,07Ch,0C6h,0FEh,0C0h,0C0h,0C6h,07Ch,000h,000h,000h,000h ; Hex #8A + Db 000h,000h,066h,000h,000h,038h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #8B + Db 000h,018h,03Ch,066h,000h,038h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #8C + Db 000h,060h,030h,018h,000h,038h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #8D + Db 000h,0C6h,000h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #8E + Db 038h,06Ch,038h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #8F + Db 00Ch,018h,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h,000h,000h ; Hex #90 + Db 000h,000h,000h,000h,000h,0ECh,036h,036h,07Eh,0D8h,0D8h,06Eh,000h,000h,000h,000h ; Hex #91 + Db 000h,000h,03Eh,06Ch,0CCh,0CCh,0FEh,0CCh,0CCh,0CCh,0CCh,0CEh,000h,000h,000h,000h ; Hex #92 + Db 000h,010h,038h,06Ch,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #93 + Db 000h,000h,0C6h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #94 + Db 000h,060h,030h,018h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #95 + Db 000h,030h,078h,0CCh,000h,0CCh,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #96 + Db 000h,060h,030h,018h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #97 + Db 000h,000h,0C6h,000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Eh,006h,00Ch,078h,000h ; Hex #98 + Db 000h,0C6h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #99 + Db 000h,0C6h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #9A + Db 000h,000h,000h,000h,000h,07Ch,0CEh,0DEh,0F6h,0E6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #9B + Db 000h,038h,06Ch,064h,060h,0F0h,060h,060h,060h,060h,0E6h,0FCh,000h,000h,000h,000h ; Hex #9C + Db 000h,004h,07Ch,0CEh,0CEh,0D6h,0D6h,0D6h,0D6h,0E6h,0E6h,07Ch,040h,000h,000h,000h ; Hex #9D + Db 000h,000h,000h,000h,000h,0C6h,06Ch,038h,038h,06Ch,0C6h,000h,000h,000h,000h,000h ; Hex #9E + Db 000h,00Eh,01Bh,018h,018h,018h,07Eh,018h,018h,018h,0D8h,070h,000h,000h,000h,000h ; Hex #9F + Db 000h,018h,030h,060h,000h,078h,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #A0 + Db 000h,00Ch,018h,030h,000h,038h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #A1 + Db 000h,018h,030h,060h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #A2 + Db 000h,018h,030h,060h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #A3 + Db 000h,000h,076h,0DCh,000h,0DCh,066h,066h,066h,066h,066h,066h,000h,000h,000h,000h ; Hex #A4 + Db 076h,0DCh,000h,0C6h,0E6h,0F6h,0FEh,0DEh,0CEh,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #A5 + Db 000h,000h,03Ch,06Ch,06Ch,03Eh,000h,07Eh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #A6 + Db 000h,000h,038h,06Ch,06Ch,038h,000h,07Ch,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #A7 + Db 000h,000h,030h,030h,000h,030h,030h,060h,0C0h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #A8 + Db 000h,000h,07Ch,082h,0B2h,0AAh,0B2h,0AAh,0AAh,082h,07Ch,000h,000h,000h,000h,000h ; Hex #A9 + Db 000h,000h,000h,000h,000h,000h,0FEh,006h,006h,006h,006h,000h,000h,000h,000h,000h ; Hex #AA + Db 000h,060h,0E0h,062h,066h,06Ch,018h,030h,060h,0DCh,086h,00Ch,018h,03Eh,000h,000h ; Hex #AB + Db 000h,060h,0E0h,062h,066h,06Ch,018h,030h,066h,0CEh,09Ah,03Fh,006h,006h,000h,000h ; Hex #AC + Db 000h,000h,018h,018h,000h,018h,018h,018h,03Ch,03Ch,03Ch,018h,000h,000h,000h,000h ; Hex #AD + Db 000h,000h,000h,000h,000h,036h,06Ch,0D8h,06Ch,036h,000h,000h,000h,000h,000h,000h ; Hex #AE + Db 000h,000h,000h,000h,000h,0D8h,06Ch,036h,06Ch,0D8h,000h,000h,000h,000h,000h,000h ; Hex #AF + Db 011h,044h,011h,044h,011h,044h,011h,044h,011h,044h,011h,044h,011h,044h,011h,044h ; Hex #B0 + Db 055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh ; Hex #B1 + Db 0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h ; Hex #B2 + Db 018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B3 + Db 018h,018h,018h,018h,018h,018h,018h,0F8h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B4 + Db 060h,0C0h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #B5 + Db 07Ch,0C6h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #B6 + Db 00Ch,006h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #B7 + Db 000h,000h,07Ch,082h,09Ah,0A2h,0A2h,0A2h,09Ah,082h,07Ch,000h,000h,000h,000h,000h ; Hex #B8 + Db 036h,036h,036h,036h,036h,0F6h,006h,0F6h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #B9 + Db 036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #BA + Db 000h,000h,000h,000h,000h,0FEh,006h,0F6h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #BB + Db 036h,036h,036h,036h,036h,0F6h,006h,0FEh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #BC + Db 000h,000h,018h,018h,07Ch,0C6h,0C0h,0C0h,0C6h,07Ch,018h,018h,000h,000h,000h,000h ; Hex #BD + Db 000h,000h,000h,066h,066h,03Ch,018h,07Eh,018h,07Eh,018h,018h,000h,000h,000h,000h ; Hex #BE + Db 000h,000h,000h,000h,000h,000h,000h,0F8h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #BF + Db 018h,018h,018h,018h,018h,018h,018h,01Fh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #C0 + Db 018h,018h,018h,018h,018h,018h,018h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #C1 + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #C2 + Db 018h,018h,018h,018h,018h,018h,018h,01Fh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #C3 + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #C4 + Db 018h,018h,018h,018h,018h,018h,018h,0FFh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #C5 + Db 000h,000h,076h,0DCh,000h,078h,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #C6 + Db 076h,0DCh,000h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #C7 + Db 036h,036h,036h,036h,036h,037h,030h,03Fh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #C8 + Db 000h,000h,000h,000h,000h,03Fh,030h,037h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #C9 + Db 036h,036h,036h,036h,036h,0F7h,000h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #CA + Db 000h,000h,000h,000h,000h,0FFh,000h,0F7h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #CB + Db 036h,036h,036h,036h,036h,037h,030h,037h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #CC + Db 000h,000h,000h,000h,000h,0FFh,000h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #CD + Db 036h,036h,036h,036h,036h,0F7h,000h,0F7h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #CE + Db 000h,000h,000h,000h,0C6h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,0C6h,000h,000h,000h,000h ; Hex #CF + Db 000h,000h,034h,018h,02Ch,006h,03Eh,066h,066h,066h,066h,03Ch,000h,000h,000h,000h ; Hex #D0 + Db 000h,000h,0F8h,06Ch,066h,066h,0F6h,066h,066h,066h,06Ch,0F8h,000h,000h,000h,000h ; Hex #D1 + Db 038h,06Ch,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h,000h,000h ; Hex #D2 + Db 000h,0C6h,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h,000h,000h ; Hex #D3 + Db 030h,018h,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h,000h,000h ; Hex #D4 + Db 000h,000h,000h,000h,000h,038h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #D5 + Db 00Ch,018h,000h,03Ch,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #D6 + Db 03Ch,066h,000h,03Ch,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #D7 + Db 000h,066h,000h,03Ch,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #D8 + Db 018h,018h,018h,018h,018h,018h,018h,0F8h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #D9 + Db 000h,000h,000h,000h,000h,000h,000h,01Fh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #DA + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #DB + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #DC + Db 000h,018h,018h,018h,018h,018h,000h,000h,018h,018h,018h,018h,018h,000h,000h,000h ; Hex #DD + Db 030h,018h,000h,03Ch,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #DE + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #DF + Db 018h,030h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #E0 + Db 000h,000h,078h,0CCh,0CCh,0CCh,0D8h,0CCh,0C6h,0C6h,0C6h,0CCh,000h,000h,000h,000h ; Hex #E1 + Db 038h,06Ch,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #E2 + Db 030h,018h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #E3 + Db 000h,000h,076h,0DCh,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #E4 + Db 076h,0DCh,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #E5 + Db 000h,000h,000h,000h,000h,066h,066h,066h,066h,066h,066h,07Ch,060h,060h,0C0h,000h ; Hex #E6 + Db 000h,000h,0E0h,060h,060h,07Ch,066h,066h,066h,066h,066h,07Ch,060h,060h,0F0h,000h ; Hex #E7 + Db 000h,000h,0F0h,060h,07Ch,066h,066h,066h,066h,07Ch,060h,0F0h,000h,000h,000h,000h ; Hex #E8 + Db 018h,030h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #E9 + Db 038h,06Ch,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #EA + Db 030h,018h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #EB + Db 000h,00Ch,018h,030h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Eh,006h,00Ch,0F8h,000h ; Hex #EC + Db 00Ch,018h,000h,066h,066h,066h,066h,03Ch,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #ED + Db 000h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #EE + Db 000h,00Ch,018h,030h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #EF + Db 000h,000h,000h,000h,000h,000h,000h,0FEh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #F0 + Db 000h,000h,000h,000h,018h,018h,07Eh,018h,018h,000h,000h,07Eh,000h,000h,000h,000h ; Hex #F1 + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,0FFh,000h,0FFh,000h ; Hex #F2 + Db 000h,0E0h,030h,062h,036h,0ECh,018h,030h,066h,0CEh,09Ah,03Fh,006h,006h,000h,000h ; Hex #F3 + Db 000h,000h,07Fh,0DBh,0DBh,0DBh,07Bh,01Bh,01Bh,01Bh,01Bh,01Bh,000h,000h,000h,000h ; Hex #F4 + Db 000h,07Ch,0C6h,060h,038h,06Ch,0C6h,0C6h,06Ch,038h,00Ch,0C6h,07Ch,000h,000h,000h ; Hex #F5 + Db 000h,000h,000h,000h,000h,018h,000h,07Eh,000h,018h,000h,000h,000h,000h,000h,000h ; Hex #F6 + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,018h,00Ch,078h,000h,000h ; Hex #F7 + Db 000h,038h,06Ch,06Ch,038h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #F8 + Db 000h,0C6h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #F9 + Db 000h,000h,000h,000h,000h,000h,000h,018h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FA + Db 000h,018h,038h,018h,018h,018h,03Ch,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FB + Db 000h,07Ch,006h,03Ch,006h,006h,07Ch,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FC + Db 000h,03Ch,066h,00Ch,018h,032h,07Eh,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FD + Db 000h,000h,000h,000h,07Eh,07Eh,07Eh,07Eh,07Eh,07Eh,07Eh,000h,000h,000h,000h,000h ; Hex #FE + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FF + diff --git a/v4.0/src/DEV/DISPLAY/EGA/850-8X8.ASM b/v4.0/src/DEV/DISPLAY/EGA/850-8X8.ASM new file mode 100644 index 0000000..3470021 --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/EGA/850-8X8.ASM @@ -0,0 +1,270 @@ +;*************************************************** +; CHARACTER FONT FILE +; Source Assembler File +; +; CODE PAGE: 850 +; FONT RESOLUTION: 8 x 8 +; +; DATE CREATED:05-28-1987 +; +; +; Output file from: MULTIFON, Version 1A +; +;*************************************************** + Db 000h,000h,000h,000h,000h,000h,000h,000h ; Hex #0 + Db 07Eh,081h,0A5h,081h,0BDh,099h,081h,07Eh ; Hex #1 + Db 07Eh,0FFh,0DBh,0FFh,0C3h,0E7h,0FFh,07Eh ; Hex #2 + Db 06Ch,0FEh,0FEh,0FEh,07Ch,038h,010h,000h ; Hex #3 + Db 010h,038h,07Ch,0FEh,07Ch,038h,010h,000h ; Hex #4 + Db 038h,07Ch,038h,0FEh,0FEh,0D6h,010h,038h ; Hex #5 + Db 010h,038h,07Ch,0FEh,0FEh,07Ch,010h,038h ; Hex #6 + Db 000h,000h,018h,03Ch,03Ch,018h,000h,000h ; Hex #7 + Db 0FFh,0FFh,0E7h,0C3h,0C3h,0E7h,0FFh,0FFh ; Hex #8 + Db 000h,03Ch,066h,042h,042h,066h,03Ch,000h ; Hex #9 + Db 0FFh,0C3h,099h,0BDh,0BDh,099h,0C3h,0FFh ; Hex #A + Db 00Fh,007h,00Fh,07Dh,0CCh,0CCh,0CCh,078h ; Hex #B + Db 03Ch,066h,066h,066h,03Ch,018h,07Eh,018h ; Hex #C + Db 03Fh,033h,03Fh,030h,030h,070h,0F0h,0E0h ; Hex #D + Db 07Fh,063h,07Fh,063h,063h,067h,0E6h,0C0h ; Hex #E + Db 018h,0DBh,03Ch,0E7h,0E7h,03Ch,0DBh,018h ; Hex #F + Db 080h,0E0h,0F8h,0FEh,0F8h,0E0h,080h,000h ; Hex #10 + Db 002h,00Eh,03Eh,0FEh,03Eh,00Eh,002h,000h ; Hex #11 + Db 018h,03Ch,07Eh,018h,018h,07Eh,03Ch,018h ; Hex #12 + Db 066h,066h,066h,066h,066h,000h,066h,000h ; Hex #13 + Db 07Fh,0DBh,0DBh,07Bh,01Bh,01Bh,01Bh,000h ; Hex #14 + Db 03Eh,061h,03Ch,066h,066h,03Ch,086h,07Ch ; Hex #15 + Db 000h,000h,000h,000h,07Eh,07Eh,07Eh,000h ; Hex #16 + Db 018h,03Ch,07Eh,018h,07Eh,03Ch,018h,0FFh ; Hex #17 + Db 018h,03Ch,07Eh,018h,018h,018h,018h,000h ; Hex #18 + Db 018h,018h,018h,018h,07Eh,03Ch,018h,000h ; Hex #19 + Db 000h,018h,00Ch,0FEh,00Ch,018h,000h,000h ; Hex #1A + Db 000h,030h,060h,0FEh,060h,030h,000h,000h ; Hex #1B + Db 000h,000h,0C0h,0C0h,0C0h,0FEh,000h,000h ; Hex #1C + Db 000h,024h,066h,0FFh,066h,024h,000h,000h ; Hex #1D + Db 000h,018h,03Ch,07Eh,0FFh,0FFh,000h,000h ; Hex #1E + Db 000h,0FFh,0FFh,07Eh,03Ch,018h,000h,000h ; Hex #1F + Db 000h,000h,000h,000h,000h,000h,000h,000h ; Hex #20 + Db 018h,03Ch,03Ch,018h,018h,000h,018h,000h ; Hex #21 + Db 066h,066h,024h,000h,000h,000h,000h,000h ; Hex #22 + Db 06Ch,06Ch,0FEh,06Ch,0FEh,06Ch,06Ch,000h ; Hex #23 + Db 018h,03Eh,060h,03Ch,006h,07Ch,018h,000h ; Hex #24 + Db 000h,0C6h,0CCh,018h,030h,066h,0C6h,000h ; Hex #25 + Db 038h,06Ch,038h,076h,0DCh,0CCh,076h,000h ; Hex #26 + Db 018h,018h,030h,000h,000h,000h,000h,000h ; Hex #27 + Db 00Ch,018h,030h,030h,030h,018h,00Ch,000h ; Hex #28 + Db 030h,018h,00Ch,00Ch,00Ch,018h,030h,000h ; Hex #29 + Db 000h,066h,03Ch,0FFh,03Ch,066h,000h,000h ; Hex #2A + Db 000h,018h,018h,07Eh,018h,018h,000h,000h ; Hex #2B + Db 000h,000h,000h,000h,000h,018h,018h,030h ; Hex #2C + Db 000h,000h,000h,07Eh,000h,000h,000h,000h ; Hex #2D + Db 000h,000h,000h,000h,000h,018h,018h,000h ; Hex #2E + Db 006h,00Ch,018h,030h,060h,0C0h,080h,000h ; Hex #2F + Db 038h,06Ch,0C6h,0D6h,0C6h,06Ch,038h,000h ; Hex #30 + Db 018h,038h,018h,018h,018h,018h,07Eh,000h ; Hex #31 + Db 07Ch,0C6h,006h,01Ch,030h,066h,0FEh,000h ; Hex #32 + Db 07Ch,0C6h,006h,03Ch,006h,0C6h,07Ch,000h ; Hex #33 + Db 01Ch,03Ch,06Ch,0CCh,0FEh,00Ch,01Eh,000h ; Hex #34 + Db 0FEh,0C0h,0C0h,0FCh,006h,0C6h,07Ch,000h ; Hex #35 + Db 038h,060h,0C0h,0FCh,0C6h,0C6h,07Ch,000h ; Hex #36 + Db 0FEh,0C6h,00Ch,018h,030h,030h,030h,000h ; Hex #37 + Db 07Ch,0C6h,0C6h,07Ch,0C6h,0C6h,07Ch,000h ; Hex #38 + Db 07Ch,0C6h,0C6h,07Eh,006h,00Ch,078h,000h ; Hex #39 + Db 000h,018h,018h,000h,000h,018h,018h,000h ; Hex #3A + Db 000h,018h,018h,000h,000h,018h,018h,030h ; Hex #3B + Db 006h,00Ch,018h,030h,018h,00Ch,006h,000h ; Hex #3C + Db 000h,000h,07Eh,000h,000h,07Eh,000h,000h ; Hex #3D + Db 060h,030h,018h,00Ch,018h,030h,060h,000h ; Hex #3E + Db 07Ch,0C6h,00Ch,018h,018h,000h,018h,000h ; Hex #3F + Db 07Ch,0C6h,0DEh,0DEh,0DEh,0C0h,078h,000h ; Hex #40 + Db 038h,06Ch,0C6h,0FEh,0C6h,0C6h,0C6h,000h ; Hex #41 + Db 0FCh,066h,066h,07Ch,066h,066h,0FCh,000h ; Hex #42 + Db 03Ch,066h,0C0h,0C0h,0C0h,066h,03Ch,000h ; Hex #43 + Db 0F8h,06Ch,066h,066h,066h,06Ch,0F8h,000h ; Hex #44 + Db 0FEh,062h,068h,078h,068h,062h,0FEh,000h ; Hex #45 + Db 0FEh,062h,068h,078h,068h,060h,0F0h,000h ; Hex #46 + Db 03Ch,066h,0C0h,0C0h,0CEh,066h,03Ah,000h ; Hex #47 + Db 0C6h,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h ; Hex #48 + Db 03Ch,018h,018h,018h,018h,018h,03Ch,000h ; Hex #49 + Db 01Eh,00Ch,00Ch,00Ch,0CCh,0CCh,078h,000h ; Hex #4A + Db 0E6h,066h,06Ch,078h,06Ch,066h,0E6h,000h ; Hex #4B + Db 0F0h,060h,060h,060h,062h,066h,0FEh,000h ; Hex #4C + Db 0C6h,0EEh,0FEh,0FEh,0D6h,0C6h,0C6h,000h ; Hex #4D + Db 0C6h,0E6h,0F6h,0DEh,0CEh,0C6h,0C6h,000h ; Hex #4E + Db 07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h ; Hex #4F + Db 0FCh,066h,066h,07Ch,060h,060h,0F0h,000h ; Hex #50 + Db 07Ch,0C6h,0C6h,0C6h,0C6h,0CEh,07Ch,00Eh ; Hex #51 + Db 0FCh,066h,066h,07Ch,06Ch,066h,0E6h,000h ; Hex #52 + Db 03Ch,066h,030h,018h,00Ch,066h,03Ch,000h ; Hex #53 + Db 07Eh,07Eh,05Ah,018h,018h,018h,03Ch,000h ; Hex #54 + Db 0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h ; Hex #55 + Db 0C6h,0C6h,0C6h,0C6h,0C6h,06Ch,038h,000h ; Hex #56 + Db 0C6h,0C6h,0C6h,0D6h,0D6h,0FEh,06Ch,000h ; Hex #57 + Db 0C6h,0C6h,06Ch,038h,06Ch,0C6h,0C6h,000h ; Hex #58 + Db 066h,066h,066h,03Ch,018h,018h,03Ch,000h ; Hex #59 + Db 0FEh,0C6h,08Ch,018h,032h,066h,0FEh,000h ; Hex #5A + Db 03Ch,030h,030h,030h,030h,030h,03Ch,000h ; Hex #5B + Db 0C0h,060h,030h,018h,00Ch,006h,002h,000h ; Hex #5C + Db 03Ch,00Ch,00Ch,00Ch,00Ch,00Ch,03Ch,000h ; Hex #5D + Db 010h,038h,06Ch,0C6h,000h,000h,000h,000h ; Hex #5E + Db 000h,000h,000h,000h,000h,000h,000h,0FFh ; Hex #5F + Db 030h,018h,00Ch,000h,000h,000h,000h,000h ; Hex #60 + Db 000h,000h,078h,00Ch,07Ch,0CCh,076h,000h ; Hex #61 + Db 0E0h,060h,07Ch,066h,066h,066h,0DCh,000h ; Hex #62 + Db 000h,000h,07Ch,0C6h,0C0h,0C6h,07Ch,000h ; Hex #63 + Db 01Ch,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h ; Hex #64 + Db 000h,000h,07Ch,0C6h,0FEh,0C0h,07Ch,000h ; Hex #65 + Db 03Ch,066h,060h,0F8h,060h,060h,0F0h,000h ; Hex #66 + Db 000h,000h,076h,0CCh,0CCh,07Ch,00Ch,0F8h ; Hex #67 + Db 0E0h,060h,06Ch,076h,066h,066h,0E6h,000h ; Hex #68 + Db 018h,000h,038h,018h,018h,018h,03Ch,000h ; Hex #69 + Db 006h,000h,006h,006h,006h,066h,066h,03Ch ; Hex #6A + Db 0E0h,060h,066h,06Ch,078h,06Ch,0E6h,000h ; Hex #6B + Db 038h,018h,018h,018h,018h,018h,03Ch,000h ; Hex #6C + Db 000h,000h,0ECh,0FEh,0D6h,0D6h,0D6h,000h ; Hex #6D + Db 000h,000h,0DCh,066h,066h,066h,066h,000h ; Hex #6E + Db 000h,000h,07Ch,0C6h,0C6h,0C6h,07Ch,000h ; Hex #6F + Db 000h,000h,0DCh,066h,066h,07Ch,060h,0F0h ; Hex #70 + Db 000h,000h,076h,0CCh,0CCh,07Ch,00Ch,01Eh ; Hex #71 + Db 000h,000h,0DCh,076h,060h,060h,0F0h,000h ; Hex #72 + Db 000h,000h,07Eh,0C0h,07Ch,006h,0FCh,000h ; Hex #73 + Db 030h,030h,0FCh,030h,030h,036h,01Ch,000h ; Hex #74 + Db 000h,000h,0CCh,0CCh,0CCh,0CCh,076h,000h ; Hex #75 + Db 000h,000h,0C6h,0C6h,0C6h,06Ch,038h,000h ; Hex #76 + Db 000h,000h,0C6h,0D6h,0D6h,0FEh,06Ch,000h ; Hex #77 + Db 000h,000h,0C6h,06Ch,038h,06Ch,0C6h,000h ; Hex #78 + Db 000h,000h,0C6h,0C6h,0C6h,07Eh,006h,0FCh ; Hex #79 + Db 000h,000h,07Eh,04Ch,018h,032h,07Eh,000h ; Hex #7A + Db 00Eh,018h,018h,070h,018h,018h,00Eh,000h ; Hex #7B + Db 018h,018h,018h,018h,018h,018h,018h,000h ; Hex #7C + Db 070h,018h,018h,00Eh,018h,018h,070h,000h ; Hex #7D + Db 076h,0DCh,000h,000h,000h,000h,000h,000h ; Hex #7E + Db 000h,010h,038h,06Ch,0C6h,0C6h,0FEh,000h ; Hex #7F + Db 07Ch,0C6h,0C0h,0C0h,0C6h,07Ch,00Ch,078h ; Hex #80 + Db 0CCh,000h,0CCh,0CCh,0CCh,0CCh,076h,000h ; Hex #81 + Db 00Ch,018h,07Ch,0C6h,0FEh,0C0h,07Ch,000h ; Hex #82 + Db 07Ch,082h,078h,00Ch,07Ch,0CCh,076h,000h ; Hex #83 + Db 0C6h,000h,078h,00Ch,07Ch,0CCh,076h,000h ; Hex #84 + Db 030h,018h,078h,00Ch,07Ch,0CCh,076h,000h ; Hex #85 + Db 030h,030h,078h,00Ch,07Ch,0CCh,076h,000h ; Hex #86 + Db 000h,000h,07Eh,0C0h,0C0h,07Eh,00Ch,038h ; Hex #87 + Db 07Ch,082h,07Ch,0C6h,0FEh,0C0h,07Ch,000h ; Hex #88 + Db 0C6h,000h,07Ch,0C6h,0FEh,0C0h,07Ch,000h ; Hex #89 + Db 030h,018h,07Ch,0C6h,0FEh,0C0h,07Ch,000h ; Hex #8A + Db 066h,000h,038h,018h,018h,018h,03Ch,000h ; Hex #8B + Db 07Ch,082h,038h,018h,018h,018h,03Ch,000h ; Hex #8C + Db 030h,018h,000h,038h,018h,018h,03Ch,000h ; Hex #8D + Db 0C6h,038h,06Ch,0C6h,0FEh,0C6h,0C6h,000h ; Hex #8E + Db 038h,06Ch,07Ch,0C6h,0FEh,0C6h,0C6h,000h ; Hex #8F + Db 018h,030h,0FEh,0C0h,0F8h,0C0h,0FEh,000h ; Hex #90 + Db 000h,000h,07Eh,012h,0fEh,090h,0fEh,000h ; Hex #91 + Db 03Eh,06Ch,0CCh,0FEh,0CCh,0CCh,0CEh,000h ; Hex #92 + Db 07Ch,082h,07Ch,0C6h,0C6h,0C6h,07Ch,000h ; Hex #93 + Db 0C6h,000h,07Ch,0C6h,0C6h,0C6h,07Ch,000h ; Hex #94 + Db 030h,018h,07Ch,0C6h,0C6h,0C6h,07Ch,000h ; Hex #95 + Db 078h,084h,000h,0CCh,0CCh,0CCh,076h,000h ; Hex #96 + Db 060h,030h,0CCh,0CCh,0CCh,0CCh,076h,000h ; Hex #97 + Db 0C6h,000h,0C6h,0C6h,0C6h,07Eh,006h,0FCh ; Hex #98 + Db 0C6h,038h,06Ch,0C6h,0C6h,06Ch,038h,000h ; Hex #99 + Db 0C6h,000h,0C6h,0C6h,0C6h,0C6h,07Ch,000h ; Hex #9A + Db 000h,002h,07Ch,0CEh,0D6h,0E6h,07Ch,080h ; Hex #9B + Db 038h,06Ch,064h,0F0h,060h,066h,0FCh,000h ; Hex #9C + Db 03Ah,06Ch,0CEh,0D6h,0E6h,06Ch,0B8h,000h ; Hex #9D + Db 000h,0C6h,06Ch,038h,06Ch,0C6h,000h,000h ; Hex #9E + Db 00Eh,01Bh,018h,03Ch,018h,0D8h,070h,000h ; Hex #9F + Db 018h,030h,078h,00Ch,07Ch,0CCh,076h,000h ; Hex #A0 + Db 00Ch,018h,000h,038h,018h,018h,03Ch,000h ; Hex #A1 + Db 00Ch,018h,07Ch,0C6h,0C6h,0C6h,07Ch,000h ; Hex #A2 + Db 018h,030h,0CCh,0CCh,0CCh,0CCh,076h,000h ; Hex #A3 + Db 076h,0DCh,000h,0DCh,066h,066h,066h,000h ; Hex #A4 + Db 076h,0DCh,000h,0E6h,0F6h,0DEh,0CEh,000h ; Hex #A5 + Db 03Ch,06Ch,06Ch,03Eh,000h,07Eh,000h,000h ; Hex #A6 + Db 038h,06Ch,06Ch,038h,000h,07Ch,000h,000h ; Hex #A7 + Db 018h,000h,018h,018h,030h,063h,03Eh,000h ; Hex #A8 + Db 07Eh,081h,0B9h,0A5h,0B9h,0A5h,081h,07Eh ; Hex #A9 + Db 000h,000h,000h,0FEh,006h,006h,000h,000h ; Hex #AA + Db 063h,0E6h,06Ch,07Eh,033h,066h,0CCh,00Fh ; Hex #AB + Db 063h,0E6h,06Ch,07Ah,036h,06Ah,0DFh,006h ; Hex #AC + Db 018h,000h,018h,018h,03Ch,03Ch,018h,000h ; Hex #AD + Db 000h,033h,066h,0CCh,066h,033h,000h,000h ; Hex #AE + Db 000h,0CCh,066h,033h,066h,0CCh,000h,000h ; Hex #AF + Db 022h,088h,022h,088h,022h,088h,022h,088h ; Hex #B0 + Db 055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh ; Hex #B1 + Db 077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh ; Hex #B2 + Db 018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B3 + Db 018h,018h,018h,018h,0F8h,018h,018h,018h ; Hex #B4 + Db 030h,060h,038h,06Ch,0C6h,0FEh,0C6h,000h ; Hex #B5 + Db 07Ch,082h,038h,06Ch,0C6h,0FEh,0C6h,000h ; Hex #B6 + Db 018h,00Ch,038h,06Ch,0C6h,0FEh,0C6h,000h ; Hex #B7 + Db 07Eh,081h,09Dh,0A1h,0A1h,09Dh,081h,07Eh ; Hex #B8 + Db 036h,036h,0F6h,006h,0F6h,036h,036h,036h ; Hex #B9 + Db 036h,036h,036h,036h,036h,036h,036h,036h ; Hex #BA + Db 000h,000h,0FEh,006h,0F6h,036h,036h,036h ; Hex #BB + Db 036h,036h,0F6h,006h,0FEh,000h,000h,000h ; Hex #BC + Db 018h,018h,07Eh,0C0h,0C0h,07Eh,018h,018h ; Hex #BD + Db 066h,066h,03Ch,07Eh,018h,07Eh,018h,018h ; Hex #BE + Db 000h,000h,000h,000h,0F8h,018h,018h,018h ; Hex #BF + Db 018h,018h,018h,018h,01Fh,000h,000h,000h ; Hex #C0 + Db 018h,018h,018h,018h,0FFh,000h,000h,000h ; Hex #C1 + Db 000h,000h,000h,000h,0FFh,018h,018h,018h ; Hex #C2 + Db 018h,018h,018h,018h,01Fh,018h,018h,018h ; Hex #C3 + Db 000h,000h,000h,000h,0FFh,000h,000h,000h ; Hex #C4 + Db 018h,018h,018h,018h,0FFh,018h,018h,018h ; Hex #C5 + Db 076h,0DCh,07Ch,006h,07Eh,0C6h,07Eh,000h ; Hex #C6 + Db 076h,0DCh,038h,06Ch,0C6h,0FEh,0C6h,000h ; Hex #C7 + Db 036h,036h,037h,030h,03Fh,000h,000h,000h ; Hex #C8 + Db 000h,000h,03Fh,030h,037h,036h,036h,036h ; Hex #C9 + Db 036h,036h,0F7h,000h,0FFh,000h,000h,000h ; Hex #CA + Db 000h,000h,0FFh,000h,0F7h,036h,036h,036h ; Hex #CB + Db 036h,036h,037h,030h,037h,036h,036h,036h ; Hex #CC + Db 000h,000h,0FFh,000h,0FFh,000h,000h,000h ; Hex #CD + Db 036h,036h,0F7h,000h,0F7h,036h,036h,036h ; Hex #CE + Db 000h,0C6h,07Ch,0C6h,0C6h,07Ch,0C6h,000h ; Hex #CF + Db 030h,07Eh,00Ch,07Ch,0CCh,0CCh,078h,000h ; Hex #D0 + Db 0F8h,06Ch,066h,0F6h,066h,06Ch,0F8h,000h ; Hex #D1 + Db 07Ch,082h,0FEh,0C0h,0FCh,0C0h,0FEh,000h ; Hex #D2 + Db 0C6h,000h,0FEh,0C0h,0FCh,0C0h,0FEh,000h ; Hex #D3 + Db 030h,018h,0FEh,0C0h,0FCh,0C0h,0FEh,000h ; Hex #D4 + Db 000h,000h,038h,018h,018h,018h,03Ch,000h ; Hex #D5 + Db 00Ch,018h,03Ch,018h,018h,018h,03Ch,000h ; Hex #D6 + Db 03Ch,042h,03Ch,018h,018h,018h,03Ch,000h ; Hex #D7 + Db 066h,000h,03Ch,018h,018h,018h,03Ch,000h ; Hex #D8 + Db 018h,018h,018h,018h,0F8h,000h,000h,000h ; Hex #D9 + Db 000h,000h,000h,000h,01Fh,018h,018h,018h ; Hex #DA + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #DB + Db 000h,000h,000h,000h,0FFh,0FFh,0FFh,0FFh ; Hex #DC + Db 018h,018h,018h,000h,000h,018h,018h,018h ; Hex #DD + Db 030h,018h,03Ch,018h,018h,018h,03Ch,000h ; Hex #DE + Db 0FFh,0FFh,0FFh,0FFh,000h,000h,000h,000h ; Hex #DF + Db 030h,060h,038h,06Ch,0C6h,06Ch,038h,000h ; Hex #E0 + Db 078h,0CCh,0CCh,0D8h,0CCh,0C6h,0CCh,000h ; Hex #E1 + Db 07Ch,082h,038h,06Ch,0C6h,06Ch,038h,000h ; Hex #E2 + Db 00Ch,006h,038h,06Ch,0C6h,06Ch,038h,000h ; Hex #E3 + Db 076h,0DCh,07Ch,0C6h,0C6h,0C6h,07Ch,000h ; Hex #E4 + Db 076h,0DCh,038h,06Ch,0C6h,06Ch,038h,000h ; Hex #E5 + Db 000h,000h,066h,066h,066h,066h,07Ch,0C0h ; Hex #E6 + Db 0E0h,060h,07Ch,066h,066h,07Ch,060h,0F0h ; Hex #E7 + Db 0F0h,060h,07Ch,066h,07Ch,060h,0F0h,000h ; Hex #E8 + Db 018h,030h,0C6h,0C6h,0C6h,0C6h,07Ch,000h ; Hex #E9 + Db 07Ch,082h,000h,0C6h,0C6h,0C6h,07Ch,000h ; Hex #EA + Db 060h,030h,0C6h,0C6h,0C6h,0C6h,07Ch,000h ; Hex #EB + Db 018h,030h,0C6h,0C6h,0C6h,07Eh,006h,0FCh ; Hex #EC + Db 00Ch,018h,066h,066h,03Ch,018h,03Ch,000h ; Hex #ED + Db 0FFh,000h,000h,000h,000h,000h,000h,000h ; Hex #EE + Db 00Ch,018h,030h,000h,000h,000h,000h,000h ; Hex #EF + Db 000h,000h,000h,07Eh,000h,000h,000h,000h ; Hex #F0 + Db 018h,018h,07Eh,018h,018h,000h,07Eh,000h ; Hex #F1 + Db 000h,000h,000h,000h,000h,0FFh,000h,0FFh ; Hex #F2 + Db 0E1h,032h,0E4h,03Ah,0F6h,02Ah,05Fh,086h ; Hex #F3 + Db 07Fh,0DBh,0DBh,07Bh,01Bh,01Bh,01Bh,000h ; Hex #F4 + Db 03Eh,061h,03Ch,066h,066h,03Ch,086h,07Ch ; Hex #F5 + Db 000h,018h,000h,07Eh,000h,018h,000h,000h ; Hex #F6 + Db 000h,000h,000h,000h,000h,018h,00Ch,038h ; Hex #F7 + Db 038h,06Ch,06Ch,038h,000h,000h,000h,000h ; Hex #F8 + Db 000h,0C6h,000h,000h,000h,000h,000h,000h ; Hex #F9 + Db 000h,000h,000h,018h,000h,000h,000h,000h ; Hex #FA + Db 018h,038h,018h,018h,03Ch,000h,000h,000h ; Hex #FB + Db 078h,00Ch,038h,00Ch,078h,000h,000h,000h ; Hex #FC + Db 078h,00Ch,018h,030h,07Ch,000h,000h,000h ; Hex #FD + Db 000h,000h,03Ch,03Ch,03Ch,03Ch,000h,000h ; Hex #FE + Db 000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FF + diff --git a/v4.0/src/DEV/DISPLAY/EGA/850-CPI.ASM b/v4.0/src/DEV/DISPLAY/EGA/850-CPI.ASM new file mode 100644 index 0000000..d40a36c --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/EGA/850-CPI.ASM @@ -0,0 +1,49 @@ +CODE SEGMENT BYTE PUBLIC 'CODE' + ASSUME CS:CODE,DS:CODE + +IF1 + %OUT EGA.CPI creation file + %OUT . + %OUT CP SRC files: + %OUT . + %OUT . CODE PAGE: 850 +ENDIF + +EGA850: DW LEN_850 ; SIZE OF ENTRY HEADER + DW POST_EGA850,0 ; POINTER TO NEXT HEADER + DW 1 ; DEVICE TYPE + DB "EGA " ; DEVICE SUBTYPE ID + DW 850 ; CODE PAGE ID + DW 3 DUP(0) ; RESERVED + DW OFFSET DATA850,0 ; POINTER TO FONTS +LEN_850 EQU ($-EGA850) ; + ; +DATA850:DW 1 ; CART/NON-CART + DW 3 ; # OF FONTS + DW LEN_D850 ; LENGTH OF DATA +D850: ; + DB 16,8 ; CHARACTER BOX SIZE + DB 0,0 ; ASPECT RATIO (UNUSED) + DW 256 ; NUMBER OF CHARACTERS + ; + INCLUDE 850-8X16.ASM ; + ; + DB 14,8 ; CHARACTER BOX SIZE + DB 0,0 ; ASPECT RATIO (UNUSED) + DW 256 ; NUMBER OF CHARACTERS + ; + INCLUDE 850-8X14.ASM ; + ; + DB 8,8 ; CHARACTER BOX SIZE + DB 0,0 ; ASPECT RATIO (UNUSED) + DW 256 ; NUMBER OF CHARACTERS + ; + INCLUDE 850-8X8.ASM ; + ; +LEN_D850 EQU ($-D850) ; + ; +POST_EGA850 EQU $ ; + ; +CODE ENDS ; + END ; + \ No newline at end of file diff --git a/v4.0/src/DEV/DISPLAY/EGA/860-8X14.ASM b/v4.0/src/DEV/DISPLAY/EGA/860-8X14.ASM new file mode 100644 index 0000000..082874c --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/EGA/860-8X14.ASM @@ -0,0 +1,270 @@ +;*************************************************** +; CHARACTER FONT FILE +; Source Assembler File +; +; CODE PAGE: 860 +; FONT RESOLUTION: 8 x 14 +; +; DATE CREATED:05-28-1987 +; +; +; Output file from: MULTIFON, Version 1A +; +;*************************************************** + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #0 + Db 000h,000h,000h,07Eh,081h,0A5h,081h,081h,0BDh,099h,081h,07Eh,000h,000h ; Hex #1 + Db 000h,000h,000h,07Eh,0FFh,0DBh,0FFh,0FFh,0C3h,0E7h,0FFh,07Eh,000h,000h ; Hex #2 + Db 000h,000h,000h,000h,06Ch,0FEh,0FEh,0FEh,0FEh,07Ch,038h,010h,000h,000h ; Hex #3 + Db 000h,000h,000h,000h,010h,038h,07Ch,0FEh,07Ch,038h,010h,000h,000h,000h ; Hex #4 + Db 000h,000h,000h,018h,03Ch,03Ch,0E7h,0E7h,0E7h,018h,018h,03Ch,000h,000h ; Hex #5 + Db 000h,000h,000h,018h,03Ch,07Eh,0FFh,0FFh,07Eh,018h,018h,03Ch,000h,000h ; Hex #6 + Db 000h,000h,000h,000h,000h,000h,018h,03Ch,03Ch,018h,000h,000h,000h,000h ; Hex #7 + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0E7h,0C3h,0C3h,0E7h,0FFh,0FFh,0FFh,0FFh ; Hex #8 + Db 000h,000h,000h,000h,000h,03Ch,066h,042h,042h,066h,03Ch,000h,000h,000h ; Hex #9 + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0C3h,099h,0BDh,0BDh,099h,0C3h,0FFh,0FFh,0FFh ; Hex #A + Db 000h,000h,000h,01Eh,00Eh,01Ah,032h,078h,0CCh,0CCh,0CCh,078h,000h,000h ; Hex #B + Db 000h,000h,000h,03Ch,066h,066h,066h,03Ch,018h,07Eh,018h,018h,000h,000h ; Hex #C + Db 000h,000h,000h,03Fh,033h,03Fh,030h,030h,030h,070h,0F0h,0E0h,000h,000h ; Hex #D + Db 000h,000h,000h,07Fh,063h,07Fh,063h,063h,063h,067h,0E7h,0E6h,0C0h,000h ; Hex #E + Db 000h,000h,000h,018h,018h,0DBh,03Ch,0E7h,03Ch,0DBh,018h,018h,000h,000h ; Hex #F + Db 000h,000h,000h,080h,0C0h,0E0h,0F8h,0FEh,0F8h,0E0h,0C0h,080h,000h,000h ; Hex #10 + Db 000h,000h,000h,002h,006h,00Eh,03Eh,0FEh,03Eh,00Eh,006h,002h,000h,000h ; Hex #11 + Db 000h,000h,000h,018h,03Ch,07Eh,018h,018h,018h,07Eh,03Ch,018h,000h,000h ; Hex #12 + Db 000h,000h,000h,066h,066h,066h,066h,066h,066h,000h,066h,066h,000h,000h ; Hex #13 + Db 000h,000h,000h,07Fh,0DBh,0DBh,0DBh,07Bh,01Bh,01Bh,01Bh,01Bh,000h,000h ; Hex #14 + Db 000h,000h,07Ch,0C6h,060h,038h,06Ch,0C6h,0C6h,06Ch,038h,00Ch,0C6h,07Ch ; Hex #15 + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,0FEh,0FEh,0FEh,000h,000h ; Hex #16 + Db 000h,000h,000h,018h,03Ch,07Eh,018h,018h,018h,07Eh,03Ch,018h,07Eh,000h ; Hex #17 + Db 000h,000h,000h,018h,03Ch,07Eh,018h,018h,018h,018h,018h,018h,000h,000h ; Hex #18 + Db 000h,000h,000h,018h,018h,018h,018h,018h,018h,07Eh,03Ch,018h,000h,000h ; Hex #19 + Db 000h,000h,000h,000h,000h,018h,00Ch,0FEh,00Ch,018h,000h,000h,000h,000h ; Hex #1A + Db 000h,000h,000h,000h,000h,030h,060h,0FEh,060h,030h,000h,000h,000h,000h ; Hex #1B + Db 000h,000h,000h,000h,000h,000h,0C0h,0C0h,0C0h,0FEh,000h,000h,000h,000h ; Hex #1C + Db 000h,000h,000h,000h,000h,028h,06Ch,0FEh,06Ch,028h,000h,000h,000h,000h ; Hex #1D + Db 000h,000h,000h,000h,010h,038h,038h,07Ch,07Ch,0FEh,0FEh,000h,000h,000h ; Hex #1E + Db 000h,000h,000h,000h,0FEh,0FEh,07Ch,07Ch,038h,038h,010h,000h,000h,000h ; Hex #1F + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #20 + Db 000h,000h,000h,018h,03Ch,03Ch,03Ch,018h,018h,000h,018h,018h,000h,000h ; Hex #21 + Db 000h,066h,066h,066h,024h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #22 + Db 000h,000h,000h,06Ch,06Ch,0FEh,06Ch,06Ch,06Ch,0FEh,06Ch,06Ch,000h,000h ; Hex #23 + Db 000h,018h,018h,07Ch,0C6h,0C2h,0C0h,07Ch,006h,086h,0C6h,07Ch,018h,018h ; Hex #24 + Db 000h,000h,000h,000h,000h,0C2h,0C6h,00Ch,018h,030h,066h,0C6h,000h,000h ; Hex #25 + Db 000h,000h,000h,038h,06Ch,06Ch,038h,076h,0DCh,0CCh,0CCh,076h,000h,000h ; Hex #26 + Db 000h,018h,018h,018h,030h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #27 + Db 000h,000h,000h,00Ch,018h,030h,030h,030h,030h,030h,018h,00Ch,000h,000h ; Hex #28 + Db 000h,000h,000h,030h,018h,00Ch,00Ch,00Ch,00Ch,00Ch,018h,030h,000h,000h ; Hex #29 + Db 000h,000h,000h,000h,000h,066h,03Ch,0FFh,03Ch,066h,000h,000h,000h,000h ; Hex #2A + Db 000h,000h,000h,000h,000h,018h,018h,07Eh,018h,018h,000h,000h,000h,000h ; Hex #2B + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,018h,018h,018h,030h,000h ; Hex #2C + Db 000h,000h,000h,000h,000h,000h,000h,0FEh,000h,000h,000h,000h,000h,000h ; Hex #2D + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,018h,018h,000h,000h ; Hex #2E + Db 000h,000h,000h,002h,006h,00Ch,018h,030h,060h,0C0h,080h,000h,000h,000h ; Hex #2F + Db 000h,000h,000h,038h,06Ch,0C6h,0C6h,0D6h,0C6h,0C6h,06Ch,038h,000h,000h ; Hex #30 + Db 000h,000h,000h,018h,038h,078h,018h,018h,018h,018h,018h,07Eh,000h,000h ; Hex #31 + Db 000h,000h,000h,07Ch,0C6h,006h,00Ch,018h,030h,060h,0C6h,0FEh,000h,000h ; Hex #32 + Db 000h,000h,000h,07Ch,0C6h,006h,006h,03Ch,006h,006h,0C6h,07Ch,000h,000h ; Hex #33 + Db 000h,000h,000h,00Ch,01Ch,03Ch,06Ch,0CCh,0FEh,00Ch,00Ch,01Eh,000h,000h ; Hex #34 + Db 000h,000h,000h,0FEh,0C0h,0C0h,0C0h,0FCh,006h,006h,0C6h,07Ch,000h,000h ; Hex #35 + Db 000h,000h,000h,038h,060h,0C0h,0C0h,0FCh,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #36 + Db 000h,000h,000h,0FEh,0C6h,006h,00Ch,018h,030h,030h,030h,030h,000h,000h ; Hex #37 + Db 000h,000h,000h,07Ch,0C6h,0C6h,0C6h,07Ch,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #38 + Db 000h,000h,000h,07Ch,0C6h,0C6h,0C6h,07Eh,006h,006h,00Ch,078h,000h,000h ; Hex #39 + Db 000h,000h,000h,000h,018h,018h,000h,000h,000h,018h,018h,000h,000h,000h ; Hex #3A + Db 000h,000h,000h,000h,018h,018h,000h,000h,000h,018h,018h,030h,000h,000h ; Hex #3B + Db 000h,000h,000h,00Ch,018h,030h,060h,0C0h,060h,030h,018h,00Ch,000h,000h ; Hex #3C + Db 000h,000h,000h,000h,000h,000h,07Eh,000h,000h,07Eh,000h,000h,000h,000h ; Hex #3D + Db 000h,000h,000h,060h,030h,018h,00Ch,006h,00Ch,018h,030h,060h,000h,000h ; Hex #3E + Db 000h,000h,000h,07Ch,0C6h,0C6h,00Ch,018h,018h,000h,018h,018h,000h,000h ; Hex #3F + Db 000h,000h,000h,07Ch,0C6h,0C6h,0DEh,0DEh,0DEh,0DCh,0C0h,07Ch,000h,000h ; Hex #40 + Db 000h,000h,000h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h,000h ; Hex #41 + Db 000h,000h,000h,0FCh,066h,066h,066h,07Ch,066h,066h,066h,0FCh,000h,000h ; Hex #42 + Db 000h,000h,000h,03Ch,066h,0C2h,0C0h,0C0h,0C0h,0C2h,066h,03Ch,000h,000h ; Hex #43 + Db 000h,000h,000h,0F8h,06Ch,066h,066h,066h,066h,066h,06Ch,0F8h,000h,000h ; Hex #44 + Db 000h,000h,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h ; Hex #45 + Db 000h,000h,000h,0FEh,066h,062h,068h,078h,068h,060h,060h,0F0h,000h,000h ; Hex #46 + Db 000h,000h,000h,03Ch,066h,0C2h,0C0h,0C0h,0DEh,0C6h,066h,03Ah,000h,000h ; Hex #47 + Db 000h,000h,000h,0C6h,0C6h,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,0C6h,000h,000h ; Hex #48 + Db 000h,000h,000h,03Ch,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #49 + Db 000h,000h,000h,01Eh,00Ch,00Ch,00Ch,00Ch,00Ch,0CCh,0CCh,078h,000h,000h ; Hex #4A + Db 000h,000h,000h,0E6h,066h,06Ch,06Ch,078h,06Ch,06Ch,066h,0E6h,000h,000h ; Hex #4B + Db 000h,000h,000h,0F0h,060h,060h,060h,060h,060h,062h,066h,0FEh,000h,000h ; Hex #4C + Db 000h,000h,000h,0C6h,0EEh,0FEh,0D6h,0C6h,0C6h,0C6h,0C6h,0C6h,000h,000h ; Hex #4D + Db 000h,000h,000h,0C6h,0E6h,0F6h,0FEh,0DEh,0CEh,0C6h,0C6h,0C6h,000h,000h ; Hex #4E + Db 000h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #4F + Db 000h,000h,000h,0FCh,066h,066h,066h,07Ch,060h,060h,060h,0F0h,000h,000h ; Hex #50 + Db 000h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0D6h,0DEh,07Ch,00Eh,000h ; Hex #51 + Db 000h,000h,000h,0FCh,066h,066h,066h,07Ch,06Ch,066h,066h,0E6h,000h,000h ; Hex #52 + Db 000h,000h,000h,07Ch,0C6h,0C6h,060h,038h,00Ch,0C6h,0C6h,07Ch,000h,000h ; Hex #53 + Db 000h,000h,000h,07Eh,07Eh,05Ah,018h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #54 + Db 000h,000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #55 + Db 000h,000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,06Ch,038h,010h,000h,000h ; Hex #56 + Db 000h,000h,000h,0C6h,0C6h,0C6h,0C6h,0D6h,0D6h,0FEh,06Ch,06Ch,000h,000h ; Hex #57 + Db 000h,000h,000h,0C6h,0C6h,0C6h,07Ch,038h,07Ch,0C6h,0C6h,0C6h,000h,000h ; Hex #58 + Db 000h,000h,000h,066h,066h,066h,066h,03Ch,018h,018h,018h,03Ch,000h,000h ; Hex #59 + Db 000h,000h,000h,0FEh,0C6h,08Ch,018h,030h,060h,0C2h,0C6h,0FEh,000h,000h ; Hex #5A + Db 000h,000h,000h,03Ch,030h,030h,030h,030h,030h,030h,030h,03Ch,000h,000h ; Hex #5B + Db 000h,000h,000h,080h,0C0h,0E0h,070h,038h,01Ch,00Eh,006h,002h,000h,000h ; Hex #5C + Db 000h,000h,000h,03Ch,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,03Ch,000h,000h ; Hex #5D + Db 010h,038h,06Ch,0C6h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #5E + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,0FFh ; Hex #5F + Db 000h,030h,018h,00Ch,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #60 + Db 000h,000h,000h,000h,000h,000h,078h,00Ch,07Ch,0CCh,0CCh,076h,000h,000h ; Hex #61 + Db 000h,000h,000h,0E0h,060h,060h,078h,06Ch,066h,066h,066h,07Ch,000h,000h ; Hex #62 + Db 000h,000h,000h,000h,000h,000h,07Ch,0C6h,0C0h,0C0h,0C6h,07Ch,000h,000h ; Hex #63 + Db 000h,000h,000h,01Ch,00Ch,00Ch,03Ch,06Ch,0CCh,0CCh,0CCh,076h,000h,000h ; Hex #64 + Db 000h,000h,000h,000h,000h,000h,07Ch,0C6h,0FEh,0C0h,0C6h,07Ch,000h,000h ; Hex #65 + Db 000h,000h,000h,01Ch,036h,032h,030h,07Ch,030h,030h,030h,078h,000h,000h ; Hex #66 + Db 000h,000h,000h,000h,000h,000h,076h,0CCh,0CCh,0CCh,07Ch,00Ch,0CCh,078h ; Hex #67 + Db 000h,000h,000h,0E0h,060h,060h,06Ch,076h,066h,066h,066h,0E6h,000h,000h ; Hex #68 + Db 000h,000h,000h,018h,018h,000h,038h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #69 + Db 000h,000h,000h,006h,006h,000h,00Eh,006h,006h,006h,006h,066h,066h,03Ch ; Hex #6A + Db 000h,000h,000h,0E0h,060h,060h,066h,06Ch,078h,06Ch,066h,0E6h,000h,000h ; Hex #6B + Db 000h,000h,000h,038h,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #6C + Db 000h,000h,000h,000h,000h,000h,0ECh,0FEh,0D6h,0D6h,0D6h,0D6h,000h,000h ; Hex #6D + Db 000h,000h,000h,000h,000h,000h,0DCh,066h,066h,066h,066h,066h,000h,000h ; Hex #6E + Db 000h,000h,000h,000h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #6F + Db 000h,000h,000h,000h,000h,000h,0DCh,066h,066h,066h,07Ch,060h,060h,0F0h ; Hex #70 + Db 000h,000h,000h,000h,000h,000h,076h,0CCh,0CCh,0CCh,07Ch,00Ch,00Ch,01Eh ; Hex #71 + Db 000h,000h,000h,000h,000h,000h,0DCh,076h,066h,060h,060h,0F0h,000h,000h ; Hex #72 + Db 000h,000h,000h,000h,000h,000h,07Ch,0C6h,070h,01Ch,0C6h,07Ch,000h,000h ; Hex #73 + Db 000h,000h,000h,010h,030h,030h,0FCh,030h,030h,030h,036h,01Ch,000h,000h ; Hex #74 + Db 000h,000h,000h,000h,000h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h ; Hex #75 + Db 000h,000h,000h,000h,000h,000h,0C6h,0C6h,0C6h,06Ch,038h,010h,000h,000h ; Hex #76 + Db 000h,000h,000h,000h,000h,000h,0C6h,0C6h,0D6h,0D6h,0FEh,06Ch,000h,000h ; Hex #77 + Db 000h,000h,000h,000h,000h,000h,0C6h,06Ch,038h,038h,06Ch,0C6h,000h,000h ; Hex #78 + Db 000h,000h,000h,000h,000h,000h,0C6h,0C6h,0C6h,0C6h,07Eh,006h,00Ch,078h ; Hex #79 + Db 000h,000h,000h,000h,000h,000h,0FEh,0CCh,018h,030h,066h,0FEh,000h,000h ; Hex #7A + Db 000h,000h,000h,00Eh,018h,018h,018h,070h,018h,018h,018h,00Eh,000h,000h ; Hex #7B + Db 000h,000h,000h,018h,018h,018h,018h,018h,018h,018h,018h,018h,000h,000h ; Hex #7C + Db 000h,000h,000h,070h,018h,018h,018h,00Eh,018h,018h,018h,070h,000h,000h ; Hex #7D + Db 000h,076h,0DCh,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #7E + Db 000h,000h,000h,000h,000h,010h,038h,06Ch,0C6h,0C6h,0FEh,000h,000h,000h ; Hex #7F + Db 000h,000h,000h,03Ch,066h,0C2h,0C0h,0C0h,0C0h,0C2h,066h,03Ch,00Ch,078h ; Hex #80 + Db 000h,000h,000h,0CCh,000h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h ; Hex #81 + Db 000h,000h,00Ch,018h,030h,000h,07Ch,0C6h,0FEh,0C0h,0C6h,07Ch,000h,000h ; Hex #82 + Db 000h,000h,010h,038h,06Ch,000h,078h,00Ch,07Ch,0CCh,0CCh,076h,000h,000h ; Hex #83 + Db 000h,000h,000h,076h,0DCh,000h,078h,00Ch,07Ch,0CCh,0CCh,076h,000h,000h ; Hex #84 + Db 000h,000h,060h,030h,018h,000h,078h,00Ch,07Ch,0CCh,0CCh,076h,000h,000h ; Hex #85 + Db 030h,060h,0C0h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h,000h ; Hex #86 + Db 000h,000h,000h,000h,000h,000h,07Ch,0C6h,0C0h,0C0h,0C6h,07Ch,00Ch,078h ; Hex #87 + Db 000h,000h,010h,038h,06Ch,000h,07Ch,0C6h,0FEh,0C0h,0C6h,07Ch,000h,000h ; Hex #88 + Db 038h,06Ch,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h ; Hex #89 + Db 000h,000h,060h,030h,018h,000h,07Ch,0C6h,0FEh,0C0h,0C6h,07Ch,000h,000h ; Hex #8A + Db 00Ch,018h,000h,03Ch,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #8B + Db 038h,06Ch,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #8C + Db 000h,000h,060h,030h,018h,000h,038h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #8D + Db 076h,0DCh,000h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h,000h ; Hex #8E + Db 038h,06Ch,0C6h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h,000h ; Hex #8F + Db 00Ch,018h,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h ; Hex #90 + Db 018h,00Ch,006h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h,000h ; Hex #91 + Db 030h,018h,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h ; Hex #92 + Db 000h,000h,010h,038h,06Ch,000h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #93 + Db 000h,000h,000h,076h,0DCh,000h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #94 + Db 000h,000h,060h,030h,018h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #95 + Db 018h,030h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #96 + Db 000h,000h,060h,030h,018h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h ; Hex #97 + Db 030h,018h,000h,03Ch,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #98 + Db 076h,0DCh,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #99 + Db 000h,0C6h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #9A + Db 000h,000h,018h,018h,07Ch,0C6h,0C0h,0C0h,0C6h,07Ch,018h,018h,000h,000h ; Hex #9B + Db 000h,000h,038h,06Ch,064h,060h,0F0h,060h,060h,060h,0E6h,0FCh,000h,000h ; Hex #9C + Db 030h,018h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #9D + Db 000h,000h,0FCh,066h,066h,07Ch,062h,066h,06Fh,066h,066h,0F3h,000h,000h ; Hex #9E + Db 00Ch,018h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #9F + Db 000h,000h,00Ch,018h,030h,000h,078h,00Ch,07Ch,0CCh,0CCh,076h,000h,000h ; Hex #A0 + Db 000h,000h,00Ch,018h,030h,000h,038h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #A1 + Db 000h,000h,00Ch,018h,030h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #A2 + Db 000h,000h,00Ch,018h,030h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h ; Hex #A3 + Db 000h,000h,000h,076h,0DCh,000h,0DCh,066h,066h,066h,066h,066h,000h,000h ; Hex #A4 + Db 076h,0DCh,000h,0C6h,0E6h,0F6h,0FEh,0DEh,0CEh,0C6h,0C6h,0C6h,000h,000h ; Hex #A5 + Db 000h,000h,03Ch,06Ch,06Ch,03Eh,000h,07Eh,000h,000h,000h,000h,000h,000h ; Hex #A6 + Db 000h,000h,038h,06Ch,06Ch,038h,000h,07Ch,000h,000h,000h,000h,000h,000h ; Hex #A7 + Db 000h,000h,000h,030h,030h,000h,030h,030h,060h,0C6h,0C6h,07Ch,000h,000h ; Hex #A8 + Db 030h,018h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #A9 + Db 000h,000h,000h,000h,000h,000h,000h,0FEh,006h,006h,006h,000h,000h,000h ; Hex #AA + Db 000h,000h,060h,0E0h,063h,066h,06Ch,018h,030h,06Eh,0C3h,006h,00Ch,01Fh ; Hex #AB + Db 000h,000h,060h,0E0h,063h,066h,06Ch,01Ah,036h,06Eh,0DAh,03Fh,006h,006h ; Hex #AC + Db 000h,000h,000h,018h,018h,000h,018h,018h,03Ch,03Ch,03Ch,018h,000h,000h ; Hex #AD + Db 000h,000h,000h,000h,000h,036h,06Ch,0D8h,06Ch,036h,000h,000h,000h,000h ; Hex #AE + Db 000h,000h,000h,000h,000h,0D8h,06Ch,036h,06Ch,0D8h,000h,000h,000h,000h ; Hex #AF + Db 011h,044h,011h,044h,011h,044h,011h,044h,011h,044h,011h,044h,011h,044h ; Hex #B0 + Db 055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh ; Hex #B1 + Db 0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h ; Hex #B2 + Db 018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B3 + Db 018h,018h,018h,018h,018h,018h,018h,0F8h,018h,018h,018h,018h,018h,018h ; Hex #B4 + Db 018h,018h,018h,018h,018h,0F8h,018h,0F8h,018h,018h,018h,018h,018h,018h ; Hex #B5 + Db 036h,036h,036h,036h,036h,036h,036h,0F6h,036h,036h,036h,036h,036h,036h ; Hex #B6 + Db 000h,000h,000h,000h,000h,000h,000h,0FEh,036h,036h,036h,036h,036h,036h ; Hex #B7 + Db 000h,000h,000h,000h,000h,0F8h,018h,0F8h,018h,018h,018h,018h,018h,018h ; Hex #B8 + Db 036h,036h,036h,036h,036h,0F6h,006h,0F6h,036h,036h,036h,036h,036h,036h ; Hex #B9 + Db 036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #BA + Db 000h,000h,000h,000h,000h,0FEh,006h,0F6h,036h,036h,036h,036h,036h,036h ; Hex #BB + Db 036h,036h,036h,036h,036h,0F6h,006h,0FEh,000h,000h,000h,000h,000h,000h ; Hex #BC + Db 036h,036h,036h,036h,036h,036h,036h,0FEh,000h,000h,000h,000h,000h,000h ; Hex #BD + Db 018h,018h,018h,018h,018h,0F8h,018h,0F8h,000h,000h,000h,000h,000h,000h ; Hex #BE + Db 000h,000h,000h,000h,000h,000h,000h,0F8h,018h,018h,018h,018h,018h,018h ; Hex #BF + Db 018h,018h,018h,018h,018h,018h,018h,01Fh,000h,000h,000h,000h,000h,000h ; Hex #C0 + Db 018h,018h,018h,018h,018h,018h,018h,0FFh,000h,000h,000h,000h,000h,000h ; Hex #C1 + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,018h,018h,018h,018h,018h,018h ; Hex #C2 + Db 018h,018h,018h,018h,018h,018h,018h,01Fh,018h,018h,018h,018h,018h,018h ; Hex #C3 + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,000h,000h,000h,000h,000h,000h ; Hex #C4 + Db 018h,018h,018h,018h,018h,018h,018h,0FFh,018h,018h,018h,018h,018h,018h ; Hex #C5 + Db 018h,018h,018h,018h,018h,01Fh,018h,01Fh,018h,018h,018h,018h,018h,018h ; Hex #C6 + Db 036h,036h,036h,036h,036h,036h,036h,037h,036h,036h,036h,036h,036h,036h ; Hex #C7 + Db 036h,036h,036h,036h,036h,037h,030h,03Fh,000h,000h,000h,000h,000h,000h ; Hex #C8 + Db 000h,000h,000h,000h,000h,03Fh,030h,037h,036h,036h,036h,036h,036h,036h ; Hex #C9 + Db 036h,036h,036h,036h,036h,0F7h,000h,0FFh,000h,000h,000h,000h,000h,000h ; Hex #CA + Db 000h,000h,000h,000h,000h,0FFh,000h,0F7h,036h,036h,036h,036h,036h,036h ; Hex #CB + Db 036h,036h,036h,036h,036h,037h,030h,037h,036h,036h,036h,036h,036h,036h ; Hex #CC + Db 000h,000h,000h,000h,000h,0FFh,000h,0FFh,000h,000h,000h,000h,000h,000h ; Hex #CD + Db 036h,036h,036h,036h,036h,0F7h,000h,0F7h,036h,036h,036h,036h,036h,036h ; Hex #CE + Db 018h,018h,018h,018h,018h,0FFh,000h,0FFh,000h,000h,000h,000h,000h,000h ; Hex #CF + Db 036h,036h,036h,036h,036h,036h,036h,0FFh,000h,000h,000h,000h,000h,000h ; Hex #D0 + Db 000h,000h,000h,000h,000h,0FFh,000h,0FFh,018h,018h,018h,018h,018h,018h ; Hex #D1 + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,036h,036h,036h,036h,036h,036h ; Hex #D2 + Db 036h,036h,036h,036h,036h,036h,036h,03Fh,000h,000h,000h,000h,000h,000h ; Hex #D3 + Db 018h,018h,018h,018h,018h,01Fh,018h,01Fh,000h,000h,000h,000h,000h,000h ; Hex #D4 + Db 000h,000h,000h,000h,000h,01Fh,018h,01Fh,018h,018h,018h,018h,018h,018h ; Hex #D5 + Db 000h,000h,000h,000h,000h,000h,000h,03Fh,036h,036h,036h,036h,036h,036h ; Hex #D6 + Db 036h,036h,036h,036h,036h,036h,036h,0FFh,036h,036h,036h,036h,036h,036h ; Hex #D7 + Db 018h,018h,018h,018h,018h,0FFh,018h,0FFh,018h,018h,018h,018h,018h,018h ; Hex #D8 + Db 018h,018h,018h,018h,018h,018h,018h,0F8h,000h,000h,000h,000h,000h,000h ; Hex #D9 + Db 000h,000h,000h,000h,000h,000h,000h,01Fh,018h,018h,018h,018h,018h,018h ; Hex #DA + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #DB + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #DC + Db 0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h ; Hex #DD + Db 00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh ; Hex #DE + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,000h,000h,000h,000h,000h,000h,000h ; Hex #DF + Db 000h,000h,000h,000h,000h,000h,076h,0DCh,0D8h,0D8h,0DCh,076h,000h,000h ; Hex #E0 + Db 000h,000h,000h,078h,0CCh,0CCh,0CCh,0D8h,0CCh,0C6h,0C6h,0CCh,000h,000h ; Hex #E1 + Db 000h,000h,000h,0FEh,0C6h,0C6h,0C0h,0C0h,0C0h,0C0h,0C0h,0C0h,000h,000h ; Hex #E2 + Db 000h,000h,000h,000h,000h,000h,0FEh,06Ch,06Ch,06Ch,06Ch,06Ch,000h,000h ; Hex #E3 + Db 000h,000h,000h,0FEh,0C6h,060h,030h,018h,030h,060h,0C6h,0FEh,000h,000h ; Hex #E4 + Db 000h,000h,000h,000h,000h,000h,07Eh,0D8h,0D8h,0D8h,0D8h,070h,000h,000h ; Hex #E5 + Db 000h,000h,000h,000h,000h,000h,066h,066h,066h,066h,066h,07Ch,060h,0C0h ; Hex #E6 + Db 000h,000h,000h,000h,000h,076h,0DCh,018h,018h,018h,018h,018h,000h,000h ; Hex #E7 + Db 000h,000h,000h,07Eh,018h,03Ch,066h,066h,066h,03Ch,018h,07Eh,000h,000h ; Hex #E8 + Db 000h,000h,000h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,06Ch,038h,000h,000h ; Hex #E9 + Db 000h,000h,000h,038h,06Ch,0C6h,0C6h,0C6h,06Ch,06Ch,06Ch,0EEh,000h,000h ; Hex #EA + Db 000h,000h,000h,01Eh,030h,018h,00Ch,03Eh,066h,066h,066h,03Ch,000h,000h ; Hex #EB + Db 000h,000h,000h,000h,000h,000h,07Eh,0DBh,0DBh,07Eh,000h,000h,000h,000h ; Hex #EC + Db 000h,000h,000h,003h,006h,07Eh,0DBh,0DBh,0F3h,07Eh,060h,0C0h,000h,000h ; Hex #ED + Db 000h,000h,000h,01Eh,030h,060h,060h,07Eh,060h,060h,030h,01Eh,000h,000h ; Hex #EE + Db 000h,000h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,000h,000h ; Hex #EF + Db 000h,000h,000h,000h,0FEh,000h,000h,0FEh,000h,000h,0FEh,000h,000h,000h ; Hex #F0 + Db 000h,000h,000h,000h,018h,018h,07Eh,018h,018h,000h,000h,07Eh,000h,000h ; Hex #F1 + Db 000h,000h,000h,030h,018h,00Ch,006h,00Ch,018h,030h,000h,07Eh,000h,000h ; Hex #F2 + Db 000h,000h,000h,00Ch,018h,030h,060h,030h,018h,00Ch,000h,07Eh,000h,000h ; Hex #F3 + Db 000h,000h,00Eh,01Bh,01Bh,018h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #F4 + Db 018h,018h,018h,018h,018h,018h,018h,018h,0D8h,0D8h,070h,000h,000h,000h ; Hex #F5 + Db 000h,000h,000h,000h,000h,018h,000h,07Eh,000h,018h,000h,000h,000h,000h ; Hex #F6 + Db 000h,000h,000h,000h,000h,076h,0DCh,000h,076h,0DCh,000h,000h,000h,000h ; Hex #F7 + Db 000h,038h,06Ch,06Ch,038h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #F8 + Db 000h,000h,000h,000h,000h,000h,000h,018h,018h,000h,000h,000h,000h,000h ; Hex #F9 + Db 000h,000h,000h,000h,000h,000h,000h,018h,000h,000h,000h,000h,000h,000h ; Hex #FA + Db 000h,00Fh,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,0ECh,06Ch,03Ch,01Ch,000h,000h ; Hex #FB + Db 000h,06Ch,036h,036h,036h,036h,036h,000h,000h,000h,000h,000h,000h,000h ; Hex #FC + Db 000h,03Ch,066h,00Ch,018h,032h,07Eh,000h,000h,000h,000h,000h,000h,000h ; Hex #FD + Db 000h,000h,000h,000h,000h,07Eh,07Eh,07Eh,07Eh,07Eh,07Eh,000h,000h,000h ; Hex #FE + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FF + diff --git a/v4.0/src/DEV/DISPLAY/EGA/860-8X16.ASM b/v4.0/src/DEV/DISPLAY/EGA/860-8X16.ASM new file mode 100644 index 0000000..e14176c --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/EGA/860-8X16.ASM @@ -0,0 +1,270 @@ +;*************************************************** +; CHARACTER FONT FILE +; Source Assembler File +; +; CODE PAGE: 860 +; FONT RESOLUTION: 8 x 16 +; +; DATE CREATED:05-28-1987 +; +; +; Output file from: MULTIFON, Version 1A +; +;*************************************************** + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #0 + Db 000h,000h,07Eh,081h,0A5h,081h,081h,0BDh,099h,081h,081h,07Eh,000h,000h,000h,000h ; Hex #1 + Db 000h,000h,07Eh,0FFh,0DBh,0FFh,0FFh,0C3h,0E7h,0FFh,0FFh,07Eh,000h,000h,000h,000h ; Hex #2 + Db 000h,000h,000h,000h,06Ch,0FEh,0FEh,0FEh,0FEh,07Ch,038h,010h,000h,000h,000h,000h ; Hex #3 + Db 000h,000h,000h,000h,010h,038h,07Ch,0FEh,07Ch,038h,010h,000h,000h,000h,000h,000h ; Hex #4 + Db 000h,000h,000h,018h,03Ch,03Ch,0E7h,0E7h,0E7h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #5 + Db 000h,000h,000h,018h,03Ch,07Eh,0FFh,0FFh,07Eh,018h,018h,03Ch,000h,000h,000h,000h ; Hex #6 + Db 000h,000h,000h,000h,000h,000h,018h,03Ch,03Ch,018h,000h,000h,000h,000h,000h,000h ; Hex #7 + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0E7h,0C3h,0C3h,0E7h,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #8 + Db 000h,000h,000h,000h,000h,03Ch,066h,042h,042h,066h,03Ch,000h,000h,000h,000h,000h ; Hex #9 + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0C3h,099h,0BDh,0BDh,099h,0C3h,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #A + Db 000h,000h,01Eh,00Eh,01Ah,032h,078h,0CCh,0CCh,0CCh,0CCh,078h,000h,000h,000h,000h ; Hex #B + Db 000h,000h,03Ch,066h,066h,066h,066h,03Ch,018h,07Eh,018h,018h,000h,000h,000h,000h ; Hex #C + Db 000h,000h,03Fh,033h,03Fh,030h,030h,030h,030h,070h,0F0h,0E0h,000h,000h,000h,000h ; Hex #D + Db 000h,000h,07Fh,063h,07Fh,063h,063h,063h,063h,067h,0E7h,0E6h,0C0h,000h,000h,000h ; Hex #E + Db 000h,000h,000h,018h,018h,0DBh,03Ch,0E7h,03Ch,0DBh,018h,018h,000h,000h,000h,000h ; Hex #F + Db 000h,080h,0C0h,0E0h,0F0h,0F8h,0FEh,0F8h,0F0h,0E0h,0C0h,080h,000h,000h,000h,000h ; Hex #10 + Db 000h,002h,006h,00Eh,01Eh,03Eh,0FEh,03Eh,01Eh,00Eh,006h,002h,000h,000h,000h,000h ; Hex #11 + Db 000h,000h,018h,03Ch,07Eh,018h,018h,018h,07Eh,03Ch,018h,000h,000h,000h,000h,000h ; Hex #12 + Db 000h,000h,066h,066h,066h,066h,066h,066h,066h,000h,066h,066h,000h,000h,000h,000h ; Hex #13 + Db 000h,000h,07Fh,0DBh,0DBh,0DBh,07Bh,01Bh,01Bh,01Bh,01Bh,01Bh,000h,000h,000h,000h ; Hex #14 + Db 000h,07Ch,0C6h,060h,038h,06Ch,0C6h,0C6h,06Ch,038h,00Ch,0C6h,07Ch,000h,000h,000h ; Hex #15 + Db 000h,000h,000h,000h,000h,000h,000h,000h,0FEh,0FEh,0FEh,0FEh,000h,000h,000h,000h ; Hex #16 + Db 000h,000h,018h,03Ch,07Eh,018h,018h,018h,07Eh,03Ch,018h,07Eh,000h,000h,000h,000h ; Hex #17 + Db 000h,000h,018h,03Ch,07Eh,018h,018h,018h,018h,018h,018h,018h,000h,000h,000h,000h ; Hex #18 + Db 000h,000h,018h,018h,018h,018h,018h,018h,018h,07Eh,03Ch,018h,000h,000h,000h,000h ; Hex #19 + Db 000h,000h,000h,000h,000h,018h,00Ch,0FEh,00Ch,018h,000h,000h,000h,000h,000h,000h ; Hex #1A + Db 000h,000h,000h,000h,000h,030h,060h,0FEh,060h,030h,000h,000h,000h,000h,000h,000h ; Hex #1B + Db 000h,000h,000h,000h,000h,000h,0C0h,0C0h,0C0h,0FEh,000h,000h,000h,000h,000h,000h ; Hex #1C + Db 000h,000h,000h,000h,000h,028h,06Ch,0FEh,06Ch,028h,000h,000h,000h,000h,000h,000h ; Hex #1D + Db 000h,000h,000h,000h,010h,038h,038h,07Ch,07Ch,0FEh,0FEh,000h,000h,000h,000h,000h ; Hex #1E + Db 000h,000h,000h,000h,0FEh,0FEh,07Ch,07Ch,038h,038h,010h,000h,000h,000h,000h,000h ; Hex #1F + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #20 + Db 000h,000h,018h,03Ch,03Ch,03Ch,018h,018h,018h,000h,018h,018h,000h,000h,000h,000h ; Hex #21 + Db 000h,066h,066h,066h,024h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #22 + Db 000h,000h,000h,06Ch,06Ch,0FEh,06Ch,06Ch,06Ch,0FEh,06Ch,06Ch,000h,000h,000h,000h ; Hex #23 + Db 018h,018h,07Ch,0C6h,0C2h,0C0h,07Ch,006h,006h,086h,0C6h,07Ch,018h,018h,000h,000h ; Hex #24 + Db 000h,000h,000h,000h,0C2h,0C6h,00Ch,018h,030h,060h,0C6h,086h,000h,000h,000h,000h ; Hex #25 + Db 000h,000h,038h,06Ch,06Ch,038h,076h,0DCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #26 + Db 000h,030h,030h,030h,060h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #27 + Db 000h,000h,00Ch,018h,030h,030h,030h,030h,030h,030h,018h,00Ch,000h,000h,000h,000h ; Hex #28 + Db 000h,000h,030h,018h,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,018h,030h,000h,000h,000h,000h ; Hex #29 + Db 000h,000h,000h,000h,000h,066h,03Ch,0FFh,03Ch,066h,000h,000h,000h,000h,000h,000h ; Hex #2A + Db 000h,000h,000h,000h,000h,018h,018h,07Eh,018h,018h,000h,000h,000h,000h,000h,000h ; Hex #2B + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,018h,018h,018h,030h,000h,000h,000h ; Hex #2C + Db 000h,000h,000h,000h,000h,000h,000h,0FEh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #2D + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,018h,018h,000h,000h,000h,000h ; Hex #2E + Db 000h,000h,000h,000h,002h,006h,00Ch,018h,030h,060h,0C0h,080h,000h,000h,000h,000h ; Hex #2F + Db 000h,000h,038h,06Ch,0C6h,0C6h,0D6h,0D6h,0C6h,0C6h,06Ch,038h,000h,000h,000h,000h ; Hex #30 + Db 000h,000h,018h,038h,078h,018h,018h,018h,018h,018h,018h,07Eh,000h,000h,000h,000h ; Hex #31 + Db 000h,000h,07Ch,0C6h,006h,00Ch,018h,030h,060h,0C0h,0C6h,0FEh,000h,000h,000h,000h ; Hex #32 + Db 000h,000h,07Ch,0C6h,006h,006h,03Ch,006h,006h,006h,0C6h,07Ch,000h,000h,000h,000h ; Hex #33 + Db 000h,000h,00Ch,01Ch,03Ch,06Ch,0CCh,0FEh,00Ch,00Ch,00Ch,01Eh,000h,000h,000h,000h ; Hex #34 + Db 000h,000h,0FEh,0C0h,0C0h,0C0h,0FCh,006h,006h,006h,0C6h,07Ch,000h,000h,000h,000h ; Hex #35 + Db 000h,000h,038h,060h,0C0h,0C0h,0FCh,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #36 + Db 000h,000h,0FEh,0C6h,006h,006h,00Ch,018h,030h,030h,030h,030h,000h,000h,000h,000h ; Hex #37 + Db 000h,000h,07Ch,0C6h,0C6h,0C6h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #38 + Db 000h,000h,07Ch,0C6h,0C6h,0C6h,07Eh,006h,006h,006h,00Ch,078h,000h,000h,000h,000h ; Hex #39 + Db 000h,000h,000h,000h,018h,018h,000h,000h,000h,018h,018h,000h,000h,000h,000h,000h ; Hex #3A + Db 000h,000h,000h,000h,018h,018h,000h,000h,000h,018h,018h,030h,000h,000h,000h,000h ; Hex #3B + Db 000h,000h,000h,006h,00Ch,018h,030h,060h,030h,018h,00Ch,006h,000h,000h,000h,000h ; Hex #3C + Db 000h,000h,000h,000h,000h,07Eh,000h,000h,07Eh,000h,000h,000h,000h,000h,000h,000h ; Hex #3D + Db 000h,000h,000h,060h,030h,018h,00Ch,006h,00Ch,018h,030h,060h,000h,000h,000h,000h ; Hex #3E + Db 000h,000h,07Ch,0C6h,0C6h,00Ch,018h,018h,018h,000h,018h,018h,000h,000h,000h,000h ; Hex #3F + Db 000h,000h,000h,07Ch,0C6h,0C6h,0DEh,0DEh,0DEh,0DCh,0C0h,07Ch,000h,000h,000h,000h ; Hex #40 + Db 000h,000h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #41 + Db 000h,000h,0FCh,066h,066h,066h,07Ch,066h,066h,066h,066h,0FCh,000h,000h,000h,000h ; Hex #42 + Db 000h,000h,03Ch,066h,0C2h,0C0h,0C0h,0C0h,0C0h,0C2h,066h,03Ch,000h,000h,000h,000h ; Hex #43 + Db 000h,000h,0F8h,06Ch,066h,066h,066h,066h,066h,066h,06Ch,0F8h,000h,000h,000h,000h ; Hex #44 + Db 000h,000h,0FEh,066h,062h,068h,078h,068h,060h,062h,066h,0FEh,000h,000h,000h,000h ; Hex #45 + Db 000h,000h,0FEh,066h,062h,068h,078h,068h,060h,060h,060h,0F0h,000h,000h,000h,000h ; Hex #46 + Db 000h,000h,03Ch,066h,0C2h,0C0h,0C0h,0DEh,0C6h,0C6h,066h,03Ah,000h,000h,000h,000h ; Hex #47 + Db 000h,000h,0C6h,0C6h,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #48 + Db 000h,000h,03Ch,018h,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #49 + Db 000h,000h,01Eh,00Ch,00Ch,00Ch,00Ch,00Ch,0CCh,0CCh,0CCh,078h,000h,000h,000h,000h ; Hex #4A + Db 000h,000h,0E6h,066h,066h,06Ch,078h,078h,06Ch,066h,066h,0E6h,000h,000h,000h,000h ; Hex #4B + Db 000h,000h,0F0h,060h,060h,060h,060h,060h,060h,062h,066h,0FEh,000h,000h,000h,000h ; Hex #4C + Db 000h,000h,0C6h,0EEh,0FEh,0FEh,0D6h,0C6h,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #4D + Db 000h,000h,0C6h,0E6h,0F6h,0FEh,0DEh,0CEh,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #4E + Db 000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #4F + Db 000h,000h,0FCh,066h,066h,066h,07Ch,060h,060h,060h,060h,0F0h,000h,000h,000h,000h ; Hex #50 + Db 000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0D6h,0DEh,07Ch,00Ch,00Eh,000h,000h ; Hex #51 + Db 000h,000h,0FCh,066h,066h,066h,07Ch,06Ch,066h,066h,066h,0E6h,000h,000h,000h,000h ; Hex #52 + Db 000h,000h,07Ch,0C6h,0C6h,060h,038h,00Ch,006h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #53 + Db 000h,000h,07Eh,07Eh,05Ah,018h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #54 + Db 000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #55 + Db 000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,06Ch,038h,010h,000h,000h,000h,000h ; Hex #56 + Db 000h,000h,0C6h,0C6h,0C6h,0C6h,0D6h,0D6h,0D6h,0FEh,0EEh,06Ch,000h,000h,000h,000h ; Hex #57 + Db 000h,000h,0C6h,0C6h,06Ch,07Ch,038h,038h,07Ch,06Ch,0C6h,0C6h,000h,000h,000h,000h ; Hex #58 + Db 000h,000h,066h,066h,066h,066h,03Ch,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #59 + Db 000h,000h,0FEh,0C6h,086h,00Ch,018h,030h,060h,0C2h,0C6h,0FEh,000h,000h,000h,000h ; Hex #5A + Db 000h,000h,03Ch,030h,030h,030h,030h,030h,030h,030h,030h,03Ch,000h,000h,000h,000h ; Hex #5B + Db 000h,000h,000h,080h,0C0h,0E0h,070h,038h,01Ch,00Eh,006h,002h,000h,000h,000h,000h ; Hex #5C + Db 000h,000h,03Ch,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,03Ch,000h,000h,000h,000h ; Hex #5D + Db 010h,038h,06Ch,0C6h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #5E + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,0FFh,000h,000h ; Hex #5F + Db 000h,030h,018h,00Ch,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #60 + Db 000h,000h,000h,000h,000h,078h,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #61 + Db 000h,000h,0E0h,060h,060h,078h,06Ch,066h,066h,066h,066h,07Ch,000h,000h,000h,000h ; Hex #62 + Db 000h,000h,000h,000h,000h,07Ch,0C6h,0C0h,0C0h,0C0h,0C6h,07Ch,000h,000h,000h,000h ; Hex #63 + Db 000h,000h,01Ch,00Ch,00Ch,03Ch,06Ch,0CCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #64 + Db 000h,000h,000h,000h,000h,07Ch,0C6h,0FEh,0C0h,0C0h,0C6h,07Ch,000h,000h,000h,000h ; Hex #65 + Db 000h,000h,01Ch,036h,032h,030h,078h,030h,030h,030h,030h,078h,000h,000h,000h,000h ; Hex #66 + Db 000h,000h,000h,000h,000h,076h,0CCh,0CCh,0CCh,0CCh,0CCh,07Ch,00Ch,0CCh,078h,000h ; Hex #67 + Db 000h,000h,0E0h,060h,060h,06Ch,076h,066h,066h,066h,066h,0E6h,000h,000h,000h,000h ; Hex #68 + Db 000h,000h,018h,018h,000h,038h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #69 + Db 000h,000h,006h,006h,000h,00Eh,006h,006h,006h,006h,006h,006h,066h,066h,03Ch,000h ; Hex #6A + Db 000h,000h,0E0h,060h,060h,066h,06Ch,078h,078h,06Ch,066h,0E6h,000h,000h,000h,000h ; Hex #6B + Db 000h,000h,038h,018h,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #6C + Db 000h,000h,000h,000h,000h,0ECh,0FEh,0D6h,0D6h,0D6h,0D6h,0C6h,000h,000h,000h,000h ; Hex #6D + Db 000h,000h,000h,000h,000h,0DCh,066h,066h,066h,066h,066h,066h,000h,000h,000h,000h ; Hex #6E + Db 000h,000h,000h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #6F + Db 000h,000h,000h,000h,000h,0DCh,066h,066h,066h,066h,066h,07Ch,060h,060h,0F0h,000h ; Hex #70 + Db 000h,000h,000h,000h,000h,076h,0CCh,0CCh,0CCh,0CCh,0CCh,07Ch,00Ch,00Ch,01Eh,000h ; Hex #71 + Db 000h,000h,000h,000h,000h,0DCh,076h,066h,060h,060h,060h,0F0h,000h,000h,000h,000h ; Hex #72 + Db 000h,000h,000h,000h,000h,07Ch,0C6h,060h,038h,00Ch,0C6h,07Ch,000h,000h,000h,000h ; Hex #73 + Db 000h,000h,010h,030h,030h,0FCh,030h,030h,030h,030h,036h,01Ch,000h,000h,000h,000h ; Hex #74 + Db 000h,000h,000h,000h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #75 + Db 000h,000h,000h,000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,06Ch,038h,000h,000h,000h,000h ; Hex #76 + Db 000h,000h,000h,000h,000h,0C6h,0C6h,0D6h,0D6h,0D6h,0FEh,06Ch,000h,000h,000h,000h ; Hex #77 + Db 000h,000h,000h,000h,000h,0C6h,06Ch,038h,038h,038h,06Ch,0C6h,000h,000h,000h,000h ; Hex #78 + Db 000h,000h,000h,000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Eh,006h,00Ch,0F8h,000h ; Hex #79 + Db 000h,000h,000h,000h,000h,0FEh,0CCh,018h,030h,060h,0C6h,0FEh,000h,000h,000h,000h ; Hex #7A + Db 000h,000h,00Eh,018h,018h,018h,070h,018h,018h,018h,018h,00Eh,000h,000h,000h,000h ; Hex #7B + Db 000h,000h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,000h,000h,000h,000h ; Hex #7C + Db 000h,000h,070h,018h,018h,018h,00Eh,018h,018h,018h,018h,070h,000h,000h,000h,000h ; Hex #7D + Db 000h,076h,0DCh,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #7E + Db 000h,000h,000h,000h,010h,038h,06Ch,0C6h,0C6h,0C6h,0FEh,000h,000h,000h,000h,000h ; Hex #7F + Db 000h,000h,03Ch,066h,0C2h,0C0h,0C0h,0C0h,0C0h,0C2h,066h,03Ch,018h,070h,000h,000h ; Hex #80 + Db 000h,000h,0CCh,000h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #81 + Db 000h,00Ch,018h,030h,000h,07Ch,0C6h,0FEh,0C0h,0C0h,0C6h,07Ch,000h,000h,000h,000h ; Hex #82 + Db 000h,010h,038h,06Ch,000h,078h,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #83 + Db 000h,000h,076h,0DCh,000h,078h,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #84 + Db 000h,060h,030h,018h,000h,078h,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #85 + Db 060h,0C0h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #86 + Db 000h,000h,000h,000h,000h,07Ch,0C6h,0C0h,0C0h,0C0h,0C6h,07Ch,018h,070h,000h,000h ; Hex #87 + Db 000h,010h,038h,06Ch,000h,07Ch,0C6h,0FEh,0C0h,0C0h,0C6h,07Ch,000h,000h,000h,000h ; Hex #88 + Db 038h,06Ch,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h,000h,000h ; Hex #89 + Db 000h,060h,030h,018h,000h,07Ch,0C6h,0FEh,0C0h,0C0h,0C6h,07Ch,000h,000h,000h,000h ; Hex #8A + Db 00Ch,018h,000h,03Ch,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #8B + Db 038h,06Ch,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #8C + Db 000h,060h,030h,018h,000h,038h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #8D + Db 076h,0DCh,000h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #8E + Db 038h,06Ch,0C6h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #8F + Db 00Ch,018h,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h,000h,000h ; Hex #90 + Db 00Ch,006h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #91 + Db 030h,018h,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h,000h,000h ; Hex #92 + Db 000h,010h,038h,06Ch,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #93 + Db 000h,000h,076h,0DCh,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #94 + Db 000h,060h,030h,018h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #95 + Db 018h,030h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #96 + Db 000h,060h,030h,018h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #97 + Db 030h,018h,000h,03Ch,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #98 + Db 076h,0DCh,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #99 + Db 000h,0C6h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #9A + Db 000h,018h,018h,07Ch,0C6h,0C0h,0C0h,0C0h,0C6h,07Ch,018h,018h,000h,000h,000h,000h ; Hex #9B + Db 000h,038h,06Ch,064h,060h,0F0h,060h,060h,060h,060h,0E6h,0FCh,000h,000h,000h,000h ; Hex #9C + Db 030h,018h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #9D + Db 000h,0F8h,0CCh,0CCh,0F8h,0C4h,0CCh,0DEh,0CCh,0CCh,0CCh,0C6h,000h,000h,000h,000h ; Hex #9E + Db 018h,030h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #9F + Db 000h,018h,030h,060h,000h,078h,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #A0 + Db 000h,00Ch,018h,030h,000h,038h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #A1 + Db 000h,018h,030h,060h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #A2 + Db 000h,018h,030h,060h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #A3 + Db 000h,000h,076h,0DCh,000h,0DCh,066h,066h,066h,066h,066h,066h,000h,000h,000h,000h ; Hex #A4 + Db 076h,0DCh,000h,0C6h,0E6h,0F6h,0FEh,0DEh,0CEh,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #A5 + Db 000h,000h,03Ch,06Ch,06Ch,03Eh,000h,07Eh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #A6 + Db 000h,000h,038h,06Ch,06Ch,038h,000h,07Ch,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #A7 + Db 000h,000h,030h,030h,000h,030h,030h,060h,0C0h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #A8 + Db 030h,018h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #A9 + Db 000h,000h,000h,000h,000h,000h,0FEh,006h,006h,006h,006h,000h,000h,000h,000h,000h ; Hex #AA + Db 000h,060h,0E0h,062h,066h,06Ch,018h,030h,060h,0DCh,086h,00Ch,018h,03Eh,000h,000h ; Hex #AB + Db 000h,060h,0E0h,062h,066h,06Ch,018h,030h,066h,0CEh,09Ah,03Fh,006h,006h,000h,000h ; Hex #AC + Db 000h,000h,018h,018h,000h,018h,018h,018h,03Ch,03Ch,03Ch,018h,000h,000h,000h,000h ; Hex #AD + Db 000h,000h,000h,000h,000h,036h,06Ch,0D8h,06Ch,036h,000h,000h,000h,000h,000h,000h ; Hex #AE + Db 000h,000h,000h,000h,000h,0D8h,06Ch,036h,06Ch,0D8h,000h,000h,000h,000h,000h,000h ; Hex #AF + Db 011h,044h,011h,044h,011h,044h,011h,044h,011h,044h,011h,044h,011h,044h,011h,044h ; Hex #B0 + Db 055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh ; Hex #B1 + Db 0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h ; Hex #B2 + Db 018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B3 + Db 018h,018h,018h,018h,018h,018h,018h,0F8h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B4 + Db 018h,018h,018h,018h,018h,0F8h,018h,0F8h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B5 + Db 036h,036h,036h,036h,036h,036h,036h,0F6h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #B6 + Db 000h,000h,000h,000h,000h,000h,000h,0FEh,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #B7 + Db 000h,000h,000h,000h,000h,0F8h,018h,0F8h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B8 + Db 036h,036h,036h,036h,036h,0F6h,006h,0F6h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #B9 + Db 036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #BA + Db 000h,000h,000h,000h,000h,0FEh,006h,0F6h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #BB + Db 036h,036h,036h,036h,036h,0F6h,006h,0FEh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #BC + Db 036h,036h,036h,036h,036h,036h,036h,0FEh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #BD + Db 018h,018h,018h,018h,018h,0F8h,018h,0F8h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #BE + Db 000h,000h,000h,000h,000h,000h,000h,0F8h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #BF + Db 018h,018h,018h,018h,018h,018h,018h,01Fh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #C0 + Db 018h,018h,018h,018h,018h,018h,018h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #C1 + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #C2 + Db 018h,018h,018h,018h,018h,018h,018h,01Fh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #C3 + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #C4 + Db 018h,018h,018h,018h,018h,018h,018h,0FFh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #C5 + Db 018h,018h,018h,018h,018h,01Fh,018h,01Fh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #C6 + Db 036h,036h,036h,036h,036h,036h,036h,037h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #C7 + Db 036h,036h,036h,036h,036h,037h,030h,03Fh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #C8 + Db 000h,000h,000h,000h,000h,03Fh,030h,037h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #C9 + Db 036h,036h,036h,036h,036h,0F7h,000h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #CA + Db 000h,000h,000h,000h,000h,0FFh,000h,0F7h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #CB + Db 036h,036h,036h,036h,036h,037h,030h,037h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #CC + Db 000h,000h,000h,000h,000h,0FFh,000h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #CD + Db 036h,036h,036h,036h,036h,0F7h,000h,0F7h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #CE + Db 018h,018h,018h,018h,018h,0FFh,000h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #CF + Db 036h,036h,036h,036h,036h,036h,036h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #D0 + Db 000h,000h,000h,000h,000h,0FFh,000h,0FFh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #D1 + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #D2 + Db 036h,036h,036h,036h,036h,036h,036h,03Fh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #D3 + Db 018h,018h,018h,018h,018h,01Fh,018h,01Fh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #D4 + Db 000h,000h,000h,000h,000h,01Fh,018h,01Fh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #D5 + Db 000h,000h,000h,000h,000h,000h,000h,03Fh,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #D6 + Db 036h,036h,036h,036h,036h,036h,036h,0FFh,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #D7 + Db 018h,018h,018h,018h,018h,0FFh,018h,0FFh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #D8 + Db 018h,018h,018h,018h,018h,018h,018h,0F8h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #D9 + Db 000h,000h,000h,000h,000h,000h,000h,01Fh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #DA + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #DB + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #DC + Db 0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h ; Hex #DD + Db 00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh ; Hex #DE + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #DF + Db 000h,000h,000h,000h,000h,076h,0DCh,0D8h,0D8h,0D8h,0DCh,076h,000h,000h,000h,000h ; Hex #E0 + Db 000h,000h,078h,0CCh,0CCh,0CCh,0D8h,0CCh,0C6h,0C6h,0C6h,0CCh,000h,000h,000h,000h ; Hex #E1 + Db 000h,000h,0FEh,0C6h,0C6h,0C0h,0C0h,0C0h,0C0h,0C0h,0C0h,0C0h,000h,000h,000h,000h ; Hex #E2 + Db 000h,000h,000h,000h,000h,0FEh,06Ch,06Ch,06Ch,06Ch,06Ch,06Ch,000h,000h,000h,000h ; Hex #E3 + Db 000h,000h,0FEh,0C6h,060h,030h,018h,018h,030h,060h,0C6h,0FEh,000h,000h,000h,000h ; Hex #E4 + Db 000h,000h,000h,000h,000h,07Eh,0D8h,0D8h,0D8h,0D8h,0D8h,070h,000h,000h,000h,000h ; Hex #E5 + Db 000h,000h,000h,000h,000h,066h,066h,066h,066h,066h,066h,07Ch,060h,060h,0C0h,000h ; Hex #E6 + Db 000h,000h,000h,000h,076h,0DCh,018h,018h,018h,018h,018h,018h,000h,000h,000h,000h ; Hex #E7 + Db 000h,000h,07Eh,018h,03Ch,066h,066h,066h,066h,03Ch,018h,07Eh,000h,000h,000h,000h ; Hex #E8 + Db 000h,000h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,06Ch,038h,000h,000h,000h,000h ; Hex #E9 + Db 000h,000h,038h,06Ch,0C6h,0C6h,0C6h,06Ch,06Ch,06Ch,06Ch,0EEh,000h,000h,000h,000h ; Hex #EA + Db 000h,000h,01Eh,030h,018h,00Ch,03Eh,066h,066h,066h,066h,03Ch,000h,000h,000h,000h ; Hex #EB + Db 000h,000h,000h,000h,000h,07Eh,0DBh,0DBh,0DBh,07Eh,000h,000h,000h,000h,000h,000h ; Hex #EC + Db 000h,000h,000h,003h,006h,07Eh,0DBh,0DBh,0F3h,07Eh,060h,0C0h,000h,000h,000h,000h ; Hex #ED + Db 000h,000h,01Ch,030h,060h,060h,07Ch,060h,060h,060h,030h,01Ch,000h,000h,000h,000h ; Hex #EE + Db 000h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #EF + Db 000h,000h,000h,000h,0FEh,000h,000h,0FEh,000h,000h,0FEh,000h,000h,000h,000h,000h ; Hex #F0 + Db 000h,000h,000h,000h,018h,018h,07Eh,018h,018h,000h,000h,07Eh,000h,000h,000h,000h ; Hex #F1 + Db 000h,000h,000h,030h,018h,00Ch,006h,00Ch,018h,030h,000h,07Eh,000h,000h,000h,000h ; Hex #F2 + Db 000h,000h,000h,00Ch,018h,030h,060h,030h,018h,00Ch,000h,07Eh,000h,000h,000h,000h ; Hex #F3 + Db 000h,000h,00Eh,01Bh,01Bh,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #F4 + Db 018h,018h,018h,018h,018h,018h,018h,018h,018h,0D8h,0D8h,0D8h,070h,000h,000h,000h ; Hex #F5 + Db 000h,000h,000h,000h,000h,018h,000h,07Eh,000h,018h,000h,000h,000h,000h,000h,000h ; Hex #F6 + Db 000h,000h,000h,000h,000h,076h,0DCh,000h,076h,0DCh,000h,000h,000h,000h,000h,000h ; Hex #F7 + Db 000h,038h,06Ch,06Ch,038h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #F8 + Db 000h,000h,000h,000h,000h,000h,000h,018h,018h,000h,000h,000h,000h,000h,000h,000h ; Hex #F9 + Db 000h,000h,000h,000h,000h,000h,000h,018h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FA + Db 000h,00Fh,00Ch,00Ch,00Ch,00Ch,00Ch,0ECh,06Ch,06Ch,03Ch,01Ch,000h,000h,000h,000h ; Hex #FB + Db 000h,06Ch,036h,036h,036h,036h,036h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FC + Db 000h,03Ch,066h,00Ch,018h,032h,07Eh,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FD + Db 000h,000h,000h,000h,07Eh,07Eh,07Eh,07Eh,07Eh,07Eh,07Eh,000h,000h,000h,000h,000h ; Hex #FE + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FF + diff --git a/v4.0/src/DEV/DISPLAY/EGA/860-8X8.ASM b/v4.0/src/DEV/DISPLAY/EGA/860-8X8.ASM new file mode 100644 index 0000000..c6e1b72 --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/EGA/860-8X8.ASM @@ -0,0 +1,270 @@ +;*************************************************** +; CHARACTER FONT FILE +; Source Assembler File +; +; CODE PAGE: 860 +; FONT RESOLUTION: 8 x 8 +; +; DATE CREATED:05-28-1987 +; +; +; Output file from: MULTIFON, Version 1A +; +;*************************************************** + Db 000h,000h,000h,000h,000h,000h,000h,000h ; Hex #0 + Db 07Eh,081h,0A5h,081h,0BDh,099h,081h,07Eh ; Hex #1 + Db 07Eh,0FFh,0DBh,0FFh,0C3h,0E7h,0FFh,07Eh ; Hex #2 + Db 06Ch,0FEh,0FEh,0FEh,07Ch,038h,010h,000h ; Hex #3 + Db 010h,038h,07Ch,0FEh,07Ch,038h,010h,000h ; Hex #4 + Db 038h,07Ch,038h,0FEh,0FEh,0D6h,010h,038h ; Hex #5 + Db 010h,038h,07Ch,0FEh,0FEh,07Ch,010h,038h ; Hex #6 + Db 000h,000h,018h,03Ch,03Ch,018h,000h,000h ; Hex #7 + Db 0FFh,0FFh,0E7h,0C3h,0C3h,0E7h,0FFh,0FFh ; Hex #8 + Db 000h,03Ch,066h,042h,042h,066h,03Ch,000h ; Hex #9 + Db 0FFh,0C3h,099h,0BDh,0BDh,099h,0C3h,0FFh ; Hex #A + Db 00Fh,007h,00Fh,07Dh,0CCh,0CCh,0CCh,078h ; Hex #B + Db 03Ch,066h,066h,066h,03Ch,018h,07Eh,018h ; Hex #C + Db 03Fh,033h,03Fh,030h,030h,070h,0F0h,0E0h ; Hex #D + Db 07Fh,063h,07Fh,063h,063h,067h,0E6h,0C0h ; Hex #E + Db 018h,0DBh,03Ch,0E7h,0E7h,03Ch,0DBh,018h ; Hex #F + Db 080h,0E0h,0F8h,0FEh,0F8h,0E0h,080h,000h ; Hex #10 + Db 002h,00Eh,03Eh,0FEh,03Eh,00Eh,002h,000h ; Hex #11 + Db 018h,03Ch,07Eh,018h,018h,07Eh,03Ch,018h ; Hex #12 + Db 066h,066h,066h,066h,066h,000h,066h,000h ; Hex #13 + Db 07Fh,0DBh,0DBh,07Bh,01Bh,01Bh,01Bh,000h ; Hex #14 + Db 03Eh,061h,03Ch,066h,066h,03Ch,086h,07Ch ; Hex #15 + Db 000h,000h,000h,000h,07Eh,07Eh,07Eh,000h ; Hex #16 + Db 018h,03Ch,07Eh,018h,07Eh,03Ch,018h,0FFh ; Hex #17 + Db 018h,03Ch,07Eh,018h,018h,018h,018h,000h ; Hex #18 + Db 018h,018h,018h,018h,07Eh,03Ch,018h,000h ; Hex #19 + Db 000h,018h,00Ch,0FEh,00Ch,018h,000h,000h ; Hex #1A + Db 000h,030h,060h,0FEh,060h,030h,000h,000h ; Hex #1B + Db 000h,000h,0C0h,0C0h,0C0h,0FEh,000h,000h ; Hex #1C + Db 000h,024h,066h,0FFh,066h,024h,000h,000h ; Hex #1D + Db 000h,018h,03Ch,07Eh,0FFh,0FFh,000h,000h ; Hex #1E + Db 000h,0FFh,0FFh,07Eh,03Ch,018h,000h,000h ; Hex #1F + Db 000h,000h,000h,000h,000h,000h,000h,000h ; Hex #20 + Db 018h,03Ch,03Ch,018h,018h,000h,018h,000h ; Hex #21 + Db 066h,066h,024h,000h,000h,000h,000h,000h ; Hex #22 + Db 06Ch,06Ch,0FEh,06Ch,0FEh,06Ch,06Ch,000h ; Hex #23 + Db 018h,03Eh,060h,03Ch,006h,07Ch,018h,000h ; Hex #24 + Db 000h,0C6h,0CCh,018h,030h,066h,0C6h,000h ; Hex #25 + Db 038h,06Ch,038h,076h,0DCh,0CCh,076h,000h ; Hex #26 + Db 018h,018h,030h,000h,000h,000h,000h,000h ; Hex #27 + Db 00Ch,018h,030h,030h,030h,018h,00Ch,000h ; Hex #28 + Db 030h,018h,00Ch,00Ch,00Ch,018h,030h,000h ; Hex #29 + Db 000h,066h,03Ch,0FFh,03Ch,066h,000h,000h ; Hex #2A + Db 000h,018h,018h,07Eh,018h,018h,000h,000h ; Hex #2B + Db 000h,000h,000h,000h,000h,018h,018h,030h ; Hex #2C + Db 000h,000h,000h,07Eh,000h,000h,000h,000h ; Hex #2D + Db 000h,000h,000h,000h,000h,018h,018h,000h ; Hex #2E + Db 006h,00Ch,018h,030h,060h,0C0h,080h,000h ; Hex #2F + Db 038h,06Ch,0C6h,0D6h,0C6h,06Ch,038h,000h ; Hex #30 + Db 018h,038h,018h,018h,018h,018h,07Eh,000h ; Hex #31 + Db 07Ch,0C6h,006h,01Ch,030h,066h,0FEh,000h ; Hex #32 + Db 07Ch,0C6h,006h,03Ch,006h,0C6h,07Ch,000h ; Hex #33 + Db 01Ch,03Ch,06Ch,0CCh,0FEh,00Ch,01Eh,000h ; Hex #34 + Db 0FEh,0C0h,0C0h,0FCh,006h,0C6h,07Ch,000h ; Hex #35 + Db 038h,060h,0C0h,0FCh,0C6h,0C6h,07Ch,000h ; Hex #36 + Db 0FEh,0C6h,00Ch,018h,030h,030h,030h,000h ; Hex #37 + Db 07Ch,0C6h,0C6h,07Ch,0C6h,0C6h,07Ch,000h ; Hex #38 + Db 07Ch,0C6h,0C6h,07Eh,006h,00Ch,078h,000h ; Hex #39 + Db 000h,018h,018h,000h,000h,018h,018h,000h ; Hex #3A + Db 000h,018h,018h,000h,000h,018h,018h,030h ; Hex #3B + Db 006h,00Ch,018h,030h,018h,00Ch,006h,000h ; Hex #3C + Db 000h,000h,07Eh,000h,000h,07Eh,000h,000h ; Hex #3D + Db 060h,030h,018h,00Ch,018h,030h,060h,000h ; Hex #3E + Db 07Ch,0C6h,00Ch,018h,018h,000h,018h,000h ; Hex #3F + Db 07Ch,0C6h,0DEh,0DEh,0DEh,0C0h,078h,000h ; Hex #40 + Db 038h,06Ch,0C6h,0FEh,0C6h,0C6h,0C6h,000h ; Hex #41 + Db 0FCh,066h,066h,07Ch,066h,066h,0FCh,000h ; Hex #42 + Db 03Ch,066h,0C0h,0C0h,0C0h,066h,03Ch,000h ; Hex #43 + Db 0F8h,06Ch,066h,066h,066h,06Ch,0F8h,000h ; Hex #44 + Db 0FEh,062h,068h,078h,068h,062h,0FEh,000h ; Hex #45 + Db 0FEh,062h,068h,078h,068h,060h,0F0h,000h ; Hex #46 + Db 03Ch,066h,0C0h,0C0h,0CEh,066h,03Ah,000h ; Hex #47 + Db 0C6h,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h ; Hex #48 + Db 03Ch,018h,018h,018h,018h,018h,03Ch,000h ; Hex #49 + Db 01Eh,00Ch,00Ch,00Ch,0CCh,0CCh,078h,000h ; Hex #4A + Db 0E6h,066h,06Ch,078h,06Ch,066h,0E6h,000h ; Hex #4B + Db 0F0h,060h,060h,060h,062h,066h,0FEh,000h ; Hex #4C + Db 0C6h,0EEh,0FEh,0FEh,0D6h,0C6h,0C6h,000h ; Hex #4D + Db 0C6h,0E6h,0F6h,0DEh,0CEh,0C6h,0C6h,000h ; Hex #4E + Db 07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h ; Hex #4F + Db 0FCh,066h,066h,07Ch,060h,060h,0F0h,000h ; Hex #50 + Db 07Ch,0C6h,0C6h,0C6h,0C6h,0CEh,07Ch,00Eh ; Hex #51 + Db 0FCh,066h,066h,07Ch,06Ch,066h,0E6h,000h ; Hex #52 + Db 03Ch,066h,030h,018h,00Ch,066h,03Ch,000h ; Hex #53 + Db 07Eh,07Eh,05Ah,018h,018h,018h,03Ch,000h ; Hex #54 + Db 0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h ; Hex #55 + Db 0C6h,0C6h,0C6h,0C6h,0C6h,06Ch,038h,000h ; Hex #56 + Db 0C6h,0C6h,0C6h,0D6h,0D6h,0FEh,06Ch,000h ; Hex #57 + Db 0C6h,0C6h,06Ch,038h,06Ch,0C6h,0C6h,000h ; Hex #58 + Db 066h,066h,066h,03Ch,018h,018h,03Ch,000h ; Hex #59 + Db 0FEh,0C6h,08Ch,018h,032h,066h,0FEh,000h ; Hex #5A + Db 03Ch,030h,030h,030h,030h,030h,03Ch,000h ; Hex #5B + Db 0C0h,060h,030h,018h,00Ch,006h,002h,000h ; Hex #5C + Db 03Ch,00Ch,00Ch,00Ch,00Ch,00Ch,03Ch,000h ; Hex #5D + Db 010h,038h,06Ch,0C6h,000h,000h,000h,000h ; Hex #5E + Db 000h,000h,000h,000h,000h,000h,000h,0FFh ; Hex #5F + Db 030h,018h,00Ch,000h,000h,000h,000h,000h ; Hex #60 + Db 000h,000h,078h,00Ch,07Ch,0CCh,076h,000h ; Hex #61 + Db 0E0h,060h,07Ch,066h,066h,066h,0DCh,000h ; Hex #62 + Db 000h,000h,07Ch,0C6h,0C0h,0C6h,07Ch,000h ; Hex #63 + Db 01Ch,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h ; Hex #64 + Db 000h,000h,07Ch,0C6h,0FEh,0C0h,07Ch,000h ; Hex #65 + Db 03Ch,066h,060h,0F8h,060h,060h,0F0h,000h ; Hex #66 + Db 000h,000h,076h,0CCh,0CCh,07Ch,00Ch,0F8h ; Hex #67 + Db 0E0h,060h,06Ch,076h,066h,066h,0E6h,000h ; Hex #68 + Db 018h,000h,038h,018h,018h,018h,03Ch,000h ; Hex #69 + Db 006h,000h,006h,006h,006h,066h,066h,03Ch ; Hex #6A + Db 0E0h,060h,066h,06Ch,078h,06Ch,0E6h,000h ; Hex #6B + Db 038h,018h,018h,018h,018h,018h,03Ch,000h ; Hex #6C + Db 000h,000h,0ECh,0FEh,0D6h,0D6h,0D6h,000h ; Hex #6D + Db 000h,000h,0DCh,066h,066h,066h,066h,000h ; Hex #6E + Db 000h,000h,07Ch,0C6h,0C6h,0C6h,07Ch,000h ; Hex #6F + Db 000h,000h,0DCh,066h,066h,07Ch,060h,0F0h ; Hex #70 + Db 000h,000h,076h,0CCh,0CCh,07Ch,00Ch,01Eh ; Hex #71 + Db 000h,000h,0DCh,076h,060h,060h,0F0h,000h ; Hex #72 + Db 000h,000h,07Eh,0C0h,07Ch,006h,0FCh,000h ; Hex #73 + Db 030h,030h,0FCh,030h,030h,036h,01Ch,000h ; Hex #74 + Db 000h,000h,0CCh,0CCh,0CCh,0CCh,076h,000h ; Hex #75 + Db 000h,000h,0C6h,0C6h,0C6h,06Ch,038h,000h ; Hex #76 + Db 000h,000h,0C6h,0D6h,0D6h,0FEh,06Ch,000h ; Hex #77 + Db 000h,000h,0C6h,06Ch,038h,06Ch,0C6h,000h ; Hex #78 + Db 000h,000h,0C6h,0C6h,0C6h,07Eh,006h,0FCh ; Hex #79 + Db 000h,000h,07Eh,04Ch,018h,032h,07Eh,000h ; Hex #7A + Db 00Eh,018h,018h,070h,018h,018h,00Eh,000h ; Hex #7B + Db 018h,018h,018h,018h,018h,018h,018h,000h ; Hex #7C + Db 070h,018h,018h,00Eh,018h,018h,070h,000h ; Hex #7D + Db 076h,0DCh,000h,000h,000h,000h,000h,000h ; Hex #7E + Db 000h,010h,038h,06Ch,0C6h,0C6h,0FEh,000h ; Hex #7F + Db 07Ch,0C6h,0C0h,0C0h,0C6h,07Ch,00Ch,078h ; Hex #80 + Db 0CCh,000h,0CCh,0CCh,0CCh,0CCh,076h,000h ; Hex #81 + Db 00Ch,018h,07Ch,0C6h,0FEh,0C0h,07Ch,000h ; Hex #82 + Db 07Ch,082h,078h,00Ch,07Ch,0CCh,076h,000h ; Hex #83 + Db 076h,0DCh,078h,00Ch,07Ch,0CCh,076h,000h ; Hex #84 + Db 030h,018h,078h,00Ch,07Ch,0CCh,076h,000h ; Hex #85 + Db 030h,060h,038h,06Ch,0C6h,0FEh,0C6h,000h ; Hex #86 + Db 000h,000h,07Eh,0C0h,0C0h,07Eh,00Ch,038h ; Hex #87 + Db 07Ch,082h,07Ch,0C6h,0FEh,0C0h,07Ch,000h ; Hex #88 + Db 07Ch,082h,0FEh,0C0h,0F8h,0C0h,0FEh,000h ; Hex #89 + Db 030h,018h,07Ch,0C6h,0FEh,0C0h,07Ch,000h ; Hex #8A + Db 00Ch,018h,03Ch,018h,018h,018h,03Ch,000h ; Hex #8B + Db 07Ch,082h,038h,06Ch,0C6h,06Ch,038h,000h ; Hex #8C + Db 030h,018h,000h,038h,018h,018h,03Ch,000h ; Hex #8D + Db 076h,0DCh,038h,06Ch,0C6h,0FEh,0C6h,000h ; Hex #8E + Db 07Ch,082h,038h,06Ch,0C6h,0FEh,0C6h,000h ; Hex #8F + Db 018h,030h,0FEh,0C0h,0F8h,0C0h,0FEh,000h ; Hex #90 + Db 060h,030h,038h,06Ch,0C6h,0FEh,0C6h,000h ; Hex #91 + Db 030h,018h,0FEh,0C0h,0F8h,0C0h,0FEh,000h ; Hex #92 + Db 07Ch,082h,07Ch,0C6h,0C6h,0C6h,07Ch,000h ; Hex #93 + Db 076h,0DCh,07Ch,0C6h,0C6h,0C6h,07Ch,000h ; Hex #94 + Db 030h,018h,07Ch,0C6h,0C6h,0C6h,07Ch,000h ; Hex #95 + Db 00Ch,018h,0C6h,0C6h,0C6h,0C6h,07Ch,000h ; Hex #96 + Db 060h,030h,0CCh,0CCh,0CCh,0CCh,076h,000h ; Hex #97 + Db 030h,018h,03Ch,018h,018h,018h,03Ch,000h ; Hex #98 + Db 076h,0DCh,038h,06Ch,0C6h,06Ch,038h,000h ; Hex #99 + Db 0C6h,000h,0C6h,0C6h,0C6h,0C6h,07Ch,000h ; Hex #9A + Db 018h,018h,07Eh,0C0h,0C0h,07Eh,018h,018h ; Hex #9B + Db 038h,06Ch,064h,0F0h,060h,066h,0FCh,000h ; Hex #9C + Db 030h,018h,0C6h,0C6h,0C6h,0C6h,07Ch,000h ; Hex #9D + Db 0F8h,0CCh,0CCh,0FAh,0C6h,0CFh,0C6h,0C7h ; Hex #9E + Db 00Ch,018h,038h,06Ch,0C6h,06Ch,038h,000h ; Hex #9F + Db 018h,030h,078h,00Ch,07Ch,0CCh,076h,000h ; Hex #A0 + Db 00Ch,018h,000h,038h,018h,018h,03Ch,000h ; Hex #A1 + Db 00Ch,018h,07Ch,0C6h,0C6h,0C6h,07Ch,000h ; Hex #A2 + Db 018h,030h,0CCh,0CCh,0CCh,0CCh,076h,000h ; Hex #A3 + Db 076h,0DCh,000h,0DCh,066h,066h,066h,000h ; Hex #A4 + Db 076h,0DCh,000h,0E6h,0F6h,0DEh,0CEh,000h ; Hex #A5 + Db 03Ch,06Ch,06Ch,03Eh,000h,07Eh,000h,000h ; Hex #A6 + Db 038h,06Ch,06Ch,038h,000h,07Ch,000h,000h ; Hex #A7 + Db 018h,000h,018h,018h,030h,063h,03Eh,000h ; Hex #A8 + Db 030h,018h,038h,06Ch,0C6h,06Ch,038h,000h ; Hex #A9 + Db 000h,000h,000h,0FEh,006h,006h,000h,000h ; Hex #AA + Db 063h,0E6h,06Ch,07Eh,033h,066h,0CCh,00Fh ; Hex #AB + Db 063h,0E6h,06Ch,07Ah,036h,06Ah,0DFh,006h ; Hex #AC + Db 018h,000h,018h,018h,03Ch,03Ch,018h,000h ; Hex #AD + Db 000h,033h,066h,0CCh,066h,033h,000h,000h ; Hex #AE + Db 000h,0CCh,066h,033h,066h,0CCh,000h,000h ; Hex #AF + Db 022h,088h,022h,088h,022h,088h,022h,088h ; Hex #B0 + Db 055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh ; Hex #B1 + Db 077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh ; Hex #B2 + Db 018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B3 + Db 018h,018h,018h,018h,0F8h,018h,018h,018h ; Hex #B4 + Db 018h,018h,0F8h,018h,0F8h,018h,018h,018h ; Hex #B5 + Db 036h,036h,036h,036h,0F6h,036h,036h,036h ; Hex #B6 + Db 000h,000h,000h,000h,0FEh,036h,036h,036h ; Hex #B7 + Db 000h,000h,0F8h,018h,0F8h,018h,018h,018h ; Hex #B8 + Db 036h,036h,0F6h,006h,0F6h,036h,036h,036h ; Hex #B9 + Db 036h,036h,036h,036h,036h,036h,036h,036h ; Hex #BA + Db 000h,000h,0FEh,006h,0F6h,036h,036h,036h ; Hex #BB + Db 036h,036h,0F6h,006h,0FEh,000h,000h,000h ; Hex #BC + Db 036h,036h,036h,036h,0FEh,000h,000h,000h ; Hex #BD + Db 018h,018h,0F8h,018h,0F8h,000h,000h,000h ; Hex #BE + Db 000h,000h,000h,000h,0F8h,018h,018h,018h ; Hex #BF + Db 018h,018h,018h,018h,01Fh,000h,000h,000h ; Hex #C0 + Db 018h,018h,018h,018h,0FFh,000h,000h,000h ; Hex #C1 + Db 000h,000h,000h,000h,0FFh,018h,018h,018h ; Hex #C2 + Db 018h,018h,018h,018h,01Fh,018h,018h,018h ; Hex #C3 + Db 000h,000h,000h,000h,0FFh,000h,000h,000h ; Hex #C4 + Db 018h,018h,018h,018h,0FFh,018h,018h,018h ; Hex #C5 + Db 018h,018h,01Fh,018h,01Fh,018h,018h,018h ; Hex #C6 + Db 036h,036h,036h,036h,037h,036h,036h,036h ; Hex #C7 + Db 036h,036h,037h,030h,03Fh,000h,000h,000h ; Hex #C8 + Db 000h,000h,03Fh,030h,037h,036h,036h,036h ; Hex #C9 + Db 036h,036h,0F7h,000h,0FFh,000h,000h,000h ; Hex #CA + Db 000h,000h,0FFh,000h,0F7h,036h,036h,036h ; Hex #CB + Db 036h,036h,037h,030h,037h,036h,036h,036h ; Hex #CC + Db 000h,000h,0FFh,000h,0FFh,000h,000h,000h ; Hex #CD + Db 036h,036h,0F7h,000h,0F7h,036h,036h,036h ; Hex #CE + Db 018h,018h,0FFh,000h,0FFh,000h,000h,000h ; Hex #CF + Db 036h,036h,036h,036h,0FFh,000h,000h,000h ; Hex #D0 + Db 000h,000h,0FFh,000h,0FFh,018h,018h,018h ; Hex #D1 + Db 000h,000h,000h,000h,0FFh,036h,036h,036h ; Hex #D2 + Db 036h,036h,036h,036h,03Fh,000h,000h,000h ; Hex #D3 + Db 018h,018h,01Fh,018h,01Fh,000h,000h,000h ; Hex #D4 + Db 000h,000h,01Fh,018h,01Fh,018h,018h,018h ; Hex #D5 + Db 000h,000h,000h,000h,03Fh,036h,036h,036h ; Hex #D6 + Db 036h,036h,036h,036h,0FFh,036h,036h,036h ; Hex #D7 + Db 018h,018h,0FFh,018h,0FFh,018h,018h,018h ; Hex #D8 + Db 018h,018h,018h,018h,0F8h,000h,000h,000h ; Hex #D9 + Db 000h,000h,000h,000h,01Fh,018h,018h,018h ; Hex #DA + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #DB + Db 000h,000h,000h,000h,0FFh,0FFh,0FFh,0FFh ; Hex #DC + Db 0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h ; Hex #DD + Db 00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh ; Hex #DE + Db 0FFh,0FFh,0FFh,0FFh,000h,000h,000h,000h ; Hex #DF + Db 000h,000h,076h,0DCh,0C8h,0DCh,076h,000h ; Hex #E0 + Db 078h,0CCh,0CCh,0D8h,0CCh,0C6h,0CCh,000h ; Hex #E1 + Db 0FEh,0C6h,0C0h,0C0h,0C0h,0C0h,0C0h,000h ; Hex #E2 + Db 000h,000h,0FEh,06Ch,06Ch,06Ch,06Ch,000h ; Hex #E3 + Db 0FEh,0C6h,060h,030h,060h,0C6h,0FEh,000h ; Hex #E4 + Db 000h,000h,07Eh,0D8h,0D8h,0D8h,070h,000h ; Hex #E5 + Db 000h,000h,066h,066h,066h,066h,07Ch,0C0h ; Hex #E6 + Db 000h,076h,0DCh,018h,018h,018h,018h,000h ; Hex #E7 + Db 07Eh,018h,03Ch,066h,066h,03Ch,018h,07Eh ; Hex #E8 + Db 038h,06Ch,0C6h,0FEh,0C6h,06Ch,038h,000h ; Hex #E9 + Db 038h,06Ch,0C6h,0C6h,06Ch,06Ch,0EEh,000h ; Hex #EA + Db 00Eh,018h,00Ch,03Eh,066h,066h,03Ch,000h ; Hex #EB + Db 000h,000h,07Eh,0DBh,0DBh,07Eh,000h,000h ; Hex #EC + Db 006h,00Ch,07Eh,0DBh,0DBh,07Eh,060h,0C0h ; Hex #ED + Db 01Eh,030h,060h,07Eh,060h,030h,01Eh,000h ; Hex #EE + Db 000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,000h ; Hex #EF + Db 000h,0FEh,000h,0FEh,000h,0FEh,000h,000h ; Hex #F0 + Db 018h,018h,07Eh,018h,018h,000h,07Eh,000h ; Hex #F1 + Db 030h,018h,00Ch,018h,030h,000h,07Eh,000h ; Hex #F2 + Db 00Ch,018h,030h,018h,00Ch,000h,07Eh,000h ; Hex #F3 + Db 00Eh,01Bh,01Bh,018h,018h,018h,018h,018h ; Hex #F4 + Db 018h,018h,018h,018h,018h,0D8h,0D8h,070h ; Hex #F5 + Db 000h,018h,000h,07Eh,000h,018h,000h,000h ; Hex #F6 + Db 000h,076h,0DCh,000h,076h,0DCh,000h,000h ; Hex #F7 + Db 038h,06Ch,06Ch,038h,000h,000h,000h,000h ; Hex #F8 + Db 000h,000h,000h,018h,018h,000h,000h,000h ; Hex #F9 + Db 000h,000h,000h,018h,000h,000h,000h,000h ; Hex #FA + Db 00Fh,00Ch,00Ch,00Ch,0ECh,06Ch,03Ch,01Ch ; Hex #FB + Db 06Ch,036h,036h,036h,036h,000h,000h,000h ; Hex #FC + Db 078h,00Ch,018h,030h,07Ch,000h,000h,000h ; Hex #FD + Db 000h,000h,03Ch,03Ch,03Ch,03Ch,000h,000h ; Hex #FE + Db 000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FF + diff --git a/v4.0/src/DEV/DISPLAY/EGA/860-CPI.ASM b/v4.0/src/DEV/DISPLAY/EGA/860-CPI.ASM new file mode 100644 index 0000000..a77b658 --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/EGA/860-CPI.ASM @@ -0,0 +1,49 @@ +CODE SEGMENT BYTE PUBLIC 'CODE' + ASSUME CS:CODE,DS:CODE + +IF1 + %OUT EGA.CPI creation file + %OUT . + %OUT CP SRC files: + %OUT . + %OUT . CODE PAGE: 860 +ENDIF + +EGA860: DW LEN_860 ; SIZE OF ENTRY HEADER + DW POST_EGA860,0 ; POINTER TO NEXT HEADER + DW 1 ; DEVICE TYPE + DB "EGA " ; DEVICE SUBTYPE ID + DW 860 ; CODE PAGE ID + DW 3 DUP(0) ; RESERVED + DW OFFSET DATA860,0 ; POINTER TO FONTS +LEN_860 EQU ($-EGA860) ; + ; +DATA860:DW 1 ; CART/NON-CART + DW 3 ; # OF FONTS + DW LEN_D860 ; LENGTH OF DATA +D860: ; + DB 16,8 ; CHARACTER BOX SIZE + DB 0,0 ; ASPECT RATIO (UNUSED) + DW 256 ; NUMBER OF CHARACTERS + ; + INCLUDE 860-8X16.ASM ; + ; + DB 14,8 ; CHARACTER BOX SIZE + DB 0,0 ; ASPECT RATIO (UNUSED) + DW 256 ; NUMBER OF CHARACTERS + ; + INCLUDE 860-8X14.ASM ; + ; + DB 8,8 ; CHARACTER BOX SIZE + DB 0,0 ; ASPECT RATIO (UNUSED) + DW 256 ; NUMBER OF CHARACTERS + ; + INCLUDE 860-8X8.ASM ; + ; +LEN_D860 EQU ($-D860) ; + ; +POST_EGA860 EQU $ ; + ; +CODE ENDS ; + END ; + \ No newline at end of file diff --git a/v4.0/src/DEV/DISPLAY/EGA/863-8X14.ASM b/v4.0/src/DEV/DISPLAY/EGA/863-8X14.ASM new file mode 100644 index 0000000..be639f7 --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/EGA/863-8X14.ASM @@ -0,0 +1,270 @@ +;*************************************************** +; CHARACTER FONT FILE +; Source Assembler File +; +; CODE PAGE: 863 +; FONT RESOLUTION: 8 x 14 +; +; DATE CREATED:05-28-1987 +; +; +; Output file from: MULTIFON, Version 1A +; +;*************************************************** + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #0 + Db 000h,000h,000h,07Eh,081h,0A5h,081h,081h,0BDh,099h,081h,07Eh,000h,000h ; Hex #1 + Db 000h,000h,000h,07Eh,0FFh,0DBh,0FFh,0FFh,0C3h,0E7h,0FFh,07Eh,000h,000h ; Hex #2 + Db 000h,000h,000h,000h,06Ch,0FEh,0FEh,0FEh,0FEh,07Ch,038h,010h,000h,000h ; Hex #3 + Db 000h,000h,000h,000h,010h,038h,07Ch,0FEh,07Ch,038h,010h,000h,000h,000h ; Hex #4 + Db 000h,000h,000h,018h,03Ch,03Ch,0E7h,0E7h,0E7h,018h,018h,03Ch,000h,000h ; Hex #5 + Db 000h,000h,000h,018h,03Ch,07Eh,0FFh,0FFh,07Eh,018h,018h,03Ch,000h,000h ; Hex #6 + Db 000h,000h,000h,000h,000h,000h,018h,03Ch,03Ch,018h,000h,000h,000h,000h ; Hex #7 + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0E7h,0C3h,0C3h,0E7h,0FFh,0FFh,0FFh,0FFh ; Hex #8 + Db 000h,000h,000h,000h,000h,03Ch,066h,042h,042h,066h,03Ch,000h,000h,000h ; Hex #9 + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0C3h,099h,0BDh,0BDh,099h,0C3h,0FFh,0FFh,0FFh ; Hex #A + Db 000h,000h,000h,01Eh,00Eh,01Ah,032h,078h,0CCh,0CCh,0CCh,078h,000h,000h ; Hex #B + Db 000h,000h,000h,03Ch,066h,066h,066h,03Ch,018h,07Eh,018h,018h,000h,000h ; Hex #C + Db 000h,000h,000h,03Fh,033h,03Fh,030h,030h,030h,070h,0F0h,0E0h,000h,000h ; Hex #D + Db 000h,000h,000h,07Fh,063h,07Fh,063h,063h,063h,067h,0E7h,0E6h,0C0h,000h ; Hex #E + Db 000h,000h,000h,018h,018h,0DBh,03Ch,0E7h,03Ch,0DBh,018h,018h,000h,000h ; Hex #F + Db 000h,000h,000h,080h,0C0h,0E0h,0F8h,0FEh,0F8h,0E0h,0C0h,080h,000h,000h ; Hex #10 + Db 000h,000h,000h,002h,006h,00Eh,03Eh,0FEh,03Eh,00Eh,006h,002h,000h,000h ; Hex #11 + Db 000h,000h,000h,018h,03Ch,07Eh,018h,018h,018h,07Eh,03Ch,018h,000h,000h ; Hex #12 + Db 000h,000h,000h,066h,066h,066h,066h,066h,066h,000h,066h,066h,000h,000h ; Hex #13 + Db 000h,000h,000h,07Fh,0DBh,0DBh,0DBh,07Bh,01Bh,01Bh,01Bh,01Bh,000h,000h ; Hex #14 + Db 000h,000h,07Ch,0C6h,060h,038h,06Ch,0C6h,0C6h,06Ch,038h,00Ch,0C6h,07Ch ; Hex #15 + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,0FEh,0FEh,0FEh,000h,000h ; Hex #16 + Db 000h,000h,000h,018h,03Ch,07Eh,018h,018h,018h,07Eh,03Ch,018h,07Eh,000h ; Hex #17 + Db 000h,000h,000h,018h,03Ch,07Eh,018h,018h,018h,018h,018h,018h,000h,000h ; Hex #18 + Db 000h,000h,000h,018h,018h,018h,018h,018h,018h,07Eh,03Ch,018h,000h,000h ; Hex #19 + Db 000h,000h,000h,000h,000h,018h,00Ch,0FEh,00Ch,018h,000h,000h,000h,000h ; Hex #1A + Db 000h,000h,000h,000h,000h,030h,060h,0FEh,060h,030h,000h,000h,000h,000h ; Hex #1B + Db 000h,000h,000h,000h,000h,000h,0C0h,0C0h,0C0h,0FEh,000h,000h,000h,000h ; Hex #1C + Db 000h,000h,000h,000h,000h,028h,06Ch,0FEh,06Ch,028h,000h,000h,000h,000h ; Hex #1D + Db 000h,000h,000h,000h,010h,038h,038h,07Ch,07Ch,0FEh,0FEh,000h,000h,000h ; Hex #1E + Db 000h,000h,000h,000h,0FEh,0FEh,07Ch,07Ch,038h,038h,010h,000h,000h,000h ; Hex #1F + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #20 + Db 000h,000h,000h,018h,03Ch,03Ch,03Ch,018h,018h,000h,018h,018h,000h,000h ; Hex #21 + Db 000h,066h,066h,066h,024h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #22 + Db 000h,000h,000h,06Ch,06Ch,0FEh,06Ch,06Ch,06Ch,0FEh,06Ch,06Ch,000h,000h ; Hex #23 + Db 000h,018h,018h,07Ch,0C6h,0C2h,0C0h,07Ch,006h,086h,0C6h,07Ch,018h,018h ; Hex #24 + Db 000h,000h,000h,000h,000h,0C2h,0C6h,00Ch,018h,030h,066h,0C6h,000h,000h ; Hex #25 + Db 000h,000h,000h,038h,06Ch,06Ch,038h,076h,0DCh,0CCh,0CCh,076h,000h,000h ; Hex #26 + Db 000h,018h,018h,018h,030h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #27 + Db 000h,000h,000h,00Ch,018h,030h,030h,030h,030h,030h,018h,00Ch,000h,000h ; Hex #28 + Db 000h,000h,000h,030h,018h,00Ch,00Ch,00Ch,00Ch,00Ch,018h,030h,000h,000h ; Hex #29 + Db 000h,000h,000h,000h,000h,066h,03Ch,0FFh,03Ch,066h,000h,000h,000h,000h ; Hex #2A + Db 000h,000h,000h,000h,000h,018h,018h,07Eh,018h,018h,000h,000h,000h,000h ; Hex #2B + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,018h,018h,018h,030h,000h ; Hex #2C + Db 000h,000h,000h,000h,000h,000h,000h,0FEh,000h,000h,000h,000h,000h,000h ; Hex #2D + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,018h,018h,000h,000h ; Hex #2E + Db 000h,000h,000h,002h,006h,00Ch,018h,030h,060h,0C0h,080h,000h,000h,000h ; Hex #2F + Db 000h,000h,000h,038h,06Ch,0C6h,0C6h,0D6h,0C6h,0C6h,06Ch,038h,000h,000h ; Hex #30 + Db 000h,000h,000h,018h,038h,078h,018h,018h,018h,018h,018h,07Eh,000h,000h ; Hex #31 + Db 000h,000h,000h,07Ch,0C6h,006h,00Ch,018h,030h,060h,0C6h,0FEh,000h,000h ; Hex #32 + Db 000h,000h,000h,07Ch,0C6h,006h,006h,03Ch,006h,006h,0C6h,07Ch,000h,000h ; Hex #33 + Db 000h,000h,000h,00Ch,01Ch,03Ch,06Ch,0CCh,0FEh,00Ch,00Ch,01Eh,000h,000h ; Hex #34 + Db 000h,000h,000h,0FEh,0C0h,0C0h,0C0h,0FCh,006h,006h,0C6h,07Ch,000h,000h ; Hex #35 + Db 000h,000h,000h,038h,060h,0C0h,0C0h,0FCh,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #36 + Db 000h,000h,000h,0FEh,0C6h,006h,00Ch,018h,030h,030h,030h,030h,000h,000h ; Hex #37 + Db 000h,000h,000h,07Ch,0C6h,0C6h,0C6h,07Ch,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #38 + Db 000h,000h,000h,07Ch,0C6h,0C6h,0C6h,07Eh,006h,006h,00Ch,078h,000h,000h ; Hex #39 + Db 000h,000h,000h,000h,018h,018h,000h,000h,000h,018h,018h,000h,000h,000h ; Hex #3A + Db 000h,000h,000h,000h,018h,018h,000h,000h,000h,018h,018h,030h,000h,000h ; Hex #3B + Db 000h,000h,000h,00Ch,018h,030h,060h,0C0h,060h,030h,018h,00Ch,000h,000h ; Hex #3C + Db 000h,000h,000h,000h,000h,000h,07Eh,000h,000h,07Eh,000h,000h,000h,000h ; Hex #3D + Db 000h,000h,000h,060h,030h,018h,00Ch,006h,00Ch,018h,030h,060h,000h,000h ; Hex #3E + Db 000h,000h,000h,07Ch,0C6h,0C6h,00Ch,018h,018h,000h,018h,018h,000h,000h ; Hex #3F + Db 000h,000h,000h,07Ch,0C6h,0C6h,0DEh,0DEh,0DEh,0DCh,0C0h,07Ch,000h,000h ; Hex #40 + Db 000h,000h,000h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h,000h ; Hex #41 + Db 000h,000h,000h,0FCh,066h,066h,066h,07Ch,066h,066h,066h,0FCh,000h,000h ; Hex #42 + Db 000h,000h,000h,03Ch,066h,0C2h,0C0h,0C0h,0C0h,0C2h,066h,03Ch,000h,000h ; Hex #43 + Db 000h,000h,000h,0F8h,06Ch,066h,066h,066h,066h,066h,06Ch,0F8h,000h,000h ; Hex #44 + Db 000h,000h,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h ; Hex #45 + Db 000h,000h,000h,0FEh,066h,062h,068h,078h,068h,060h,060h,0F0h,000h,000h ; Hex #46 + Db 000h,000h,000h,03Ch,066h,0C2h,0C0h,0C0h,0DEh,0C6h,066h,03Ah,000h,000h ; Hex #47 + Db 000h,000h,000h,0C6h,0C6h,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,0C6h,000h,000h ; Hex #48 + Db 000h,000h,000h,03Ch,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #49 + Db 000h,000h,000h,01Eh,00Ch,00Ch,00Ch,00Ch,00Ch,0CCh,0CCh,078h,000h,000h ; Hex #4A + Db 000h,000h,000h,0E6h,066h,06Ch,06Ch,078h,06Ch,06Ch,066h,0E6h,000h,000h ; Hex #4B + Db 000h,000h,000h,0F0h,060h,060h,060h,060h,060h,062h,066h,0FEh,000h,000h ; Hex #4C + Db 000h,000h,000h,0C6h,0EEh,0FEh,0D6h,0C6h,0C6h,0C6h,0C6h,0C6h,000h,000h ; Hex #4D + Db 000h,000h,000h,0C6h,0E6h,0F6h,0FEh,0DEh,0CEh,0C6h,0C6h,0C6h,000h,000h ; Hex #4E + Db 000h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #4F + Db 000h,000h,000h,0FCh,066h,066h,066h,07Ch,060h,060h,060h,0F0h,000h,000h ; Hex #50 + Db 000h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0D6h,0DEh,07Ch,00Eh,000h ; Hex #51 + Db 000h,000h,000h,0FCh,066h,066h,066h,07Ch,06Ch,066h,066h,0E6h,000h,000h ; Hex #52 + Db 000h,000h,000h,07Ch,0C6h,0C6h,060h,038h,00Ch,0C6h,0C6h,07Ch,000h,000h ; Hex #53 + Db 000h,000h,000h,07Eh,07Eh,05Ah,018h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #54 + Db 000h,000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #55 + Db 000h,000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,06Ch,038h,010h,000h,000h ; Hex #56 + Db 000h,000h,000h,0C6h,0C6h,0C6h,0C6h,0D6h,0D6h,0FEh,06Ch,06Ch,000h,000h ; Hex #57 + Db 000h,000h,000h,0C6h,0C6h,0C6h,07Ch,038h,07Ch,0C6h,0C6h,0C6h,000h,000h ; Hex #58 + Db 000h,000h,000h,066h,066h,066h,066h,03Ch,018h,018h,018h,03Ch,000h,000h ; Hex #59 + Db 000h,000h,000h,0FEh,0C6h,08Ch,018h,030h,060h,0C2h,0C6h,0FEh,000h,000h ; Hex #5A + Db 000h,000h,000h,03Ch,030h,030h,030h,030h,030h,030h,030h,03Ch,000h,000h ; Hex #5B + Db 000h,000h,000h,080h,0C0h,0E0h,070h,038h,01Ch,00Eh,006h,002h,000h,000h ; Hex #5C + Db 000h,000h,000h,03Ch,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,03Ch,000h,000h ; Hex #5D + Db 010h,038h,06Ch,0C6h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #5E + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,0FFh ; Hex #5F + Db 000h,030h,018h,00Ch,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #60 + Db 000h,000h,000h,000h,000h,000h,078h,00Ch,07Ch,0CCh,0CCh,076h,000h,000h ; Hex #61 + Db 000h,000h,000h,0E0h,060h,060h,078h,06Ch,066h,066h,066h,07Ch,000h,000h ; Hex #62 + Db 000h,000h,000h,000h,000h,000h,07Ch,0C6h,0C0h,0C0h,0C6h,07Ch,000h,000h ; Hex #63 + Db 000h,000h,000h,01Ch,00Ch,00Ch,03Ch,06Ch,0CCh,0CCh,0CCh,076h,000h,000h ; Hex #64 + Db 000h,000h,000h,000h,000h,000h,07Ch,0C6h,0FEh,0C0h,0C6h,07Ch,000h,000h ; Hex #65 + Db 000h,000h,000h,01Ch,036h,032h,030h,07Ch,030h,030h,030h,078h,000h,000h ; Hex #66 + Db 000h,000h,000h,000h,000h,000h,076h,0CCh,0CCh,0CCh,07Ch,00Ch,0CCh,078h ; Hex #67 + Db 000h,000h,000h,0E0h,060h,060h,06Ch,076h,066h,066h,066h,0E6h,000h,000h ; Hex #68 + Db 000h,000h,000h,018h,018h,000h,038h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #69 + Db 000h,000h,000h,006h,006h,000h,00Eh,006h,006h,006h,006h,066h,066h,03Ch ; Hex #6A + Db 000h,000h,000h,0E0h,060h,060h,066h,06Ch,078h,06Ch,066h,0E6h,000h,000h ; Hex #6B + Db 000h,000h,000h,038h,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #6C + Db 000h,000h,000h,000h,000h,000h,0ECh,0FEh,0D6h,0D6h,0D6h,0D6h,000h,000h ; Hex #6D + Db 000h,000h,000h,000h,000h,000h,0DCh,066h,066h,066h,066h,066h,000h,000h ; Hex #6E + Db 000h,000h,000h,000h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #6F + Db 000h,000h,000h,000h,000h,000h,0DCh,066h,066h,066h,07Ch,060h,060h,0F0h ; Hex #70 + Db 000h,000h,000h,000h,000h,000h,076h,0CCh,0CCh,0CCh,07Ch,00Ch,00Ch,01Eh ; Hex #71 + Db 000h,000h,000h,000h,000h,000h,0DCh,076h,066h,060h,060h,0F0h,000h,000h ; Hex #72 + Db 000h,000h,000h,000h,000h,000h,07Ch,0C6h,070h,01Ch,0C6h,07Ch,000h,000h ; Hex #73 + Db 000h,000h,000h,010h,030h,030h,0FCh,030h,030h,030h,036h,01Ch,000h,000h ; Hex #74 + Db 000h,000h,000h,000h,000h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h ; Hex #75 + Db 000h,000h,000h,000h,000h,000h,0C6h,0C6h,0C6h,06Ch,038h,010h,000h,000h ; Hex #76 + Db 000h,000h,000h,000h,000h,000h,0C6h,0C6h,0D6h,0D6h,0FEh,06Ch,000h,000h ; Hex #77 + Db 000h,000h,000h,000h,000h,000h,0C6h,06Ch,038h,038h,06Ch,0C6h,000h,000h ; Hex #78 + Db 000h,000h,000h,000h,000h,000h,0C6h,0C6h,0C6h,0C6h,07Eh,006h,00Ch,078h ; Hex #79 + Db 000h,000h,000h,000h,000h,000h,0FEh,0CCh,018h,030h,066h,0FEh,000h,000h ; Hex #7A + Db 000h,000h,000h,00Eh,018h,018h,018h,070h,018h,018h,018h,00Eh,000h,000h ; Hex #7B + Db 000h,000h,000h,018h,018h,018h,018h,018h,018h,018h,018h,018h,000h,000h ; Hex #7C + Db 000h,000h,000h,070h,018h,018h,018h,00Eh,018h,018h,018h,070h,000h,000h ; Hex #7D + Db 000h,076h,0DCh,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #7E + Db 000h,000h,000h,000h,000h,010h,038h,06Ch,0C6h,0C6h,0FEh,000h,000h,000h ; Hex #7F + Db 000h,000h,000h,03Ch,066h,0C2h,0C0h,0C0h,0C0h,0C2h,066h,03Ch,00Ch,078h ; Hex #80 + Db 000h,000h,000h,0CCh,000h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h ; Hex #81 + Db 000h,000h,00Ch,018h,030h,000h,07Ch,0C6h,0FEh,0C0h,0C6h,07Ch,000h,000h ; Hex #82 + Db 000h,000h,010h,038h,06Ch,000h,078h,00Ch,07Ch,0CCh,0CCh,076h,000h,000h ; Hex #83 + Db 038h,06Ch,0C6h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h,000h ; Hex #84 + Db 000h,000h,060h,030h,018h,000h,078h,00Ch,07Ch,0CCh,0CCh,076h,000h,000h ; Hex #85 + Db 000h,000h,000h,07Fh,0DBh,0DBh,0DBh,07Bh,01Bh,01Bh,01Bh,01Bh,000h,000h ; Hex #86 + Db 000h,000h,000h,000h,000h,000h,07Ch,0C6h,0C0h,0C0h,0C6h,07Ch,00Ch,078h ; Hex #87 + Db 000h,000h,010h,038h,06Ch,000h,07Ch,0C6h,0FEh,0C0h,0C6h,07Ch,000h,000h ; Hex #88 + Db 000h,000h,000h,0C6h,000h,000h,07Ch,0C6h,0FEh,0C0h,0C6h,07Ch,000h,000h ; Hex #89 + Db 000h,000h,060h,030h,018h,000h,07Ch,0C6h,0FEh,0C0h,0C6h,07Ch,000h,000h ; Hex #8A + Db 000h,000h,000h,066h,000h,000h,038h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #8B + Db 000h,000h,018h,03Ch,066h,000h,038h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #8C + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,0FFh,000h,0FFh ; Hex #8D + Db 018h,00Ch,006h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h,000h ; Hex #8E + Db 000h,07Ch,0C6h,060h,038h,06Ch,0C6h,0C6h,06Ch,038h,00Ch,0C6h,07Ch,000h ; Hex #8F + Db 00Ch,018h,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h ; Hex #90 + Db 030h,018h,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h ; Hex #91 + Db 038h,06Ch,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h ; Hex #92 + Db 000h,000h,010h,038h,06Ch,000h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #93 + Db 000h,0C6h,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h ; Hex #94 + Db 000h,066h,000h,03Ch,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #95 + Db 000h,000h,030h,078h,0CCh,000h,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h ; Hex #96 + Db 000h,000h,060h,030h,018h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h ; Hex #97 + Db 000h,000h,000h,000h,000h,0C6h,07Ch,0C6h,0C6h,0C6h,07Ch,0C6h,000h,000h ; Hex #98 + Db 038h,06Ch,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #99 + Db 000h,0C6h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #9A + Db 000h,000h,018h,018h,07Ch,0C6h,0C0h,0C0h,0C6h,07Ch,018h,018h,000h,000h ; Hex #9B + Db 000h,000h,038h,06Ch,064h,060h,0F0h,060h,060h,060h,0E6h,0FCh,000h,000h ; Hex #9C + Db 030h,018h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #9D + Db 038h,06Ch,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #9E + Db 000h,000h,00Eh,01Bh,018h,018h,018h,07Eh,018h,018h,018h,0D8h,070h,000h ; Hex #9F + Db 000h,000h,018h,018h,018h,018h,000h,000h,000h,018h,018h,018h,018h,000h ; Hex #A0 + Db 000h,00Ch,018h,030h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #A1 + Db 000h,000h,00Ch,018h,030h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #A2 + Db 000h,000h,00Ch,018h,030h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h ; Hex #A3 + Db 000h,0C6h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #A4 + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,018h,00Ch,078h ; Hex #A5 + Db 000h,078h,00Ch,038h,00Ch,00Ch,078h,000h,000h,000h,000h,000h,000h,000h ; Hex #A6 + Db 000h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #A7 + Db 03Ch,066h,000h,03Ch,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #A8 + Db 000h,000h,000h,000h,000h,000h,000h,0FEh,0C0h,0C0h,0C0h,000h,000h,000h ; Hex #A9 + Db 000h,000h,000h,000h,000h,000h,000h,0FEh,006h,006h,006h,000h,000h,000h ; Hex #AA + Db 000h,000h,060h,0E0h,063h,066h,06Ch,018h,030h,06Eh,0C3h,006h,00Ch,01Fh ; Hex #AB + Db 000h,000h,060h,0E0h,063h,066h,06Ch,01Ah,036h,06Eh,0DAh,03Fh,006h,006h ; Hex #AC + Db 000h,0E0h,030h,0E3h,036h,0ECh,018h,036h,06Eh,0DAh,03Fh,006h,006h,000h ; Hex #AD + Db 000h,000h,000h,000h,000h,036h,06Ch,0D8h,06Ch,036h,000h,000h,000h,000h ; Hex #AE + Db 000h,000h,000h,000h,000h,0D8h,06Ch,036h,06Ch,0D8h,000h,000h,000h,000h ; Hex #AF + Db 011h,044h,011h,044h,011h,044h,011h,044h,011h,044h,011h,044h,011h,044h ; Hex #B0 + Db 055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh ; Hex #B1 + Db 0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h ; Hex #B2 + Db 018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B3 + Db 018h,018h,018h,018h,018h,018h,018h,0F8h,018h,018h,018h,018h,018h,018h ; Hex #B4 + Db 018h,018h,018h,018h,018h,0F8h,018h,0F8h,018h,018h,018h,018h,018h,018h ; Hex #B5 + Db 036h,036h,036h,036h,036h,036h,036h,0F6h,036h,036h,036h,036h,036h,036h ; Hex #B6 + Db 000h,000h,000h,000h,000h,000h,000h,0FEh,036h,036h,036h,036h,036h,036h ; Hex #B7 + Db 000h,000h,000h,000h,000h,0F8h,018h,0F8h,018h,018h,018h,018h,018h,018h ; Hex #B8 + Db 036h,036h,036h,036h,036h,0F6h,006h,0F6h,036h,036h,036h,036h,036h,036h ; Hex #B9 + Db 036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #BA + Db 000h,000h,000h,000h,000h,0FEh,006h,0F6h,036h,036h,036h,036h,036h,036h ; Hex #BB + Db 036h,036h,036h,036h,036h,0F6h,006h,0FEh,000h,000h,000h,000h,000h,000h ; Hex #BC + Db 036h,036h,036h,036h,036h,036h,036h,0FEh,000h,000h,000h,000h,000h,000h ; Hex #BD + Db 018h,018h,018h,018h,018h,0F8h,018h,0F8h,000h,000h,000h,000h,000h,000h ; Hex #BE + Db 000h,000h,000h,000h,000h,000h,000h,0F8h,018h,018h,018h,018h,018h,018h ; Hex #BF + Db 018h,018h,018h,018h,018h,018h,018h,01Fh,000h,000h,000h,000h,000h,000h ; Hex #C0 + Db 018h,018h,018h,018h,018h,018h,018h,0FFh,000h,000h,000h,000h,000h,000h ; Hex #C1 + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,018h,018h,018h,018h,018h,018h ; Hex #C2 + Db 018h,018h,018h,018h,018h,018h,018h,01Fh,018h,018h,018h,018h,018h,018h ; Hex #C3 + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,000h,000h,000h,000h,000h,000h ; Hex #C4 + Db 018h,018h,018h,018h,018h,018h,018h,0FFh,018h,018h,018h,018h,018h,018h ; Hex #C5 + Db 018h,018h,018h,018h,018h,01Fh,018h,01Fh,018h,018h,018h,018h,018h,018h ; Hex #C6 + Db 036h,036h,036h,036h,036h,036h,036h,037h,036h,036h,036h,036h,036h,036h ; Hex #C7 + Db 036h,036h,036h,036h,036h,037h,030h,03Fh,000h,000h,000h,000h,000h,000h ; Hex #C8 + Db 000h,000h,000h,000h,000h,03Fh,030h,037h,036h,036h,036h,036h,036h,036h ; Hex #C9 + Db 036h,036h,036h,036h,036h,0F7h,000h,0FFh,000h,000h,000h,000h,000h,000h ; Hex #CA + Db 000h,000h,000h,000h,000h,0FFh,000h,0F7h,036h,036h,036h,036h,036h,036h ; Hex #CB + Db 036h,036h,036h,036h,036h,037h,030h,037h,036h,036h,036h,036h,036h,036h ; Hex #CC + Db 000h,000h,000h,000h,000h,0FFh,000h,0FFh,000h,000h,000h,000h,000h,000h ; Hex #CD + Db 036h,036h,036h,036h,036h,0F7h,000h,0F7h,036h,036h,036h,036h,036h,036h ; Hex #CE + Db 018h,018h,018h,018h,018h,0FFh,000h,0FFh,000h,000h,000h,000h,000h,000h ; Hex #CF + Db 036h,036h,036h,036h,036h,036h,036h,0FFh,000h,000h,000h,000h,000h,000h ; Hex #D0 + Db 000h,000h,000h,000h,000h,0FFh,000h,0FFh,018h,018h,018h,018h,018h,018h ; Hex #D1 + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,036h,036h,036h,036h,036h,036h ; Hex #D2 + Db 036h,036h,036h,036h,036h,036h,036h,03Fh,000h,000h,000h,000h,000h,000h ; Hex #D3 + Db 018h,018h,018h,018h,018h,01Fh,018h,01Fh,000h,000h,000h,000h,000h,000h ; Hex #D4 + Db 000h,000h,000h,000h,000h,01Fh,018h,01Fh,018h,018h,018h,018h,018h,018h ; Hex #D5 + Db 000h,000h,000h,000h,000h,000h,000h,03Fh,036h,036h,036h,036h,036h,036h ; Hex #D6 + Db 036h,036h,036h,036h,036h,036h,036h,0FFh,036h,036h,036h,036h,036h,036h ; Hex #D7 + Db 018h,018h,018h,018h,018h,0FFh,018h,0FFh,018h,018h,018h,018h,018h,018h ; Hex #D8 + Db 018h,018h,018h,018h,018h,018h,018h,0F8h,000h,000h,000h,000h,000h,000h ; Hex #D9 + Db 000h,000h,000h,000h,000h,000h,000h,01Fh,018h,018h,018h,018h,018h,018h ; Hex #DA + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #DB + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #DC + Db 0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h ; Hex #DD + Db 00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh ; Hex #DE + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,000h,000h,000h,000h,000h,000h,000h ; Hex #DF + Db 000h,000h,000h,000h,000h,000h,076h,0DCh,0D8h,0D8h,0DCh,076h,000h,000h ; Hex #E0 + Db 000h,000h,000h,078h,0CCh,0CCh,0CCh,0D8h,0CCh,0C6h,0C6h,0CCh,000h,000h ; Hex #E1 + Db 000h,000h,000h,0FEh,0C6h,0C6h,0C0h,0C0h,0C0h,0C0h,0C0h,0C0h,000h,000h ; Hex #E2 + Db 000h,000h,000h,000h,000h,000h,0FEh,06Ch,06Ch,06Ch,06Ch,06Ch,000h,000h ; Hex #E3 + Db 000h,000h,000h,0FEh,0C6h,060h,030h,018h,030h,060h,0C6h,0FEh,000h,000h ; Hex #E4 + Db 000h,000h,000h,000h,000h,000h,07Eh,0D8h,0D8h,0D8h,0D8h,070h,000h,000h ; Hex #E5 + Db 000h,000h,000h,000h,000h,000h,066h,066h,066h,066h,066h,07Ch,060h,0C0h ; Hex #E6 + Db 000h,000h,000h,000h,000h,076h,0DCh,018h,018h,018h,018h,018h,000h,000h ; Hex #E7 + Db 000h,000h,000h,07Eh,018h,03Ch,066h,066h,066h,03Ch,018h,07Eh,000h,000h ; Hex #E8 + Db 000h,000h,000h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,06Ch,038h,000h,000h ; Hex #E9 + Db 000h,000h,000h,038h,06Ch,0C6h,0C6h,0C6h,06Ch,06Ch,06Ch,0EEh,000h,000h ; Hex #EA + Db 000h,000h,000h,01Eh,030h,018h,00Ch,03Eh,066h,066h,066h,03Ch,000h,000h ; Hex #EB + Db 000h,000h,000h,000h,000h,000h,07Eh,0DBh,0DBh,07Eh,000h,000h,000h,000h ; Hex #EC + Db 000h,000h,000h,003h,006h,07Eh,0DBh,0DBh,0F3h,07Eh,060h,0C0h,000h,000h ; Hex #ED + Db 000h,000h,000h,01Eh,030h,060h,060h,07Eh,060h,060h,030h,01Eh,000h,000h ; Hex #EE + Db 000h,000h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,000h,000h ; Hex #EF + Db 000h,000h,000h,000h,0FEh,000h,000h,0FEh,000h,000h,0FEh,000h,000h,000h ; Hex #F0 + Db 000h,000h,000h,000h,018h,018h,07Eh,018h,018h,000h,000h,07Eh,000h,000h ; Hex #F1 + Db 000h,000h,000h,030h,018h,00Ch,006h,00Ch,018h,030h,000h,07Eh,000h,000h ; Hex #F2 + Db 000h,000h,000h,00Ch,018h,030h,060h,030h,018h,00Ch,000h,07Eh,000h,000h ; Hex #F3 + Db 000h,000h,00Eh,01Bh,01Bh,018h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #F4 + Db 018h,018h,018h,018h,018h,018h,018h,018h,0D8h,0D8h,070h,000h,000h,000h ; Hex #F5 + Db 000h,000h,000h,000h,000h,018h,000h,07Eh,000h,018h,000h,000h,000h,000h ; Hex #F6 + Db 000h,000h,000h,000h,000h,076h,0DCh,000h,076h,0DCh,000h,000h,000h,000h ; Hex #F7 + Db 000h,038h,06Ch,06Ch,038h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #F8 + Db 000h,000h,000h,000h,000h,000h,000h,018h,018h,000h,000h,000h,000h,000h ; Hex #F9 + Db 000h,000h,000h,000h,000h,000h,000h,018h,000h,000h,000h,000h,000h,000h ; Hex #FA + Db 000h,00Fh,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,0ECh,06Ch,03Ch,01Ch,000h,000h ; Hex #FB + Db 000h,06Ch,036h,036h,036h,036h,036h,000h,000h,000h,000h,000h,000h,000h ; Hex #FC + Db 000h,03Ch,066h,00Ch,018h,032h,07Eh,000h,000h,000h,000h,000h,000h,000h ; Hex #FD + Db 000h,000h,000h,000h,000h,07Eh,07Eh,07Eh,07Eh,07Eh,07Eh,000h,000h,000h ; Hex #FE + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FF + diff --git a/v4.0/src/DEV/DISPLAY/EGA/863-8X16.ASM b/v4.0/src/DEV/DISPLAY/EGA/863-8X16.ASM new file mode 100644 index 0000000..e421b92 --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/EGA/863-8X16.ASM @@ -0,0 +1,270 @@ +;*************************************************** +; CHARACTER FONT FILE +; Source Assembler File +; +; CODE PAGE: 863 +; FONT RESOLUTION: 8 x 16 +; +; DATE CREATED:05-28-1987 +; +; +; Output file from: MULTIFON, Version 1A +; +;*************************************************** + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #0 + Db 000h,000h,07Eh,081h,0A5h,081h,081h,0BDh,099h,081h,081h,07Eh,000h,000h,000h,000h ; Hex #1 + Db 000h,000h,07Eh,0FFh,0DBh,0FFh,0FFh,0C3h,0E7h,0FFh,0FFh,07Eh,000h,000h,000h,000h ; Hex #2 + Db 000h,000h,000h,000h,06Ch,0FEh,0FEh,0FEh,0FEh,07Ch,038h,010h,000h,000h,000h,000h ; Hex #3 + Db 000h,000h,000h,000h,010h,038h,07Ch,0FEh,07Ch,038h,010h,000h,000h,000h,000h,000h ; Hex #4 + Db 000h,000h,000h,018h,03Ch,03Ch,0E7h,0E7h,0E7h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #5 + Db 000h,000h,000h,018h,03Ch,07Eh,0FFh,0FFh,07Eh,018h,018h,03Ch,000h,000h,000h,000h ; Hex #6 + Db 000h,000h,000h,000h,000h,000h,018h,03Ch,03Ch,018h,000h,000h,000h,000h,000h,000h ; Hex #7 + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0E7h,0C3h,0C3h,0E7h,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #8 + Db 000h,000h,000h,000h,000h,03Ch,066h,042h,042h,066h,03Ch,000h,000h,000h,000h,000h ; Hex #9 + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0C3h,099h,0BDh,0BDh,099h,0C3h,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #A + Db 000h,000h,01Eh,00Eh,01Ah,032h,078h,0CCh,0CCh,0CCh,0CCh,078h,000h,000h,000h,000h ; Hex #B + Db 000h,000h,03Ch,066h,066h,066h,066h,03Ch,018h,07Eh,018h,018h,000h,000h,000h,000h ; Hex #C + Db 000h,000h,03Fh,033h,03Fh,030h,030h,030h,030h,070h,0F0h,0E0h,000h,000h,000h,000h ; Hex #D + Db 000h,000h,07Fh,063h,07Fh,063h,063h,063h,063h,067h,0E7h,0E6h,0C0h,000h,000h,000h ; Hex #E + Db 000h,000h,000h,018h,018h,0DBh,03Ch,0E7h,03Ch,0DBh,018h,018h,000h,000h,000h,000h ; Hex #F + Db 000h,080h,0C0h,0E0h,0F0h,0F8h,0FEh,0F8h,0F0h,0E0h,0C0h,080h,000h,000h,000h,000h ; Hex #10 + Db 000h,002h,006h,00Eh,01Eh,03Eh,0FEh,03Eh,01Eh,00Eh,006h,002h,000h,000h,000h,000h ; Hex #11 + Db 000h,000h,018h,03Ch,07Eh,018h,018h,018h,07Eh,03Ch,018h,000h,000h,000h,000h,000h ; Hex #12 + Db 000h,000h,066h,066h,066h,066h,066h,066h,066h,000h,066h,066h,000h,000h,000h,000h ; Hex #13 + Db 000h,000h,07Fh,0DBh,0DBh,0DBh,07Bh,01Bh,01Bh,01Bh,01Bh,01Bh,000h,000h,000h,000h ; Hex #14 + Db 000h,07Ch,0C6h,060h,038h,06Ch,0C6h,0C6h,06Ch,038h,00Ch,0C6h,07Ch,000h,000h,000h ; Hex #15 + Db 000h,000h,000h,000h,000h,000h,000h,000h,0FEh,0FEh,0FEh,0FEh,000h,000h,000h,000h ; Hex #16 + Db 000h,000h,018h,03Ch,07Eh,018h,018h,018h,07Eh,03Ch,018h,07Eh,000h,000h,000h,000h ; Hex #17 + Db 000h,000h,018h,03Ch,07Eh,018h,018h,018h,018h,018h,018h,018h,000h,000h,000h,000h ; Hex #18 + Db 000h,000h,018h,018h,018h,018h,018h,018h,018h,07Eh,03Ch,018h,000h,000h,000h,000h ; Hex #19 + Db 000h,000h,000h,000h,000h,018h,00Ch,0FEh,00Ch,018h,000h,000h,000h,000h,000h,000h ; Hex #1A + Db 000h,000h,000h,000h,000h,030h,060h,0FEh,060h,030h,000h,000h,000h,000h,000h,000h ; Hex #1B + Db 000h,000h,000h,000h,000h,000h,0C0h,0C0h,0C0h,0FEh,000h,000h,000h,000h,000h,000h ; Hex #1C + Db 000h,000h,000h,000h,000h,028h,06Ch,0FEh,06Ch,028h,000h,000h,000h,000h,000h,000h ; Hex #1D + Db 000h,000h,000h,000h,010h,038h,038h,07Ch,07Ch,0FEh,0FEh,000h,000h,000h,000h,000h ; Hex #1E + Db 000h,000h,000h,000h,0FEh,0FEh,07Ch,07Ch,038h,038h,010h,000h,000h,000h,000h,000h ; Hex #1F + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #20 + Db 000h,000h,018h,03Ch,03Ch,03Ch,018h,018h,018h,000h,018h,018h,000h,000h,000h,000h ; Hex #21 + Db 000h,066h,066h,066h,024h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #22 + Db 000h,000h,000h,06Ch,06Ch,0FEh,06Ch,06Ch,06Ch,0FEh,06Ch,06Ch,000h,000h,000h,000h ; Hex #23 + Db 018h,018h,07Ch,0C6h,0C2h,0C0h,07Ch,006h,006h,086h,0C6h,07Ch,018h,018h,000h,000h ; Hex #24 + Db 000h,000h,000h,000h,0C2h,0C6h,00Ch,018h,030h,060h,0C6h,086h,000h,000h,000h,000h ; Hex #25 + Db 000h,000h,038h,06Ch,06Ch,038h,076h,0DCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #26 + Db 000h,030h,030h,030h,060h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #27 + Db 000h,000h,00Ch,018h,030h,030h,030h,030h,030h,030h,018h,00Ch,000h,000h,000h,000h ; Hex #28 + Db 000h,000h,030h,018h,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,018h,030h,000h,000h,000h,000h ; Hex #29 + Db 000h,000h,000h,000h,000h,066h,03Ch,0FFh,03Ch,066h,000h,000h,000h,000h,000h,000h ; Hex #2A + Db 000h,000h,000h,000h,000h,018h,018h,07Eh,018h,018h,000h,000h,000h,000h,000h,000h ; Hex #2B + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,018h,018h,018h,030h,000h,000h,000h ; Hex #2C + Db 000h,000h,000h,000h,000h,000h,000h,0FEh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #2D + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,018h,018h,000h,000h,000h,000h ; Hex #2E + Db 000h,000h,000h,000h,002h,006h,00Ch,018h,030h,060h,0C0h,080h,000h,000h,000h,000h ; Hex #2F + Db 000h,000h,038h,06Ch,0C6h,0C6h,0D6h,0D6h,0C6h,0C6h,06Ch,038h,000h,000h,000h,000h ; Hex #30 + Db 000h,000h,018h,038h,078h,018h,018h,018h,018h,018h,018h,07Eh,000h,000h,000h,000h ; Hex #31 + Db 000h,000h,07Ch,0C6h,006h,00Ch,018h,030h,060h,0C0h,0C6h,0FEh,000h,000h,000h,000h ; Hex #32 + Db 000h,000h,07Ch,0C6h,006h,006h,03Ch,006h,006h,006h,0C6h,07Ch,000h,000h,000h,000h ; Hex #33 + Db 000h,000h,00Ch,01Ch,03Ch,06Ch,0CCh,0FEh,00Ch,00Ch,00Ch,01Eh,000h,000h,000h,000h ; Hex #34 + Db 000h,000h,0FEh,0C0h,0C0h,0C0h,0FCh,006h,006h,006h,0C6h,07Ch,000h,000h,000h,000h ; Hex #35 + Db 000h,000h,038h,060h,0C0h,0C0h,0FCh,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #36 + Db 000h,000h,0FEh,0C6h,006h,006h,00Ch,018h,030h,030h,030h,030h,000h,000h,000h,000h ; Hex #37 + Db 000h,000h,07Ch,0C6h,0C6h,0C6h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #38 + Db 000h,000h,07Ch,0C6h,0C6h,0C6h,07Eh,006h,006h,006h,00Ch,078h,000h,000h,000h,000h ; Hex #39 + Db 000h,000h,000h,000h,018h,018h,000h,000h,000h,018h,018h,000h,000h,000h,000h,000h ; Hex #3A + Db 000h,000h,000h,000h,018h,018h,000h,000h,000h,018h,018h,030h,000h,000h,000h,000h ; Hex #3B + Db 000h,000h,000h,006h,00Ch,018h,030h,060h,030h,018h,00Ch,006h,000h,000h,000h,000h ; Hex #3C + Db 000h,000h,000h,000h,000h,07Eh,000h,000h,07Eh,000h,000h,000h,000h,000h,000h,000h ; Hex #3D + Db 000h,000h,000h,060h,030h,018h,00Ch,006h,00Ch,018h,030h,060h,000h,000h,000h,000h ; Hex #3E + Db 000h,000h,07Ch,0C6h,0C6h,00Ch,018h,018h,018h,000h,018h,018h,000h,000h,000h,000h ; Hex #3F + Db 000h,000h,000h,07Ch,0C6h,0C6h,0DEh,0DEh,0DEh,0DCh,0C0h,07Ch,000h,000h,000h,000h ; Hex #40 + Db 000h,000h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #41 + Db 000h,000h,0FCh,066h,066h,066h,07Ch,066h,066h,066h,066h,0FCh,000h,000h,000h,000h ; Hex #42 + Db 000h,000h,03Ch,066h,0C2h,0C0h,0C0h,0C0h,0C0h,0C2h,066h,03Ch,000h,000h,000h,000h ; Hex #43 + Db 000h,000h,0F8h,06Ch,066h,066h,066h,066h,066h,066h,06Ch,0F8h,000h,000h,000h,000h ; Hex #44 + Db 000h,000h,0FEh,066h,062h,068h,078h,068h,060h,062h,066h,0FEh,000h,000h,000h,000h ; Hex #45 + Db 000h,000h,0FEh,066h,062h,068h,078h,068h,060h,060h,060h,0F0h,000h,000h,000h,000h ; Hex #46 + Db 000h,000h,03Ch,066h,0C2h,0C0h,0C0h,0DEh,0C6h,0C6h,066h,03Ah,000h,000h,000h,000h ; Hex #47 + Db 000h,000h,0C6h,0C6h,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #48 + Db 000h,000h,03Ch,018h,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #49 + Db 000h,000h,01Eh,00Ch,00Ch,00Ch,00Ch,00Ch,0CCh,0CCh,0CCh,078h,000h,000h,000h,000h ; Hex #4A + Db 000h,000h,0E6h,066h,066h,06Ch,078h,078h,06Ch,066h,066h,0E6h,000h,000h,000h,000h ; Hex #4B + Db 000h,000h,0F0h,060h,060h,060h,060h,060h,060h,062h,066h,0FEh,000h,000h,000h,000h ; Hex #4C + Db 000h,000h,0C6h,0EEh,0FEh,0FEh,0D6h,0C6h,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #4D + Db 000h,000h,0C6h,0E6h,0F6h,0FEh,0DEh,0CEh,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #4E + Db 000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #4F + Db 000h,000h,0FCh,066h,066h,066h,07Ch,060h,060h,060h,060h,0F0h,000h,000h,000h,000h ; Hex #50 + Db 000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0D6h,0DEh,07Ch,00Ch,00Eh,000h,000h ; Hex #51 + Db 000h,000h,0FCh,066h,066h,066h,07Ch,06Ch,066h,066h,066h,0E6h,000h,000h,000h,000h ; Hex #52 + Db 000h,000h,07Ch,0C6h,0C6h,060h,038h,00Ch,006h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #53 + Db 000h,000h,07Eh,07Eh,05Ah,018h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #54 + Db 000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #55 + Db 000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,06Ch,038h,010h,000h,000h,000h,000h ; Hex #56 + Db 000h,000h,0C6h,0C6h,0C6h,0C6h,0D6h,0D6h,0D6h,0FEh,0EEh,06Ch,000h,000h,000h,000h ; Hex #57 + Db 000h,000h,0C6h,0C6h,06Ch,07Ch,038h,038h,07Ch,06Ch,0C6h,0C6h,000h,000h,000h,000h ; Hex #58 + Db 000h,000h,066h,066h,066h,066h,03Ch,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #59 + Db 000h,000h,0FEh,0C6h,086h,00Ch,018h,030h,060h,0C2h,0C6h,0FEh,000h,000h,000h,000h ; Hex #5A + Db 000h,000h,03Ch,030h,030h,030h,030h,030h,030h,030h,030h,03Ch,000h,000h,000h,000h ; Hex #5B + Db 000h,000h,000h,080h,0C0h,0E0h,070h,038h,01Ch,00Eh,006h,002h,000h,000h,000h,000h ; Hex #5C + Db 000h,000h,03Ch,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,03Ch,000h,000h,000h,000h ; Hex #5D + Db 010h,038h,06Ch,0C6h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #5E + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,0FFh,000h,000h ; Hex #5F + Db 000h,030h,018h,00Ch,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #60 + Db 000h,000h,000h,000h,000h,078h,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #61 + Db 000h,000h,0E0h,060h,060h,078h,06Ch,066h,066h,066h,066h,07Ch,000h,000h,000h,000h ; Hex #62 + Db 000h,000h,000h,000h,000h,07Ch,0C6h,0C0h,0C0h,0C0h,0C6h,07Ch,000h,000h,000h,000h ; Hex #63 + Db 000h,000h,01Ch,00Ch,00Ch,03Ch,06Ch,0CCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #64 + Db 000h,000h,000h,000h,000h,07Ch,0C6h,0FEh,0C0h,0C0h,0C6h,07Ch,000h,000h,000h,000h ; Hex #65 + Db 000h,000h,01Ch,036h,032h,030h,078h,030h,030h,030h,030h,078h,000h,000h,000h,000h ; Hex #66 + Db 000h,000h,000h,000h,000h,076h,0CCh,0CCh,0CCh,0CCh,0CCh,07Ch,00Ch,0CCh,078h,000h ; Hex #67 + Db 000h,000h,0E0h,060h,060h,06Ch,076h,066h,066h,066h,066h,0E6h,000h,000h,000h,000h ; Hex #68 + Db 000h,000h,018h,018h,000h,038h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #69 + Db 000h,000h,006h,006h,000h,00Eh,006h,006h,006h,006h,006h,006h,066h,066h,03Ch,000h ; Hex #6A + Db 000h,000h,0E0h,060h,060h,066h,06Ch,078h,078h,06Ch,066h,0E6h,000h,000h,000h,000h ; Hex #6B + Db 000h,000h,038h,018h,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #6C + Db 000h,000h,000h,000h,000h,0ECh,0FEh,0D6h,0D6h,0D6h,0D6h,0C6h,000h,000h,000h,000h ; Hex #6D + Db 000h,000h,000h,000h,000h,0DCh,066h,066h,066h,066h,066h,066h,000h,000h,000h,000h ; Hex #6E + Db 000h,000h,000h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #6F + Db 000h,000h,000h,000h,000h,0DCh,066h,066h,066h,066h,066h,07Ch,060h,060h,0F0h,000h ; Hex #70 + Db 000h,000h,000h,000h,000h,076h,0CCh,0CCh,0CCh,0CCh,0CCh,07Ch,00Ch,00Ch,01Eh,000h ; Hex #71 + Db 000h,000h,000h,000h,000h,0DCh,076h,066h,060h,060h,060h,0F0h,000h,000h,000h,000h ; Hex #72 + Db 000h,000h,000h,000h,000h,07Ch,0C6h,060h,038h,00Ch,0C6h,07Ch,000h,000h,000h,000h ; Hex #73 + Db 000h,000h,010h,030h,030h,0FCh,030h,030h,030h,030h,036h,01Ch,000h,000h,000h,000h ; Hex #74 + Db 000h,000h,000h,000h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #75 + Db 000h,000h,000h,000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,06Ch,038h,000h,000h,000h,000h ; Hex #76 + Db 000h,000h,000h,000h,000h,0C6h,0C6h,0D6h,0D6h,0D6h,0FEh,06Ch,000h,000h,000h,000h ; Hex #77 + Db 000h,000h,000h,000h,000h,0C6h,06Ch,038h,038h,038h,06Ch,0C6h,000h,000h,000h,000h ; Hex #78 + Db 000h,000h,000h,000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Eh,006h,00Ch,0F8h,000h ; Hex #79 + Db 000h,000h,000h,000h,000h,0FEh,0CCh,018h,030h,060h,0C6h,0FEh,000h,000h,000h,000h ; Hex #7A + Db 000h,000h,00Eh,018h,018h,018h,070h,018h,018h,018h,018h,00Eh,000h,000h,000h,000h ; Hex #7B + Db 000h,000h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,000h,000h,000h,000h ; Hex #7C + Db 000h,000h,070h,018h,018h,018h,00Eh,018h,018h,018h,018h,070h,000h,000h,000h,000h ; Hex #7D + Db 000h,076h,0DCh,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #7E + Db 000h,000h,000h,000h,010h,038h,06Ch,0C6h,0C6h,0C6h,0FEh,000h,000h,000h,000h,000h ; Hex #7F + Db 000h,000h,03Ch,066h,0C2h,0C0h,0C0h,0C0h,0C0h,0C2h,066h,03Ch,018h,070h,000h,000h ; Hex #80 + Db 000h,000h,0CCh,000h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #81 + Db 000h,00Ch,018h,030h,000h,07Ch,0C6h,0FEh,0C0h,0C0h,0C6h,07Ch,000h,000h,000h,000h ; Hex #82 + Db 000h,010h,038h,06Ch,000h,078h,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #83 + Db 038h,06Ch,0C6h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #84 + Db 000h,060h,030h,018h,000h,078h,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #85 + Db 000h,000h,000h,07Fh,0DBh,0DBh,0DBh,07Bh,01Bh,01Bh,01Bh,01Bh,000h,000h,000h,000h ; Hex #86 + Db 000h,000h,000h,000h,000h,07Ch,0C6h,0C0h,0C0h,0C0h,0C6h,07Ch,018h,070h,000h,000h ; Hex #87 + Db 000h,010h,038h,06Ch,000h,07Ch,0C6h,0FEh,0C0h,0C0h,0C6h,07Ch,000h,000h,000h,000h ; Hex #88 + Db 000h,000h,0C6h,000h,000h,07Ch,0C6h,0FEh,0C0h,0C0h,0C6h,07Ch,000h,000h,000h,000h ; Hex #89 + Db 000h,060h,030h,018h,000h,07Ch,0C6h,0FEh,0C0h,0C0h,0C6h,07Ch,000h,000h,000h,000h ; Hex #8A + Db 000h,000h,066h,000h,000h,038h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #8B + Db 000h,018h,03Ch,066h,000h,038h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #8C + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,0FFh,000h,0FFh,000h ; Hex #8D + Db 018h,00Ch,006h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #8E + Db 000h,07Ch,0C6h,060h,038h,06Ch,0C6h,0C6h,06Ch,038h,00Ch,0C6h,07Ch,000h,000h,000h ; Hex #8F + Db 00Ch,018h,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h,000h,000h ; Hex #90 + Db 030h,018h,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h,000h,000h ; Hex #91 + Db 038h,06Ch,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h,000h,000h ; Hex #92 + Db 000h,010h,038h,06Ch,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #93 + Db 000h,0C6h,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h,000h,000h ; Hex #94 + Db 000h,066h,000h,03Ch,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #95 + Db 000h,030h,078h,0CCh,000h,0CCh,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #96 + Db 000h,060h,030h,018h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #97 + Db 000h,000h,000h,000h,0C6h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,0C6h,000h,000h,000h,000h ; Hex #98 + Db 038h,06Ch,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #99 + Db 000h,0C6h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #9A + Db 000h,018h,018h,07Ch,0C6h,0C0h,0C0h,0C0h,0C6h,07Ch,018h,018h,000h,000h,000h,000h ; Hex #9B + Db 000h,038h,06Ch,064h,060h,0F0h,060h,060h,060h,060h,0E6h,0FCh,000h,000h,000h,000h ; Hex #9C + Db 030h,018h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #9D + Db 038h,06Ch,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #9E + Db 000h,00Eh,01Bh,018h,018h,018h,07Eh,018h,018h,018h,0D8h,070h,000h,000h,000h,000h ; Hex #9F + Db 000h,018h,018h,018h,018h,018h,000h,000h,018h,018h,018h,018h,018h,000h,000h,000h ; Hex #A0 + Db 000h,00Ch,018h,030h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #A1 + Db 000h,018h,030h,060h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #A2 + Db 000h,018h,030h,060h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #A3 + Db 000h,0C6h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #A4 + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,018h,00Ch,078h,000h,000h ; Hex #A5 + Db 000h,07Ch,006h,03Ch,006h,006h,07Ch,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #A6 + Db 000h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #A7 + Db 03Ch,066h,000h,03Ch,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #A8 + Db 000h,000h,000h,000h,000h,000h,0FEh,0C0h,0C0h,0C0h,0C0h,000h,000h,000h,000h,000h ; Hex #A9 + Db 000h,000h,000h,000h,000h,000h,0FEh,006h,006h,006h,006h,000h,000h,000h,000h,000h ; Hex #AA + Db 000h,060h,0E0h,062h,066h,06Ch,018h,030h,060h,0DCh,086h,00Ch,018h,03Eh,000h,000h ; Hex #AB + Db 000h,060h,0E0h,062h,066h,06Ch,018h,030h,066h,0CEh,09Ah,03Fh,006h,006h,000h,000h ; Hex #AC + Db 000h,0E0h,030h,0E2h,036h,0ECh,018h,030h,066h,0CEh,09Ah,03Fh,006h,006h,000h,000h ; Hex #AD + Db 000h,000h,000h,000h,000h,036h,06Ch,0D8h,06Ch,036h,000h,000h,000h,000h,000h,000h ; Hex #AE + Db 000h,000h,000h,000h,000h,0D8h,06Ch,036h,06Ch,0D8h,000h,000h,000h,000h,000h,000h ; Hex #AF + Db 011h,044h,011h,044h,011h,044h,011h,044h,011h,044h,011h,044h,011h,044h,011h,044h ; Hex #B0 + Db 055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh ; Hex #B1 + Db 0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h ; Hex #B2 + Db 018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B3 + Db 018h,018h,018h,018h,018h,018h,018h,0F8h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B4 + Db 018h,018h,018h,018h,018h,0F8h,018h,0F8h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B5 + Db 036h,036h,036h,036h,036h,036h,036h,0F6h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #B6 + Db 000h,000h,000h,000h,000h,000h,000h,0FEh,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #B7 + Db 000h,000h,000h,000h,000h,0F8h,018h,0F8h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B8 + Db 036h,036h,036h,036h,036h,0F6h,006h,0F6h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #B9 + Db 036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #BA + Db 000h,000h,000h,000h,000h,0FEh,006h,0F6h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #BB + Db 036h,036h,036h,036h,036h,0F6h,006h,0FEh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #BC + Db 036h,036h,036h,036h,036h,036h,036h,0FEh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #BD + Db 018h,018h,018h,018h,018h,0F8h,018h,0F8h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #BE + Db 000h,000h,000h,000h,000h,000h,000h,0F8h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #BF + Db 018h,018h,018h,018h,018h,018h,018h,01Fh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #C0 + Db 018h,018h,018h,018h,018h,018h,018h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #C1 + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #C2 + Db 018h,018h,018h,018h,018h,018h,018h,01Fh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #C3 + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #C4 + Db 018h,018h,018h,018h,018h,018h,018h,0FFh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #C5 + Db 018h,018h,018h,018h,018h,01Fh,018h,01Fh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #C6 + Db 036h,036h,036h,036h,036h,036h,036h,037h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #C7 + Db 036h,036h,036h,036h,036h,037h,030h,03Fh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #C8 + Db 000h,000h,000h,000h,000h,03Fh,030h,037h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #C9 + Db 036h,036h,036h,036h,036h,0F7h,000h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #CA + Db 000h,000h,000h,000h,000h,0FFh,000h,0F7h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #CB + Db 036h,036h,036h,036h,036h,037h,030h,037h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #CC + Db 000h,000h,000h,000h,000h,0FFh,000h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #CD + Db 036h,036h,036h,036h,036h,0F7h,000h,0F7h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #CE + Db 018h,018h,018h,018h,018h,0FFh,000h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #CF + Db 036h,036h,036h,036h,036h,036h,036h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #D0 + Db 000h,000h,000h,000h,000h,0FFh,000h,0FFh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #D1 + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #D2 + Db 036h,036h,036h,036h,036h,036h,036h,03Fh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #D3 + Db 018h,018h,018h,018h,018h,01Fh,018h,01Fh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #D4 + Db 000h,000h,000h,000h,000h,01Fh,018h,01Fh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #D5 + Db 000h,000h,000h,000h,000h,000h,000h,03Fh,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #D6 + Db 036h,036h,036h,036h,036h,036h,036h,0FFh,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #D7 + Db 018h,018h,018h,018h,018h,0FFh,018h,0FFh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #D8 + Db 018h,018h,018h,018h,018h,018h,018h,0F8h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #D9 + Db 000h,000h,000h,000h,000h,000h,000h,01Fh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #DA + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #DB + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #DC + Db 0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h ; Hex #DD + Db 00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh ; Hex #DE + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #DF + Db 000h,000h,000h,000h,000h,076h,0DCh,0D8h,0D8h,0D8h,0DCh,076h,000h,000h,000h,000h ; Hex #E0 + Db 000h,000h,078h,0CCh,0CCh,0CCh,0D8h,0CCh,0C6h,0C6h,0C6h,0CCh,000h,000h,000h,000h ; Hex #E1 + Db 000h,000h,0FEh,0C6h,0C6h,0C0h,0C0h,0C0h,0C0h,0C0h,0C0h,0C0h,000h,000h,000h,000h ; Hex #E2 + Db 000h,000h,000h,000h,000h,0FEh,06Ch,06Ch,06Ch,06Ch,06Ch,06Ch,000h,000h,000h,000h ; Hex #E3 + Db 000h,000h,0FEh,0C6h,060h,030h,018h,018h,030h,060h,0C6h,0FEh,000h,000h,000h,000h ; Hex #E4 + Db 000h,000h,000h,000h,000h,07Eh,0D8h,0D8h,0D8h,0D8h,0D8h,070h,000h,000h,000h,000h ; Hex #E5 + Db 000h,000h,000h,000h,000h,066h,066h,066h,066h,066h,066h,07Ch,060h,060h,0C0h,000h ; Hex #E6 + Db 000h,000h,000h,000h,076h,0DCh,018h,018h,018h,018h,018h,018h,000h,000h,000h,000h ; Hex #E7 + Db 000h,000h,07Eh,018h,03Ch,066h,066h,066h,066h,03Ch,018h,07Eh,000h,000h,000h,000h ; Hex #E8 + Db 000h,000h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,06Ch,038h,000h,000h,000h,000h ; Hex #E9 + Db 000h,000h,038h,06Ch,0C6h,0C6h,0C6h,06Ch,06Ch,06Ch,06Ch,0EEh,000h,000h,000h,000h ; Hex #EA + Db 000h,000h,01Eh,030h,018h,00Ch,03Eh,066h,066h,066h,066h,03Ch,000h,000h,000h,000h ; Hex #EB + Db 000h,000h,000h,000h,000h,07Eh,0DBh,0DBh,0DBh,07Eh,000h,000h,000h,000h,000h,000h ; Hex #EC + Db 000h,000h,000h,003h,006h,07Eh,0DBh,0DBh,0F3h,07Eh,060h,0C0h,000h,000h,000h,000h ; Hex #ED + Db 000h,000h,01Ch,030h,060h,060h,07Ch,060h,060h,060h,030h,01Ch,000h,000h,000h,000h ; Hex #EE + Db 000h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #EF + Db 000h,000h,000h,000h,0FEh,000h,000h,0FEh,000h,000h,0FEh,000h,000h,000h,000h,000h ; Hex #F0 + Db 000h,000h,000h,000h,018h,018h,07Eh,018h,018h,000h,000h,07Eh,000h,000h,000h,000h ; Hex #F1 + Db 000h,000h,000h,030h,018h,00Ch,006h,00Ch,018h,030h,000h,07Eh,000h,000h,000h,000h ; Hex #F2 + Db 000h,000h,000h,00Ch,018h,030h,060h,030h,018h,00Ch,000h,07Eh,000h,000h,000h,000h ; Hex #F3 + Db 000h,000h,00Eh,01Bh,01Bh,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #F4 + Db 018h,018h,018h,018h,018h,018h,018h,018h,018h,0D8h,0D8h,0D8h,070h,000h,000h,000h ; Hex #F5 + Db 000h,000h,000h,000h,000h,018h,000h,07Eh,000h,018h,000h,000h,000h,000h,000h,000h ; Hex #F6 + Db 000h,000h,000h,000h,000h,076h,0DCh,000h,076h,0DCh,000h,000h,000h,000h,000h,000h ; Hex #F7 + Db 000h,038h,06Ch,06Ch,038h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #F8 + Db 000h,000h,000h,000h,000h,000h,000h,018h,018h,000h,000h,000h,000h,000h,000h,000h ; Hex #F9 + Db 000h,000h,000h,000h,000h,000h,000h,018h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FA + Db 000h,00Fh,00Ch,00Ch,00Ch,00Ch,00Ch,0ECh,06Ch,06Ch,03Ch,01Ch,000h,000h,000h,000h ; Hex #FB + Db 000h,06Ch,036h,036h,036h,036h,036h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FC + Db 000h,03Ch,066h,00Ch,018h,032h,07Eh,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FD + Db 000h,000h,000h,000h,07Eh,07Eh,07Eh,07Eh,07Eh,07Eh,07Eh,000h,000h,000h,000h,000h ; Hex #FE + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FF + diff --git a/v4.0/src/DEV/DISPLAY/EGA/863-8X8.ASM b/v4.0/src/DEV/DISPLAY/EGA/863-8X8.ASM new file mode 100644 index 0000000..d11925f --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/EGA/863-8X8.ASM @@ -0,0 +1,270 @@ +;*************************************************** +; CHARACTER FONT FILE +; Source Assembler File +; +; CODE PAGE: 863 +; FONT RESOLUTION: 8 x 8 +; +; DATE CREATED:05-28-1987 +; +; +; Output file from: MULTIFON, Version 1A +; +;*************************************************** + Db 000h,000h,000h,000h,000h,000h,000h,000h ; Hex #0 + Db 07Eh,081h,0A5h,081h,0BDh,099h,081h,07Eh ; Hex #1 + Db 07Eh,0FFh,0DBh,0FFh,0C3h,0E7h,0FFh,07Eh ; Hex #2 + Db 06Ch,0FEh,0FEh,0FEh,07Ch,038h,010h,000h ; Hex #3 + Db 010h,038h,07Ch,0FEh,07Ch,038h,010h,000h ; Hex #4 + Db 038h,07Ch,038h,0FEh,0FEh,0D6h,010h,038h ; Hex #5 + Db 010h,038h,07Ch,0FEh,0FEh,07Ch,010h,038h ; Hex #6 + Db 000h,000h,018h,03Ch,03Ch,018h,000h,000h ; Hex #7 + Db 0FFh,0FFh,0E7h,0C3h,0C3h,0E7h,0FFh,0FFh ; Hex #8 + Db 000h,03Ch,066h,042h,042h,066h,03Ch,000h ; Hex #9 + Db 0FFh,0C3h,099h,0BDh,0BDh,099h,0C3h,0FFh ; Hex #A + Db 00Fh,007h,00Fh,07Dh,0CCh,0CCh,0CCh,078h ; Hex #B + Db 03Ch,066h,066h,066h,03Ch,018h,07Eh,018h ; Hex #C + Db 03Fh,033h,03Fh,030h,030h,070h,0F0h,0E0h ; Hex #D + Db 07Fh,063h,07Fh,063h,063h,067h,0E6h,0C0h ; Hex #E + Db 018h,0DBh,03Ch,0E7h,0E7h,03Ch,0DBh,018h ; Hex #F + Db 080h,0E0h,0F8h,0FEh,0F8h,0E0h,080h,000h ; Hex #10 + Db 002h,00Eh,03Eh,0FEh,03Eh,00Eh,002h,000h ; Hex #11 + Db 018h,03Ch,07Eh,018h,018h,07Eh,03Ch,018h ; Hex #12 + Db 066h,066h,066h,066h,066h,000h,066h,000h ; Hex #13 + Db 07Fh,0DBh,0DBh,07Bh,01Bh,01Bh,01Bh,000h ; Hex #14 + Db 03Eh,061h,03Ch,066h,066h,03Ch,086h,07Ch ; Hex #15 + Db 000h,000h,000h,000h,07Eh,07Eh,07Eh,000h ; Hex #16 + Db 018h,03Ch,07Eh,018h,07Eh,03Ch,018h,0FFh ; Hex #17 + Db 018h,03Ch,07Eh,018h,018h,018h,018h,000h ; Hex #18 + Db 018h,018h,018h,018h,07Eh,03Ch,018h,000h ; Hex #19 + Db 000h,018h,00Ch,0FEh,00Ch,018h,000h,000h ; Hex #1A + Db 000h,030h,060h,0FEh,060h,030h,000h,000h ; Hex #1B + Db 000h,000h,0C0h,0C0h,0C0h,0FEh,000h,000h ; Hex #1C + Db 000h,024h,066h,0FFh,066h,024h,000h,000h ; Hex #1D + Db 000h,018h,03Ch,07Eh,0FFh,0FFh,000h,000h ; Hex #1E + Db 000h,0FFh,0FFh,07Eh,03Ch,018h,000h,000h ; Hex #1F + Db 000h,000h,000h,000h,000h,000h,000h,000h ; Hex #20 + Db 018h,03Ch,03Ch,018h,018h,000h,018h,000h ; Hex #21 + Db 066h,066h,024h,000h,000h,000h,000h,000h ; Hex #22 + Db 06Ch,06Ch,0FEh,06Ch,0FEh,06Ch,06Ch,000h ; Hex #23 + Db 018h,03Eh,060h,03Ch,006h,07Ch,018h,000h ; Hex #24 + Db 000h,0C6h,0CCh,018h,030h,066h,0C6h,000h ; Hex #25 + Db 038h,06Ch,038h,076h,0DCh,0CCh,076h,000h ; Hex #26 + Db 018h,018h,030h,000h,000h,000h,000h,000h ; Hex #27 + Db 00Ch,018h,030h,030h,030h,018h,00Ch,000h ; Hex #28 + Db 030h,018h,00Ch,00Ch,00Ch,018h,030h,000h ; Hex #29 + Db 000h,066h,03Ch,0FFh,03Ch,066h,000h,000h ; Hex #2A + Db 000h,018h,018h,07Eh,018h,018h,000h,000h ; Hex #2B + Db 000h,000h,000h,000h,000h,018h,018h,030h ; Hex #2C + Db 000h,000h,000h,07Eh,000h,000h,000h,000h ; Hex #2D + Db 000h,000h,000h,000h,000h,018h,018h,000h ; Hex #2E + Db 006h,00Ch,018h,030h,060h,0C0h,080h,000h ; Hex #2F + Db 038h,06Ch,0C6h,0D6h,0C6h,06Ch,038h,000h ; Hex #30 + Db 018h,038h,018h,018h,018h,018h,07Eh,000h ; Hex #31 + Db 07Ch,0C6h,006h,01Ch,030h,066h,0FEh,000h ; Hex #32 + Db 07Ch,0C6h,006h,03Ch,006h,0C6h,07Ch,000h ; Hex #33 + Db 01Ch,03Ch,06Ch,0CCh,0FEh,00Ch,01Eh,000h ; Hex #34 + Db 0FEh,0C0h,0C0h,0FCh,006h,0C6h,07Ch,000h ; Hex #35 + Db 038h,060h,0C0h,0FCh,0C6h,0C6h,07Ch,000h ; Hex #36 + Db 0FEh,0C6h,00Ch,018h,030h,030h,030h,000h ; Hex #37 + Db 07Ch,0C6h,0C6h,07Ch,0C6h,0C6h,07Ch,000h ; Hex #38 + Db 07Ch,0C6h,0C6h,07Eh,006h,00Ch,078h,000h ; Hex #39 + Db 000h,018h,018h,000h,000h,018h,018h,000h ; Hex #3A + Db 000h,018h,018h,000h,000h,018h,018h,030h ; Hex #3B + Db 006h,00Ch,018h,030h,018h,00Ch,006h,000h ; Hex #3C + Db 000h,000h,07Eh,000h,000h,07Eh,000h,000h ; Hex #3D + Db 060h,030h,018h,00Ch,018h,030h,060h,000h ; Hex #3E + Db 07Ch,0C6h,00Ch,018h,018h,000h,018h,000h ; Hex #3F + Db 07Ch,0C6h,0DEh,0DEh,0DEh,0C0h,078h,000h ; Hex #40 + Db 038h,06Ch,0C6h,0FEh,0C6h,0C6h,0C6h,000h ; Hex #41 + Db 0FCh,066h,066h,07Ch,066h,066h,0FCh,000h ; Hex #42 + Db 03Ch,066h,0C0h,0C0h,0C0h,066h,03Ch,000h ; Hex #43 + Db 0F8h,06Ch,066h,066h,066h,06Ch,0F8h,000h ; Hex #44 + Db 0FEh,062h,068h,078h,068h,062h,0FEh,000h ; Hex #45 + Db 0FEh,062h,068h,078h,068h,060h,0F0h,000h ; Hex #46 + Db 03Ch,066h,0C0h,0C0h,0CEh,066h,03Ah,000h ; Hex #47 + Db 0C6h,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h ; Hex #48 + Db 03Ch,018h,018h,018h,018h,018h,03Ch,000h ; Hex #49 + Db 01Eh,00Ch,00Ch,00Ch,0CCh,0CCh,078h,000h ; Hex #4A + Db 0E6h,066h,06Ch,078h,06Ch,066h,0E6h,000h ; Hex #4B + Db 0F0h,060h,060h,060h,062h,066h,0FEh,000h ; Hex #4C + Db 0C6h,0EEh,0FEh,0FEh,0D6h,0C6h,0C6h,000h ; Hex #4D + Db 0C6h,0E6h,0F6h,0DEh,0CEh,0C6h,0C6h,000h ; Hex #4E + Db 07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h ; Hex #4F + Db 0FCh,066h,066h,07Ch,060h,060h,0F0h,000h ; Hex #50 + Db 07Ch,0C6h,0C6h,0C6h,0C6h,0CEh,07Ch,00Eh ; Hex #51 + Db 0FCh,066h,066h,07Ch,06Ch,066h,0E6h,000h ; Hex #52 + Db 03Ch,066h,030h,018h,00Ch,066h,03Ch,000h ; Hex #53 + Db 07Eh,07Eh,05Ah,018h,018h,018h,03Ch,000h ; Hex #54 + Db 0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h ; Hex #55 + Db 0C6h,0C6h,0C6h,0C6h,0C6h,06Ch,038h,000h ; Hex #56 + Db 0C6h,0C6h,0C6h,0D6h,0D6h,0FEh,06Ch,000h ; Hex #57 + Db 0C6h,0C6h,06Ch,038h,06Ch,0C6h,0C6h,000h ; Hex #58 + Db 066h,066h,066h,03Ch,018h,018h,03Ch,000h ; Hex #59 + Db 0FEh,0C6h,08Ch,018h,032h,066h,0FEh,000h ; Hex #5A + Db 03Ch,030h,030h,030h,030h,030h,03Ch,000h ; Hex #5B + Db 0C0h,060h,030h,018h,00Ch,006h,002h,000h ; Hex #5C + Db 03Ch,00Ch,00Ch,00Ch,00Ch,00Ch,03Ch,000h ; Hex #5D + Db 010h,038h,06Ch,0C6h,000h,000h,000h,000h ; Hex #5E + Db 000h,000h,000h,000h,000h,000h,000h,0FFh ; Hex #5F + Db 030h,018h,00Ch,000h,000h,000h,000h,000h ; Hex #60 + Db 000h,000h,078h,00Ch,07Ch,0CCh,076h,000h ; Hex #61 + Db 0E0h,060h,07Ch,066h,066h,066h,0DCh,000h ; Hex #62 + Db 000h,000h,07Ch,0C6h,0C0h,0C6h,07Ch,000h ; Hex #63 + Db 01Ch,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h ; Hex #64 + Db 000h,000h,07Ch,0C6h,0FEh,0C0h,07Ch,000h ; Hex #65 + Db 03Ch,066h,060h,0F8h,060h,060h,0F0h,000h ; Hex #66 + Db 000h,000h,076h,0CCh,0CCh,07Ch,00Ch,0F8h ; Hex #67 + Db 0E0h,060h,06Ch,076h,066h,066h,0E6h,000h ; Hex #68 + Db 018h,000h,038h,018h,018h,018h,03Ch,000h ; Hex #69 + Db 006h,000h,006h,006h,006h,066h,066h,03Ch ; Hex #6A + Db 0E0h,060h,066h,06Ch,078h,06Ch,0E6h,000h ; Hex #6B + Db 038h,018h,018h,018h,018h,018h,03Ch,000h ; Hex #6C + Db 000h,000h,0ECh,0FEh,0D6h,0D6h,0D6h,000h ; Hex #6D + Db 000h,000h,0DCh,066h,066h,066h,066h,000h ; Hex #6E + Db 000h,000h,07Ch,0C6h,0C6h,0C6h,07Ch,000h ; Hex #6F + Db 000h,000h,0DCh,066h,066h,07Ch,060h,0F0h ; Hex #70 + Db 000h,000h,076h,0CCh,0CCh,07Ch,00Ch,01Eh ; Hex #71 + Db 000h,000h,0DCh,076h,060h,060h,0F0h,000h ; Hex #72 + Db 000h,000h,07Eh,0C0h,07Ch,006h,0FCh,000h ; Hex #73 + Db 030h,030h,0FCh,030h,030h,036h,01Ch,000h ; Hex #74 + Db 000h,000h,0CCh,0CCh,0CCh,0CCh,076h,000h ; Hex #75 + Db 000h,000h,0C6h,0C6h,0C6h,06Ch,038h,000h ; Hex #76 + Db 000h,000h,0C6h,0D6h,0D6h,0FEh,06Ch,000h ; Hex #77 + Db 000h,000h,0C6h,06Ch,038h,06Ch,0C6h,000h ; Hex #78 + Db 000h,000h,0C6h,0C6h,0C6h,07Eh,006h,0FCh ; Hex #79 + Db 000h,000h,07Eh,04Ch,018h,032h,07Eh,000h ; Hex #7A + Db 00Eh,018h,018h,070h,018h,018h,00Eh,000h ; Hex #7B + Db 018h,018h,018h,018h,018h,018h,018h,000h ; Hex #7C + Db 070h,018h,018h,00Eh,018h,018h,070h,000h ; Hex #7D + Db 076h,0DCh,000h,000h,000h,000h,000h,000h ; Hex #7E + Db 000h,010h,038h,06Ch,0C6h,0C6h,0FEh,000h ; Hex #7F + Db 07Ch,0C6h,0C0h,0C0h,0C6h,07Ch,00Ch,078h ; Hex #80 + Db 0CCh,000h,0CCh,0CCh,0CCh,0CCh,076h,000h ; Hex #81 + Db 00Ch,018h,07Ch,0C6h,0FEh,0C0h,07Ch,000h ; Hex #82 + Db 07Ch,082h,078h,00Ch,07Ch,0CCh,076h,000h ; Hex #83 + Db 07Ch,082h,038h,06Ch,0C6h,0FEh,0C6h,000h ; Hex #84 + Db 030h,018h,078h,00Ch,07Ch,0CCh,076h,000h ; Hex #85 + Db 07Fh,0DBh,0DBh,07Bh,01Bh,01Bh,01Bh,000h ; Hex #86 + Db 000h,000h,07Eh,0C0h,0C0h,07Eh,00Ch,038h ; Hex #87 + Db 07Ch,082h,07Ch,0C6h,0FEh,0C0h,07Ch,000h ; Hex #88 + Db 0C6h,000h,07Ch,0C6h,0FEh,0C0h,07Ch,000h ; Hex #89 + Db 030h,018h,07Ch,0C6h,0FEh,0C0h,07Ch,000h ; Hex #8A + Db 066h,000h,038h,018h,018h,018h,03Ch,000h ; Hex #8B + Db 07Ch,082h,038h,018h,018h,018h,03Ch,000h ; Hex #8C + Db 000h,000h,000h,000h,000h,0FFh,000h,0FFh ; Hex #8D + Db 018h,00Ch,038h,06Ch,0C6h,0FEh,0C6h,000h ; Hex #8E + Db 03Eh,061h,03Ch,066h,066h,03Ch,086h,07Ch ; Hex #8F + Db 018h,030h,0FEh,0C0h,0F8h,0C0h,0FEh,000h ; Hex #90 + Db 030h,018h,0FEh,0C0h,0FCh,0C0h,0FEh,000h ; Hex #91 + Db 038h,044h,0FEh,0C0h,0FCh,0C0h,0FEh,000h ; Hex #92 + Db 07Ch,082h,07Ch,0C6h,0C6h,0C6h,07Ch,000h ; Hex #93 + Db 0C6h,000h,0FEh,0C0h,0FCh,0C0h,0FEh,000h ; Hex #94 + Db 066h,000h,03Ch,018h,018h,018h,03Ch,000h ; Hex #95 + Db 078h,084h,000h,0CCh,0CCh,0CCh,076h,000h ; Hex #96 + Db 060h,030h,0CCh,0CCh,0CCh,0CCh,076h,000h ; Hex #97 + Db 000h,0C6h,07Ch,0C6h,0C6h,07Ch,0C6h,000h ; Hex #98 + Db 07Ch,082h,038h,06Ch,0C6h,06Ch,038h,000h ; Hex #99 + Db 0C6h,000h,0C6h,0C6h,0C6h,0C6h,07Ch,000h ; Hex #9A + Db 018h,018h,07Eh,0C0h,0C0h,07Eh,018h,018h ; Hex #9B + Db 038h,06Ch,064h,0F0h,060h,066h,0FCh,000h ; Hex #9C + Db 060h,030h,0C6h,0C6h,0C6h,0C6h,07Ch,000h ; Hex #9D + Db 07Ch,082h,000h,0C6h,0C6h,0C6h,07Ch,000h ; Hex #9E + Db 00Eh,01Bh,018h,03Ch,018h,0D8h,070h,000h ; Hex #9F + Db 018h,018h,018h,000h,000h,018h,018h,018h ; Hex #A0 + Db 00Ch,018h,030h,000h,000h,000h,000h,000h ; Hex #A1 + Db 00Ch,018h,07Ch,0C6h,0C6h,0C6h,07Ch,000h ; Hex #A2 + Db 018h,030h,0CCh,0CCh,0CCh,0CCh,076h,000h ; Hex #A3 + Db 000h,0C6h,000h,000h,000h,000h,000h,000h ; Hex #A4 + Db 000h,000h,000h,000h,000h,018h,00Ch,078h ; Hex #A5 + Db 078h,00Ch,038h,00Ch,078h,000h,000h,000h ; Hex #A6 + Db 0FFh,000h,000h,000h,000h,000h,000h,000h ; Hex #A7 + Db 07Eh,081h,03Ch,018h,018h,018h,03Ch,000h ; Hex #A8 + Db 000h,000h,000h,0FEh,0C0h,0C0h,000h,000h ; Hex #A9 + Db 000h,000h,000h,0FEh,006h,006h,000h,000h ; Hex #AA + Db 063h,0E6h,06Ch,07Eh,033h,066h,0CCh,00Fh ; Hex #AB + Db 063h,0E6h,06Ch,07Ah,036h,06Ah,0DFh,006h ; Hex #AC + Db 0E1h,032h,064h,03Ah,0F6h,02Ah,05Fh,082h ; Hex #AD + Db 000h,033h,066h,0CCh,066h,033h,000h,000h ; Hex #AE + Db 000h,0CCh,066h,033h,066h,0CCh,000h,000h ; Hex #AF + Db 022h,088h,022h,088h,022h,088h,022h,088h ; Hex #B0 + Db 055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh ; Hex #B1 + Db 077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh ; Hex #B2 + Db 018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B3 + Db 018h,018h,018h,018h,0F8h,018h,018h,018h ; Hex #B4 + Db 018h,018h,0F8h,018h,0F8h,018h,018h,018h ; Hex #B5 + Db 036h,036h,036h,036h,0F6h,036h,036h,036h ; Hex #B6 + Db 000h,000h,000h,000h,0FEh,036h,036h,036h ; Hex #B7 + Db 000h,000h,0F8h,018h,0F8h,018h,018h,018h ; Hex #B8 + Db 036h,036h,0F6h,006h,0F6h,036h,036h,036h ; Hex #B9 + Db 036h,036h,036h,036h,036h,036h,036h,036h ; Hex #BA + Db 000h,000h,0FEh,006h,0F6h,036h,036h,036h ; Hex #BB + Db 036h,036h,0F6h,006h,0FEh,000h,000h,000h ; Hex #BC + Db 036h,036h,036h,036h,0FEh,000h,000h,000h ; Hex #BD + Db 018h,018h,0F8h,018h,0F8h,000h,000h,000h ; Hex #BE + Db 000h,000h,000h,000h,0F8h,018h,018h,018h ; Hex #BF + Db 018h,018h,018h,018h,01Fh,000h,000h,000h ; Hex #C0 + Db 018h,018h,018h,018h,0FFh,000h,000h,000h ; Hex #C1 + Db 000h,000h,000h,000h,0FFh,018h,018h,018h ; Hex #C2 + Db 018h,018h,018h,018h,01Fh,018h,018h,018h ; Hex #C3 + Db 000h,000h,000h,000h,0FFh,000h,000h,000h ; Hex #C4 + Db 018h,018h,018h,018h,0FFh,018h,018h,018h ; Hex #C5 + Db 018h,018h,01Fh,018h,01Fh,018h,018h,018h ; Hex #C6 + Db 036h,036h,036h,036h,037h,036h,036h,036h ; Hex #C7 + Db 036h,036h,037h,030h,03Fh,000h,000h,000h ; Hex #C8 + Db 000h,000h,03Fh,030h,037h,036h,036h,036h ; Hex #C9 + Db 036h,036h,0F7h,000h,0FFh,000h,000h,000h ; Hex #CA + Db 000h,000h,0FFh,000h,0F7h,036h,036h,036h ; Hex #CB + Db 036h,036h,037h,030h,037h,036h,036h,036h ; Hex #CC + Db 000h,000h,0FFh,000h,0FFh,000h,000h,000h ; Hex #CD + Db 036h,036h,0F7h,000h,0F7h,036h,036h,036h ; Hex #CE + Db 018h,018h,0FFh,000h,0FFh,000h,000h,000h ; Hex #CF + Db 036h,036h,036h,036h,0FFh,000h,000h,000h ; Hex #D0 + Db 000h,000h,0FFh,000h,0FFh,018h,018h,018h ; Hex #D1 + Db 000h,000h,000h,000h,0FFh,036h,036h,036h ; Hex #D2 + Db 036h,036h,036h,036h,03Fh,000h,000h,000h ; Hex #D3 + Db 018h,018h,01Fh,018h,01Fh,000h,000h,000h ; Hex #D4 + Db 000h,000h,01Fh,018h,01Fh,018h,018h,018h ; Hex #D5 + Db 000h,000h,000h,000h,03Fh,036h,036h,036h ; Hex #D6 + Db 036h,036h,036h,036h,0FFh,036h,036h,036h ; Hex #D7 + Db 018h,018h,0FFh,018h,0FFh,018h,018h,018h ; Hex #D8 + Db 018h,018h,018h,018h,0F8h,000h,000h,000h ; Hex #D9 + Db 000h,000h,000h,000h,01Fh,018h,018h,018h ; Hex #DA + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #DB + Db 000h,000h,000h,000h,0FFh,0FFh,0FFh,0FFh ; Hex #DC + Db 0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h ; Hex #DD + Db 00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh ; Hex #DE + Db 0FFh,0FFh,0FFh,0FFh,000h,000h,000h,000h ; Hex #DF + Db 000h,000h,076h,0DCh,0C8h,0DCh,076h,000h ; Hex #E0 + Db 078h,0CCh,0CCh,0D8h,0CCh,0C6h,0CCh,000h ; Hex #E1 + Db 0FEh,0C6h,0C0h,0C0h,0C0h,0C0h,0C0h,000h ; Hex #E2 + Db 000h,000h,0FEh,06Ch,06Ch,06Ch,06Ch,000h ; Hex #E3 + Db 0FEh,0C6h,060h,030h,060h,0C6h,0FEh,000h ; Hex #E4 + Db 000h,000h,07Eh,0D8h,0D8h,0D8h,070h,000h ; Hex #E5 + Db 000h,000h,066h,066h,066h,066h,07Ch,0C0h ; Hex #E6 + Db 000h,076h,0DCh,018h,018h,018h,018h,000h ; Hex #E7 + Db 07Eh,018h,03Ch,066h,066h,03Ch,018h,07Eh ; Hex #E8 + Db 038h,06Ch,0C6h,0FEh,0C6h,06Ch,038h,000h ; Hex #E9 + Db 038h,06Ch,0C6h,0C6h,06Ch,06Ch,0EEh,000h ; Hex #EA + Db 00Eh,018h,00Ch,03Eh,066h,066h,03Ch,000h ; Hex #EB + Db 000h,000h,07Eh,0DBh,0DBh,07Eh,000h,000h ; Hex #EC + Db 006h,00Ch,07Eh,0DBh,0DBh,07Eh,060h,0C0h ; Hex #ED + Db 01Eh,030h,060h,07Eh,060h,030h,01Eh,000h ; Hex #EE + Db 000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,000h ; Hex #EF + Db 000h,0FEh,000h,0FEh,000h,0FEh,000h,000h ; Hex #F0 + Db 018h,018h,07Eh,018h,018h,000h,07Eh,000h ; Hex #F1 + Db 030h,018h,00Ch,018h,030h,000h,07Eh,000h ; Hex #F2 + Db 00Ch,018h,030h,018h,00Ch,000h,07Eh,000h ; Hex #F3 + Db 00Eh,01Bh,01Bh,018h,018h,018h,018h,018h ; Hex #F4 + Db 018h,018h,018h,018h,018h,0D8h,0D8h,070h ; Hex #F5 + Db 000h,018h,000h,07Eh,000h,018h,000h,000h ; Hex #F6 + Db 000h,076h,0DCh,000h,076h,0DCh,000h,000h ; Hex #F7 + Db 038h,06Ch,06Ch,038h,000h,000h,000h,000h ; Hex #F8 + Db 000h,000h,000h,018h,018h,000h,000h,000h ; Hex #F9 + Db 000h,000h,000h,018h,000h,000h,000h,000h ; Hex #FA + Db 00Fh,00Ch,00Ch,00Ch,0ECh,06Ch,03Ch,01Ch ; Hex #FB + Db 06Ch,036h,036h,036h,036h,000h,000h,000h ; Hex #FC + Db 078h,00Ch,018h,030h,07Ch,000h,000h,000h ; Hex #FD + Db 000h,000h,03Ch,03Ch,03Ch,03Ch,000h,000h ; Hex #FE + Db 000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FF + diff --git a/v4.0/src/DEV/DISPLAY/EGA/863-CPI.ASM b/v4.0/src/DEV/DISPLAY/EGA/863-CPI.ASM new file mode 100644 index 0000000..62622ff --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/EGA/863-CPI.ASM @@ -0,0 +1,49 @@ +CODE SEGMENT BYTE PUBLIC 'CODE' + ASSUME CS:CODE,DS:CODE + +IF1 + %OUT EGA.CPI creation file + %OUT . + %OUT CP SRC files: + %OUT . + %OUT . CODE PAGE: 863 +ENDIF + +EGA863: DW LEN_863 ; SIZE OF ENTRY HEADER + DW POST_EGA863,0 ; POINTER TO NEXT HEADER + DW 1 ; DEVICE TYPE + DB "EGA " ; DEVICE SUBTYPE ID + DW 863 ; CODE PAGE ID + DW 3 DUP(0) ; RESERVED + DW OFFSET DATA863,0 ; POINTER TO FONTS +LEN_863 EQU ($-EGA863) ; + ; +DATA863:DW 1 ; CART/NON-CART + DW 3 ; # OF FONTS + DW LEN_D863 ; LENGTH OF DATA +D863: ; + DB 16,8 ; CHARACTER BOX SIZE + DB 0,0 ; ASPECT RATIO (UNUSED) + DW 256 ; NUMBER OF CHARACTERS + ; + INCLUDE 863-8X16.ASM ; + ; + DB 14,8 ; CHARACTER BOX SIZE + DB 0,0 ; ASPECT RATIO (UNUSED) + DW 256 ; NUMBER OF CHARACTERS + ; + INCLUDE 863-8X14.ASM ; + ; + DB 8,8 ; CHARACTER BOX SIZE + DB 0,0 ; ASPECT RATIO (UNUSED) + DW 256 ; NUMBER OF CHARACTERS + ; + INCLUDE 863-8X8.ASM ; + ; +LEN_D863 EQU ($-D863) ; + ; +POST_EGA863 EQU $ ; + ; +CODE ENDS ; + END ; + \ No newline at end of file diff --git a/v4.0/src/DEV/DISPLAY/EGA/865-8X14.ASM b/v4.0/src/DEV/DISPLAY/EGA/865-8X14.ASM new file mode 100644 index 0000000..e7171f1 --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/EGA/865-8X14.ASM @@ -0,0 +1,270 @@ +;*************************************************** +; CHARACTER FONT FILE +; Source Assembler File +; +; CODE PAGE: 865 +; FONT RESOLUTION: 8 x 14 +; +; DATE CREATED:05-28-1987 +; +; +; Output file from: MULTIFON, Version 1A +; +;*************************************************** + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #0 + Db 000h,000h,000h,07Eh,081h,0A5h,081h,081h,0BDh,099h,081h,07Eh,000h,000h ; Hex #1 + Db 000h,000h,000h,07Eh,0FFh,0DBh,0FFh,0FFh,0C3h,0E7h,0FFh,07Eh,000h,000h ; Hex #2 + Db 000h,000h,000h,000h,06Ch,0FEh,0FEh,0FEh,0FEh,07Ch,038h,010h,000h,000h ; Hex #3 + Db 000h,000h,000h,000h,010h,038h,07Ch,0FEh,07Ch,038h,010h,000h,000h,000h ; Hex #4 + Db 000h,000h,000h,018h,03Ch,03Ch,0E7h,0E7h,0E7h,018h,018h,03Ch,000h,000h ; Hex #5 + Db 000h,000h,000h,018h,03Ch,07Eh,0FFh,0FFh,07Eh,018h,018h,03Ch,000h,000h ; Hex #6 + Db 000h,000h,000h,000h,000h,000h,018h,03Ch,03Ch,018h,000h,000h,000h,000h ; Hex #7 + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0E7h,0C3h,0C3h,0E7h,0FFh,0FFh,0FFh,0FFh ; Hex #8 + Db 000h,000h,000h,000h,000h,03Ch,066h,042h,042h,066h,03Ch,000h,000h,000h ; Hex #9 + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0C3h,099h,0BDh,0BDh,099h,0C3h,0FFh,0FFh,0FFh ; Hex #A + Db 000h,000h,000h,01Eh,00Eh,01Ah,032h,078h,0CCh,0CCh,0CCh,078h,000h,000h ; Hex #B + Db 000h,000h,000h,03Ch,066h,066h,066h,03Ch,018h,07Eh,018h,018h,000h,000h ; Hex #C + Db 000h,000h,000h,03Fh,033h,03Fh,030h,030h,030h,070h,0F0h,0E0h,000h,000h ; Hex #D + Db 000h,000h,000h,07Fh,063h,07Fh,063h,063h,063h,067h,0E7h,0E6h,0C0h,000h ; Hex #E + Db 000h,000h,000h,018h,018h,0DBh,03Ch,0E7h,03Ch,0DBh,018h,018h,000h,000h ; Hex #F + Db 000h,000h,000h,080h,0C0h,0E0h,0F8h,0FEh,0F8h,0E0h,0C0h,080h,000h,000h ; Hex #10 + Db 000h,000h,000h,002h,006h,00Eh,03Eh,0FEh,03Eh,00Eh,006h,002h,000h,000h ; Hex #11 + Db 000h,000h,000h,018h,03Ch,07Eh,018h,018h,018h,07Eh,03Ch,018h,000h,000h ; Hex #12 + Db 000h,000h,000h,066h,066h,066h,066h,066h,066h,000h,066h,066h,000h,000h ; Hex #13 + Db 000h,000h,000h,07Fh,0DBh,0DBh,0DBh,07Bh,01Bh,01Bh,01Bh,01Bh,000h,000h ; Hex #14 + Db 000h,000h,07Ch,0C6h,060h,038h,06Ch,0C6h,0C6h,06Ch,038h,00Ch,0C6h,07Ch ; Hex #15 + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,0FEh,0FEh,0FEh,000h,000h ; Hex #16 + Db 000h,000h,000h,018h,03Ch,07Eh,018h,018h,018h,07Eh,03Ch,018h,07Eh,000h ; Hex #17 + Db 000h,000h,000h,018h,03Ch,07Eh,018h,018h,018h,018h,018h,018h,000h,000h ; Hex #18 + Db 000h,000h,000h,018h,018h,018h,018h,018h,018h,07Eh,03Ch,018h,000h,000h ; Hex #19 + Db 000h,000h,000h,000h,000h,018h,00Ch,0FEh,00Ch,018h,000h,000h,000h,000h ; Hex #1A + Db 000h,000h,000h,000h,000h,030h,060h,0FEh,060h,030h,000h,000h,000h,000h ; Hex #1B + Db 000h,000h,000h,000h,000h,000h,0C0h,0C0h,0C0h,0FEh,000h,000h,000h,000h ; Hex #1C + Db 000h,000h,000h,000h,000h,028h,06Ch,0FEh,06Ch,028h,000h,000h,000h,000h ; Hex #1D + Db 000h,000h,000h,000h,010h,038h,038h,07Ch,07Ch,0FEh,0FEh,000h,000h,000h ; Hex #1E + Db 000h,000h,000h,000h,0FEh,0FEh,07Ch,07Ch,038h,038h,010h,000h,000h,000h ; Hex #1F + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #20 + Db 000h,000h,000h,018h,03Ch,03Ch,03Ch,018h,018h,000h,018h,018h,000h,000h ; Hex #21 + Db 000h,066h,066h,066h,024h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #22 + Db 000h,000h,000h,06Ch,06Ch,0FEh,06Ch,06Ch,06Ch,0FEh,06Ch,06Ch,000h,000h ; Hex #23 + Db 000h,018h,018h,07Ch,0C6h,0C2h,0C0h,07Ch,006h,086h,0C6h,07Ch,018h,018h ; Hex #24 + Db 000h,000h,000h,000h,000h,0C2h,0C6h,00Ch,018h,030h,066h,0C6h,000h,000h ; Hex #25 + Db 000h,000h,000h,038h,06Ch,06Ch,038h,076h,0DCh,0CCh,0CCh,076h,000h,000h ; Hex #26 + Db 000h,018h,018h,018h,030h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #27 + Db 000h,000h,000h,00Ch,018h,030h,030h,030h,030h,030h,018h,00Ch,000h,000h ; Hex #28 + Db 000h,000h,000h,030h,018h,00Ch,00Ch,00Ch,00Ch,00Ch,018h,030h,000h,000h ; Hex #29 + Db 000h,000h,000h,000h,000h,066h,03Ch,0FFh,03Ch,066h,000h,000h,000h,000h ; Hex #2A + Db 000h,000h,000h,000h,000h,018h,018h,07Eh,018h,018h,000h,000h,000h,000h ; Hex #2B + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,018h,018h,018h,030h,000h ; Hex #2C + Db 000h,000h,000h,000h,000h,000h,000h,0FEh,000h,000h,000h,000h,000h,000h ; Hex #2D + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,018h,018h,000h,000h ; Hex #2E + Db 000h,000h,000h,002h,006h,00Ch,018h,030h,060h,0C0h,080h,000h,000h,000h ; Hex #2F + Db 000h,000h,000h,038h,06Ch,0C6h,0C6h,0D6h,0C6h,0C6h,06Ch,038h,000h,000h ; Hex #30 + Db 000h,000h,000h,018h,038h,078h,018h,018h,018h,018h,018h,07Eh,000h,000h ; Hex #31 + Db 000h,000h,000h,07Ch,0C6h,006h,00Ch,018h,030h,060h,0C6h,0FEh,000h,000h ; Hex #32 + Db 000h,000h,000h,07Ch,0C6h,006h,006h,03Ch,006h,006h,0C6h,07Ch,000h,000h ; Hex #33 + Db 000h,000h,000h,00Ch,01Ch,03Ch,06Ch,0CCh,0FEh,00Ch,00Ch,01Eh,000h,000h ; Hex #34 + Db 000h,000h,000h,0FEh,0C0h,0C0h,0C0h,0FCh,006h,006h,0C6h,07Ch,000h,000h ; Hex #35 + Db 000h,000h,000h,038h,060h,0C0h,0C0h,0FCh,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #36 + Db 000h,000h,000h,0FEh,0C6h,006h,00Ch,018h,030h,030h,030h,030h,000h,000h ; Hex #37 + Db 000h,000h,000h,07Ch,0C6h,0C6h,0C6h,07Ch,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #38 + Db 000h,000h,000h,07Ch,0C6h,0C6h,0C6h,07Eh,006h,006h,00Ch,078h,000h,000h ; Hex #39 + Db 000h,000h,000h,000h,018h,018h,000h,000h,000h,018h,018h,000h,000h,000h ; Hex #3A + Db 000h,000h,000h,000h,018h,018h,000h,000h,000h,018h,018h,030h,000h,000h ; Hex #3B + Db 000h,000h,000h,00Ch,018h,030h,060h,0C0h,060h,030h,018h,00Ch,000h,000h ; Hex #3C + Db 000h,000h,000h,000h,000h,000h,07Eh,000h,000h,07Eh,000h,000h,000h,000h ; Hex #3D + Db 000h,000h,000h,060h,030h,018h,00Ch,006h,00Ch,018h,030h,060h,000h,000h ; Hex #3E + Db 000h,000h,000h,07Ch,0C6h,0C6h,00Ch,018h,018h,000h,018h,018h,000h,000h ; Hex #3F + Db 000h,000h,000h,07Ch,0C6h,0C6h,0DEh,0DEh,0DEh,0DCh,0C0h,07Ch,000h,000h ; Hex #40 + Db 000h,000h,000h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h,000h ; Hex #41 + Db 000h,000h,000h,0FCh,066h,066h,066h,07Ch,066h,066h,066h,0FCh,000h,000h ; Hex #42 + Db 000h,000h,000h,03Ch,066h,0C2h,0C0h,0C0h,0C0h,0C2h,066h,03Ch,000h,000h ; Hex #43 + Db 000h,000h,000h,0F8h,06Ch,066h,066h,066h,066h,066h,06Ch,0F8h,000h,000h ; Hex #44 + Db 000h,000h,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h ; Hex #45 + Db 000h,000h,000h,0FEh,066h,062h,068h,078h,068h,060h,060h,0F0h,000h,000h ; Hex #46 + Db 000h,000h,000h,03Ch,066h,0C2h,0C0h,0C0h,0DEh,0C6h,066h,03Ah,000h,000h ; Hex #47 + Db 000h,000h,000h,0C6h,0C6h,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,0C6h,000h,000h ; Hex #48 + Db 000h,000h,000h,03Ch,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #49 + Db 000h,000h,000h,01Eh,00Ch,00Ch,00Ch,00Ch,00Ch,0CCh,0CCh,078h,000h,000h ; Hex #4A + Db 000h,000h,000h,0E6h,066h,06Ch,06Ch,078h,06Ch,06Ch,066h,0E6h,000h,000h ; Hex #4B + Db 000h,000h,000h,0F0h,060h,060h,060h,060h,060h,062h,066h,0FEh,000h,000h ; Hex #4C + Db 000h,000h,000h,0C6h,0EEh,0FEh,0D6h,0C6h,0C6h,0C6h,0C6h,0C6h,000h,000h ; Hex #4D + Db 000h,000h,000h,0C6h,0E6h,0F6h,0FEh,0DEh,0CEh,0C6h,0C6h,0C6h,000h,000h ; Hex #4E + Db 000h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #4F + Db 000h,000h,000h,0FCh,066h,066h,066h,07Ch,060h,060h,060h,0F0h,000h,000h ; Hex #50 + Db 000h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0D6h,0DEh,07Ch,00Eh,000h ; Hex #51 + Db 000h,000h,000h,0FCh,066h,066h,066h,07Ch,06Ch,066h,066h,0E6h,000h,000h ; Hex #52 + Db 000h,000h,000h,07Ch,0C6h,0C6h,060h,038h,00Ch,0C6h,0C6h,07Ch,000h,000h ; Hex #53 + Db 000h,000h,000h,07Eh,07Eh,05Ah,018h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #54 + Db 000h,000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #55 + Db 000h,000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,06Ch,038h,010h,000h,000h ; Hex #56 + Db 000h,000h,000h,0C6h,0C6h,0C6h,0C6h,0D6h,0D6h,0FEh,06Ch,06Ch,000h,000h ; Hex #57 + Db 000h,000h,000h,0C6h,0C6h,0C6h,07Ch,038h,07Ch,0C6h,0C6h,0C6h,000h,000h ; Hex #58 + Db 000h,000h,000h,066h,066h,066h,066h,03Ch,018h,018h,018h,03Ch,000h,000h ; Hex #59 + Db 000h,000h,000h,0FEh,0C6h,08Ch,018h,030h,060h,0C2h,0C6h,0FEh,000h,000h ; Hex #5A + Db 000h,000h,000h,03Ch,030h,030h,030h,030h,030h,030h,030h,03Ch,000h,000h ; Hex #5B + Db 000h,000h,000h,080h,0C0h,0E0h,070h,038h,01Ch,00Eh,006h,002h,000h,000h ; Hex #5C + Db 000h,000h,000h,03Ch,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,03Ch,000h,000h ; Hex #5D + Db 010h,038h,06Ch,0C6h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #5E + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,0FFh ; Hex #5F + Db 000h,030h,018h,00Ch,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #60 + Db 000h,000h,000h,000h,000h,000h,078h,00Ch,07Ch,0CCh,0CCh,076h,000h,000h ; Hex #61 + Db 000h,000h,000h,0E0h,060h,060h,078h,06Ch,066h,066h,066h,07Ch,000h,000h ; Hex #62 + Db 000h,000h,000h,000h,000h,000h,07Ch,0C6h,0C0h,0C0h,0C6h,07Ch,000h,000h ; Hex #63 + Db 000h,000h,000h,01Ch,00Ch,00Ch,03Ch,06Ch,0CCh,0CCh,0CCh,076h,000h,000h ; Hex #64 + Db 000h,000h,000h,000h,000h,000h,07Ch,0C6h,0FEh,0C0h,0C6h,07Ch,000h,000h ; Hex #65 + Db 000h,000h,000h,01Ch,036h,032h,030h,07Ch,030h,030h,030h,078h,000h,000h ; Hex #66 + Db 000h,000h,000h,000h,000h,000h,076h,0CCh,0CCh,0CCh,07Ch,00Ch,0CCh,078h ; Hex #67 + Db 000h,000h,000h,0E0h,060h,060h,06Ch,076h,066h,066h,066h,0E6h,000h,000h ; Hex #68 + Db 000h,000h,000h,018h,018h,000h,038h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #69 + Db 000h,000h,000h,006h,006h,000h,00Eh,006h,006h,006h,006h,066h,066h,03Ch ; Hex #6A + Db 000h,000h,000h,0E0h,060h,060h,066h,06Ch,078h,06Ch,066h,0E6h,000h,000h ; Hex #6B + Db 000h,000h,000h,038h,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #6C + Db 000h,000h,000h,000h,000h,000h,0ECh,0FEh,0D6h,0D6h,0D6h,0D6h,000h,000h ; Hex #6D + Db 000h,000h,000h,000h,000h,000h,0DCh,066h,066h,066h,066h,066h,000h,000h ; Hex #6E + Db 000h,000h,000h,000h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #6F + Db 000h,000h,000h,000h,000h,000h,0DCh,066h,066h,066h,07Ch,060h,060h,0F0h ; Hex #70 + Db 000h,000h,000h,000h,000h,000h,076h,0CCh,0CCh,0CCh,07Ch,00Ch,00Ch,01Eh ; Hex #71 + Db 000h,000h,000h,000h,000h,000h,0DCh,076h,066h,060h,060h,0F0h,000h,000h ; Hex #72 + Db 000h,000h,000h,000h,000h,000h,07Ch,0C6h,070h,01Ch,0C6h,07Ch,000h,000h ; Hex #73 + Db 000h,000h,000h,010h,030h,030h,0FCh,030h,030h,030h,036h,01Ch,000h,000h ; Hex #74 + Db 000h,000h,000h,000h,000h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h ; Hex #75 + Db 000h,000h,000h,000h,000h,000h,0C6h,0C6h,0C6h,06Ch,038h,010h,000h,000h ; Hex #76 + Db 000h,000h,000h,000h,000h,000h,0C6h,0C6h,0D6h,0D6h,0FEh,06Ch,000h,000h ; Hex #77 + Db 000h,000h,000h,000h,000h,000h,0C6h,06Ch,038h,038h,06Ch,0C6h,000h,000h ; Hex #78 + Db 000h,000h,000h,000h,000h,000h,0C6h,0C6h,0C6h,0C6h,07Eh,006h,00Ch,078h ; Hex #79 + Db 000h,000h,000h,000h,000h,000h,0FEh,0CCh,018h,030h,066h,0FEh,000h,000h ; Hex #7A + Db 000h,000h,000h,00Eh,018h,018h,018h,070h,018h,018h,018h,00Eh,000h,000h ; Hex #7B + Db 000h,000h,000h,018h,018h,018h,018h,018h,018h,018h,018h,018h,000h,000h ; Hex #7C + Db 000h,000h,000h,070h,018h,018h,018h,00Eh,018h,018h,018h,070h,000h,000h ; Hex #7D + Db 000h,076h,0DCh,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #7E + Db 000h,000h,000h,000h,000h,010h,038h,06Ch,0C6h,0C6h,0FEh,000h,000h,000h ; Hex #7F + Db 000h,000h,000h,03Ch,066h,0C2h,0C0h,0C0h,0C0h,0C2h,066h,03Ch,00Ch,078h ; Hex #80 + Db 000h,000h,000h,0CCh,000h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h ; Hex #81 + Db 000h,000h,00Ch,018h,030h,000h,07Ch,0C6h,0FEh,0C0h,0C6h,07Ch,000h,000h ; Hex #82 + Db 000h,000h,010h,038h,06Ch,000h,078h,00Ch,07Ch,0CCh,0CCh,076h,000h,000h ; Hex #83 + Db 000h,000h,000h,0C6h,000h,000h,078h,00Ch,07Ch,0CCh,0CCh,076h,000h,000h ; Hex #84 + Db 000h,000h,060h,030h,018h,000h,078h,00Ch,07Ch,0CCh,0CCh,076h,000h,000h ; Hex #85 + Db 000h,000h,038h,06Ch,038h,000h,078h,00Ch,07Ch,0CCh,0CCh,076h,000h,000h ; Hex #86 + Db 000h,000h,000h,000h,000h,000h,07Ch,0C6h,0C0h,0C0h,0C6h,07Ch,00Ch,078h ; Hex #87 + Db 000h,000h,010h,038h,06Ch,000h,07Ch,0C6h,0FEh,0C0h,0C6h,07Ch,000h,000h ; Hex #88 + Db 000h,000h,000h,0C6h,000h,000h,07Ch,0C6h,0FEh,0C0h,0C6h,07Ch,000h,000h ; Hex #89 + Db 000h,000h,060h,030h,018h,000h,07Ch,0C6h,0FEh,0C0h,0C6h,07Ch,000h,000h ; Hex #8A + Db 000h,000h,000h,066h,000h,000h,038h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #8B + Db 000h,000h,018h,03Ch,066h,000h,038h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #8C + Db 000h,000h,060h,030h,018h,000h,038h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #8D + Db 000h,0C6h,000h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h,000h ; Hex #8E + Db 038h,06Ch,038h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h,000h ; Hex #8F + Db 00Ch,018h,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h ; Hex #90 + Db 000h,000h,000h,000h,000h,000h,0ECh,036h,076h,0DCh,0D8h,06Eh,000h,000h ; Hex #91 + Db 000h,000h,000h,03Eh,06Ch,0CCh,0CCh,0FEh,0CCh,0CCh,0CCh,0CEh,000h,000h ; Hex #92 + Db 000h,000h,010h,038h,06Ch,000h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #93 + Db 000h,000h,000h,0C6h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #94 + Db 000h,000h,060h,030h,018h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #95 + Db 000h,000h,030h,078h,0CCh,000h,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h ; Hex #96 + Db 000h,000h,060h,030h,018h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h ; Hex #97 + Db 000h,000h,000h,0C6h,000h,000h,0C6h,0C6h,0C6h,0C6h,07Eh,006h,00Ch,078h ; Hex #98 + Db 000h,0C6h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #99 + Db 000h,0C6h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #9A + Db 000h,000h,000h,000h,000h,000h,07Ch,0CEh,0DEh,0F6h,0E6h,07Ch,000h,000h ; Hex #9B + Db 000h,000h,038h,06Ch,064h,060h,0F0h,060h,060h,060h,0E6h,0FCh,000h,000h ; Hex #9C + Db 000h,000h,004h,07Ch,0CEh,0CEh,0D6h,0D6h,0D6h,0E6h,0E6h,07Ch,040h,000h ; Hex #9D + Db 000h,000h,0FCh,066h,066h,07Ch,062h,066h,06Fh,066h,066h,0F3h,000h,000h ; Hex #9E + Db 000h,000h,00Eh,01Bh,018h,018h,018h,07Eh,018h,018h,018h,0D8h,070h,000h ; Hex #9F + Db 000h,000h,00Ch,018h,030h,000h,078h,00Ch,07Ch,0CCh,0CCh,076h,000h,000h ; Hex #A0 + Db 000h,000h,00Ch,018h,030h,000h,038h,018h,018h,018h,018h,03Ch,000h,000h ; Hex #A1 + Db 000h,000h,00Ch,018h,030h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h ; Hex #A2 + Db 000h,000h,00Ch,018h,030h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h ; Hex #A3 + Db 000h,000h,000h,076h,0DCh,000h,0DCh,066h,066h,066h,066h,066h,000h,000h ; Hex #A4 + Db 076h,0DCh,000h,0C6h,0E6h,0F6h,0FEh,0DEh,0CEh,0C6h,0C6h,0C6h,000h,000h ; Hex #A5 + Db 000h,000h,03Ch,06Ch,06Ch,03Eh,000h,07Eh,000h,000h,000h,000h,000h,000h ; Hex #A6 + Db 000h,000h,038h,06Ch,06Ch,038h,000h,07Ch,000h,000h,000h,000h,000h,000h ; Hex #A7 + Db 000h,000h,000h,030h,030h,000h,030h,030h,060h,0C6h,0C6h,07Ch,000h,000h ; Hex #A8 + Db 000h,000h,000h,000h,000h,000h,000h,0FEh,0C0h,0C0h,0C0h,000h,000h,000h ; Hex #A9 + Db 000h,000h,000h,000h,000h,000h,000h,0FEh,006h,006h,006h,000h,000h,000h ; Hex #AA + Db 000h,000h,060h,0E0h,063h,066h,06Ch,018h,030h,06Eh,0C3h,006h,00Ch,01Fh ; Hex #AB + Db 000h,000h,060h,0E0h,063h,066h,06Ch,01Ah,036h,06Eh,0DAh,03Fh,006h,006h ; Hex #AC + Db 000h,000h,000h,018h,018h,000h,018h,018h,03Ch,03Ch,03Ch,018h,000h,000h ; Hex #AD + Db 000h,000h,000h,000h,000h,036h,06Ch,0D8h,06Ch,036h,000h,000h,000h,000h ; Hex #AE + Db 000h,000h,000h,000h,000h,0C6h,07Ch,0C6h,0C6h,0C6h,07Ch,0C6h,000h,000h ; Hex #AF + Db 011h,044h,011h,044h,011h,044h,011h,044h,011h,044h,011h,044h,011h,044h ; Hex #B0 + Db 055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh ; Hex #B1 + Db 0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h ; Hex #B2 + Db 018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B3 + Db 018h,018h,018h,018h,018h,018h,018h,0F8h,018h,018h,018h,018h,018h,018h ; Hex #B4 + Db 018h,018h,018h,018h,018h,0F8h,018h,0F8h,018h,018h,018h,018h,018h,018h ; Hex #B5 + Db 036h,036h,036h,036h,036h,036h,036h,0F6h,036h,036h,036h,036h,036h,036h ; Hex #B6 + Db 000h,000h,000h,000h,000h,000h,000h,0FEh,036h,036h,036h,036h,036h,036h ; Hex #B7 + Db 000h,000h,000h,000h,000h,0F8h,018h,0F8h,018h,018h,018h,018h,018h,018h ; Hex #B8 + Db 036h,036h,036h,036h,036h,0F6h,006h,0F6h,036h,036h,036h,036h,036h,036h ; Hex #B9 + Db 036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #BA + Db 000h,000h,000h,000h,000h,0FEh,006h,0F6h,036h,036h,036h,036h,036h,036h ; Hex #BB + Db 036h,036h,036h,036h,036h,0F6h,006h,0FEh,000h,000h,000h,000h,000h,000h ; Hex #BC + Db 036h,036h,036h,036h,036h,036h,036h,0FEh,000h,000h,000h,000h,000h,000h ; Hex #BD + Db 018h,018h,018h,018h,018h,0F8h,018h,0F8h,000h,000h,000h,000h,000h,000h ; Hex #BE + Db 000h,000h,000h,000h,000h,000h,000h,0F8h,018h,018h,018h,018h,018h,018h ; Hex #BF + Db 018h,018h,018h,018h,018h,018h,018h,01Fh,000h,000h,000h,000h,000h,000h ; Hex #C0 + Db 018h,018h,018h,018h,018h,018h,018h,0FFh,000h,000h,000h,000h,000h,000h ; Hex #C1 + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,018h,018h,018h,018h,018h,018h ; Hex #C2 + Db 018h,018h,018h,018h,018h,018h,018h,01Fh,018h,018h,018h,018h,018h,018h ; Hex #C3 + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,000h,000h,000h,000h,000h,000h ; Hex #C4 + Db 018h,018h,018h,018h,018h,018h,018h,0FFh,018h,018h,018h,018h,018h,018h ; Hex #C5 + Db 018h,018h,018h,018h,018h,01Fh,018h,01Fh,018h,018h,018h,018h,018h,018h ; Hex #C6 + Db 036h,036h,036h,036h,036h,036h,036h,037h,036h,036h,036h,036h,036h,036h ; Hex #C7 + Db 036h,036h,036h,036h,036h,037h,030h,03Fh,000h,000h,000h,000h,000h,000h ; Hex #C8 + Db 000h,000h,000h,000h,000h,03Fh,030h,037h,036h,036h,036h,036h,036h,036h ; Hex #C9 + Db 036h,036h,036h,036h,036h,0F7h,000h,0FFh,000h,000h,000h,000h,000h,000h ; Hex #CA + Db 000h,000h,000h,000h,000h,0FFh,000h,0F7h,036h,036h,036h,036h,036h,036h ; Hex #CB + Db 036h,036h,036h,036h,036h,037h,030h,037h,036h,036h,036h,036h,036h,036h ; Hex #CC + Db 000h,000h,000h,000h,000h,0FFh,000h,0FFh,000h,000h,000h,000h,000h,000h ; Hex #CD + Db 036h,036h,036h,036h,036h,0F7h,000h,0F7h,036h,036h,036h,036h,036h,036h ; Hex #CE + Db 018h,018h,018h,018h,018h,0FFh,000h,0FFh,000h,000h,000h,000h,000h,000h ; Hex #CF + Db 036h,036h,036h,036h,036h,036h,036h,0FFh,000h,000h,000h,000h,000h,000h ; Hex #D0 + Db 000h,000h,000h,000h,000h,0FFh,000h,0FFh,018h,018h,018h,018h,018h,018h ; Hex #D1 + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,036h,036h,036h,036h,036h,036h ; Hex #D2 + Db 036h,036h,036h,036h,036h,036h,036h,03Fh,000h,000h,000h,000h,000h,000h ; Hex #D3 + Db 018h,018h,018h,018h,018h,01Fh,018h,01Fh,000h,000h,000h,000h,000h,000h ; Hex #D4 + Db 000h,000h,000h,000h,000h,01Fh,018h,01Fh,018h,018h,018h,018h,018h,018h ; Hex #D5 + Db 000h,000h,000h,000h,000h,000h,000h,03Fh,036h,036h,036h,036h,036h,036h ; Hex #D6 + Db 036h,036h,036h,036h,036h,036h,036h,0FFh,036h,036h,036h,036h,036h,036h ; Hex #D7 + Db 018h,018h,018h,018h,018h,0FFh,018h,0FFh,018h,018h,018h,018h,018h,018h ; Hex #D8 + Db 018h,018h,018h,018h,018h,018h,018h,0F8h,000h,000h,000h,000h,000h,000h ; Hex #D9 + Db 000h,000h,000h,000h,000h,000h,000h,01Fh,018h,018h,018h,018h,018h,018h ; Hex #DA + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #DB + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #DC + Db 0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h ; Hex #DD + Db 00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh ; Hex #DE + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,000h,000h,000h,000h,000h,000h,000h ; Hex #DF + Db 000h,000h,000h,000h,000h,000h,076h,0DCh,0D8h,0D8h,0DCh,076h,000h,000h ; Hex #E0 + Db 000h,000h,000h,078h,0CCh,0CCh,0CCh,0D8h,0CCh,0C6h,0C6h,0CCh,000h,000h ; Hex #E1 + Db 000h,000h,000h,0FEh,0C6h,0C6h,0C0h,0C0h,0C0h,0C0h,0C0h,0C0h,000h,000h ; Hex #E2 + Db 000h,000h,000h,000h,000h,000h,0FEh,06Ch,06Ch,06Ch,06Ch,06Ch,000h,000h ; Hex #E3 + Db 000h,000h,000h,0FEh,0C6h,060h,030h,018h,030h,060h,0C6h,0FEh,000h,000h ; Hex #E4 + Db 000h,000h,000h,000h,000h,000h,07Eh,0D8h,0D8h,0D8h,0D8h,070h,000h,000h ; Hex #E5 + Db 000h,000h,000h,000h,000h,000h,066h,066h,066h,066h,066h,07Ch,060h,0C0h ; Hex #E6 + Db 000h,000h,000h,000h,000h,076h,0DCh,018h,018h,018h,018h,018h,000h,000h ; Hex #E7 + Db 000h,000h,000h,07Eh,018h,03Ch,066h,066h,066h,03Ch,018h,07Eh,000h,000h ; Hex #E8 + Db 000h,000h,000h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,06Ch,038h,000h,000h ; Hex #E9 + Db 000h,000h,000h,038h,06Ch,0C6h,0C6h,0C6h,06Ch,06Ch,06Ch,0EEh,000h,000h ; Hex #EA + Db 000h,000h,000h,01Eh,030h,018h,00Ch,03Eh,066h,066h,066h,03Ch,000h,000h ; Hex #EB + Db 000h,000h,000h,000h,000h,000h,07Eh,0DBh,0DBh,07Eh,000h,000h,000h,000h ; Hex #EC + Db 000h,000h,000h,003h,006h,07Eh,0DBh,0DBh,0F3h,07Eh,060h,0C0h,000h,000h ; Hex #ED + Db 000h,000h,000h,01Eh,030h,060h,060h,07Eh,060h,060h,030h,01Eh,000h,000h ; Hex #EE + Db 000h,000h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,000h,000h ; Hex #EF + Db 000h,000h,000h,000h,0FEh,000h,000h,0FEh,000h,000h,0FEh,000h,000h,000h ; Hex #F0 + Db 000h,000h,000h,000h,018h,018h,07Eh,018h,018h,000h,000h,07Eh,000h,000h ; Hex #F1 + Db 000h,000h,000h,030h,018h,00Ch,006h,00Ch,018h,030h,000h,07Eh,000h,000h ; Hex #F2 + Db 000h,000h,000h,00Ch,018h,030h,060h,030h,018h,00Ch,000h,07Eh,000h,000h ; Hex #F3 + Db 000h,000h,00Eh,01Bh,01Bh,018h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #F4 + Db 018h,018h,018h,018h,018h,018h,018h,018h,0D8h,0D8h,070h,000h,000h,000h ; Hex #F5 + Db 000h,000h,000h,000h,000h,018h,000h,07Eh,000h,018h,000h,000h,000h,000h ; Hex #F6 + Db 000h,000h,000h,000h,000h,076h,0DCh,000h,076h,0DCh,000h,000h,000h,000h ; Hex #F7 + Db 000h,038h,06Ch,06Ch,038h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #F8 + Db 000h,000h,000h,000h,000h,000h,000h,018h,018h,000h,000h,000h,000h,000h ; Hex #F9 + Db 000h,000h,000h,000h,000h,000h,000h,018h,000h,000h,000h,000h,000h,000h ; Hex #FA + Db 000h,00Fh,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,0ECh,06Ch,03Ch,01Ch,000h,000h ; Hex #FB + Db 000h,06Ch,036h,036h,036h,036h,036h,000h,000h,000h,000h,000h,000h,000h ; Hex #FC + Db 000h,03Ch,066h,00Ch,018h,032h,07Eh,000h,000h,000h,000h,000h,000h,000h ; Hex #FD + Db 000h,000h,000h,000h,000h,07Eh,07Eh,07Eh,07Eh,07Eh,07Eh,000h,000h,000h ; Hex #FE + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FF + diff --git a/v4.0/src/DEV/DISPLAY/EGA/865-8X16.ASM b/v4.0/src/DEV/DISPLAY/EGA/865-8X16.ASM new file mode 100644 index 0000000..33b26f5 --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/EGA/865-8X16.ASM @@ -0,0 +1,270 @@ +;*************************************************** +; CHARACTER FONT FILE +; Source Assembler File +; +; CODE PAGE: 865 +; FONT RESOLUTION: 8 x 16 +; +; DATE CREATED:05-28-1987 +; +; +; Output file from: MULTIFON, Version 1A +; +;*************************************************** + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #0 + Db 000h,000h,07Eh,081h,0A5h,081h,081h,0BDh,099h,081h,081h,07Eh,000h,000h,000h,000h ; Hex #1 + Db 000h,000h,07Eh,0FFh,0DBh,0FFh,0FFh,0C3h,0E7h,0FFh,0FFh,07Eh,000h,000h,000h,000h ; Hex #2 + Db 000h,000h,000h,000h,06Ch,0FEh,0FEh,0FEh,0FEh,07Ch,038h,010h,000h,000h,000h,000h ; Hex #3 + Db 000h,000h,000h,000h,010h,038h,07Ch,0FEh,07Ch,038h,010h,000h,000h,000h,000h,000h ; Hex #4 + Db 000h,000h,000h,018h,03Ch,03Ch,0E7h,0E7h,0E7h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #5 + Db 000h,000h,000h,018h,03Ch,07Eh,0FFh,0FFh,07Eh,018h,018h,03Ch,000h,000h,000h,000h ; Hex #6 + Db 000h,000h,000h,000h,000h,000h,018h,03Ch,03Ch,018h,000h,000h,000h,000h,000h,000h ; Hex #7 + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0E7h,0C3h,0C3h,0E7h,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #8 + Db 000h,000h,000h,000h,000h,03Ch,066h,042h,042h,066h,03Ch,000h,000h,000h,000h,000h ; Hex #9 + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0C3h,099h,0BDh,0BDh,099h,0C3h,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #A + Db 000h,000h,01Eh,00Eh,01Ah,032h,078h,0CCh,0CCh,0CCh,0CCh,078h,000h,000h,000h,000h ; Hex #B + Db 000h,000h,03Ch,066h,066h,066h,066h,03Ch,018h,07Eh,018h,018h,000h,000h,000h,000h ; Hex #C + Db 000h,000h,03Fh,033h,03Fh,030h,030h,030h,030h,070h,0F0h,0E0h,000h,000h,000h,000h ; Hex #D + Db 000h,000h,07Fh,063h,07Fh,063h,063h,063h,063h,067h,0E7h,0E6h,0C0h,000h,000h,000h ; Hex #E + Db 000h,000h,000h,018h,018h,0DBh,03Ch,0E7h,03Ch,0DBh,018h,018h,000h,000h,000h,000h ; Hex #F + Db 000h,080h,0C0h,0E0h,0F0h,0F8h,0FEh,0F8h,0F0h,0E0h,0C0h,080h,000h,000h,000h,000h ; Hex #10 + Db 000h,002h,006h,00Eh,01Eh,03Eh,0FEh,03Eh,01Eh,00Eh,006h,002h,000h,000h,000h,000h ; Hex #11 + Db 000h,000h,018h,03Ch,07Eh,018h,018h,018h,07Eh,03Ch,018h,000h,000h,000h,000h,000h ; Hex #12 + Db 000h,000h,066h,066h,066h,066h,066h,066h,066h,000h,066h,066h,000h,000h,000h,000h ; Hex #13 + Db 000h,000h,07Fh,0DBh,0DBh,0DBh,07Bh,01Bh,01Bh,01Bh,01Bh,01Bh,000h,000h,000h,000h ; Hex #14 + Db 000h,07Ch,0C6h,060h,038h,06Ch,0C6h,0C6h,06Ch,038h,00Ch,0C6h,07Ch,000h,000h,000h ; Hex #15 + Db 000h,000h,000h,000h,000h,000h,000h,000h,0FEh,0FEh,0FEh,0FEh,000h,000h,000h,000h ; Hex #16 + Db 000h,000h,018h,03Ch,07Eh,018h,018h,018h,07Eh,03Ch,018h,07Eh,000h,000h,000h,000h ; Hex #17 + Db 000h,000h,018h,03Ch,07Eh,018h,018h,018h,018h,018h,018h,018h,000h,000h,000h,000h ; Hex #18 + Db 000h,000h,018h,018h,018h,018h,018h,018h,018h,07Eh,03Ch,018h,000h,000h,000h,000h ; Hex #19 + Db 000h,000h,000h,000h,000h,018h,00Ch,0FEh,00Ch,018h,000h,000h,000h,000h,000h,000h ; Hex #1A + Db 000h,000h,000h,000h,000h,030h,060h,0FEh,060h,030h,000h,000h,000h,000h,000h,000h ; Hex #1B + Db 000h,000h,000h,000h,000h,000h,0C0h,0C0h,0C0h,0FEh,000h,000h,000h,000h,000h,000h ; Hex #1C + Db 000h,000h,000h,000h,000h,028h,06Ch,0FEh,06Ch,028h,000h,000h,000h,000h,000h,000h ; Hex #1D + Db 000h,000h,000h,000h,010h,038h,038h,07Ch,07Ch,0FEh,0FEh,000h,000h,000h,000h,000h ; Hex #1E + Db 000h,000h,000h,000h,0FEh,0FEh,07Ch,07Ch,038h,038h,010h,000h,000h,000h,000h,000h ; Hex #1F + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #20 + Db 000h,000h,018h,03Ch,03Ch,03Ch,018h,018h,018h,000h,018h,018h,000h,000h,000h,000h ; Hex #21 + Db 000h,066h,066h,066h,024h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #22 + Db 000h,000h,000h,06Ch,06Ch,0FEh,06Ch,06Ch,06Ch,0FEh,06Ch,06Ch,000h,000h,000h,000h ; Hex #23 + Db 018h,018h,07Ch,0C6h,0C2h,0C0h,07Ch,006h,006h,086h,0C6h,07Ch,018h,018h,000h,000h ; Hex #24 + Db 000h,000h,000h,000h,0C2h,0C6h,00Ch,018h,030h,060h,0C6h,086h,000h,000h,000h,000h ; Hex #25 + Db 000h,000h,038h,06Ch,06Ch,038h,076h,0DCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #26 + Db 000h,030h,030h,030h,060h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #27 + Db 000h,000h,00Ch,018h,030h,030h,030h,030h,030h,030h,018h,00Ch,000h,000h,000h,000h ; Hex #28 + Db 000h,000h,030h,018h,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,018h,030h,000h,000h,000h,000h ; Hex #29 + Db 000h,000h,000h,000h,000h,066h,03Ch,0FFh,03Ch,066h,000h,000h,000h,000h,000h,000h ; Hex #2A + Db 000h,000h,000h,000h,000h,018h,018h,07Eh,018h,018h,000h,000h,000h,000h,000h,000h ; Hex #2B + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,018h,018h,018h,030h,000h,000h,000h ; Hex #2C + Db 000h,000h,000h,000h,000h,000h,000h,0FEh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #2D + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,018h,018h,000h,000h,000h,000h ; Hex #2E + Db 000h,000h,000h,000h,002h,006h,00Ch,018h,030h,060h,0C0h,080h,000h,000h,000h,000h ; Hex #2F + Db 000h,000h,038h,06Ch,0C6h,0C6h,0D6h,0D6h,0C6h,0C6h,06Ch,038h,000h,000h,000h,000h ; Hex #30 + Db 000h,000h,018h,038h,078h,018h,018h,018h,018h,018h,018h,07Eh,000h,000h,000h,000h ; Hex #31 + Db 000h,000h,07Ch,0C6h,006h,00Ch,018h,030h,060h,0C0h,0C6h,0FEh,000h,000h,000h,000h ; Hex #32 + Db 000h,000h,07Ch,0C6h,006h,006h,03Ch,006h,006h,006h,0C6h,07Ch,000h,000h,000h,000h ; Hex #33 + Db 000h,000h,00Ch,01Ch,03Ch,06Ch,0CCh,0FEh,00Ch,00Ch,00Ch,01Eh,000h,000h,000h,000h ; Hex #34 + Db 000h,000h,0FEh,0C0h,0C0h,0C0h,0FCh,006h,006h,006h,0C6h,07Ch,000h,000h,000h,000h ; Hex #35 + Db 000h,000h,038h,060h,0C0h,0C0h,0FCh,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #36 + Db 000h,000h,0FEh,0C6h,006h,006h,00Ch,018h,030h,030h,030h,030h,000h,000h,000h,000h ; Hex #37 + Db 000h,000h,07Ch,0C6h,0C6h,0C6h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #38 + Db 000h,000h,07Ch,0C6h,0C6h,0C6h,07Eh,006h,006h,006h,00Ch,078h,000h,000h,000h,000h ; Hex #39 + Db 000h,000h,000h,000h,018h,018h,000h,000h,000h,018h,018h,000h,000h,000h,000h,000h ; Hex #3A + Db 000h,000h,000h,000h,018h,018h,000h,000h,000h,018h,018h,030h,000h,000h,000h,000h ; Hex #3B + Db 000h,000h,000h,006h,00Ch,018h,030h,060h,030h,018h,00Ch,006h,000h,000h,000h,000h ; Hex #3C + Db 000h,000h,000h,000h,000h,07Eh,000h,000h,07Eh,000h,000h,000h,000h,000h,000h,000h ; Hex #3D + Db 000h,000h,000h,060h,030h,018h,00Ch,006h,00Ch,018h,030h,060h,000h,000h,000h,000h ; Hex #3E + Db 000h,000h,07Ch,0C6h,0C6h,00Ch,018h,018h,018h,000h,018h,018h,000h,000h,000h,000h ; Hex #3F + Db 000h,000h,000h,07Ch,0C6h,0C6h,0DEh,0DEh,0DEh,0DCh,0C0h,07Ch,000h,000h,000h,000h ; Hex #40 + Db 000h,000h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #41 + Db 000h,000h,0FCh,066h,066h,066h,07Ch,066h,066h,066h,066h,0FCh,000h,000h,000h,000h ; Hex #42 + Db 000h,000h,03Ch,066h,0C2h,0C0h,0C0h,0C0h,0C0h,0C2h,066h,03Ch,000h,000h,000h,000h ; Hex #43 + Db 000h,000h,0F8h,06Ch,066h,066h,066h,066h,066h,066h,06Ch,0F8h,000h,000h,000h,000h ; Hex #44 + Db 000h,000h,0FEh,066h,062h,068h,078h,068h,060h,062h,066h,0FEh,000h,000h,000h,000h ; Hex #45 + Db 000h,000h,0FEh,066h,062h,068h,078h,068h,060h,060h,060h,0F0h,000h,000h,000h,000h ; Hex #46 + Db 000h,000h,03Ch,066h,0C2h,0C0h,0C0h,0DEh,0C6h,0C6h,066h,03Ah,000h,000h,000h,000h ; Hex #47 + Db 000h,000h,0C6h,0C6h,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #48 + Db 000h,000h,03Ch,018h,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #49 + Db 000h,000h,01Eh,00Ch,00Ch,00Ch,00Ch,00Ch,0CCh,0CCh,0CCh,078h,000h,000h,000h,000h ; Hex #4A + Db 000h,000h,0E6h,066h,066h,06Ch,078h,078h,06Ch,066h,066h,0E6h,000h,000h,000h,000h ; Hex #4B + Db 000h,000h,0F0h,060h,060h,060h,060h,060h,060h,062h,066h,0FEh,000h,000h,000h,000h ; Hex #4C + Db 000h,000h,0C6h,0EEh,0FEh,0FEh,0D6h,0C6h,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #4D + Db 000h,000h,0C6h,0E6h,0F6h,0FEh,0DEh,0CEh,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #4E + Db 000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #4F + Db 000h,000h,0FCh,066h,066h,066h,07Ch,060h,060h,060h,060h,0F0h,000h,000h,000h,000h ; Hex #50 + Db 000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0D6h,0DEh,07Ch,00Ch,00Eh,000h,000h ; Hex #51 + Db 000h,000h,0FCh,066h,066h,066h,07Ch,06Ch,066h,066h,066h,0E6h,000h,000h,000h,000h ; Hex #52 + Db 000h,000h,07Ch,0C6h,0C6h,060h,038h,00Ch,006h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #53 + Db 000h,000h,07Eh,07Eh,05Ah,018h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #54 + Db 000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #55 + Db 000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,06Ch,038h,010h,000h,000h,000h,000h ; Hex #56 + Db 000h,000h,0C6h,0C6h,0C6h,0C6h,0D6h,0D6h,0D6h,0FEh,0EEh,06Ch,000h,000h,000h,000h ; Hex #57 + Db 000h,000h,0C6h,0C6h,06Ch,07Ch,038h,038h,07Ch,06Ch,0C6h,0C6h,000h,000h,000h,000h ; Hex #58 + Db 000h,000h,066h,066h,066h,066h,03Ch,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #59 + Db 000h,000h,0FEh,0C6h,086h,00Ch,018h,030h,060h,0C2h,0C6h,0FEh,000h,000h,000h,000h ; Hex #5A + Db 000h,000h,03Ch,030h,030h,030h,030h,030h,030h,030h,030h,03Ch,000h,000h,000h,000h ; Hex #5B + Db 000h,000h,000h,080h,0C0h,0E0h,070h,038h,01Ch,00Eh,006h,002h,000h,000h,000h,000h ; Hex #5C + Db 000h,000h,03Ch,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,00Ch,03Ch,000h,000h,000h,000h ; Hex #5D + Db 010h,038h,06Ch,0C6h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #5E + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,0FFh,000h,000h ; Hex #5F + Db 000h,030h,018h,00Ch,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #60 + Db 000h,000h,000h,000h,000h,078h,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #61 + Db 000h,000h,0E0h,060h,060h,078h,06Ch,066h,066h,066h,066h,07Ch,000h,000h,000h,000h ; Hex #62 + Db 000h,000h,000h,000h,000h,07Ch,0C6h,0C0h,0C0h,0C0h,0C6h,07Ch,000h,000h,000h,000h ; Hex #63 + Db 000h,000h,01Ch,00Ch,00Ch,03Ch,06Ch,0CCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #64 + Db 000h,000h,000h,000h,000h,07Ch,0C6h,0FEh,0C0h,0C0h,0C6h,07Ch,000h,000h,000h,000h ; Hex #65 + Db 000h,000h,01Ch,036h,032h,030h,078h,030h,030h,030h,030h,078h,000h,000h,000h,000h ; Hex #66 + Db 000h,000h,000h,000h,000h,076h,0CCh,0CCh,0CCh,0CCh,0CCh,07Ch,00Ch,0CCh,078h,000h ; Hex #67 + Db 000h,000h,0E0h,060h,060h,06Ch,076h,066h,066h,066h,066h,0E6h,000h,000h,000h,000h ; Hex #68 + Db 000h,000h,018h,018h,000h,038h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #69 + Db 000h,000h,006h,006h,000h,00Eh,006h,006h,006h,006h,006h,006h,066h,066h,03Ch,000h ; Hex #6A + Db 000h,000h,0E0h,060h,060h,066h,06Ch,078h,078h,06Ch,066h,0E6h,000h,000h,000h,000h ; Hex #6B + Db 000h,000h,038h,018h,018h,018h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #6C + Db 000h,000h,000h,000h,000h,0ECh,0FEh,0D6h,0D6h,0D6h,0D6h,0C6h,000h,000h,000h,000h ; Hex #6D + Db 000h,000h,000h,000h,000h,0DCh,066h,066h,066h,066h,066h,066h,000h,000h,000h,000h ; Hex #6E + Db 000h,000h,000h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #6F + Db 000h,000h,000h,000h,000h,0DCh,066h,066h,066h,066h,066h,07Ch,060h,060h,0F0h,000h ; Hex #70 + Db 000h,000h,000h,000h,000h,076h,0CCh,0CCh,0CCh,0CCh,0CCh,07Ch,00Ch,00Ch,01Eh,000h ; Hex #71 + Db 000h,000h,000h,000h,000h,0DCh,076h,066h,060h,060h,060h,0F0h,000h,000h,000h,000h ; Hex #72 + Db 000h,000h,000h,000h,000h,07Ch,0C6h,060h,038h,00Ch,0C6h,07Ch,000h,000h,000h,000h ; Hex #73 + Db 000h,000h,010h,030h,030h,0FCh,030h,030h,030h,030h,036h,01Ch,000h,000h,000h,000h ; Hex #74 + Db 000h,000h,000h,000h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #75 + Db 000h,000h,000h,000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,06Ch,038h,000h,000h,000h,000h ; Hex #76 + Db 000h,000h,000h,000h,000h,0C6h,0C6h,0D6h,0D6h,0D6h,0FEh,06Ch,000h,000h,000h,000h ; Hex #77 + Db 000h,000h,000h,000h,000h,0C6h,06Ch,038h,038h,038h,06Ch,0C6h,000h,000h,000h,000h ; Hex #78 + Db 000h,000h,000h,000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Eh,006h,00Ch,0F8h,000h ; Hex #79 + Db 000h,000h,000h,000h,000h,0FEh,0CCh,018h,030h,060h,0C6h,0FEh,000h,000h,000h,000h ; Hex #7A + Db 000h,000h,00Eh,018h,018h,018h,070h,018h,018h,018h,018h,00Eh,000h,000h,000h,000h ; Hex #7B + Db 000h,000h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,000h,000h,000h,000h ; Hex #7C + Db 000h,000h,070h,018h,018h,018h,00Eh,018h,018h,018h,018h,070h,000h,000h,000h,000h ; Hex #7D + Db 000h,076h,0DCh,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #7E + Db 000h,000h,000h,000h,010h,038h,06Ch,0C6h,0C6h,0C6h,0FEh,000h,000h,000h,000h,000h ; Hex #7F + Db 000h,000h,03Ch,066h,0C2h,0C0h,0C0h,0C0h,0C0h,0C2h,066h,03Ch,018h,070h,000h,000h ; Hex #80 + Db 000h,000h,0CCh,000h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #81 + Db 000h,00Ch,018h,030h,000h,07Ch,0C6h,0FEh,0C0h,0C0h,0C6h,07Ch,000h,000h,000h,000h ; Hex #82 + Db 000h,010h,038h,06Ch,000h,078h,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #83 + Db 000h,000h,0CCh,000h,000h,078h,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #84 + Db 000h,060h,030h,018h,000h,078h,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #85 + Db 000h,038h,06Ch,038h,000h,078h,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #86 + Db 000h,000h,000h,000h,000h,07Ch,0C6h,0C0h,0C0h,0C0h,0C6h,07Ch,018h,070h,000h,000h ; Hex #87 + Db 000h,010h,038h,06Ch,000h,07Ch,0C6h,0FEh,0C0h,0C0h,0C6h,07Ch,000h,000h,000h,000h ; Hex #88 + Db 000h,000h,0C6h,000h,000h,07Ch,0C6h,0FEh,0C0h,0C0h,0C6h,07Ch,000h,000h,000h,000h ; Hex #89 + Db 000h,060h,030h,018h,000h,07Ch,0C6h,0FEh,0C0h,0C0h,0C6h,07Ch,000h,000h,000h,000h ; Hex #8A + Db 000h,000h,066h,000h,000h,038h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #8B + Db 000h,018h,03Ch,066h,000h,038h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #8C + Db 000h,060h,030h,018h,000h,038h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #8D + Db 000h,0C6h,000h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #8E + Db 038h,06Ch,038h,010h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #8F + Db 00Ch,018h,000h,0FEh,066h,062h,068h,078h,068h,062h,066h,0FEh,000h,000h,000h,000h ; Hex #90 + Db 000h,000h,000h,000h,000h,0ECh,036h,036h,07Eh,0D8h,0D8h,06Eh,000h,000h,000h,000h ; Hex #91 + Db 000h,000h,03Eh,06Ch,0CCh,0CCh,0FEh,0CCh,0CCh,0CCh,0CCh,0CEh,000h,000h,000h,000h ; Hex #92 + Db 000h,010h,038h,06Ch,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #93 + Db 000h,000h,0C6h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #94 + Db 000h,060h,030h,018h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #95 + Db 000h,030h,078h,0CCh,000h,0CCh,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #96 + Db 000h,060h,030h,018h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #97 + Db 000h,000h,0C6h,000h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Eh,006h,00Ch,078h,000h ; Hex #98 + Db 000h,0C6h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #99 + Db 000h,0C6h,000h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #9A + Db 000h,000h,000h,000h,000h,07Ch,0C6h,0CEh,0D6h,0E6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #9B + Db 000h,038h,06Ch,064h,060h,0F0h,060h,060h,060h,060h,0E6h,0FCh,000h,000h,000h,000h ; Hex #9C + Db 000h,004h,07Ch,0CEh,0CEh,0D6h,0D6h,0D6h,0D6h,0E6h,0E6h,07Ch,040h,000h,000h,000h ; Hex #9D + Db 000h,0F8h,0CCh,0CCh,0F8h,0C4h,0CCh,0DEh,0CCh,0CCh,0CCh,0C6h,000h,000h,000h,000h ; Hex #9E + Db 000h,00Eh,01Bh,018h,018h,018h,07Eh,018h,018h,018h,0D8h,070h,000h,000h,000h,000h ; Hex #9F + Db 000h,018h,030h,060h,000h,078h,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #A0 + Db 000h,00Ch,018h,030h,000h,038h,018h,018h,018h,018h,018h,03Ch,000h,000h,000h,000h ; Hex #A1 + Db 000h,018h,030h,060h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #A2 + Db 000h,018h,030h,060h,000h,0CCh,0CCh,0CCh,0CCh,0CCh,0CCh,076h,000h,000h,000h,000h ; Hex #A3 + Db 000h,000h,076h,0DCh,000h,0DCh,066h,066h,066h,066h,066h,066h,000h,000h,000h,000h ; Hex #A4 + Db 076h,0DCh,000h,0C6h,0E6h,0F6h,0FEh,0DEh,0CEh,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #A5 + Db 000h,000h,03Ch,06Ch,06Ch,03Eh,000h,07Eh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #A6 + Db 000h,000h,038h,06Ch,06Ch,038h,000h,07Ch,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #A7 + Db 000h,000h,030h,030h,000h,030h,030h,060h,0C0h,0C6h,0C6h,07Ch,000h,000h,000h,000h ; Hex #A8 + Db 000h,000h,000h,000h,000h,000h,0FEh,0C0h,0C0h,0C0h,0C0h,000h,000h,000h,000h,000h ; Hex #A9 + Db 000h,000h,000h,000h,000h,000h,0FEh,006h,006h,006h,006h,000h,000h,000h,000h,000h ; Hex #AA + Db 000h,060h,0E0h,062h,066h,06Ch,018h,030h,060h,0DCh,086h,00Ch,018h,03Eh,000h,000h ; Hex #AB + Db 000h,060h,0E0h,062h,066h,06Ch,018h,030h,066h,0CEh,09Ah,03Fh,006h,006h,000h,000h ; Hex #AC + Db 000h,000h,018h,018h,000h,018h,018h,018h,03Ch,03Ch,03Ch,018h,000h,000h,000h,000h ; Hex #AD + Db 000h,000h,000h,000h,000h,036h,06Ch,0D8h,06Ch,036h,000h,000h,000h,000h,000h,000h ; Hex #AE + Db 000h,000h,000h,000h,0C6h,07Ch,0C6h,0C6h,0C6h,0C6h,07Ch,0C6h,000h,000h,000h,000h ; Hex #AF + Db 011h,044h,011h,044h,011h,044h,011h,044h,011h,044h,011h,044h,011h,044h,011h,044h ; Hex #B0 + Db 055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh ; Hex #B1 + Db 0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh,077h ; Hex #B2 + Db 018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B3 + Db 018h,018h,018h,018h,018h,018h,018h,0F8h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B4 + Db 018h,018h,018h,018h,018h,0F8h,018h,0F8h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B5 + Db 036h,036h,036h,036h,036h,036h,036h,0F6h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #B6 + Db 000h,000h,000h,000h,000h,000h,000h,0FEh,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #B7 + Db 000h,000h,000h,000h,000h,0F8h,018h,0F8h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B8 + Db 036h,036h,036h,036h,036h,0F6h,006h,0F6h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #B9 + Db 036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #BA + Db 000h,000h,000h,000h,000h,0FEh,006h,0F6h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #BB + Db 036h,036h,036h,036h,036h,0F6h,006h,0FEh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #BC + Db 036h,036h,036h,036h,036h,036h,036h,0FEh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #BD + Db 018h,018h,018h,018h,018h,0F8h,018h,0F8h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #BE + Db 000h,000h,000h,000h,000h,000h,000h,0F8h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #BF + Db 018h,018h,018h,018h,018h,018h,018h,01Fh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #C0 + Db 018h,018h,018h,018h,018h,018h,018h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #C1 + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #C2 + Db 018h,018h,018h,018h,018h,018h,018h,01Fh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #C3 + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #C4 + Db 018h,018h,018h,018h,018h,018h,018h,0FFh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #C5 + Db 018h,018h,018h,018h,018h,01Fh,018h,01Fh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #C6 + Db 036h,036h,036h,036h,036h,036h,036h,037h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #C7 + Db 036h,036h,036h,036h,036h,037h,030h,03Fh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #C8 + Db 000h,000h,000h,000h,000h,03Fh,030h,037h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #C9 + Db 036h,036h,036h,036h,036h,0F7h,000h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #CA + Db 000h,000h,000h,000h,000h,0FFh,000h,0F7h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #CB + Db 036h,036h,036h,036h,036h,037h,030h,037h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #CC + Db 000h,000h,000h,000h,000h,0FFh,000h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #CD + Db 036h,036h,036h,036h,036h,0F7h,000h,0F7h,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #CE + Db 018h,018h,018h,018h,018h,0FFh,000h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #CF + Db 036h,036h,036h,036h,036h,036h,036h,0FFh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #D0 + Db 000h,000h,000h,000h,000h,0FFh,000h,0FFh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #D1 + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #D2 + Db 036h,036h,036h,036h,036h,036h,036h,03Fh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #D3 + Db 018h,018h,018h,018h,018h,01Fh,018h,01Fh,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #D4 + Db 000h,000h,000h,000h,000h,01Fh,018h,01Fh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #D5 + Db 000h,000h,000h,000h,000h,000h,000h,03Fh,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #D6 + Db 036h,036h,036h,036h,036h,036h,036h,0FFh,036h,036h,036h,036h,036h,036h,036h,036h ; Hex #D7 + Db 018h,018h,018h,018h,018h,0FFh,018h,0FFh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #D8 + Db 018h,018h,018h,018h,018h,018h,018h,0F8h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #D9 + Db 000h,000h,000h,000h,000h,000h,000h,01Fh,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #DA + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #DB + Db 000h,000h,000h,000h,000h,000h,000h,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #DC + Db 0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h ; Hex #DD + Db 00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh ; Hex #DE + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #DF + Db 000h,000h,000h,000h,000h,076h,0DCh,0D8h,0D8h,0D8h,0DCh,076h,000h,000h,000h,000h ; Hex #E0 + Db 000h,000h,078h,0CCh,0CCh,0CCh,0D8h,0CCh,0C6h,0C6h,0C6h,0CCh,000h,000h,000h,000h ; Hex #E1 + Db 000h,000h,0FEh,0C6h,0C6h,0C0h,0C0h,0C0h,0C0h,0C0h,0C0h,0C0h,000h,000h,000h,000h ; Hex #E2 + Db 000h,000h,000h,000h,000h,0FEh,06Ch,06Ch,06Ch,06Ch,06Ch,06Ch,000h,000h,000h,000h ; Hex #E3 + Db 000h,000h,0FEh,0C6h,060h,030h,018h,018h,030h,060h,0C6h,0FEh,000h,000h,000h,000h ; Hex #E4 + Db 000h,000h,000h,000h,000h,07Eh,0D8h,0D8h,0D8h,0D8h,0D8h,070h,000h,000h,000h,000h ; Hex #E5 + Db 000h,000h,000h,000h,000h,066h,066h,066h,066h,066h,066h,07Ch,060h,060h,0C0h,000h ; Hex #E6 + Db 000h,000h,000h,000h,076h,0DCh,018h,018h,018h,018h,018h,018h,000h,000h,000h,000h ; Hex #E7 + Db 000h,000h,07Eh,018h,03Ch,066h,066h,066h,066h,03Ch,018h,07Eh,000h,000h,000h,000h ; Hex #E8 + Db 000h,000h,038h,06Ch,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,06Ch,038h,000h,000h,000h,000h ; Hex #E9 + Db 000h,000h,038h,06Ch,0C6h,0C6h,0C6h,06Ch,06Ch,06Ch,06Ch,0EEh,000h,000h,000h,000h ; Hex #EA + Db 000h,000h,01Eh,030h,018h,00Ch,03Eh,066h,066h,066h,066h,03Ch,000h,000h,000h,000h ; Hex #EB + Db 000h,000h,000h,000h,000h,07Eh,0DBh,0DBh,0DBh,07Eh,000h,000h,000h,000h,000h,000h ; Hex #EC + Db 000h,000h,000h,003h,006h,07Eh,0DBh,0DBh,0F3h,07Eh,060h,0C0h,000h,000h,000h,000h ; Hex #ED + Db 000h,000h,01Ch,030h,060h,060h,07Ch,060h,060h,060h,030h,01Ch,000h,000h,000h,000h ; Hex #EE + Db 000h,000h,000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,000h,000h,000h,000h ; Hex #EF + Db 000h,000h,000h,000h,0FEh,000h,000h,0FEh,000h,000h,0FEh,000h,000h,000h,000h,000h ; Hex #F0 + Db 000h,000h,000h,000h,018h,018h,07Eh,018h,018h,000h,000h,07Eh,000h,000h,000h,000h ; Hex #F1 + Db 000h,000h,000h,030h,018h,00Ch,006h,00Ch,018h,030h,000h,07Eh,000h,000h,000h,000h ; Hex #F2 + Db 000h,000h,000h,00Ch,018h,030h,060h,030h,018h,00Ch,000h,07Eh,000h,000h,000h,000h ; Hex #F3 + Db 000h,000h,00Eh,01Bh,01Bh,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h,018h ; Hex #F4 + Db 018h,018h,018h,018h,018h,018h,018h,018h,018h,0D8h,0D8h,0D8h,070h,000h,000h,000h ; Hex #F5 + Db 000h,000h,000h,000h,000h,018h,000h,07Eh,000h,018h,000h,000h,000h,000h,000h,000h ; Hex #F6 + Db 000h,000h,000h,000h,000h,076h,0DCh,000h,076h,0DCh,000h,000h,000h,000h,000h,000h ; Hex #F7 + Db 000h,038h,06Ch,06Ch,038h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #F8 + Db 000h,000h,000h,000h,000h,000h,000h,018h,018h,000h,000h,000h,000h,000h,000h,000h ; Hex #F9 + Db 000h,000h,000h,000h,000h,000h,000h,018h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FA + Db 000h,00Fh,00Ch,00Ch,00Ch,00Ch,00Ch,0ECh,06Ch,06Ch,03Ch,01Ch,000h,000h,000h,000h ; Hex #FB + Db 000h,06Ch,036h,036h,036h,036h,036h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FC + Db 000h,03Ch,066h,00Ch,018h,032h,07Eh,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FD + Db 000h,000h,000h,000h,07Eh,07Eh,07Eh,07Eh,07Eh,07Eh,07Eh,000h,000h,000h,000h,000h ; Hex #FE + Db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FF + diff --git a/v4.0/src/DEV/DISPLAY/EGA/865-8X8.ASM b/v4.0/src/DEV/DISPLAY/EGA/865-8X8.ASM new file mode 100644 index 0000000..3aad184 --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/EGA/865-8X8.ASM @@ -0,0 +1,270 @@ +;*************************************************** +; CHARACTER FONT FILE +; Source Assembler File +; +; CODE PAGE: 865 +; FONT RESOLUTION: 8 x 8 +; +; DATE CREATED:05-28-1987 +; +; +; Output file from: MULTIFON, Version 1A +; +;*************************************************** + Db 000h,000h,000h,000h,000h,000h,000h,000h ; Hex #0 + Db 07Eh,081h,0A5h,081h,0BDh,099h,081h,07Eh ; Hex #1 + Db 07Eh,0FFh,0DBh,0FFh,0C3h,0E7h,0FFh,07Eh ; Hex #2 + Db 06Ch,0FEh,0FEh,0FEh,07Ch,038h,010h,000h ; Hex #3 + Db 010h,038h,07Ch,0FEh,07Ch,038h,010h,000h ; Hex #4 + Db 038h,07Ch,038h,0FEh,0FEh,0D6h,010h,038h ; Hex #5 + Db 010h,038h,07Ch,0FEh,0FEh,07Ch,010h,038h ; Hex #6 + Db 000h,000h,018h,03Ch,03Ch,018h,000h,000h ; Hex #7 + Db 0FFh,0FFh,0E7h,0C3h,0C3h,0E7h,0FFh,0FFh ; Hex #8 + Db 000h,03Ch,066h,042h,042h,066h,03Ch,000h ; Hex #9 + Db 0FFh,0C3h,099h,0BDh,0BDh,099h,0C3h,0FFh ; Hex #A + Db 00Fh,007h,00Fh,07Dh,0CCh,0CCh,0CCh,078h ; Hex #B + Db 03Ch,066h,066h,066h,03Ch,018h,07Eh,018h ; Hex #C + Db 03Fh,033h,03Fh,030h,030h,070h,0F0h,0E0h ; Hex #D + Db 07Fh,063h,07Fh,063h,063h,067h,0E6h,0C0h ; Hex #E + Db 018h,0DBh,03Ch,0E7h,0E7h,03Ch,0DBh,018h ; Hex #F + Db 080h,0E0h,0F8h,0FEh,0F8h,0E0h,080h,000h ; Hex #10 + Db 002h,00Eh,03Eh,0FEh,03Eh,00Eh,002h,000h ; Hex #11 + Db 018h,03Ch,07Eh,018h,018h,07Eh,03Ch,018h ; Hex #12 + Db 066h,066h,066h,066h,066h,000h,066h,000h ; Hex #13 + Db 07Fh,0DBh,0DBh,07Bh,01Bh,01Bh,01Bh,000h ; Hex #14 + Db 03Eh,061h,03Ch,066h,066h,03Ch,086h,07Ch ; Hex #15 + Db 000h,000h,000h,000h,07Eh,07Eh,07Eh,000h ; Hex #16 + Db 018h,03Ch,07Eh,018h,07Eh,03Ch,018h,0FFh ; Hex #17 + Db 018h,03Ch,07Eh,018h,018h,018h,018h,000h ; Hex #18 + Db 018h,018h,018h,018h,07Eh,03Ch,018h,000h ; Hex #19 + Db 000h,018h,00Ch,0FEh,00Ch,018h,000h,000h ; Hex #1A + Db 000h,030h,060h,0FEh,060h,030h,000h,000h ; Hex #1B + Db 000h,000h,0C0h,0C0h,0C0h,0FEh,000h,000h ; Hex #1C + Db 000h,024h,066h,0FFh,066h,024h,000h,000h ; Hex #1D + Db 000h,018h,03Ch,07Eh,0FFh,0FFh,000h,000h ; Hex #1E + Db 000h,0FFh,0FFh,07Eh,03Ch,018h,000h,000h ; Hex #1F + Db 000h,000h,000h,000h,000h,000h,000h,000h ; Hex #20 + Db 018h,03Ch,03Ch,018h,018h,000h,018h,000h ; Hex #21 + Db 066h,066h,024h,000h,000h,000h,000h,000h ; Hex #22 + Db 06Ch,06Ch,0FEh,06Ch,0FEh,06Ch,06Ch,000h ; Hex #23 + Db 018h,03Eh,060h,03Ch,006h,07Ch,018h,000h ; Hex #24 + Db 000h,0C6h,0CCh,018h,030h,066h,0C6h,000h ; Hex #25 + Db 038h,06Ch,038h,076h,0DCh,0CCh,076h,000h ; Hex #26 + Db 018h,018h,030h,000h,000h,000h,000h,000h ; Hex #27 + Db 00Ch,018h,030h,030h,030h,018h,00Ch,000h ; Hex #28 + Db 030h,018h,00Ch,00Ch,00Ch,018h,030h,000h ; Hex #29 + Db 000h,066h,03Ch,0FFh,03Ch,066h,000h,000h ; Hex #2A + Db 000h,018h,018h,07Eh,018h,018h,000h,000h ; Hex #2B + Db 000h,000h,000h,000h,000h,018h,018h,030h ; Hex #2C + Db 000h,000h,000h,07Eh,000h,000h,000h,000h ; Hex #2D + Db 000h,000h,000h,000h,000h,018h,018h,000h ; Hex #2E + Db 006h,00Ch,018h,030h,060h,0C0h,080h,000h ; Hex #2F + Db 038h,06Ch,0C6h,0D6h,0C6h,06Ch,038h,000h ; Hex #30 + Db 018h,038h,018h,018h,018h,018h,07Eh,000h ; Hex #31 + Db 07Ch,0C6h,006h,01Ch,030h,066h,0FEh,000h ; Hex #32 + Db 07Ch,0C6h,006h,03Ch,006h,0C6h,07Ch,000h ; Hex #33 + Db 01Ch,03Ch,06Ch,0CCh,0FEh,00Ch,01Eh,000h ; Hex #34 + Db 0FEh,0C0h,0C0h,0FCh,006h,0C6h,07Ch,000h ; Hex #35 + Db 038h,060h,0C0h,0FCh,0C6h,0C6h,07Ch,000h ; Hex #36 + Db 0FEh,0C6h,00Ch,018h,030h,030h,030h,000h ; Hex #37 + Db 07Ch,0C6h,0C6h,07Ch,0C6h,0C6h,07Ch,000h ; Hex #38 + Db 07Ch,0C6h,0C6h,07Eh,006h,00Ch,078h,000h ; Hex #39 + Db 000h,018h,018h,000h,000h,018h,018h,000h ; Hex #3A + Db 000h,018h,018h,000h,000h,018h,018h,030h ; Hex #3B + Db 006h,00Ch,018h,030h,018h,00Ch,006h,000h ; Hex #3C + Db 000h,000h,07Eh,000h,000h,07Eh,000h,000h ; Hex #3D + Db 060h,030h,018h,00Ch,018h,030h,060h,000h ; Hex #3E + Db 07Ch,0C6h,00Ch,018h,018h,000h,018h,000h ; Hex #3F + Db 07Ch,0C6h,0DEh,0DEh,0DEh,0C0h,078h,000h ; Hex #40 + Db 038h,06Ch,0C6h,0FEh,0C6h,0C6h,0C6h,000h ; Hex #41 + Db 0FCh,066h,066h,07Ch,066h,066h,0FCh,000h ; Hex #42 + Db 03Ch,066h,0C0h,0C0h,0C0h,066h,03Ch,000h ; Hex #43 + Db 0F8h,06Ch,066h,066h,066h,06Ch,0F8h,000h ; Hex #44 + Db 0FEh,062h,068h,078h,068h,062h,0FEh,000h ; Hex #45 + Db 0FEh,062h,068h,078h,068h,060h,0F0h,000h ; Hex #46 + Db 03Ch,066h,0C0h,0C0h,0CEh,066h,03Ah,000h ; Hex #47 + Db 0C6h,0C6h,0C6h,0FEh,0C6h,0C6h,0C6h,000h ; Hex #48 + Db 03Ch,018h,018h,018h,018h,018h,03Ch,000h ; Hex #49 + Db 01Eh,00Ch,00Ch,00Ch,0CCh,0CCh,078h,000h ; Hex #4A + Db 0E6h,066h,06Ch,078h,06Ch,066h,0E6h,000h ; Hex #4B + Db 0F0h,060h,060h,060h,062h,066h,0FEh,000h ; Hex #4C + Db 0C6h,0EEh,0FEh,0FEh,0D6h,0C6h,0C6h,000h ; Hex #4D + Db 0C6h,0E6h,0F6h,0DEh,0CEh,0C6h,0C6h,000h ; Hex #4E + Db 07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h ; Hex #4F + Db 0FCh,066h,066h,07Ch,060h,060h,0F0h,000h ; Hex #50 + Db 07Ch,0C6h,0C6h,0C6h,0C6h,0CEh,07Ch,00Eh ; Hex #51 + Db 0FCh,066h,066h,07Ch,06Ch,066h,0E6h,000h ; Hex #52 + Db 03Ch,066h,030h,018h,00Ch,066h,03Ch,000h ; Hex #53 + Db 07Eh,07Eh,05Ah,018h,018h,018h,03Ch,000h ; Hex #54 + Db 0C6h,0C6h,0C6h,0C6h,0C6h,0C6h,07Ch,000h ; Hex #55 + Db 0C6h,0C6h,0C6h,0C6h,0C6h,06Ch,038h,000h ; Hex #56 + Db 0C6h,0C6h,0C6h,0D6h,0D6h,0FEh,06Ch,000h ; Hex #57 + Db 0C6h,0C6h,06Ch,038h,06Ch,0C6h,0C6h,000h ; Hex #58 + Db 066h,066h,066h,03Ch,018h,018h,03Ch,000h ; Hex #59 + Db 0FEh,0C6h,08Ch,018h,032h,066h,0FEh,000h ; Hex #5A + Db 03Ch,030h,030h,030h,030h,030h,03Ch,000h ; Hex #5B + Db 0C0h,060h,030h,018h,00Ch,006h,002h,000h ; Hex #5C + Db 03Ch,00Ch,00Ch,00Ch,00Ch,00Ch,03Ch,000h ; Hex #5D + Db 010h,038h,06Ch,0C6h,000h,000h,000h,000h ; Hex #5E + Db 000h,000h,000h,000h,000h,000h,000h,0FFh ; Hex #5F + Db 030h,018h,00Ch,000h,000h,000h,000h,000h ; Hex #60 + Db 000h,000h,078h,00Ch,07Ch,0CCh,076h,000h ; Hex #61 + Db 0E0h,060h,07Ch,066h,066h,066h,0DCh,000h ; Hex #62 + Db 000h,000h,07Ch,0C6h,0C0h,0C6h,07Ch,000h ; Hex #63 + Db 01Ch,00Ch,07Ch,0CCh,0CCh,0CCh,076h,000h ; Hex #64 + Db 000h,000h,07Ch,0C6h,0FEh,0C0h,07Ch,000h ; Hex #65 + Db 03Ch,066h,060h,0F8h,060h,060h,0F0h,000h ; Hex #66 + Db 000h,000h,076h,0CCh,0CCh,07Ch,00Ch,0F8h ; Hex #67 + Db 0E0h,060h,06Ch,076h,066h,066h,0E6h,000h ; Hex #68 + Db 018h,000h,038h,018h,018h,018h,03Ch,000h ; Hex #69 + Db 006h,000h,006h,006h,006h,066h,066h,03Ch ; Hex #6A + Db 0E0h,060h,066h,06Ch,078h,06Ch,0E6h,000h ; Hex #6B + Db 038h,018h,018h,018h,018h,018h,03Ch,000h ; Hex #6C + Db 000h,000h,0ECh,0FEh,0D6h,0D6h,0D6h,000h ; Hex #6D + Db 000h,000h,0DCh,066h,066h,066h,066h,000h ; Hex #6E + Db 000h,000h,07Ch,0C6h,0C6h,0C6h,07Ch,000h ; Hex #6F + Db 000h,000h,0DCh,066h,066h,07Ch,060h,0F0h ; Hex #70 + Db 000h,000h,076h,0CCh,0CCh,07Ch,00Ch,01Eh ; Hex #71 + Db 000h,000h,0DCh,076h,060h,060h,0F0h,000h ; Hex #72 + Db 000h,000h,07Eh,0C0h,07Ch,006h,0FCh,000h ; Hex #73 + Db 030h,030h,0FCh,030h,030h,036h,01Ch,000h ; Hex #74 + Db 000h,000h,0CCh,0CCh,0CCh,0CCh,076h,000h ; Hex #75 + Db 000h,000h,0C6h,0C6h,0C6h,06Ch,038h,000h ; Hex #76 + Db 000h,000h,0C6h,0D6h,0D6h,0FEh,06Ch,000h ; Hex #77 + Db 000h,000h,0C6h,06Ch,038h,06Ch,0C6h,000h ; Hex #78 + Db 000h,000h,0C6h,0C6h,0C6h,07Eh,006h,0FCh ; Hex #79 + Db 000h,000h,07Eh,04Ch,018h,032h,07Eh,000h ; Hex #7A + Db 00Eh,018h,018h,070h,018h,018h,00Eh,000h ; Hex #7B + Db 018h,018h,018h,018h,018h,018h,018h,000h ; Hex #7C + Db 070h,018h,018h,00Eh,018h,018h,070h,000h ; Hex #7D + Db 076h,0DCh,000h,000h,000h,000h,000h,000h ; Hex #7E + Db 000h,010h,038h,06Ch,0C6h,0C6h,0FEh,000h ; Hex #7F + Db 07Ch,0C6h,0C0h,0C0h,0C6h,07Ch,00Ch,078h ; Hex #80 + Db 0CCh,000h,0CCh,0CCh,0CCh,0CCh,076h,000h ; Hex #81 + Db 00Ch,018h,07Ch,0C6h,0FEh,0C0h,07Ch,000h ; Hex #82 + Db 07Ch,082h,078h,00Ch,07Ch,0CCh,076h,000h ; Hex #83 + Db 0C6h,000h,078h,00Ch,07Ch,0CCh,076h,000h ; Hex #84 + Db 030h,018h,078h,00Ch,07Ch,0CCh,076h,000h ; Hex #85 + Db 030h,030h,078h,00Ch,07Ch,0CCh,076h,000h ; Hex #86 + Db 000h,000h,07Eh,0C0h,0C0h,07Eh,00Ch,038h ; Hex #87 + Db 07Ch,082h,07Ch,0C6h,0FEh,0C0h,07Ch,000h ; Hex #88 + Db 0C6h,000h,07Ch,0C6h,0FEh,0C0h,07Ch,000h ; Hex #89 + Db 030h,018h,07Ch,0C6h,0FEh,0C0h,07Ch,000h ; Hex #8A + Db 066h,000h,038h,018h,018h,018h,03Ch,000h ; Hex #8B + Db 07Ch,082h,038h,018h,018h,018h,03Ch,000h ; Hex #8C + Db 030h,018h,000h,038h,018h,018h,03Ch,000h ; Hex #8D + Db 0C6h,038h,06Ch,0C6h,0FEh,0C6h,0C6h,000h ; Hex #8E + Db 038h,06Ch,07Ch,0C6h,0FEh,0C6h,0C6h,000h ; Hex #8F + Db 018h,030h,0FEh,0C0h,0F8h,0C0h,0FEh,000h ; Hex #90 + Db 000h,000h,07Eh,012h,0feh,090h,0fEh,000h ; Hex #91 + Db 03Eh,06Ch,0CCh,0FEh,0CCh,0CCh,0CEh,000h ; Hex #92 + Db 07Ch,082h,07Ch,0C6h,0C6h,0C6h,07Ch,000h ; Hex #93 + Db 0C6h,000h,07Ch,0C6h,0C6h,0C6h,07Ch,000h ; Hex #94 + Db 030h,018h,07Ch,0C6h,0C6h,0C6h,07Ch,000h ; Hex #95 + Db 078h,084h,000h,0CCh,0CCh,0CCh,076h,000h ; Hex #96 + Db 060h,030h,0CCh,0CCh,0CCh,0CCh,076h,000h ; Hex #97 + Db 0C6h,000h,0C6h,0C6h,0C6h,07Eh,006h,0FCh ; Hex #98 + Db 0C6h,038h,06Ch,0C6h,0C6h,06Ch,038h,000h ; Hex #99 + Db 0C6h,000h,0C6h,0C6h,0C6h,0C6h,07Ch,000h ; Hex #9A + Db 000h,002h,07Ch,0CEh,0D6h,0E6h,07Ch,080h ; Hex #9B + Db 038h,06Ch,064h,0F0h,060h,066h,0FCh,000h ; Hex #9C + Db 03Ah,06Ch,0CEh,0D6h,0E6h,06Ch,0B8h,000h ; Hex #9D + Db 0F8h,0CCh,0CCh,0FAh,0C6h,0CFh,0C6h,0C7h ; Hex #9E + Db 00Eh,01Bh,018h,03Ch,018h,0D8h,070h,000h ; Hex #9F + Db 018h,030h,078h,00Ch,07Ch,0CCh,076h,000h ; Hex #A0 + Db 00Ch,018h,000h,038h,018h,018h,03Ch,000h ; Hex #A1 + Db 00Ch,018h,07Ch,0C6h,0C6h,0C6h,07Ch,000h ; Hex #A2 + Db 018h,030h,0CCh,0CCh,0CCh,0CCh,076h,000h ; Hex #A3 + Db 076h,0DCh,000h,0DCh,066h,066h,066h,000h ; Hex #A4 + Db 076h,0DCh,000h,0E6h,0F6h,0DEh,0CEh,000h ; Hex #A5 + Db 03Ch,06Ch,06Ch,03Eh,000h,07Eh,000h,000h ; Hex #A6 + Db 038h,06Ch,06Ch,038h,000h,07Ch,000h,000h ; Hex #A7 + Db 018h,000h,018h,018h,030h,063h,03Eh,000h ; Hex #A8 + Db 000h,000h,000h,0FEh,0C0h,0C0h,000h,000h ; Hex #A9 + Db 000h,000h,000h,0FEh,006h,006h,000h,000h ; Hex #AA + Db 063h,0E6h,06Ch,07Eh,033h,066h,0CCh,00Fh ; Hex #AB + Db 063h,0E6h,06Ch,07Ah,036h,06Ah,0DFh,006h ; Hex #AC + Db 018h,000h,018h,018h,03Ch,03Ch,018h,000h ; Hex #AD + Db 000h,033h,066h,0CCh,066h,033h,000h,000h ; Hex #AE + Db 000h,0C6h,07Ch,0C6h,0C6h,07Ch,0C6h,000h ; Hex #AF + Db 022h,088h,022h,088h,022h,088h,022h,088h ; Hex #B0 + Db 055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh ; Hex #B1 + Db 077h,0DDh,077h,0DDh,077h,0DDh,077h,0DDh ; Hex #B2 + Db 018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B3 + Db 018h,018h,018h,018h,0F8h,018h,018h,018h ; Hex #B4 + Db 018h,018h,0F8h,018h,0F8h,018h,018h,018h ; Hex #B5 + Db 036h,036h,036h,036h,0F6h,036h,036h,036h ; Hex #B6 + Db 000h,000h,000h,000h,0FEh,036h,036h,036h ; Hex #B7 + Db 000h,000h,0F8h,018h,0F8h,018h,018h,018h ; Hex #B8 + Db 036h,036h,0F6h,006h,0F6h,036h,036h,036h ; Hex #B9 + Db 036h,036h,036h,036h,036h,036h,036h,036h ; Hex #BA + Db 000h,000h,0FEh,006h,0F6h,036h,036h,036h ; Hex #BB + Db 036h,036h,0F6h,006h,0FEh,000h,000h,000h ; Hex #BC + Db 036h,036h,036h,036h,0FEh,000h,000h,000h ; Hex #BD + Db 018h,018h,0F8h,018h,0F8h,000h,000h,000h ; Hex #BE + Db 000h,000h,000h,000h,0F8h,018h,018h,018h ; Hex #BF + Db 018h,018h,018h,018h,01Fh,000h,000h,000h ; Hex #C0 + Db 018h,018h,018h,018h,0FFh,000h,000h,000h ; Hex #C1 + Db 000h,000h,000h,000h,0FFh,018h,018h,018h ; Hex #C2 + Db 018h,018h,018h,018h,01Fh,018h,018h,018h ; Hex #C3 + Db 000h,000h,000h,000h,0FFh,000h,000h,000h ; Hex #C4 + Db 018h,018h,018h,018h,0FFh,018h,018h,018h ; Hex #C5 + Db 018h,018h,01Fh,018h,01Fh,018h,018h,018h ; Hex #C6 + Db 036h,036h,036h,036h,037h,036h,036h,036h ; Hex #C7 + Db 036h,036h,037h,030h,03Fh,000h,000h,000h ; Hex #C8 + Db 000h,000h,03Fh,030h,037h,036h,036h,036h ; Hex #C9 + Db 036h,036h,0F7h,000h,0FFh,000h,000h,000h ; Hex #CA + Db 000h,000h,0FFh,000h,0F7h,036h,036h,036h ; Hex #CB + Db 036h,036h,037h,030h,037h,036h,036h,036h ; Hex #CC + Db 000h,000h,0FFh,000h,0FFh,000h,000h,000h ; Hex #CD + Db 036h,036h,0F7h,000h,0F7h,036h,036h,036h ; Hex #CE + Db 018h,018h,0FFh,000h,0FFh,000h,000h,000h ; Hex #CF + Db 036h,036h,036h,036h,0FFh,000h,000h,000h ; Hex #D0 + Db 000h,000h,0FFh,000h,0FFh,018h,018h,018h ; Hex #D1 + Db 000h,000h,000h,000h,0FFh,036h,036h,036h ; Hex #D2 + Db 036h,036h,036h,036h,03Fh,000h,000h,000h ; Hex #D3 + Db 018h,018h,01Fh,018h,01Fh,000h,000h,000h ; Hex #D4 + Db 000h,000h,01Fh,018h,01Fh,018h,018h,018h ; Hex #D5 + Db 000h,000h,000h,000h,03Fh,036h,036h,036h ; Hex #D6 + Db 036h,036h,036h,036h,0FFh,036h,036h,036h ; Hex #D7 + Db 018h,018h,0FFh,018h,0FFh,018h,018h,018h ; Hex #D8 + Db 018h,018h,018h,018h,0F8h,000h,000h,000h ; Hex #D9 + Db 000h,000h,000h,000h,01Fh,018h,018h,018h ; Hex #DA + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #DB + Db 000h,000h,000h,000h,0FFh,0FFh,0FFh,0FFh ; Hex #DC + Db 0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h ; Hex #DD + Db 00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh ; Hex #DE + Db 0FFh,0FFh,0FFh,0FFh,000h,000h,000h,000h ; Hex #DF + Db 000h,000h,076h,0DCh,0C8h,0DCh,076h,000h ; Hex #E0 + Db 078h,0CCh,0CCh,0D8h,0CCh,0C6h,0CCh,000h ; Hex #E1 + Db 0FEh,0C6h,0C0h,0C0h,0C0h,0C0h,0C0h,000h ; Hex #E2 + Db 000h,000h,0FEh,06Ch,06Ch,06Ch,06Ch,000h ; Hex #E3 + Db 0FEh,0C6h,060h,030h,060h,0C6h,0FEh,000h ; Hex #E4 + Db 000h,000h,07Eh,0D8h,0D8h,0D8h,070h,000h ; Hex #E5 + Db 000h,000h,066h,066h,066h,066h,07Ch,0C0h ; Hex #E6 + Db 000h,076h,0DCh,018h,018h,018h,018h,000h ; Hex #E7 + Db 07Eh,018h,03Ch,066h,066h,03Ch,018h,07Eh ; Hex #E8 + Db 038h,06Ch,0C6h,0FEh,0C6h,06Ch,038h,000h ; Hex #E9 + Db 038h,06Ch,0C6h,0C6h,06Ch,06Ch,0EEh,000h ; Hex #EA + Db 00Eh,018h,00Ch,03Eh,066h,066h,03Ch,000h ; Hex #EB + Db 000h,000h,07Eh,0DBh,0DBh,07Eh,000h,000h ; Hex #EC + Db 006h,00Ch,07Eh,0DBh,0DBh,07Eh,060h,0C0h ; Hex #ED + Db 01Eh,030h,060h,07Eh,060h,030h,01Eh,000h ; Hex #EE + Db 000h,07Ch,0C6h,0C6h,0C6h,0C6h,0C6h,000h ; Hex #EF + Db 000h,0FEh,000h,0FEh,000h,0FEh,000h,000h ; Hex #F0 + Db 018h,018h,07Eh,018h,018h,000h,07Eh,000h ; Hex #F1 + Db 030h,018h,00Ch,018h,030h,000h,07Eh,000h ; Hex #F2 + Db 00Ch,018h,030h,018h,00Ch,000h,07Eh,000h ; Hex #F3 + Db 00Eh,01Bh,01Bh,018h,018h,018h,018h,018h ; Hex #F4 + Db 018h,018h,018h,018h,018h,0D8h,0D8h,070h ; Hex #F5 + Db 000h,018h,000h,07Eh,000h,018h,000h,000h ; Hex #F6 + Db 000h,076h,0DCh,000h,076h,0DCh,000h,000h ; Hex #F7 + Db 038h,06Ch,06Ch,038h,000h,000h,000h,000h ; Hex #F8 + Db 000h,000h,000h,018h,018h,000h,000h,000h ; Hex #F9 + Db 000h,000h,000h,018h,000h,000h,000h,000h ; Hex #FA + Db 00Fh,00Ch,00Ch,00Ch,0ECh,06Ch,03Ch,01Ch ; Hex #FB + Db 06Ch,036h,036h,036h,036h,000h,000h,000h ; Hex #FC + Db 078h,00Ch,018h,030h,07Ch,000h,000h,000h ; Hex #FD + Db 000h,000h,03Ch,03Ch,03Ch,03Ch,000h,000h ; Hex #FE + Db 000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FF + diff --git a/v4.0/src/DEV/DISPLAY/EGA/865-CPI.ASM b/v4.0/src/DEV/DISPLAY/EGA/865-CPI.ASM new file mode 100644 index 0000000..2d101fd --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/EGA/865-CPI.ASM @@ -0,0 +1,49 @@ +CODE SEGMENT BYTE PUBLIC 'CODE' + ASSUME CS:CODE,DS:CODE + +IF1 + %OUT EGA.CPI creation file + %OUT . + %OUT CP SRC files: + %OUT . + %OUT . CODE PAGE: 865 +ENDIF + +EGA865: DW LEN_865 ; SIZE OF ENTRY HEADER + DW POST_EGA865,0 ; POINTER TO NEXT HEADER + DW 1 ; DEVICE TYPE + DB "EGA " ; DEVICE SUBTYPE ID + DW 865 ; CODE PAGE ID + DW 3 DUP(0) ; RESERVED + DW OFFSET DATA865,0 ; POINTER TO FONTS +LEN_865 EQU ($-EGA865) ; + ; +DATA865:DW 1 ; CART/NON-CART + DW 3 ; # OF FONTS + DW LEN_D865 ; LENGTH OF DATA +D865: ; + DB 16,8 ; CHARACTER BOX SIZE + DB 0,0 ; ASPECT RATIO (UNUSED) + DW 256 ; NUMBER OF CHARACTERS + ; + INCLUDE 865-8X16.ASM ; + ; + DB 14,8 ; CHARACTER BOX SIZE + DB 0,0 ; ASPECT RATIO (UNUSED) + DW 256 ; NUMBER OF CHARACTERS + ; + INCLUDE 865-8X14.ASM ; + ; + DB 8,8 ; CHARACTER BOX SIZE + DB 0,0 ; ASPECT RATIO (UNUSED) + DW 256 ; NUMBER OF CHARACTERS + ; + INCLUDE 865-8X8.ASM ; + ; +LEN_D865 EQU ($-D865) ; + ; +POST_EGA865 EQU $ ; + ; +CODE ENDS ; + END ; + \ No newline at end of file diff --git a/v4.0/src/DEV/DISPLAY/EGA/COPYRIGH.ASM b/v4.0/src/DEV/DISPLAY/EGA/COPYRIGH.ASM new file mode 100644 index 0000000..9b83db0 --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/EGA/COPYRIGH.ASM @@ -0,0 +1,11 @@ +CODE SEGMENT BYTE PUBLIC 'CODE' + ASSUME CS:CODE,DS:CODE + + DB 13,10 + DB "Microsoft MS-DOS (R) EGA Display Font File",13,10 +include copyrigh.inc + DB 1Ah + +CODE ENDS + END + diff --git a/v4.0/src/DEV/DISPLAY/EGA/CPI-HEAD.ASM b/v4.0/src/DEV/DISPLAY/EGA/CPI-HEAD.ASM new file mode 100644 index 0000000..43626bf --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/EGA/CPI-HEAD.ASM @@ -0,0 +1,15 @@ +CODE SEGMENT BYTE PUBLIC 'CODE' + ASSUME CS:CODE,DS:CODE + +BEGIN: ORG 0 + +FNTHEAD:DB 0FFH,"FONT " ;FILE TAG + DB 8 DUP(0) ;RESERVED + DW 1 ;CNT OF POINTERS IN HEADER + DB 1 ;TYPE FOR INFO POINTER + DW OFFSET INFO,0 ;POINTER TO INFO IN FILE +INFO: DW 5 ;COUNT OF ENTRIES + +CODE ENDS + END + \ No newline at end of file diff --git a/v4.0/src/DEV/DISPLAY/EGA/EGA.LNK b/v4.0/src/DEV/DISPLAY/EGA/EGA.LNK new file mode 100644 index 0000000..45ea5ea --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/EGA/EGA.LNK @@ -0,0 +1,8 @@ +cpi-head+ +437-CPI+ +850-CPI+ +860-CPI+ +863-CPI+ +865-CPI+ +COPYRIGH; + \ No newline at end of file diff --git a/v4.0/src/DEV/DISPLAY/EGA/MAKEFILE b/v4.0/src/DEV/DISPLAY/EGA/MAKEFILE new file mode 100644 index 0000000..89319c7 --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/EGA/MAKEFILE @@ -0,0 +1,55 @@ +#*********************** Makefile for Display\EGA ************************ + +inc =..\..\..\inc +dos =..\..\..\dos +msg =..\..\..\messages +hinc =..\..\..\h + +# +######################## Dependencies begin here ######################### +# + +all: ega.cpi + +cpi-head.obj: cpi-head.asm \ + makefile + +437-cpi.obj: 437-cpi.asm \ + 437-8x16.asm \ + 437-8x14.asm \ + makefile \ + 437-8x8.asm + +850-cpi.obj: 850-cpi.asm \ + 850-8x16.asm \ + 850-8x14.asm \ + makefile \ + 850-8x8.asm + +860-cpi.obj: 860-cpi.asm \ + 860-8x16.asm \ + 860-8x14.asm \ + makefile \ + 860-8x8.asm + +863-cpi.obj: 863-cpi.asm \ + 863-8x16.asm \ + 863-8x14.asm \ + makefile \ + 863-8x8.asm + +865-cpi.obj: 865-cpi.asm \ + 865-8x16.asm \ + 865-8x14.asm \ + makefile \ + 865-8x8.asm + +copyrigh.obj: copyrigh.asm $(inc)\copyrigh.inc \ + makefile + +ega.cpi: cpi-head.obj 437-cpi.obj 850-cpi.obj 860-cpi.obj \ + 863-cpi.obj 865-cpi.obj copyrigh.obj makefile ega.lnk \ + makefile + link @ega.lnk + exe2bin cpi-head.exe ega.cpi + del cpi-head.exe diff --git a/v4.0/src/DEV/DISPLAY/F-PARSER.INC b/v4.0/src/DEV/DISPLAY/F-PARSER.INC new file mode 100644 index 0000000..47c166b --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/F-PARSER.INC @@ -0,0 +1,2040 @@ + + PAGE ,132 + +IF1 + %OUT . F-PARSER.SRC +ENDIF +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; FILENAME: CPS Device Driver -- Font Parser +;; MODULE NAME: CPSFONT +;; TYPE: Font Parser Module +;; LINK PROCEDURE: Link CPSPMnn+CPSFONTn+PTRMSGn+CPSPInn into .EXE format. +;; CPSPM must be first. CPSPInn must be last. Everything +;; before CPSPInn will be resident. +;; INCLUDE FILES: +;; CPSPEQU.INC +;; Remarks : +;; +;; changes are made in stages : PTRSELLO, PTRSELHI, PTRLENLO, PTRLENHI +;; as for Display-type of DEVICE_ID, there will be no printer-type of +;; of DEVICE_TYPE. And these four stages are for the DEVICE_TYPE with +;; the value of printer-type. +;; +;; (most codes in the four stages are masked out as comments than real +;; codes to save spaces. Also mask out lines that contain the +;; following varaibles : +;; -- PTR_SEL_WORD +;; -- PTR_SELOB +;; -- PTR_SEHIB +;; -- PTR_LEN_WORD +;; -- PTR_LNLOB +;; -- PTR_LNHIB +;; -- PRE_FONT_P0 +;; -- PRE_FONT_P +;; -- FTB_SELECT +;; -- FTB_SELLEN +;; +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +;INCLUDE CPSPEQU.INC ;; + ;; +STAT_DELETE EQU 08000H ; previous degignate deleted (DST) + ; STAT_DELETE : only for FIFO +STAT_NOFIND EQU 08008H ; codepage,device not found (DST) +STAT_DEVERR EQU 0800AH ; Device error (DST, IVK, QIV, QLS) +STAT_BADATA EQU 0800CH ; bad font file (DST) +STAT_BADDEN EQU 0800CH ; no DST (DEN) +STAT_TOMANY EQU 0800CH ; too manay codepages (DST) +STAT_DUPLCP EQU 0800CH ; too manay codepages (DST) +STAT_NOCPIV EQU 08007H ; no codepage designated/invoked +STAT_NOCP EQU 08007H ; no codepage designated/invoked + ; (IVK, QIV, QLS) +TYPE_DISPLAY EQU 01H ;; display type device +FLAG_RESTART EQU 000001H ;; bit 1 = restart the parsing + +FPKT EQU DS:[SI] ; +FTP EQU ES:[BX] ; + ; ( I=Input O=Output ) +FTBLK STRUC ; +FTB_LENGTH DW TYPE FTBLK ; (NOT TO BE CHANGED) +FTB_STATUS DW 0FFFFH ; (O) parsing compelte +FTB_TYPE DW 0 ; (O) +FTB_TID DB '........' ; (I) +FTB_CP DW 0FFFFH ; (I) +FTB_MOD DW 0 ; (O) +FTB_FONTS DW 0 ; (O) +FTB_ROWS DB 0 ;; (O) DISPLAY TYPE DEVICE +FTB_COLS DB 0 ;; (O) DISPLAY TYPE DEVICE +FTB_X DB 0 ;; (O) DISPLAY TYPE DEVICE +FTB_Y DB 0 ;; (O) DISPLAY TYPE DEVICE +FTB_COUNT DW 0 ;; (O) DISPLAY TYPE DEVICE +FTB_DLEFT DW 0 ; (O) =0, none to come +FTB_DLEN DW 0 ; (O) =0, not in this packet +FTB_DALO DW 0 ; (O) in the DOS "packet" buffer +FTB_DAHI DW 0 ; (O) " " " " " +TARGET_LO DW 0 ; internal registers +TARGET_HI DW 0 ; internal registers +FTBLK ENDS ; + ; +FBUFS STRUC ; +FLAG DW 0 ; +BUFFER_LEN DW 0 ; +BUFFER_ADDR DD 0 ; +NUM_FTBLK DW 0 ; no. of FTBKL entries +FBUFS ENDS ; + ; STATUS : (in FTB_STATUS) +FSTAT_COMPLETE EQU 0FFFFH ; parsing compeleted. (good status) +FSTAT_FONT EQU 0FFFEH ; font data is defined and returned +FSTAT_FOUND EQU 0FFFDH ; informations including font-length +FSTAT_MATCH EQU 0FFFCH ; font header matches FTBLK +FSTAT_SEARCH EQU 0FFFBH ; seraching for header & font +FSTAT_BOTTOM EQU 0FFF0H ; below this are the DOS_STATUS. + ; +;; the FSTAT with value lower than 0FFF0H is to be returned to the DOS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +PUBLIC FTABLE,FONT_PARSER ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; ************************************ +;; ** ** +;; ** Resident Code ** +;; ** ** +;; ************************************ +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; FONT_PARSER data +;; +;; -- Interface table : FTABLE +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +FTABLE: FBUFS <0FFFFH,,,> ;; for temporary testing +FTB1 FTBLK <,,,,,,,,,,,,> ;; -- at most 12 entries +FTB2 FTBLK <,,,,,,,,,,,,> ;; +FTB3 FTBLK <,,,,,,,,,,,,> ;; +FTB4 FTBLK <,,,,,,,,,,,,> ;; +FTB5 FTBLK <,,,,,,,,,,,,> ;; +FTB6 FTBLK <,,,,,,,,,,,,> ;; +FTB7 FTBLK <,,,,,,,,,,,,> ;; +FTB8 FTBLK <,,,,,,,,,,,,> ;; +FTB9 FTBLK <,,,,,,,,,,,,> ;; +FTBa FTBLK <,,,,,,,,,,,,> ;; +FTBb FTBLK <,,,,,,,,,,,,> ;; +FTBc FTBLK <,,,,,,,,,,,,> ;; + ;; +FP_ERROR DW 0000H ;; internal error register + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; the followings are bytes accumulated + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +FTAG_LEN EQU 8 ;; FILE TAGE in the font file header +FTAG_COUNT DW 0000H ;; + ;; +FTAG_PATTERN LABEL BYTE ;; + DB 0FFH ;; + DB 'FONT ' ;; + ;; + ;; + ;; POINTER in the font file header +fptr_LOW LABEL WORD ;; +fptr_LOL DB 00H ;; NEXT +fptr_LOH DB 00H ;; +fptr_HIGH LABEL WORD ;; +fptr_HIL DB 00H ;; +fptr_HIH DB 00H ;; + ;; + ;; + ;; +ENTRY_WORD LABEL WORD ;; +ENTRY_LOB DB 00H ;; ENTRY COUNT +ENTRY_HIB DB 00H ;; +NEXT_LOW LABEL WORD ;; +NEXT_LOL DB 00H ;; NEXT +NEXT_LOH DB 00H ;; +NEXT_HIGH LABEL WORD ;; +NEXT_HIL DB 00H ;; +NEXT_HIH DB 00H ;; +TYPE_WORD LABEL WORD ;; +TYPE_LOB DB 00H ;; TYPE +TYPE_HIB DB 00H ;; +TID_CNT DW 00000H ;; TYPEID COUNT(0 to 8) +TYPE_ID : DB ' ' ;; TYPEID +CPG_WORD LABEL WORD ;; +CPG_LOB DB 00H ;; CODE PAGE +CPG_HIB DB 00H ;; +FONT_LOW LABEL WORD ;; +FONT_LOL DB 00H ;; FONT ADDRESS +FONT_LOH DB 00H ;; +FONT_HIGH LABEL WORD ;; +FONT_HIL DB 00H ;; +FONT_HIH DB 00H ;; +;; the followings are contained in the font-block in the exact order & length +MOD_WORD LABEL WORD ;; +MOD_LOB DB 00H ;; MODIFIER +MOD_HIB DB 00H ;; +FONTS_WORD LABEL WORD ;; +FONTS_LOB DB 00H ;; FONTS +FONTS_HIB DB 00H ;; +FDLEN_WORD LABEL WORD ;; +FDLEN_LOB DB 00H ;; FONT DATA LENGTH +FDLEN_HIB DB 00H ;; +PRE_FONT_ND EQU ($-MOD_WORD) ;; used to update target for font data + ;; to follow. -- for NON-DISPLAY +;DISP_ROWS DB 00H ;; DISPLAY's parameters : +;DISP_COLS DB 00H ;; BOX SIZE +;DISP_X DB 00H ;; ASPECT RATIO +;DISP_Y DB 00H ;; +;COUNT_WORD LABEL WORD ;; NO. OF DISPLAY CHARACTERS +;COUNT_LOB DB 00H ;; +;COUNT_HIB DB 00H ;; +;PRE_FONT_D EQU ($-MOD_WORD) ;; used to update target for font data + ;; to follow. -- for DISPLAY + ;; +;PTR_SEL_WORD LABEL WORD ;; +;PTR_SELOB DB 00H ;; +;PTR_SEHIB DB 00H ;; +;PRE_FONT_P0 EQU ($-PTR_SELOB+PRE_FONT_ND) ;; to update target for font data + ;; to follow -- for PRINTER with + ;; selection type = 0. + ;; +;PTR_LEN_WORD LABEL WORD ;; +;PTR_LNLOB DB 00H ;; +;PTR_LNHIB DB 00H ;; +;PRE_FONT_P EQU ($-PTR_SELOB+PRE_FONT_ND) ;; to update target for font data + ;; to follow -- for PRINTER with + ;; selection type <> 0. + ;; + ;; +;; also update STAGE_CASES and indexing constants + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; the stage the parsing is in : ;;;;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +STAGE_CASES LABEL WORD ;; the stage the parsing is in : + ;; + ;; *** INDEXED BY STAGE-INDEX + ;; + DW OFFSET ENTRYLO ;; 0 + DW OFFSET ENTRYHI ;; 1 + DW OFFSET NEXTLOL ;; 2 + DW OFFSET NEXTLOH ;; 3 + DW OFFSET NEXTHIL ;; 4 + DW OFFSET NEXTHIH ;; 5 + DW OFFSET TYPELO ;; 6 + DW OFFSET TYPEHI ;; 7 + DW OFFSET TYPEIDS ;; 8 + DW OFFSET CPGLO ;; 9 + DW OFFSET CPGHI ;; A + DW OFFSET FONTLOL ;; B + DW OFFSET FONTLOH ;; C + DW OFFSET FONTHIL ;; D + DW OFFSET FONTHIH ;; E + DW 00H ;; MATCH case -- end of SEARCH stages + DW 00H ;; SCAN case -- before PRE-FOUND stage + DW OFFSET MODLO ;; 11 + DW OFFSET MODHI ;; 12 + DW OFFSET FONTSLO ;; 13 + DW OFFSET FONTSHI ;; 14 + DW OFFSET FDLENLO ;; 15 + DW OFFSET FDLENHI ;; 16 -- lead to FONT case,NON- DISPLAY + DW OFFSET DSPROWS ;; 17 -- DISPLAY only + DW OFFSET DSPCOLS ;; 18 + DW OFFSET DSPX ;; 19 + DW OFFSET DSPY ;; 1A + DW OFFSET DSPCOUNTLO ;; 1B + DW OFFSET DSPCOUNTHI ;; 1C -- lead to FONT case, DISPLAY + DW OFFSET PTRSELLO ;; 1D -- PRINTER only + DW OFFSET PTRSELHI ;; 1E + DW OFFSET PTRLENLO ;; 1F + DW OFFSET PTRLENHI ;; 20 -- lead to FONT case, PRINTER + DW 00H ;; FOUND case + DW 00H ;; GET_FONT case + DW 00H ;; PASS special stage + DW OFFSET FILETAG ;; 24 + DW OFFSET fptrLOL ;; 25 + DW OFFSET fptrLOH ;; 26 + DW OFFSET fptrHIL ;; 27 + DW OFFSET fptrHIH ;; 28 + DW 00H ;; FPTR_SKIP_CASE + ;; + ;; The followings are individual stage +STAGE_MAX EQU ($-STAGE_CASES)/2 ;; number of stages + ;; + ;; STAGE-INDEX + ;; + ;; **** INDEX TO STAGE_CASES **** +ENTRY_LOX EQU 00H ;; +ENTRY_HIX EQU 01H ;; +NEXT_LOLX EQU 02H ;; NEXT +NEXT_LOHX EQU 03H ;; +NEXT_HILX EQU 04H ;; +NEXT_HIHX EQU 05H ;; +TYPE_LOBX EQU 06H ;; TYPE +TYPE_HIBX EQU 07H ;; +TYPE_IDX EQU 08H ;; TYPEID +CPG_LOBX EQU 09H ;; CODE PAGE +CPG_HIBX EQU 0AH ;; +FONT_LOLX EQU 0BH ;; FONT ADDRESS +FONT_LOHX EQU 0CH ;; +FONT_HILX EQU 0DH ;; +FONT_HIHX EQU 0EH ;; + ;; ------------------------------ +MATCHX EQU 0FH ;; MATCH is the end of SEARCH's stages +SCANX EQU 10H ;; SCANX is before the PRE-FOUND stages + ;; ------------------------------ +MOD_LOBX EQU 11H ;; MODIFIER +MOD_HIBX EQU 12H ;; +FONTS_LOBX EQU 13H ;; FONTS +FONTS_HIBX EQU 14H ;; +FDLEN_LOBX EQU 15H ;; FONT DATA LENGTH +FDLEN_HIBX EQU 16H ;; +DISP_ROWSX EQU 17H ;; DISPLAY -- CHAR. SIZE +DISP_COLSX EQU 18H ;; +DISP_XX EQU 19H ;; DISPLAY -- ASPECT RATIO +DISP_YX EQU 1AH ;; +COUNT_LOBX EQU 1BH ;; DISPLAY -- COUNT +COUNT_HIBX EQU 1CH ;; +PTRSELLOX EQU 1DH ;; +PTRSELHIX EQU 1EH ;; +PTRLENLOX EQU 1FH ;; +PTRLENHIX EQU 20H ;; + ;; + ;; ------------------------------ +FOUNDX EQU 21H ;; GET_FX is the end of PRE-FOUND stage +GET_FX EQU 22H ;; + ;; ------------------------------ +PASSX EQU 23H ;; see pass_brk table + ;; ------------------------------ +FTAGX EQU 24H ;; RESTART ==> FILE TAG + ;; +fptr_LOLX EQU 25H ;; POINTER in font file header +fptr_LOHX EQU 26H ;; +fptr_HILX EQU 27H ;; +fptr_HIHX EQU 28H ;; --------------------------------- + ;; +fptr_SKIPX EQU 29H ;; ==> ENTRY_LOX + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; PASS -- to skip some bytes ;;;;;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; the PASS mechanism is used to skip + ;; a number of bytes between two fields + ;; The numbers are tabulated in + ;; PASS_BRK table in the accumulative + ;; sum. The PASS_POSTX(and PASS_POSTXX) + ;; are used to tell what is the stage + ;; after all the bytes have skipped. + ;; +PASS_POSTX DW STAGE_MAX ;; the stage after pass-stage + ;; +FILE_OFFSET EQU 0BH ;; spaces to be skipped in font file : + ;; ( after TAG, before POINTER) + ;; +PASS_CNT DW 0 ;; +PASS_BRK LABEL WORD ;; + DW FILE_OFFSET ;; skip in the font file header + DW FILE_OFFSET+2 ;; pass header-length, needs to reset + ;; PASS_CNT for each of the font_header + DW FILE_OFFSET+8 ;; pass header-reserved bytes +PASS_INDX EQU ($-PASS_BRK)/2 ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; the control variables : ;;;;;;;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +STAGE DW STAGE_MAX ;; of the STAGE-INDEX + ;; +Pre_font_len DW 00000H ;; no. of bytes before the FONT DATA + ;; + ;; +COUNT_LO DW 00000H ;; no. of bytes parsed so far +COUNT_hI DW 00000H ;; + ;; +HIT_LO DW 00000H ;; the next byte that is addressed by : +HIT_HI DW 00000H ;; either NEXT or TARGET in FTBLK. + ;; +HIT_FLAG DW 00000H ;; IF ZERO, the NEXT is approaching +HIT_BX DW 00000H ;; where FTB is found for nearest hit + ;; +NUM_FTB DW 00000H ;; as defined in the FP_BUFFER + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; FONT_PARSER routine +;; +;; -- to be called at every packet received to extract informations +;; from Font File on byte basis. +;; +;; -- Interface though FTABLE +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +FONT_PARSER PROC ;; + PUSH DS ;; save all registers Revised + PUSH ES ;; + PUSH AX ;; + PUSH BX ;; + PUSH CX ;; + PUSH DX ;; + PUSH DI ;; + PUSH SI ;; + ;; BP isn't used, so it isn't saved + LEA BX,FTABLE ;; + PUSH CS ;; + POP ES ;; ES:[BX] + LDS SI,FTP.BUFFER_ADDR ;; DS:[SI] + MOV CX,FTP.BUFFER_LEN ;; CX = length of packet + MOV DX,FTP.NUM_FTBLK ;; DX = number of FTB + MOV cs:num_ftb,DX ;; + AND DX,DX ;; + JNZ VALID_BUFFER ;; + MOV cs:fp_error,0020H ;; ERROR 0020H + JMP FP_RET ;; +VALID_BUFFER : ;; + MOV AX,FTP.FLAG ;; + AND AX,FLAG_RESTART ;; + Jnz has_RESTART ;; + JMP NO_RESTART ;; + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +has_restart : ;; + PUSH BX ;; reset all the output fields + ADD BX,TYPE FBUFS ;; FTP = FONT BLOCK + XOR AX,AX ;; + ;; + MOV cs:ftag_count,AX ;; + MOV cs:fptr_low,AX ;; + MOV cs:fptr_high,AX ;; + MOV cs:pre_font_len,AX ;; + MOV cs:count_lo,AX ;; + MOV cs:count_hi,AX ;; + MOV cs:next_low,AX ;; + MOV cs:next_high,AX ;; + MOV cs:hit_lo,AX ;; + MOV cs:hit_hi,AX ;; + MOV cs:hit_flag,AX ;; + MOV cs:pass_cnt,AX ;; + MOV cs:pass_postx,STAGE_MAX ;; + ;; + MOV cs:stage,STAGE_MAX ;; + ;; +RESET_FTB : ;; + MOV FTP.FTB_STATUS,FSTAT_SEARCH + MOV FTP.FTB_TYPE,AX ;; + MOV FTP.FTB_MOD,AX ;; + MOV FTP.FTB_FONTS,AX ;; + MOV FTP.FTB_ROWS,AL ;; + MOV FTP.FTB_COLS,AL ;; + MOV FTP.FTB_X,AL ;; + MOV FTP.FTB_Y,AL ;; + MOV FTP.FTB_COUNT,AX ;; + MOV FTP.FTB_DLEFT,AX ;; + MOV FTP.FTB_DLEN,AX ;; + MOV FTP.FTB_DALO,AX ;; + MOV FTP.FTB_DAHI,AX ;; + MOV FTP.TARGET_LO,AX ;; + MOV FTP.TARGET_HI,AX ;; + ;; + ADD BX, TYPE FTBLK ;; + ;; + DEC DX ;; + AND DX,DX ;; + JNZ RESET_FTB ;; + ;; + POP BX ;; +NO_RESTART : ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; any FTBLKs have their data all + ;; returned ? if so set their status + ;; from FOUND to COMPLETE + PUSH BX ;; + ADD BX,TYPE FBUFS ;; FTP = FONT BLOCK + ;; + MOV DX,cs:num_ftb ;; + ;; +SET_COMPLETE : ;; + MOV AX,FTP.FTB_STATUS ;; + CMP AX,FSTAT_FONT ;; + JNE SET_NEXT ;; + ;; + MOV AX,FTP.FTB_DLEFT ;; + AND AX,AX ;; + JNZ SET_NEXT ;; + ;; + MOV FTP.FTB_STATUS,FSTAT_COMPLETE + ;; +SET_NEXT : ;; + ;; + ADD BX,TYPE FTBLK ;; + ;; + DEC DX ;; + AND DX,DX ;; + JNZ SET_COMPLETE ;; + ;; + POP BX ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ADD BX,TYPE FBUFS ;; FTP = FONT BLOCK + ;; + PUSH CX ;; STACK 1 = CX +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; DO WHILE CX is not zero : +;; +;; -- on each loop, the CX, COUNTs are updated +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +FTB_LOOP : ;; + POP AX ;; STACK -1 + SUB AX,CX ;; + ADD cs:count_lo,AX ;; + JNC NO_CARRY ;; + ADD cs:count_hi,1000H ;; +NO_CARRY : ;; + PUSH CX ;; STACK 1 = CX + AND CX,CX ;; + JNZ FTB_CONT ;; + JMP FTB_LPEND ;; + ;; DO CASES : +FTB_CONT : ;; ========== + ;; + MOV AX,cs:stage ;; + ;; + CMP AX,STAGE_MAX ;; + JNE FTB_010 ;; + JMP START_CASE ;; ** RESTART ** + ;; +FTB_010 : ;; + CMP AX,MATCHX ;; + JAE FTB_020 ;; + JMP SEARCH_CASE ;; ** SEARCH ** + ;; +FTB_020 : ;; + CMP AX,MATCHX ;; + JNE FTB_030 ;; + JMP MATCH_CASE ;; ** MATCH ** + ;; +FTB_030 : ;; + CMP AX,SCANX ;; + JNE FTB_040 ;; + JMP SCAN_CASE ;; ** SCAN ** + ;; +FTB_040 : ;; + CMP AX,FOUNDX ;; + JAE FTB_050 ;; + JMP PRE_FOUND_CASE ;; ** PRE-FOUND ** + ;; +FTB_050 : ;; + CMP AX,FOUNDX ;; + JNE FTB_060 ;; + JMP FOUND_CASE ;; ** FOUND ** + ;; +FTB_060 : ;; + CMP AX,GET_FX ;; + JNE FTB_070 ;; + JMP GETFONT_CASE ;; ** GET_FONT ** + ;; +FTB_070 : ;; + CMP AX,PASSX ;; + JNE FTB_080 ;; + JMP PASS ;; ** PASS ** + ;; +FTB_080 : ;; + CMP AX,FPTR_SKIPX ;; + JAE FTB_090 ;; + JMP SEARCH_CASE ;; ** SEARCH ** + ;; +FTB_090 : ;; + CMP AX,FPTR_SKIPX ;; + JNE FTB_FFF ;; + JMP FPTR_SKIP_CASE ;; ** SEARCH ** + ;; +FTB_FFF : ;; + MOV FTP.FTB_STATUS,STAT_DEVERR + JMP FTB_LPEND ;; ** DEVICE ERROR ** + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; at the entry of each STAGES /CASES +;; +;; -- DS:[SI] (FPKT) points to PACKET, of DOS's buffer +;; -- CX remaining packet length +;; -- ES:[BX] points to the first FTBLK +;; -- COUNT_LO, COUNT_HI, upto but and including the address pointed by FPKT +;; +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +;============================================================================ +START_CASE : ;; pass the FILE leading bytes + ;; + MOV cs:ftag_count,0 ;; + MOV cs:stage,ftagx ;; + JMP FTB_LOOP ;; + ;; +;============================================================================= +FPTR_SKIP_CASE : ;; skip until the ENTRY pointed by + ;; POINTER (in FPTR) is reached. + ;; + ;; ************** + MOV AX,cs:fptr_low ;; * HIT = FPTR * + MOV cs:hit_lo,AX ;; ************** + MOV DX,cs:fptr_high ;; + MOV cs:hit_hi,DX ;; + ;; + CMP AX,0FFFFH ;; + JNE FPTR_SKIP_VALID ;; + CMP DX,0FFFFH ;; + JNE FPTR_SKIP_VALID ;; + ;; + MOV FTP.FTB_STATUS,STAT_BADATA ;; returned at the first FTBLK + JMP FPTR_SKIP_MORE ;; + ;; +FPTR_SKIP_VALID : ;; + ;; normalised HIT_HI, HIT_LO + MOV AX,DX ;; + AND AX,00FFFH ;; + PUSH CX ;; + MOV CX,4 ;; + SHL AX,CL ;; + POP CX ;; + AND DX,0F000H ;; + ADD AX,cs:hit_lo ;; + JNC NO_CARRY10 ;; + ADD DX,01000H ;; +NO_CARRY10: ;; + MOV cs:hit_lo,AX ;; + MOV cs:hit_hi,DX ;; + ;; ************************** + ;; * compare FPTR and COUNT * + ;; ************************** + ;; DX:AX = HIT_HI:HIT_LO (normalised) + ;; + SUB AX,cs:count_lo ;; + Jnc more_fptrlo ;; + sub dx,01000h ;; + jc fptr_bad ;; + ;; +more_fptrlo : ;; + SUB DX,cs:count_hi ;; + JC fptr_BAD ;; + ;; + INC AX ;; COUNT can be at the HIT, then AX=0 + JNC NO_CARRY11 ;; INC AX to make AX comparable to CX + ADD DX,01000H ;; i.e. AX = offset + 1 + ;; +NO_CARRY11: ;; + CMP AX,CX ;; + JA fptr_skip_more ;; AX > CX, whole CX to be skipped + ;; + PUSH DX ;; normalise dx:ax + AND DX,00FFFH ;; + PUSH CX ;; + MOV CX,4 ;; + SHL DX,CL ;; + POP CX ;; + ADD AX,DX ;; + POP DX ;; + JNC NO_CARRY13 ;; + ADD DX,01000H ;; +NO_CARRY13: ;; + AND DX,0F000H ;; + ;; + PUSH AX ;; + PUSH DX ;; STACK +1 : normalosed DX:AX + SUB AX,CX ;; + JNC NO_BORROW11 ;; + SUB DX,1000H ;; + JC fptr_MORE_CXp ;; dx:ax < cx +NO_BORROW11: ;; + ;; dx:ax >= cx + AND AX,AX ;; + JNE fptr_skip_MOREP ;; + AND DX,DX ;; + JNE fptr_skip_MOREP ;; + ;; dx:ax = cx, or + ;; offset + 1 = CX + ;; + ;; ************************************ + ;; * POINTER is within the current CX * + ;; ************************************ +fptr_MORE_CXP : ;; + POP DX ;; + POP AX ;; STACK -1 + ;; +fptr_MORE_CX : ;; DX = 0,to have more CX than offset+1 + DEC AX ;; = offset : 0 and above + SUB CX,AX ;; + ADD SI,AX ;; where the first byte is + ;; + MOV cs:stage,entry_lox ;; ENTRIES in the font file + ;; + JMP FTB_LOOP ;; ****** RETURN ******* + ;; + ;; *********************************** + ;; * more to skip ==> FPTR_SKIP_CASE * + ;; *********************************** +fptr_skip_morep: ;; + POP DX ;; + POP AX ;; STACK -1 + ;; +fptr_skip_more : ;; + ADD SI,CX ;; + SUB CX,CX ;; + JMP FTB_LOOP ;; ****** RETURN ***** + ;; + ;; *********************************** + ;; * bad POINTER in font file header * + ;; *********************************** + ;; +fptr_bad : ;; + MOV cs:fptr_low,0FFFFH ;; + MOV cs:fptr_high,0FFFFH ;; + ;; + MOV FTP.FTB_STATUS,STAT_BADATA ;; returned at the first FTBLK + ;; + JMP FPTR_SKIP_MORE ;; + ;; +;============================================================================= +SEARCH_CASE : ;; + ;; still looking for header to match + ;; the input : codepage and typeid + ;; + MOV DI,cs:stage ;; + ;; + ADD DI,DI ;; double to index to WORD-offset + ;; + JMP CS:STAGE_CASES[DI] ;; call routine to process the stage + ;; + ;; +;=========================================================================== +MATCH_CASE : ;; + ;; + PUSH BX ;; + MOV DX,cs:num_ftb ;; + ;; + ;; +MATCH_LOOP : ;; + MOV AX,FTP.FTB_STATUS ;; + CMP AX,FSTAT_SEARCH ;; + JE MATCH_SEARCH ;; + JMP MATCH_NEXT ;; + ;; +MATCH_SEARCH : ;; + MOV AX,FTP.FTB_CP ;; check the FTB with SEARCH status + CMP AX,cs:cpg_word ;; + JNE MATCH_MORE ;; + PUSH DS ;; code page matched + PUSH SI ;; + PUSH CX ;; + ;; + PUSH CS ;; + POP DS ;; + MOV SI,OFFSET TYPE_ID ;; + LEA DI,[BX].FTB_TID ;; + MOV CX,8 ;; + REPE CMPSB ;; + ;; + POP CX ;; + POP SI ;; + POP DS ;; + ;; + JNE MATCH_MORE ;; + ;; MATCH !!!!! (type_id matched) + MOV FTP.FTB_STATUS,FSTAT_MATCH + MOV AX,cs:type_word ;; + MOV FTP.FTB_TYPE,AX ;; + MOV AX,cs:font_low ;; + MOV FTP.TARGET_LO,AX ;; + MOV AX,cs:font_high ;; + MOV FTP.TARGET_HI,AX ;; + ;; + JMP MATCH_NEXT ;; + ;; +MATCH_MORE : ;; if this is the last rounf ? + ;; + MOV AX,cs:next_low ;; NEXT = FFFF:FFFF means no more + CMP AX,-1 ;; header to come. + JNE MATCH_NEXT ;; + ;; + MOV AX,cs:next_high ;; + CMP AX,-1 ;; + JNE MATCH_NEXT ;; + ;; + MOV FTP.FTB_STATUS,STAT_NOFIND ;; ERROR : no match + ;; +MATCH_NEXT : ;; + ADD BX,FTP.FTB_LENGTH ;; + DEC DX ;; + AND DX,DX ;; + JZ MATCH_ALL ;; + JMP MATCH_LOOP ;; + ;; +MATCH_ALL : ;; + MOV cs:stage,SCANX ;; + ;; +MATCH_DONE : ;; + POP BX ;; + JMP FTB_LOOP ;; + ;; +;=========================================================================== +SCAN_CASE : ;; + ;; ********************************** + ;; * determine whether it the font * + ;; * data(TARGET),or the next font * + ;; * header(NEXT) that is approaching + ;; ********************************** + ;; + MOV AX,cs:next_low ;; + MOV cs:hit_lo,AX ;; + MOV AX,cs:next_high ;; + MOV cs:hit_hi,AX ;; + XOR AX,AX ;; + MOV cs:hit_flag,AX ;; + ;; + MOV DI,cs:hit_hi ;; normalised HIT_HI, HIT_LO + MOV AX,DI ;; + AND AX,00FFFH ;; + PUSH CX ;; + MOV CX,4 ;; + SHL AX,CL ;; + POP CX ;; + AND DI,0F000H ;; + ADD AX,cs:hit_lo ;; + JNC NO_CARRY2 ;; + ADD DI,01000H ;; +NO_CARRY2 : ;; + MOV cs:hit_lo,AX ;; + MOV cs:hit_hi,DI ;; + ;; + MOV DX,cs:num_ftb ;; + ;; + PUSH BX ;; +SCAN_LOOP : ;; + MOV AX,FTP.FTB_STATUS ;; + CMP AX,FSTAT_MATCH ;; + JNE SCAN_NEXT ;; + ;; + ;; + MOV DI,FTP.TARGET_HI ;; NORMALISED TARGET + MOV AX,DI ;; + AND AX,00FFFH ;; + PUSH CX ;; + MOV CX,4 ;; + SHL AX,CL ;; + POP CX ;; + AND DI,0F000H ;; + ADD AX,FTP.TARGET_LO ;; + JNC NO_CARRY1 ;; + ADD DI,01000H ;; +NO_CARRY1 : ;; DI:AX = NORMALISED TARGET + ;; + ;; ** compare the TARGET and the NEXT + ;; + CMP DI,cs:hit_hi ;; + JA SCAN_NEXT ;; + ;; + JE SCAN_EQU ;; + JMP NEAR_FONT ;; + ;; +SCAN_EQU : ;; + CMP AX,cs:hit_lo ;; + JA SCAN_NEXT ;; + JE SCAN_ERROR_CHK ;; + ;; ********************************** + ;; * the font data is approaching * + ;; ********************************** +NEAR_FONT : ;; + MOV cs:hit_flag,-1 ;; + MOV cs:hit_lo,AX ;; + MOV cs:hit_hi,DI ;; + MOV cs:hit_bx,BX ;; used for BAD_BX and in FOUND_CASE + JMP SCAN_NEXT ;; + ;; + ;; ********************************** + ;; * the NEXT header is approaching * + ;; ********************************** +SCAN_ERROR_CHK : ;; + MOV AX,cs:hit_flag ;; + AND AX,AX ;; + JNZ SCAN_NEXT ;; + MOV FTP.FTB_STATUS,STAT_BADATA ;; next header and font cannot be the + ;; same + ;; +SCAN_NEXT : ;; + DEC DX ;; + AND DX,DX ;; + JZ SCAN_DONE ;; + ;; + ADD BX,FTP.FTB_LENGTH ;; + JMP SCAN_LOOP ;; ** is there any closer font data ? + ;; + ;; ************************************ + ;; * the HIT is either font data(TARGET + ;; * or the font block (NEXT). * + ;; ************************************ +SCAN_DONE : ;; + POP BX ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + MOV DX,cs:hit_hi ;; HIT_FLAG, HIT_LO, HIT_HI defined + MOV AX,cs:hit_lo ;; + ;; + CMP AX,0FFFFH ;; + JNE NOT_FFFF_HIT ;; + CMP DX,0FFFFH ;; + JNE NOT_FFFF_HIT ;; + JMP SCAN_MORE ;; stage remained as SCAN, discard data + ;; +NOT_FFFF_HIT : ;; + ;; DX:AX = HIT_HI:HIT_LO (normalised) + SUB AX,cs:count_lo ;; + JNC NO_BORROW ;; + SUB DX,01000H ;; + JC SCAN_BAD ;; +NO_BORROW: ;; + SUB DX,cs:count_hi ;; + JC SCAN_BAD ;; + ;; + INC AX ;; COUNT can be at the HIT, then AX=0 + JNC NO_CARRYX ;; INC AX to make AX comparable to CX + ADD DX,01000H ;; i.e. AX = offset + 1 + ;; +NO_CARRYX : ;; + CMP AX,CX ;; + JA SCAN_MORE ;; + ;; + PUSH DX ;; + AND DX,00FFFH ;; + PUSH CX ;; + MOV CX,4 ;; + SHL DX,CL ;; + POP CX ;; + ADD AX,DX ;; + POP DX ;; + JNC NO_CARRY3 ;; + ADD DX,01000H ;; +NO_CARRY3 : ;; + AND DX,0F000H ;; + ;; + ;; + PUSH AX ;; + PUSH DX ;; + SUB AX,CX ;; + JNC NO_BORROW1 ;; + SUB DX,1000H ;; + JC MORE_CXp ;; +NO_BORROW1 : ;; + ;; dx:ax >= cx + AND AX,AX ;; + JNE SCAN_MOREP ;; + AND DX,DX ;; + JNE SCAN_MOREP ;; + ;; + ;; offset + 1 = CX + ;; +MORE_CXP : ;; + POP DX ;; + POP AX ;; + ;; +MORE_CX : ;; DX = 0,to have more CX than offset+1 + DEC AX ;; = offset : 0 and above + SUB CX,AX ;; + ADD SI,AX ;; where the first byte is + MOV AX,cs:hit_flag ;; + AND AX,AX ;; + JE NEXT_REACHED ;; + ;; + MOV cs:stage,MOD_LOBX ;; font-data reached, + ;; + JMP FTB_LOOP ;; ****** RETURN ******* + ;; +NEXT_REACHED : ;; + MOV cs:stage,PASSX ;; + MOV cs:pass_postx,next_lolX ;; + MOV cs:pass_cnt,FILE_OFFSET ;; + ;; + ;; + JMP FTB_LOOP ;; ****** RETURN ******* + ;; + ;; *********************************** +SCAN_MOREP : ;; * scan more FTBLK for the nearest * + ;; * font data * + ;; *********************************** + POP DX ;; + POP AX ;; + ;; +SCAN_MORE : ;; + ADD SI,CX ;; + SUB CX,CX ;; + JMP FTB_LOOP ;; more SCAN stage + ;; +SCAN_BAD: ;; ************************* + MOV AX,cs:hit_flag ;; * scan is bad * + AND AX,AX ;; ************************* + JNZ BAD_BX ;; + MOV AX,-1 ;; NEXT is pointing backwards + MOV cs:next_low,AX ;; + MOV cs:next_high,AX ;; no more NEXT + MOV FTP.FTB_STATUS,STAT_BADATA ;; returned at the first FTBLK + JMP FTB_LOOP ;; + ;; +BAD_BX : ;; + PUSH BX ;; FONT is pointing backwards + MOV BX,cs:hit_bx ;; + MOV FTP.FTB_STATUS,STAT_BADATA + POP BX ;; + JMP FTB_LOOP ;; + ;; +;=========================================================================== +PRE_FOUND_CASE : ;; + ;; extract informations from the font + ;; block until font_length is defined + ;; + MOV DI,cs:stage ;; + ;; + ADD DI,DI ;; double to index to WORD-offset + ;; + JMP CS:STAGE_CASES[DI] ;; call routine to process the stage + ;; +;=========================================================================== +FOUND_CASE : ;; + MOV DI,OFFSET FTB_LOOP ;; as FOUND has two places to return to + PUSH DI ;; +;=========================================================================== +FOUND_DO : ;; + ;; define informations into FTBLK of + ;; HIT_BX defined in the SCAN case + PUSH BX ;; + MOV BX,cs:hit_bx ;; + ;; FTBLK : + MOV AX,cs:mod_word ;; + MOV FTP.FTB_MOD,AX ;; + MOV AX,cs:fonts_word ;; + MOV FTP.FTB_FONTS,AX ;; + ;; + MOV AX,cs:fdlen_word ;; + MOV FTP.FTB_DLEFT,AX ;; + MOV FTP.FTB_DLEN,0 ;; + MOV FTP.FTB_DALO,0 ;; + MOV FTP.FTB_DAHI,0 ;; + ;; + MOV FTP.FTB_STATUS,FSTAT_FOUND + ;; +; CMP FTP.FTB_TYPE,TYPE_DISPLAY; +; JNE CHECK_PTR_TYPE ;; +; CMP cs:pre_font_len,PRE_FONT_D ;; +; JNE DISPLAY_BAD ;; +; JMP DISPLAY_DONE ;; +; ;; +;CHECK_PTR_TYPE : ;; +; CMP FTP.FTB_TYPE,TYPE_PRINTER; +; JNE SET_STAGE ;; +; CMP cs:ptr_sel_word,0 ;; +; JNE PRINTER_HAS_SEL ;; +; CMP cs:pre_font_len,PRE_FONT_P0;; +; JNE PRINTER_BAD ;; +; JMP PRINTER_DONE ;; +; ;; +;PRINTER_HAS_SEL : ;; +; CMP cs:pre_font_len,PRE_FONT_P ;; +; JNE PRINTER_BAD ;; +; JMP PRINTER_DONE ;; +; ;; +;DISPLAY_BAD : ;; +; ;; +; MOV FTP.FTB_STATUS,STAT_BADATA ;the FDLEN_WORD should be 0. +; ;; +;DISPLAY_DONE : ;; +; MOV AL,cs:disp_rows ;; +; MOV FTP.FTB_ROWS,AL ;; +; MOV AL,cs:disp_cols ;; +; MOV FTP.FTB_COLS,AL ;; +; MOV AL,cs:disp_x ;; +; MOV FTP.FTB_X,AL ;; +; MOV AL,cs:disp_y ;; +; MOV FTP.FTB_Y,AL ;; +; MOV AX,cs:count_word ;; +; MOV FTP.FTB_COUNT,AX ;; +; JMP SET_STAGE ;; + ;; +;PRINTER_BAD : ;; +; ;; +; MOV FTP.FTB_STATUS,STAT_BADATA ;the FDLEN_WORD should be 0. +; ;; +;PRINTER_DONE : ;; +; MOV AX,cs:ptr_sel_word ;; +; MOV FTP.FTB_SELECT,AX ;; +; MOV AX,cs:ptr_len_word ;; +; MOV FTP.FTB_SELLEN,AX ;; +; ;; +;SET_STAGE : ;; STAGE : + MOV AX,cs:fdlen_word ;; if no font data to follow + AND AX,AX ;; + JNZ GET_FDATA ;; + MOV cs:stage,SCANX ;; then scan for next header or font + JMP FONT_RET ;; + ;; +GET_FDATA : ;; update the moving target + MOV cs:stage,GET_FX ;; + MOV AX,cs:pre_font_len ;; + ADD FTP.TARGET_LO,AX ;; + JNC FONT_RET ;; + ADD FTP.TARGET_HI,01000H ;; + ;; +FONT_RET : ;; + POP BX ;; + RET ;; + ;; +;=========================================================================== +GETFONT_CASE : ;; as ES:[SI], at COUNT, there is font + ;; data + MOV DX,cs:num_ftb ;; + PUSH BX ;; + ;; + MOV cs:hit_hi,0 ;; temp. register + MOV cs:hit_flag,0 ;; assumed can be changed to SCAN stage + ;; + MOV DI,cs:count_hi ;; normalised COUNT_HI,COUNT_LO + MOV AX,DI ;; + AND AX,00FFFH ;; + PUSH CX ;; + MOV CX,4 ;; + SHL AX,CL ;; + POP CX ;; + AND DI,0F000H ;; + ADD AX,cs:count_lo ;; + JNC NO_CARRY4 ;; + ADD DI,01000H ;; +NO_CARRY4 : ;; + MOV cs:count_lo,AX ;; + MOV cs:count_hi,DI ;; + ;; + ;; +GETFONT_LOOP : ;; + MOV AX,FTP.FTB_STATUS ;; + CMP AX,FSTAT_FONT ;; + JE GETFONT_CONT ;; + ;; + CMP AX,FSTAT_FOUND ;; + JE GETFONT_FOUND ;; + ;; + JMP NEXT_GETFONT ;; + ;; +GETFONT_FOUND : ;; + MOV AX,FTP.FTB_DLEFT ;; + AND AX,AX ;; + JZ NEXT_GF ;; + MOV FTP.FTB_STATUS,FSTAT_FONT; + JMP GETFONT_CONT1 ;; + ;; + ;; +GETFONT_CONT : ;; + MOV AX,FTP.FTB_DLEFT ;; + AND AX,AX ;; + JNZ GETFONT_CONT1 ;; +NEXT_GF : ;; + JMP NEXT_GETFONT ;; + ;; only on FOUND and DLEFT <> 0 +GETFONT_CONT1: ;; + MOV DI,FTP.TARGET_HI ;; normalised TARGET + MOV AX,DI ;; + AND AX,00FFFH ;; + PUSH CX ;; + MOV CX,4 ;; + SHL AX,CL ;; + POP CX ;; + AND DI,0F000H ;; + ADD AX,FTP.TARGET_LO ;; + JNC NO_CARRY5 ;; + ADD DI,01000H ;; +NO_CARRY5 : ;; DI:AX = TARGET (normalised) + ;; + CMP DI,cs:count_hi ;; + JB GETFONT_BAD ;; + JNE NEXT_GETFONT ;; + CMP AX,cs:count_lo ;; + JB GETFONT_BAD ;; + JNE NEXT_GETFONT ;; + ;; + MOV FTP.FTB_DALO,SI ;; where the font data is in the packet + MOV FTP.FTB_DAHI,DS ;; + ;; + MOV AX,FTP.FTB_DLEFT ;; + CMP AX,CX ;; + JAE UPTO_CX ;; + ;; upto FDLEFT + MOV FTP.FTB_DLEFT,0 ;; + MOV FTP.FTB_DLEN,AX ;; + CMP cs:hit_hi,AX ;; + JNB NOT_HIGHER0 ;; + MOV cs:hit_hi,AX ;; +NOT_HIGHER0 : ;; + ADD FTP.TARGET_LO,AX ;; + JNC NEXT_GETFONT ;; + ADD FTP.TARGET_HI,01000H ;; + JMP NEXT_GETFONT ;; + ;; +GETFONT_BAD : ;; + MOV FTP.FTB_STATUS,STAT_BADATA ;; pointing backwards + JMP NEXT_GETFONT ;; + ;; +UPTO_CX : ;; + SUB AX,CX ;; + MOV FTP.FTB_DLEFT,AX ;; + MOV FTP.FTB_DLEN,CX ;; + MOV cs:hit_hi,CX ;; + ADD FTP.TARGET_LO,CX ;; + JNC NO_CARRYOVER ;; + ADD FTP.TARGET_HI,01000H ;; +NO_CARRYOVER : ;; + AND AX,AX ;; all data have been returned ? + JZ NEXT_GETFONT ;; + ;; + MOV cs:hit_flag,-1 ;; no ! stay in the GET_FONT stage + ;; +NEXT_GETFONT : ;; + ADD BX,FTP.FTB_LENGTH ;; + DEC DX ;; + AND DX,DX ;; + JZ GETFONT_END ;; + JMP GETFONT_LOOP ;; + ;; +GETFONT_END : ;; + MOV AX,cs:hit_hi ;; + ADD SI,AX ;; + SUB CX,AX ;; + ;; + CMP cs:hit_flag,0 ;; + Jne GETFONT_DONE ;; + MOV cs:stage,SCANX ;; no more in the GET_FONT stage + ;; + ;; +GETFONT_DONE : ;; + POP BX ;; + JMP FTB_LOOP ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; STAGES -- "called by" SERACH_CASE +;; +;; -- DS:[SI] (FPKT) points to PACKET, of DOS's buffer +;; -- CX remaining packet length +;; -- ES:[BX] points to the first FTBLK +;; -- COUNT_LO, COUNT_HI, upto but not including the address pointed by FPKT +;; +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;;+++++++++++++++++++++++++++++++++ +filetag : ;; + ;; +; mov ax,ftag_len ;; + cmp cs:ftag_count,ftag_len ;; + jB valid_ftag ;; + JE FTAG_FAILED ;; + ;; + mov ftp.ftb_status,stat_deverr + mov cs:fp_error,00022H ;; ERROR 0022H + ;; +FTAG_FAILED : ;; discard all the bytes, while + ADD SI,CX ;; stage stays as FTAGX + SUB CX,CX ;; + JMP FTB_LOOP ;; **** RETURN (bytes discarded) **** + ;; +VALID_FTAG : ;; + MOV AX,FPKT ;; + INC SI ;; + DEC CX ;; + ;; + MOV DI,cs:ftag_count ;; + CMP AL,cs:ftag_pattern[DI] ;; + JE FTAG_NEXTB ;; + ;; + mov ftp.ftb_status,stat_badata + MOV ax,ftag_len ;; stays in FTAGX to consume all bytes + MOV cs:ftag_count,ax ;; stays in FTAGX to consume all bytes + JMP FTB_LOOP ;; **** RETURN (FAILED !) **** + ;; +FTAG_NEXTB : ;; + INC DI ;; + MOV cs:ftag_count,DI ;; + ;; + CMP DI,ftag_len ;; + JE FTAG_DONE ;; + ;; + JMP FTB_LOOP ;; **** RETURN ( MORE TO COME) **** + ;; +FTAG_DONE : ;; + MOV cs:pass_cnt,0 ;; + MOV cs:stage,PASSX ;; + MOV cs:pass_postx,fptr_lolx ;; + ;; + JMP FTB_LOOP ;; **** NEXT STAGE **** + ;; + ;;+++++++++++++++++++++++++++++++++ +fptrLOL : ;; STAGE the low byte of the low fptr + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_fptrLO ;; + MOV cs:fptr_lol,AL ;; + MOV cs:stage,fptr_lohX ;; + JMP FTB_LOOP ;; +WORD_fptrLO : ;; + INC SI ;; + DEC CX ;; + MOV cs:fptr_low,AX ;; + MOV cs:stage,fptr_HILX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +fptrLOH : ;; STAGE the high byte of the low fptr + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:fptr_loh,AL ;; + MOV cs:stage,fptr_HILX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +fptrHIL : ;; STAGE the low byte of the high fptr + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_fptrHI ;; + MOV cs:fptr_hil,AL ;; + MOV cs:stage,fptr_hihX ;; + JMP FTB_LOOP ;; +WORD_fptrHI : ;; + INC SI ;; + DEC CX ;; + MOV cs:fptr_high,AX ;; + MOV cs:stage,FPTR_SKIPX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +fptrHIH : ;; STAGE the high byte of the high fptr + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:fptr_hih,AL ;; + MOV cs:stage,FPTR_SKIPX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +ENTRYLO : ;; STAGE - ENTRY LOW BYTE + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_ENTRY ;; + MOV cs:entry_lob,AL ;; + MOV cs:stage,ENTRY_HIX ;; + JMP FTB_LOOP ;; +WORD_ENTRY : ;; + INC SI ;; + DEC CX ;; + MOV cs:entry_word,AX ;; + MOV cs:stage,PASSX ;; 2 bytes to be passed + MOV cs:pass_postx,NEXT_LOLX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +ENTRYHI : ;; stage - ENTRY HIGN BYTE + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:entry_hib,AL ;; + MOV cs:stage,PASSX ;; 2 bytes to be passed + MOV cs:pass_postx,NEXT_LOLX ;; + AND CX,CX ;; + JNZ ENTHI_PASS1 ;; + JMP FTB_LOOP ;; +ENTHI_PASS1 : ;; + INC SI ;; + INC cs:pass_cnt ;; + DEC CX ;; + AND CX,CX ;; + JNZ ENTHI_PASS2 ;; + JMP FTB_LOOP ;; +ENTHI_PASS2 : ;; + INC SI ;; + INC cs:pass_cnt ;; + DEC CX ;; + MOV cs:stage,NEXT_LOLX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +NEXTLOL : ;; STAGE the low byte of the low NEXT + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_NEXTLO ;; + MOV cs:next_lol,AL ;; + MOV cs:stage,NEXT_LOHX ;; + JMP FTB_LOOP ;; +WORD_NEXTLO : ;; + INC SI ;; + DEC CX ;; + MOV cs:next_low,AX ;; + MOV cs:stage,next_hilX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +NEXTLOH : ;; STAGE the high byte of the low NEXT + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:next_loh,AL ;; + MOV cs:stage,next_hilX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +NEXTHIL : ;; STAGE the low byte of the high NEXT + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_NEXTHI ;; + MOV cs:next_hil,AL ;; + MOV cs:stage,NEXT_HIHX ;; + JMP FTB_LOOP ;; +WORD_NEXTHI : ;; + INC SI ;; + DEC CX ;; + MOV cs:next_high,AX ;; + MOV cs:stage,type_lobX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +NEXTHIH : ;; STAGE the high byte of the high NEXT + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:next_hih,AL ;; + MOV cs:stage,type_lobX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +TYPELO : ;; STAGE the low byte of the TYPE + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_TYPE ;; + MOV cs:type_lob,AL ;; + MOV cs:stage,type_hibX ;; + JMP FTB_LOOP ;; +WORD_TYPE : ;; + INC SI ;; + DEC CX ;; + MOV cs:type_word,AX ;; + MOV cs:stage,type_idX ;; + MOV cs:tid_cnt,0 ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +TYPEHI : ;; STAGE the high byte of the TYPE + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:type_hib,AL ;; + MOV cs:stage,TYPE_IDX ;; + MOV cs:tid_cnt,0 ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +TYPEIDS : ;; STAGE the type id + CMP cs:tid_cnt,8 ;; + JNA VALID_TID ;; + MOV FTP.FTB_STATUS,STAT_DEVERR + MOV cs:fp_error,00021H ;; ERROR 0021H + ADD SI,CX ;; + SUB CX,CX ;; + JMP FTB_LOOP ;; + ;; +VALID_TID : ;; + MOV AX,8 ;; + SUB AX,cs:tid_cnt ;; + CMP CX,AX ;; + JNB TID_ALL ;; + ;; all data in FPKT are stored + PUSH ES ;; + PUSH CS ;; + POP ES ;; + ;; + MOV DI,OFFSET TYPE_ID ;; + ADD DI,cs:tid_cnt ;; + ADD cs:tid_cnt,CX ;; + REP MOVSB ;; SI is incremented accordingly + POP ES ;; + ;; + MOV CX,0 ;; STAGE remained + JMP FTB_LOOP ;; +TID_ALL : ;; + PUSH CX ;; + ;; + PUSH ES ;; + PUSH CS ;; + POP ES ;; + ;; + MOV DI,OFFSET TYPE_ID ;; + ADD DI,cs:tid_cnt ;; + MOV CX,AX ;; + REP MOVSB ;; SI is incremented accordingly + POP ES ;; + ;; + ADD cs:tid_cnt,AX ;; + POP CX ;; + SUB CX,AX ;; + ;; + MOV cs:stage,CPG_LOBX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +CPGLO : ;; STAGE the low byte of the CODE PAGE + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_CPG ;; + MOV cs:cpg_lob,AL ;; + MOV cs:stage,CPG_HIBX ;; + JMP FTB_LOOP ;; +WORD_CPG : ;; + INC SI ;; + DEC CX ;; + MOV cs:cpg_word,AX ;; + MOV cs:stage,PASSX ;; + MOV cs:pass_postx,font_lolX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +CPGHI : ;; STAGE the high byte of the CODE PAGE + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:cpg_hib,AL ;; + MOV cs:stage,PASSX ;; + MOV cs:pass_postx,font_lolX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +FONTLOL : ;; STAGE the low byte of the low FONT + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_FONTLO ;; + MOV cs:font_lol,AL ;; + MOV cs:stage,FONT_LOHX ;; + JMP FTB_LOOP ;; +WORD_FONTLO : ;; + INC SI ;; + DEC CX ;; + MOV cs:font_low,AX ;; + MOV cs:stage,FONT_HILX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +FONTLOH : ;; STAGE the high byte of the low FONT + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:font_loh,AL ;; + MOV cs:stage,FONT_HILX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +FONTHIL : ;; STAGE the low byte of the high FONT + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_FONTHI ;; + MOV cs:font_hil,AL ;; + MOV cs:stage,FONT_HIHX ;; + JMP FTB_LOOP ;; +WORD_FONTHI : ;; + INC SI ;; + DEC CX ;; + MOV cs:font_high,AX ;; +;;;;;; MOV cs:stage,MOD_LOBX ;; end of SCAN + ;; anymore headers to be processed ? + MOV cs:stage,MATCHX ;; + MOV AX,cs:entry_word ;; + DEC AX ;; + MOV cs:entry_word,AX ;; + AND AX,AX ;; + JNZ CHECK_NEXT ;; + ;; no more header to be processed ! + MOV AX,-1 ;; + MOV cs:next_low,AX ;; + MOV cs:next_high,AX ;; as ENTRY has been consumed + JMP FTB_LOOP ;; + ;; +CHECK_NEXT : ;; + MOV AX,cs:next_low ;; + AND AX,AX ;; + JNZ MORE_HEADER ;; + MOV AX,cs:next_high ;; + AND AX,AX ;; + JNZ MORE_HEADER ;; + ;; no more header to be processed ! + MOV AX,-1 ;; + MOV cs:next_low,AX ;; as NEXT is nil + MOV cs:next_high,AX ;; + ;; +MORE_HEADER : ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +FONTHIH : ;; STAGE the high byte of the high FONT + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:font_hih,AL ;; +;;;;; MOV cs:stage,MOD_LOBX ;; end of SCAN + ;; + MOV cs:stage,MATCHX ;; + ;; anymore headers to be processed ? + MOV AX,cs:entry_word ;; + DEC AX ;; + MOV cs:entry_word,AX ;; + AND AX,AX ;; + JNZ CHECK_NEXT0 ;; + ;; no more header to be processed ! + MOV AX,-1 ;; + MOV cs:next_low,AX ;; + MOV cs:next_high,AX ;; as ENTRY has been consumed + JMP FTB_LOOP ;; + ;; +CHECK_NEXT0 : ;; + MOV AX,cs:next_low ;; + AND AX,AX ;; + JNZ MORE_HEADER0 ;; + MOV AX,cs:next_high ;; + AND AX,AX ;; + JNZ MORE_HEADER0 ;; + ;; no more header to be processed ! + MOV AX,-1 ;; + MOV cs:next_low,AX ;; as NEXT is nil + MOV cs:next_high,AX ;; + ;; +MORE_HEADER0 : ;; + JMP FTB_LOOP ;; + ;; + ;;+++++++++++++++++++++++++++++++++ +MODLO : ;; STAGE the low byte of the MODIFIER + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_MOD ;; + MOV MOD_LOB,AL ;; + MOV cs:stage,MOD_HIBX ;; + JMP FTB_LOOP ;; +WORD_MOD : ;; + INC SI ;; + DEC CX ;; + MOV cs:mod_word,AX ;; + MOV cs:stage,fonts_lobX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +MODHI : ;; STAGE the high byte of the MODIFIER + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:mod_hib,AL ;; + MOV cs:stage,FONTS_LOBX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +FONTSLO : ;; STAGE the low byte of the FONTS + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_FONTS ;; + MOV cs:fonts_lob,AL ;; + MOV cs:stage,FONTS_HIBX ;; + JMP FTB_LOOP ;; +WORD_FONTS : ;; + INC SI ;; + DEC CX ;; + MOV cs:fonts_word,AX ;; + MOV cs:stage,FDLEN_LOBX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +FONTSHI : ;; STAGE the high byte of the FONTS + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:fonts_hib,AL ;; + MOV cs:stage,FDLEN_LOBX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +FDLENLO : ;; the low byte of the FONT-LENGTH + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_FDLEN ;; + MOV cs:fdlen_lob,AL ;; + MOV cs:stage,FDLEN_HIBX ;; + JMP FTB_LOOP ;; +WORD_FDLEN : ;; + INC SI ;; + DEC CX ;; + MOV cs:pre_font_len,PRE_FONT_ND;; + MOV cs:fdlen_word,AX ;; +; AND AX,AX ;; +; JZ NO_DISP_PTR ;; +; CMP cs:type_word,TYPE_DISPLAY ;; +; JE DISPLAY_TYPE1 ;; +; CMP cs:type_word,TYPE_PRINTER ;; +; JE PRINTER_TYPE1 ;; + ;; +;NO_DISP_PTR : ;; + MOV cs:stage,FOUNDX ;; FSTAT is to be changed + JMP FTB_LOOP ;; +;DISPLAY_TYPE1 : ;; +; MOV cs:stage,DISP_ROWSX ;; +; JMP FTB_LOOP ;; +;PRINTER_TYPE1 : ;; +; MOV cs:stage,PTRSELLOX ;; +; JMP FTB_LOOP ;; + ;; + ;;+++++++++++++++++++++++++++++++++ +FDLENHI : ;; STAGE the high byte of the F-LENGTH + MOV cs:pre_font_len,PRE_FONT_ND + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:fdlen_hib,AL ;; + MOV AX,cs:fdlen_word ;; +; AND AX,AX ;; +; JZ NO_DISP_PTR2 ;; +; CMP cs:type_word,TYPE_DISPLAY ;; +; JE DISPLAY_TYPE2 ;; +; CMP cs:type_word,TYPE_PRINTER ;; +; JE PRINTER_TYPE2 ;; +;NO_DISP_PTR2: ;; + MOV cs:stage,FOUNDX ;; FSTAT is to be changed + JMP FTB_LOOP ;; +;DISPLAY_TYPE2 : ;; +; MOV cs:stage,DISP_ROWSX ;; +; JMP FTB_LOOP ;; +;PRINTER_TYPE2 : ;; +; MOV cs:stage,PTRSELLOX ;; +; JMP FTB_LOOP ;; + ;; + ;;+++++++++++++++++++++++++++++++++ +DSPROWS : ;; STAGE : get the rows +; XOR AX,AX ;; +; MOV cs:disp_rows,AL ;; +; MOV cs:disp_cols,AL ;; +; MOV cs:DISP_X,AL ;; +; MOV cs:disp_y,AL ;; +; MOV cs:count_word,AX ;; +; ;; +; INC cs:pre_font_len ;; +; MOV AX,FPKT ;; +; INC SI ;; +; DEC CX ;; +; MOV cs:disp_rows,AL ;; +; MOV AX,cs:fdlen_word ;; +; DEC AX ;; +; MOV cs:fdlen_word,AX ;; +; JZ NO_DISP_FONT3 ;; +; MOV cs:stage,disp_colsX ;; +; JMP FTB_LOOP ;; +;NO_DISP_FONT3 : ;; +; MOV cs:stage,FOUNDX ;; FSTAT is to be changed +; JMP FTB_LOOP ;; +; ;;+++++++++++++++++++++++++++++++++ +DSPCOLS : ;; STAGE : get the COLS +; INC cs:pre_font_len ;; +; MOV AX,FPKT ;; +; INC SI ;; +; DEC CX ;; +; MOV cs:disp_cols,AL ;; +; MOV AX,cs:fdlen_word ;; +; DEC AX ;; +; MOV cs:fdlen_word,AX ;; +; JZ NO_DISP_FONT3 ;; +; MOV cs:stage,DISP_XX ;; +; JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ + DSPX : ;; STAGE : get the aspect X +; INC cs:pre_font_len ;; +; MOV AX,FPKT ;; +; INC SI ;; +; DEC CX ;; +; MOV DISP_X,AL ;; +; MOV AX,cs:fdlen_word ;; +; DEC AX ;; +; MOV cs:fdlen_word,AX ;; +; JZ NO_DISP_FONT3 ;; +; MOV cs:stage,DISP_YX ;; +; JMP FTB_LOOP ;; +; ;;+++++++++++++++++++++++++++++++++ + DSPY : ;; STAGE : get the aspect Y +; INC cs:pre_font_len ;; +; MOV AX,FPKT ;; +; INC SI ;; +; DEC CX ;; +; MOV cs:disp_y,AL ;; +; MOV AX,cs:fdlen_word ;; +; DEC AX ;; +; MOV cs:fdlen_word,AX ;; +; JZ NO_DISP_FONT3 ;; +; MOV cs:stage,COUNT_LOBX ;; +; JMP FTB_LOOP ;; +; ;; + ;;+++++++++++++++++++++++++++++++++ + DSPCOUNTLO : ;; the low byte of the FONT-LENGTH +; INC cs:pre_font_len ;; +; MOV AX,FPKT ;; +; INC SI ;; byte by byte +; DEC CX ;; +; PUSH AX ;; check if length is enough +; MOV AX,cs:fdlen_word ;; +; DEC AX ;; +; MOV cs:fdlen_word,AX ;; +; POP AX ;; +; JNZ A_WORD_COUNT ;; +; JMP NO_DISP_FONT3 ;; +;A_WORD_COUNT : ;; +; AND CX,CX ;; +; JNZ WORD_COUNT ;; +; MOV cs:count_lob,AL ;; +; MOV cs:stage,COUNT_HIBX ;; +; JMP FTB_LOOP ;; +;WORD_COUNT : ;; +; INC cs:pre_font_len ;; +; INC SI ;; +; DEC CX ;; +; MOV cs:count_word,AX ;; +; MOV cs:pre_font_len,PRE_FONT_D; + ;; +; MOV AX,cs:fdlen_word ;; +; DEC AX ;; +; MOV cs:fdlen_word,AX ;; +; MOV cs:stage,FOUNDX ;; FSTAT is to be changed +; JMP FTB_LOOP ;; +; ;; +; ;;+++++++++++++++++++++++++++++++++ + DSPCOUNTHI : ;; STAGE the high byte of the F-LENGTH +; INC cs:pre_font_len ;; +; MOV AX,FPKT ;; +; INC SI ;; byte by byte +; DEC CX ;; +; MOV cs:count_hib,AL ;; +; MOV cs:pre_font_len,PRE_FONT_D; + ;; +; MOV AX,cs:fdlen_word ;; +; DEC AX ;; +; MOV cs:fdlen_word,AX ;; +; MOV cs:stage,FOUNDX ;; FSTAT is to be changed +; JMP FTB_LOOP ;; +; ;; + ;; + ;;+++++++++++++++++++++++++++++++++ +PTRSELLO : ;; the low byte of the SELECTION_TYPE + ;; +; INC cs:pre_font_len ;; +; MOV AX,FPKT ;; +; INC SI ;; byte by byte +; DEC CX ;; +; PUSH AX ;; check if length is enough +; MOV AX,cs:fdlen_word ;; +; DEC AX ;; +; MOV cs:fdlen_word,AX ;; +; POP AX ;; +; JNZ A_WORD_SEL ;; +; JMP NO_PTR_FONT3 ;; +;A_WORD_SEL : ;; +; AND CX,CX ;; +; JNZ WORD_SEL ;; +; MOV cs:ptr_selob,AL ;; +; MOV cs:stage,PTRSELHIX ;; +; JMP FTB_LOOP ;; +;WORD_SEL : ;; +; INC cs:pre_font_len ;; +; INC SI ;; +; DEC CX ;; +; MOV cs:ptr_sel_word,AX ;; +; ;; +; MOV AX,cs:fdlen_word ;; +; DEC AX ;; +; MOV cs:fdlen_word,AX ;; +; ;; +; CMP cs:ptr_sel_word,0 ;; +; JNE PTR_SEL_NOT0 ;; +; ;; +; ;; +; MOV cs:stage,FOUNDX ;; FSTAT is to be changed +; JMP FTB_LOOP ;; +; ;; +;PTR_SEL_NOT0 : ;; +; MOV cs:stage,PTRLENLOX ;; +; JMP FTB_LOOP ;; +; ;; + ;;+++++++++++++++++++++++++++++++++ +PTRSELHI: ;; STAGE the high byte of SELECT_TYPE + ;; +; INC cs:pre_font_len ;; +; MOV AX,FPKT ;; +; INC SI ;; byte by byte +; DEC CX ;; +; MOV cs:ptr_sehib,AL ;; +; ;; +; MOV AX,cs:fdlen_word ;; +; DEC AX ;; +; MOV cs:fdlen_word,AX ;; +; ;; +; CMP cs:ptr_sel_word,0 ;; +; JNE PTR_SEL_NOT0 ;; +; ;; +; ;; +; MOV cs:stage,FOUNDX ;; FSTAT is to be changed +; JMP FTB_LOOP ;; +; ;; +; ;; + ;;+++++++++++++++++++++++++++++++++ +PTRLENLO : ;; the low byte of SELECTION_LENGTH + ;; +; INC cs:pre_font_len ;; +; MOV AX,FPKT ;; +; INC SI ;; byte by byte +; DEC CX ;; +; PUSH AX ;; check if length is enough +; MOV AX,cs:fdlen_word ;; +; DEC AX ;; +; MOV cs:fdlen_word,AX ;; +; POP AX ;; +; JNZ A_WORD_SELEN ;; +; JMP NO_PTR_FONT3 ;; +;A_WORD_SELEN : ;; +; AND CX,CX ;; +; JNZ WORD_SELEN ;; +; MOV cs:ptr_lnlob,AL ;; +; MOV cs:stage,PTRLENHIX ;; +; JMP FTB_LOOP ;; +;WORD_SELEN : ;; +; INC cs:pre_font_len ;; +; INC SI ;; +; DEC CX ;; +; MOV cs:ptr_len_word,AX ;; +; ;; +; MOV AX,cs:fdlen_word ;; +; DEC AX ;; +; MOV cs:fdlen_word,AX ;; +; MOV cs:stage,FOUNDX ;; FSTAT is to be changed +; JMP FTB_LOOP ;; +; ;; + ;;+++++++++++++++++++++++++++++++++ + PTRLENHI : ;; STAGE the high byte of SELECT_LENGTH + ;; + SUB CX,CX ;D; added for DISPLAY.SYS version + MOV CS:STAGE,STAGE_MAX+1 ;D; added for DISPLAY.SYS version + JMP FTB_LOOP ;D; added for DISPLAY.SYS version + ;; + ;; +; INC cs:pre_font_len ;; +; MOV AX,FPKT ;; +; INC SI ;; byte by byte +; DEC CX ;; +; MOV cs:ptr_lnhib,AL ;; +; ;; +; MOV AX,cs:fdlen_word ;; +; DEC AX ;; +; MOV cs:fdlen_word,AX ;; +; MOV cs:stage,FOUNDX ;; FSTAT is to be changed +; JMP FTB_LOOP ;; +; ;; +;NO_PTR_FONT3 : ;; +; MOV cs:stage,FOUNDX ;; FSTAT is to be changed +; JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +PASS : ;; STAGE - PASS DUMMY BYTES + ;; + PUSH DX ;; + PUSH ES ;; + PUSH DI ;; + ;; + PUSH CS ;; + POP ES ;; + MOV DI,OFFSET PASS_BRK ;; + MOV DX,PASS_INDX ;; + MOV AX,cs:pass_cnt ;; + ;; +NEXT_BRK: ;; find the next pass-break + CMP AX,ES:[DI] ;; + ;; + JB UPTO_BRK ;; + ;; + DEC DX ;; + JZ PASS_ERR ;; + INC DI ;; + INC DI ;; + JMP NEXT_BRK ;; + ;; +UPTO_BRK : ;; next break point found + MOV DX,ES:[DI] ;; + SUB DX,AX ;; bytes to be skipped + CMP CX,DX ;; all to be skipped ? + JAE PASS_ALL ;; + ;; + ADD cs:pass_cnt,CX ;; + ADD SI,CX ;; + SUB CX,CX ;; + JMP PASS_END ;; + ;; +PASS_ALL : ;; + ADD cs:pass_cnt,DX ;; + ADD SI,DX ;; + SUB CX,DX ;; + ;; + MOV AX,cs:pass_postx ;; + MOV cs:stage,AX ;; + ;; +; cmp ax,passx ;; is the next stage a pass-stage ? +; jne not_passx ;; +; mov ax,pass_postxx ;; +; mov pass_postx,ax ;; +; mov pass_postxx,stage_max ;; can support only 2 consecutive pass + ;; +;not_passx : ;; + ;; + JMP PASS_END ;; + ;; +PASS_ERR : ;; DEVICE ERROR, wrong stage + POP DI ;; + POP ES ;; + POP DX ;; + MOV FTP.FTB_STATUS,STAT_DEVERR + SUB CX,CX ;; ignore all the input string + JMP PASS_DONE ;; + ;; +PASS_END : ;; + POP DI ;; + POP ES ;; + POP DX ;; +PASS_DONE : ;; + JMP FTB_LOOP ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +FTB_LPEND : ;; + ;; + CMP cs:stage,FOUNDX ;; + JNE NOT_FOUNDX ;; + ;; + CALL FOUND_DO ;; + ;; +NOT_FOUNDX : ;; + ;; + POP CX ;; STACK -1 + ;; +FP_RET : ;; + POP SI ;; restore registers + POP DI ;; + POP DX ;; + POP CX ;; + POP BX ;; + POP AX ;; + POP ES ;; + POP DS ;; + ;; + RET ;; +FONT_PARSER ENDP ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/v4.0/src/DEV/DISPLAY/INIT.ASM b/v4.0/src/DEV/DISPLAY/INIT.ASM new file mode 100644 index 0000000..f5067c1 --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/INIT.ASM @@ -0,0 +1,965 @@ +PAGE ,132 +TITLE DOS - CON Code Page Switching Device Driver (INIT) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; FILENAME: INIT.ASM +; PROGRAM: DISPLAY.SYS (Load module) +; LINK PROCEDURE: Linkk +; INSTALLATION: +; +; This is the routine used to initialize the DOS CPS +; (Code Page Switching) device driver. It is linked into the +; DISPLAY.SYS file at the very end. +; +; PSEUDO CODE: +; INIT PROC +; +; not specified yet....patience is a virtue!!! +; +; INIT ENDP +; +; +; (C)Copyright 1988 Microsoft +; +; DATE: August 28, 1986 +; +;Modification history ********************************************************* +;AN001; D358 New device driver INIT function package 12/07/87 J.K. +;AN002; D493 Undo D358. 02/24/88 J.K. +;****************************************************************************** + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +IF1 ; + %OUT .COMPILING: INIT.ASM + %OUT . INSTALL CPS-CON DRIVER + %OUT . VERSION 3.30 + %OUT .INCLUDE FILES: +ENDIF ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; REFERENCES +; +; THESE REFERENCES ARE FOR VARIABLES SET WITHIN THE +; MAIN-LINE PROGRAM, NOT CONTAINED IN THIS MODULE. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; +.XLIST ; +INCLUDE SYSMSG.INC ; WGR ;AN000; +MSG_UTILNAME ; WGR ;AN000; +.LIST ; + ; + ; +CODE SEGMENT PUBLIC BYTE 'CODE' ; + ASSUME CS:CODE,DS:CODE ; + PUBLIC INIT ; + ; + EXTRN ROM_INT_2F:WORD ; + EXTRN ROM_INT_10:WORD ; + EXTRN ROM_INT_1F:WORD ; + EXTRN OLD_INT_1F:WORD ; + EXTRN ROM_INT_44:WORD ; + EXTRN INT_2F_COM:NEAR ; + EXTRN INT_10_COM:NEAR ; + EXTRN EOF_MARKER:BYTE ; + EXTRN ABORT:BYTE ; + EXTRN CPD_ACTIVE:WORD ; + EXTRN CPD_CLASS:BYTE ; + EXTRN CPD_HDWR_N_MAX:ABS ; + EXTRN CPD_DESG_N_MAX:ABS ; + EXTRN CPD_HDWR_N:WORD ; + EXTRN CPD_DESG_N:WORD ; + EXTRN CPD_FONTS_N:WORD ; + EXTRN IRPT_2:NEAR ; + EXTRN IRPT_CMD_EXIT:NEAR ; + EXTRN FONT_SIZE:BYTE ; + EXTRN LOAD_MECH:BYTE ; + EXTRN CPD_FONT_PNTER:WORD ; + EXTRN PARSER:NEAR ; + EXTRN GET_DEVICE_ID:NEAR ; + EXTRN TABLE:BYTE ; + EXTRN ASK_BIOS_FONT_SIZE:NEAR ; + EXTRN ASK_BIOS_SCAN_LINES:NEAR; + EXTRN REDUCED_SUPPORT:ABS ; + EXTRN DEV_HDR:WORD ; + EXTRN MODE_VALUE:BYTE ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; LOCAL VARIABLES +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +HANDLE_ROUTINES LABEL WORD ; INDEX TABLE OF 'FUNCTIONS' TO + DW OFFSET HANDLE_DEVICE_NAME ; OPERATE ON THE COMMAND_LINE + DW OFFSET HANDLE_DEVICE_ID ; + DW OFFSET HANDLE_HDWR_CP ; + DW OFFSET HANDLE_DESG_CP ; +LEN_HANDLE_ROUTINES EQU ($-HANDLE_ROUTINES)/2 + ; +RESIDENT_END DW OFFSET EOF_MARKER ; POINTER TO SEG:OFFSET OF CODE END! +RESIDENT_ENDS DW SEG CODE ; + ; +DEVICE_ID_INDEX DW 0 ; INDEX VALUE FOR DEVICE SUB-TYPE +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; INCLUDE FILES +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + INCLUDE MACROS.INC ; GENERAL PURPOSE 'MACROs' + INCLUDE DEF-EQU.INC ; CPS DRIVER STRUCTURES AND EQUATES + INCLUDE TABLES.INC ; DEVICE SUB-TYPE CONFIGURATION TABLES +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; INITIALIZATION ROUTINE +; +; THE INIT PROC IS CALLED BY THE DEVICE DRIVER DURING DOS BOOT TIME! +; THE CALL WILL BE MADE ONCE, AND ONLY ONCE. THEREFORE, WHEN THIS +; CODE IS COMPLETED, IT IS DISCARDED INTO THAT 'great bit bucket +; in the sky! +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +INIT PROC ; + PUSH DS ; + ; + PUSH CS ; + POP DS ; FIRST SET DS = CS + ; + PUSH BX ; WGR ;AN000; + CALL SYSLOADMSG ; WGR load messages ;AN000; + JNC INIT_00 ; WGR if no error then continue.. ;AN000; + CALL SYSDISPMSG ; WGR display error message.. ;AN000; + POP BX ; WGR ;AN000; + JMP INIT_1 ; WGR exit with error status ;AN000; +INIT_00: ; WGR ;AN000; + POP BX ; WGR ;AN000; + MOV RESIDENT_ENDS,CS ; SET INITIAL RESIDENT END SEGMENT + ; + LES DI,DWORD PTR BUF.RH_PTRO; GET RH + CALL PARSER ; + JC INIT_1A ; + ; + MOV SI,OFFSET TABLE ; ADDRESS [ TABLE 1 ] + MOV CX,[SI].NUM_DEVICES ; CHECK THE NUMBER OF DEVICES SPECIFIED + CMP CX,ONE ; IF <> 1, THEN WE HAVE A PROBLEM... + JNE INIT_1A ; ERROR + MOV SI,[SI].DEVICE1_OFFSET ; MOVE FROM [ TABLE 1 ] TO [ TABLE 2 ] + MOV CX,[SI].NUM_ITEMS ; + LEA DI,HANDLE_ROUTINES ; + ; +INIT_0: CALL CS:[DI] ; CALL ROUTINE WITH '[SI].OFFSET_LIST' + ; + JC INIT_1 ; ERROR IN ROUTINE (COMMAND_LINE) + INC SI ; ADVANCE POINTERS FOR CALL AND + INC SI ; THE OFFSET_LIST! + INC DI ; + INC DI ; + LOOP INIT_0 ; + ; + CALL INSTALL_ID ; CONFIGURE DEVICE DRIVER FOR MATCHED + JC INIT_1 ; DISPLAY ADAPTER! + ; + PUSH BX ; + MOV AH,15 ; PERFORM CALL TO GET ACTIVE MODE + INT 10H ; + MOV MODE_VALUE,AL ; SET IT IN THE INT10COM.INC ROUTINE + POP BX ; + ; + JUMP INIT_2 ; + ; +INIT_1A: ; + PUSH AX ; WGR ;AN000; + PUSH DX ; WGR ;AN000; + MOV AX,ERROR_2 ; PARSING ERROR CONDITION ;AN000; + MOV DH,UTILITY_MSG_CLASS ; WGR ;AN000; + CALL ISSUE_MESSAGE ; WGR ;AN000; + POP DX ; WGR ;AN000; + POP AX ; WGR ;AN000; + ; +INIT_1: XOR AX,AX ; CLEAR ERROR CODE TO BE RETURNED + LES DI,DWORD PTR BUF.RH_PTRO; GET RH + MOV RH.RH0_ENDO,AX ; OFFSET = 0 + MOV RH.RH0_ENDS,CS ; + MOV RH.RH0_UNIT,AL ; SET 0 UNITS.... + ; + CMP NOT_CPS_ID,OFF ; WGR did we find a non-CPS id? ;AN000; + JNE INIT_1B ; WGR yes....do not set an error ;AN000; + OR BUF.STATUS,103H ; SET INIT ERROR OCCURRED + JMP INIT_1C ; WGR ;AN000; + ; +INIT_1B: ; + OR BUF.STATUS,AX ; WGR no error code..but do not load ;AN000; +; mov RH.RH0_SYSINIT_MSG, 0 ;AN001;AN002; Ask IBMBIO not to show "Error in CONFIG.SYS lines= #" message +INIT_1C: ; + PUSH DI ; 'DETACH' THE LINK LIST TO THE + MOV AX,-1 ; NEXT DEVICE NAME....THIS MAY not + LEA DI,DEV_HDR ; NEED TO BE RESET FOR INIT ERROR.... + MOV CS:[DI],AX ; + MOV CS:[DI+2],AX ; + POP DI ; + STC ; SET CY TO INDICATE FNC DONE + POP DS ; + RET ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; NOW MOVE ONTO INSTALLATION OF INT 2F HEX +; +; SINCE WE ARE GOING TO CHAIN THE INTERRUPT 2FH VECTOR, +; IT IS IMPORTANT THAT THE lower LEVEL IS VALID! THIS +; IS VERIFIED BY SEEING IF THE ORIGINAL VECTOR <> 0000:0000. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +INIT_2: PUSH ES ; + XOR AX,AX ; SET ES TO INTERRUPT REGION + MOV ES,AX ; + MOV AX,ES:WORD PTR INT_2F_LOW;GET OFFSET VALUE OF INT 2F hex + MOV CS:ROM_INT_2F,AX ; & + MOV CX,ES:WORD PTR INT_2F_HI; ALSO THE SEGMENT VALUE + MOV CS:ROM_INT_2F+2,CX ; + OR AX,CX ; IS INT 2F hex = 0 ? + JNE INIT_6 ; + MOV AX,OFFSET ABORT ; YES: USE IRET AS THE LOWER CODE + MOV CS:ROM_INT_2F,AX ; REFER TO ABORT LABEL FOR IRET! + MOV AX,CS ; + MOV CS:ROM_INT_2F+2,AX ; +INIT_6: CLI ; NEXT CHANGE THE ACTIVE INT 2F hex + MOV ES:WORD PTR INT_2F_LOW,OFFSET INT_2F_COM; + MOV ES:WORD PTR INT_2F_HI,CS; TO THE NEWLY LOADED CODE (INT2FCOM) + STI ; (with interrupts off, of course) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; READ THE INTERRUPT 1F HEX FOR INT10COM MODULE +; THIS IS READ DURING INITIAL LOAD TO RECORD THE +; DEFAULT VALUE. THE CPS SUPPORT WILL not CHANGE +; THE INT 1F HEX VECTOR IF IT WAS CHANGED FROM +; THIS VALUE....ie. GRAFTABL.COM or other HAS THE +; VECTOR. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + MOV CX,ES:WORD PTR INT_1F_LOW; GET OFFSET OF INTERRUPT 1FH + MOV CS:ROM_INT_1F,CX ; & + MOV CS:OLD_INT_1F,CX ; + MOV CX,ES:WORD PTR INT_1F_HI; SEGMENT OF INTERRUPT 1FH + MOV CS:ROM_INT_1F+2,CX ; + MOV CS:OLD_INT_1F+2,CX ; + ; + MOV CX,ES:WORD PTR INT_44_LOW; GET OFFSET OF INTERRUPT 44H + MOV CS:ROM_INT_44,CX ; & + MOV CX,ES:WORD PTR INT_44_HI; SEGMENT OF INTERRUPT 44H + MOV CS:ROM_INT_44+2,CX ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; NOW MOVE ONTO INSTALLATION OF INT 10 HEX +; THE INT 10H VECTOR IS TAKEN TO MONITOR THE +; MODE_SET INTERFACE (AH=0). THIS IS THE KEY +; TO THE CPS SUPPORT MECHANISM...ie. THE ACTIVE +; CODE PAGE IS LOADED EVERYTIME A MODE_SET OCCURS! +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + MOV CX,ES:WORD PTR INT_10_LOW; GET OFFSET OF INT 10H + MOV CS:ROM_INT_10,CX ; & + MOV CX,ES:WORD PTR INT_10_HI; SEGMENT OF INT 10H + MOV CS:ROM_INT_10+2,CX ; + CLI ; INSTALL THE NEW INT 10H CODE + MOV ES:WORD PTR INT_10_LOW,OFFSET INT_10_COM; + MOV ES:WORD PTR INT_10_HI,CS; + STI ; (with interrupts off, of course) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; INSTALL THE DEVICE DRIVER CODE. THE RESIDENT_END +; VALUE HAS BEEN SET TO: +; +; 1 - REDUCED_SUPPORT used when #DESG = 0 (CGA, MONO) +; 2 - LAST DESIGNATED BUFFER - calculated by #DESG x #FONTS +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + POP ES ; RESTORE THE ES REGISTER + LES DI,DWORD PTR BUF.RH_PTRO; GET REQUEST HEADER ADDRESS + MOV AX,RESIDENT_END ; GET OFFSET OF RESIDENT END + MOV RH.RH0_ENDO,AX ; +INIT_7: MOV AX,RESIDENT_ENDS ; GET SEGMENT OF RESIDENT END + MOV RH.RH0_ENDS,AX ; + STC ; CY = 1, CALL FULLY SERVICED = ON + POP DS ; + RET ; +INIT ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; DEVICE NAME PARSING IS LIMITED ONLY TO 1 DEVICE NAME +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +DEVICE_NAMES DB "CON " ; ONLY ONE VALID NAME FOR DEVICE... +L_DEVICE_NAMES EQU ($-DEVICE_NAMES) ; +N_DEVICE_NAMES EQU ($-DEVICE_NAMES)/L_DEVICE_NAMES + ; +HANDLE_DEVICE_NAME PROC ; [ TABLE 3 ] + PUSH CX ; + PUSH SI ; + ; + MOV SI,[SI].OFFSET_LIST ; + MOV CX,[SI] ; TEST THAT DEVICE NAME IS 8 BYTES + ; + CMP CX,L_DEVICE_NAMES ; + JNE H_DN_0 ; LEN(DEVICE_NAME) <> 8, THEN ERROR + ; + PUSH ES ; + PUSH DI ; + ; + PUSH CS ; + POP ES ; + LEA DI,DEVICE_NAMES ; SET COMPARE STRING TO "CON " + INC SI ; + INC SI ; ADVANCE SI TO POINT TO DEVICE_NAME + REPE CMPSB ; CHECK OUT THE 1 NAME..... + POP DI ; + POP ES ; + JNE H_DN_0 ; + ; + POP SI ; + POP CX ; + CLC ; + RET ; +H_DN_0: POP SI ; + POP CX ; + CALL ISSUE_ERROR_1 ; ERROR OCCURRED...NOW ISSUE THE MESG + ; + STC ; TELL CALLER ABOUT ERROR! + RET ; +HANDLE_DEVICE_NAME ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; THIS ROUTINE IS USED TO VERIFY THE ADAPTER 'NAME' AGAINST +; THE SUPPORTED ONES. IF A MATCH IS FOUND THEN THE APPROPRIATE +; CONFIGURATION TABLE IS LOADED INTO RESIDENT MEMORY, ELSE THE +; 'CY' FLAG IS SET AND AN ERROR IS ISSUED. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +ID_NAMES DB "EGA " ; +L_ID_NAMES EQU ($-ID_NAMES) ; + DB "EGA 8 " ; INTERNAL USE ONLY + DB "EGA 14 " ; INTERNAL USE ONLY + DB "EGA 14M " ; INTERNAL USE ONLY + DB "LCD " ; + DB "MONO " ; + DB "CGA " ; +N_ID_NAMES EQU ($-ID_NAMES)/L_ID_NAMES + ; +HANDLE_DEVICE_ID PROC ; [ TABLE 4 ] + PUSH DI ; + PUSH CX ; + PUSH SI ; + ; + CALL MODIFY_ID_NAME ; THIS CALL IS USED TO CONVERT THE + JC HDID_4 ; 'EGA' CLASS TYPE INTO SUB-CATEGORY'S + ; + MOV SI,[SI].OFFSET_LIST ; + MOV CX,[SI] ; TEST THAT ID_NAME IS 8 BYTES + CMP CX,L_ID_NAMES ; + JNE HDID_4 ; + ; + INC SI ; + INC SI ; ADVANCE SI TO POINT TO ID_NAME + ; + LEA DI,ID_NAMES ; SET COMPARE STRING TO "DEVICEID" + MOV CX,N_ID_NAMES ; + ; +HDID_0: PUSH DI ; SAVE REGISTERS BETWEEN PASSES + PUSH ES ; + PUSH SI ; + PUSH CX ; + ; + PUSH CS ; + POP ES ; + MOV CX,L_ID_NAMES ; + REPE CMPSB ; TEST NAME (ALL 8 BYTES) AGAINST + ; THE NEXT NAME! + POP CX ; + POP SI ; + POP ES ; + POP DI ; + JE HDID_1 ; + ADD DI,L_ID_NAMES ; + LOOP HDID_0 ; TRY ALL ENTRIES FOR A MATCH... +HDID_4: ; + CMP NOT_CPS_ID,ON ; WGR did we find a non-CPS id? ;AN000; + JNE HDID_5 ; WGR no...not the problem..continue ;AN000; + STC ; WGR yes...so no message...but.. ;AN000; + JMP HDID_6 ; WGR set error for return ;AN000; + ; +HDID_5: ; WGR ;AN000; + POP SI ; IF NONE WERE FOUND, THEN ERROR... + POP CX ; + POP DI ; + ; + DEC SI ; BACK TO SUB-TYPE ID AND ISSUE + DEC SI ; THE ERROR MESSAGE. + CALL ISSUE_ERROR_1 ; + STC ; INFORM CALLER ABOUT THE ERROR! + RET ; +HDID_1: SUB CX,N_ID_NAMES ; ID NAME HAS BEEN FOUND + NEG CX ; NORMALIZE CX FOR TABLE INDEXING!! + ; + MOV DEVICE_ID_INDEX,CX ; + CLC ; +HDID_6: ; WGR ;AN000; + POP SI ; + POP CX ; + POP DI ; + RET ; +HANDLE_DEVICE_ID ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; THIS ROUTINE CHECKS THE HARDWARE CP VALUE (if specified)! +; THE VALUE OF THE HARDWARE CP IS NOT VERIFIED, ALLOWING +; FUTURE ADAPTERS WITH non-437 HARDWARE PAGES. +; +; IF #HDWR_CP > 1 (FOR ANY DEVICES IN RELEASE 1.00) THEM +; ERROR +; ELSE +; RECORD VALUE (1 WORD) +; ENDIF +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +HANDLE_HDWR_CP PROC ; [ TABLE 5 ] + PUSH CX ; + PUSH SI ; + MOV SI,[SI].OFFSET_LIST ; + MOV CX,[SI] ; GET THE NUMBER OF HDWR_CP'S + CMP CX,CPD_HDWR_N_MAX ; TEST IF GREATER THAN MAX ALLOWED! + JA H_HC_0 ; + ; + CMP CX,1 ; CHECK THE NUMBER OF HDWR CP's + JA H_HC_0 ; IF MORE THAN ONE..THEN WE HAVE A + ; PROBLEM....TELL USER! + PUSH CX ; + MOV CX,[SI+2] ; GET THE ACTUAL HARDWARE CP + CMP CX,-1 ; IS IT INVALID??? + POP CX ; + JE H_HC_0 ; + ; + PUSH ES ; + PUSH DI ; + ; + PUSH CS ; + POP ES ; + LEA DI,CPD_HDWR_N ; POINT DESTINATION TO INTERNAL TABLE + INC CX ; ALSO ACCOUNT FOR COUNT N + REP MOVSW ; SI ALREADY POINTS TO 'N,CP1,CP2..' + ; + POP DI ; + POP ES ; + ; + POP SI ; + POP CX ; + CLC ; + RET ; +H_HC_0: POP SI ; + POP CX ; + ; + PUSH SI ; HARDWARE CP IN ERROR, PUT 'SI' + DEC SI ; BACK TO SUB-TYPE ID AND ISSUE + DEC SI ; THE ERROR MESSAGE. + DEC SI ; BACK TO SUB-TYPE ID AND ISSUE + DEC SI ; THE ERROR MESSAGE. + CALL ISSUE_ERROR_1 ; + POP SI ; + STC ; + RET ; +HANDLE_HDWR_CP ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; THIS ROUTINE CHECKS THE LAST PARAMETER IN THE COMMAND LINE +; IT CONTAINS THE INFORMATION FOR THE NUMBER OF DESIGNATES AND +; AND THE NUMBER OF DISPLAY FONTS TO BE USED. ONLY MINIMAL +; ERROR CHECKING OCCURS HERE. +; +; THE FOLLOWING IS A LIST OF THE POSSIBLE VALUE IN 'OFFSET_LIST' +; ============================================================== +; +; COND: # 1 # 2 # 3 +; -----------------|--------------------|----------------- +; TABLE: DW 0 DW 1 DW 2 +; DW ? DW n DW n +; DW ? DW ? DW m +; +; DETAILS: no parameters only #desg both #desg +; specified. specified & #font specified +; +; RESULT: #DESG = 0 #DESG = n #DESG = n +; #FONT = 0 (maximum) #FONT = 0 (maximum) #FONT = m +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +HANDLE_DESG_CP PROC ; [ TABLE 6 ] + PUSH AX ; + PUSH CX ; + PUSH DX ; + PUSH SI ; + MOV SI,[SI].OFFSET_LIST ; + ; + MOV CX,-1 ; SET #DESG DEFAULT = 1 + MOV DX,-1 ; SET #FONT DEFAULT = 0 (maximum) + MOV AX,[SI] ; GET DESCRIPTOR FOR PARAMETER LIST + ; + OR AX,AX ; CHECK FOR + JE H_DC_2 ; SET DRIVER TO DEFAULTS + ; + MOV CX,[SI+2] ; + CMP CX,CPD_DESG_N_MAX ; CHECK IF THIS VALUE IS ABOVE MAXIMUM! + JA H_DC_5 ; + CMP AX,ONE ; CHECK FOR + JE H_DC_2 ; SET DRIVER TO DEFAULTS + ; + MOV DX,[SI+4] ; HAS TO BE + ; +H_DC_2: MOV CPD_DESG_N,CX ; RECORD THE #DESG & THE + MOV CPD_FONTS_N,DX ; THE #FONT FROM THE SET VALUES + ; + POP SI ; + POP DX ; + POP CX ; + POP AX ; + CLC ; + RET ; +H_DC_5: POP SI ; + POP DX ; + POP CX ; + PUSH DX ; WGR ;AN000; + MOV AX,ERROR_3 ; WGR ;AN000; + MOV DH,UTILITY_MSG_CLASS ; WGR ;AN000; + CALL ISSUE_MESSAGE ; WGR ;AN000; + POP DX ; WGR ;AN000; + POP AX ; WGR ;AN000; + STC ; + RET ; +HANDLE_DESG_CP ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; INSTALL_ID +; +; THIS ROUTINE PERFORMS THE DISPLAY_CONFIG TABLE +; LOAD WHICH IS USED FOR THE REMAINDER OF THE SESSION +; +; INPUT: +; DEVICE_ID_INDEX = INDEX TO LIST OF SUPPORTED DEVICES +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +INSTALL_ID PROC ; ROUTINE TO INSTALL INFO FOR DEVICE + CALL INSTALL_TABLE ; + JNC INSI_3 ; + ; + PUSH SI ; + MOV SI,OFFSET TABLE ; ADDRESS [ TABLE 1 ] + MOV SI,[SI].DEVICE1_OFFSET ; MOVE FROM [ TABLE 1 ] TO [ TABLE 2 ] +; INC SI ; +; INC SI ; + CALL ISSUE_ERROR_1 ; + POP SI ; + STC ; +INSI_3: RET ; +INSTALL_ID ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +INSTALL_TABLE PROC ; + PUSH AX ; + PUSH CX ; + PUSH DX ; + PUSH DI ; + PUSH SI ; + PUSH DS ; + PUSH ES ; + ; + PUSH CS ; + POP DS ; + PUSH CS ; + POP ES ; + ; + MOV AX,DEVICE_ID_INDEX ; + MOV CX,DC_ENTRY ; + MUL CX ; + LEA CX,DISPLAY_CONFIG ; + ADD CX,AX ; + ADD CX,8 ; ACCOUNT FOR 8 CHARACTER NAME + MOV DI,CX ; + ; + CALL INSTALL_MEMORY ; + JC IT_5 ; + ; + INC DI ; ACCOUNT FOR ENCODED MEMORY BYTES + MOV SI,[DI] ; + PUSH DI ; + MOV CX,NUM_MODES ; + LEA DI,LOAD_MECH ; DUPLICATE LOAD_MECH TABLE + REP MOVSB ; + POP DI ; + MOV SI,[DI+2] ; + MOV CX,NUM_MODES ; + LEA DI,FONT_SIZE ; DUPLICATE FONT_SIZE TABLE + REP MOVSB ; + CLC ; + ; +IT_5: POP ES ; + POP DS ; + POP SI ; + POP DI ; + POP DX ; + POP CX ; + POP AX ; + RET ; +INSTALL_TABLE ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; INSTALL MEMORY +; +; ENTRY: +; ES : DI = POINTER TO ENCODED SCAN LINES ALLOWED +; EXIT: +; CREATION OF CPD_FONT_PNTER TABLE +; CALCULATION OF RESIDENT_END VALUE +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +MEMORY_SIZE_INDEX LABEL WORD ; THIS CORRESPONDS TO THE MEM RQMENTS + DW 0,0,0,0 ; + DW 19*256+6 ; + DW 16*256+6 ; + DW 14*256+6 ; + DW 8*256+6 ; BYTE IN 'TABLES.SRC'. +NUM_MEMORY_SIZE EQU ($-MEMORY_SIZE_INDEX)/2 + ; +INSTALL_MEMORY PROC ; + PUSH AX ; + PUSH BX ; + PUSH CX ; + PUSH DX ; + PUSH SI ; + PUSH DI ; + PUSH ES ; + ; + PUSH CS ; + POP ES ; SET EXTRA SEGMENT + ; + MOV AL,[DI] ; GET ENCODED VALUE FROM TABLE + CALL ASK_BIOS_SCAN_LINES ; IF PERMITTED...BIOS KNOWS SCAN LINES + ; +IM_0Y: PUSH AX ; + PUSH CX ; + MOV CX,NUM_MEMORY_SIZE ; COUNT THE NUMBER OF FONTS POSSIBLE + XOR DX,DX ; DX (INIT=0) WILL = #DIF FONT TYPES +IM_0A: SAL AL,1 ; + JNC IM_0B ; + INC DX ; +IM_0B: LOOP IM_0A ; + POP CX ; + POP AX ; + ; ELSE, STAY WITH INITIAL VALUE!!!! + MOV CX,CPD_FONTS_N ; FIRST CHECK TO SEE IF #FONTS>TYPE + CMP CX,DX ; FIND OUT IF > ALLOWED... + JBE IM_0P ; IF NOT, THEN + MOV CX,-1 ; SET BACK TO DEFAULT VALUE + ; +IM_0P: CMP CX,-1 ; CHECK FOR FONTS = DEFAULT VALUE + JNE IM_0R ; + MOV CPD_FONTS_N,DX ; SET TO THE MAXIMUM FOR THE HARDWARE + ; +IM_0R: MOV CX,CPD_DESG_N ; + CMP CX,-1 ; CHECK FOR #DESG = DEFAULT VALUE + JNE IM_0T ; + MOV CPD_DESG_N,DX ; DX = #FONTS ALLOWED FOR THIS DEVICE + OR DX,DX ; TEST IF > 0 ? + JZ IM_0T ; + MOV CPD_DESG_N,ONE ; + ; +IM_0T: CMP CPD_DESG_N,ZERO ; TEST VALUE OF DESIGNATED CP's + JE IM_8 ; IF THE #DESG=0, THEN REDUCED SUPPORT + ; + CMP CPD_FONTS_N,ZERO ; TEST VALUE OF FONTS, (knowing DESG>0) + JE IM_9 ; ERROR OCCURRED!!! + ; +IM_0: MOV BX,CPD_FONTS_N ; BX=#FONTS REQUESTED + MOV CX,NUM_MEMORY_SIZE ; CX = 8 BITS + LEA SI,MEMORY_SIZE_INDEX ; SI SETUP FOR MEMORY VALUES, CX=#FONTS + XOR DX,DX ; DX=buffer size (INIT=0) +IM_1: SAL AL,1 ; TEST NEXT BIT FOR ACTIVATION + JNC IM_2 ; IF NOT ON...THEN IGNORE + OR BX,BX ; TEST IF MORE FONTS REQUESTED... + JE IM_2 ; + DEC BX ; LESS #FONTS REQUESTED BY ONE + ADD DX,[SI] ; AND ADD THE LARGEST BUFFER SIZE ON +IM_2: INC SI ; ADVANCE MEMORY INDEX POINTER + INC SI ; ADVANCE MEMORY INDEX POINTER + LOOP IM_1 ; + ; + MOV AX,DX ; SET AX=completed buffer size + ; +IM_5: MOV CX,CPD_DESG_N ; NOW, SETUP POINTERS & CALC FONT BUFFER + LEA SI,CPD_FONT_PNTER ; FIND THE DATA_POINTERS + MOV DX,RESIDENT_END ; GET LAST USEABLE ADDRESS + ; + PUSH BX ; SAVE VALUE OF BX FOR RESTORATION... + MOV BX,ES ; SET ES TO BX SO PNTER IS 'BX:DX' +IM_6: PUSH DX ; SET SEGMENT:OFFSET OF BUFFER 'X' + SHR DX,1 ; STRIP OFF LOW 4 BITS OF OFFSET.... + SHR DX,1 ; TO TOP OFF THE 'ES' SEGMENT REGISTER + SHR DX,1 ; + SHR DX,1 ; + ADD BX,DX ; AND MINIMIZE VALUE OF OFFSET + POP DX ; + AND DX,000FH ; THIS IS DONE TO PREVENT STRADDLING + MOV [SI],DX ; A SEGMENT BOUNDARY WITH THE DATA BUF + MOV [SI+2],BX ; + ; + ADD SI,4 ; + ADD DX,AX ; + LOOP IM_6 ; + ; +IM_7A: MOV RESIDENT_END,DX ; SET FINAL OFFSET & SEGMENT TO + MOV RESIDENT_ENDS,BX ; TERMINATE THE 'INIT' WITH + POP BX ; + CLC ; + JUMP IM_A ; + ; +IM_8: MOV DX,REDUCED_SUPPORT ; SET POINTER TO REDUCED SUPPORT + PUSH BX ; + MOV BX,ES ; + JUMP IM_7A ; + ; +IM_9: STC ; +IM_A: POP ES ; + POP DI ; + POP SI ; + POP DX ; + POP CX ; + POP BX ; + POP AX ; + RET ; +INSTALL_MEMORY ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; WGR +; ; WGR +; ISSUE MESSAGE ; WGR +; ; WGR +; THIS ROUTINE IS USED TO PERFORM THE MESSAGE ; WGR +; RETRIVER. ; WGR +; ; WGR +; INPUT: ; WGR +; AX = MESSAGE NUMBER ; WGR +; DH = MESSAGE CLASS ; WGR +; ; WGR +; OUTPUT: ; WGR +; none ; WGR +; ; WGR +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; WGR +ISSUE_MESSAGE PROC ; ; WGR ;AN000; + PUSH DS ; WGR ;AN000; + PUSH BX ; WGR ;AN000; + PUSH CX ; WGR ;AN000; + PUSH CS ; WGR ;AN000; + POP DS ; WGR ;AN000; + MOV BX,STDERR ; WGR ;AN000; + XOR CX,CX ; WGR ;AN000; + XOR DL,DL ; WGR ;AN000; + CALL SYSDISPMSG ; WGR ;AN000; + POP CX ; WGR ;AN000; + POP BX ; WGR ;AN000; + POP DS ; WGR ;AN000; + RET ; WGR ;AN000; +ISSUE_MESSAGE ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; ISSUE_ERROR_1 +; +; THIS IS USED TO CONSTRUCT AND OUTPUT THE ERROR MESSAGE; +; +; DEVICE_ID + 'code page driver cannot be initialized' +; +; THE DEVICE_ID IS PULLED FROM THE COMMAND_PARSER. IF ONE +; IS NOT DEFINED OR UNREADABLE, THEN A CONDENSED MESSAGE +; WITHOUT THE DEVICE_ID IS USED. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +SUB_SIZE EQU 11 ; WGR sublist size ;AN000; +LEFT_ASCIIZ EQU 00010000B ; WGR left-aligned asciiz string ;AN000; +UNLIMITED EQU 0 ; WGR unlimited message size. ;AN000; + ; WGR ;AN000; +SUBLIST LABEL DWORD ; WGR ;AN000; + DB SUB_SIZE ; WGR ;AN000; + DB 0 ; WGR ;AN000; +MSG_PTR DW ? ; WGR ;AN000; +MSG_SEG DW SEG CODE ; WGR ;AN000; + DB 1 ; WGR ;AN000; + DB LEFT_ASCIIZ ; WGR ;AN000; + DB UNLIMITED ; WGR ;AN000; + DB 1 ; WGR ;AN000; + DB " " ; WGR ;AN000; + ; +ISSUE_ERROR_1 PROC ; + PUSH AX ; + PUSH BX ; WGR ;AN000; + PUSH CX ; + PUSH DX ; + PUSH SI ; + ; + MOV SI,[SI].OFFSET_LIST ; POINT TO NAME TO PRINTOUT + INC SI ; + INC SI ; + ; + PUSH SI ; + MOV CX,8 ; MAX LENGTH OF NAME + MOV AL,' ' ; +IN_0: CMP [SI],AL ; + JBE IN_3 ; + INC SI ; + LOOP IN_0 ; +IN_3: MOV AL,ZERO ; SET 0 TO TERMINATE ASCII STRING + MOV [SI],AL ; OVERWRITE LAST BYTE - THIS AFFECTS + ; DATA IMMEDIATELY AFTER NAME. NOT + ; IMPORTANT SINCE FOLLOWING DATA IS IN + ; ERROR + POP SI ; GET START OF NAME + MOV MSG_PTR,SI ; WGR ;AN000; + MOV MSG_SEG,CS ; WGR ;AN000; + MOV AX,ERROR_1 ; WGR ;AN000; + MOV BX,STDERR ; WGR ;AN000; + MOV CX,ONE ; WGR ;AN000; + XOR DL,DL ; WGR ;AN000; + LEA SI,SUBLIST ; WGR ;AN000; + MOV DH,UTILITY_MSG_CLASS ; WGR ;AN000; + CALL SYSDISPMSG ; WGR ;AN000; + ; WGR ;AN000; + POP SI ; + POP DX ; + POP CX ; + POP BX ; WGR ;AN000; + POP AX ; + RET ; +ISSUE_ERROR_1 ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; MODIFY_ID_NAME +; +; THE USER NEED ONLY SPECIFY THE CLASS OF THE DISPLAY ADAPTER. +; THE AVAILABLE DESCRIPTIONS ARE 'EGA, LCD, CGA, and MONO'. +; THIS ROUTINE IS USED TO FURTHER DETAIL WHAT TYPE OF 'EGA' +; CLASS. THIS IS USED SPECIFICALLY FOR THE EGA (1501200) ADAPTER +; AND ITS MANY CONFIGURATION SETTINGS. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +MODIFY_NAME DB "EGA " ; +NEW_NAME DB "EGA 14M " ; + DB "EGA 14 " ; + DB "EGA 8 " ; +NUM_NEW_NAME EQU ($-NEW_NAME)/L_ID_NAMES + ; +NOT_CPS_ID DB OFF ; WGR device id does not support CPS ;AN000; + ; +MODIFY_ID_NAME PROC ; + PUSH DI ; + PUSH AX ; + PUSH BX ; + PUSH CX ; + PUSH SI ; + ; + MOV SI,[SI].OFFSET_LIST ; GET START OF ID_NAME + CMP WORD PTR [SI],EIGHT ; WGR ;AN000; + JE MIN_00 ; WGR ;AN000; + CALL GET_DEVICE_ID ; WGR ;AN000; + JNC MIN_00 ; WGR CPS id?...yes continue ;AN000; + MOV NOT_CPS_ID,ON ; WGR no....set flag ;AN000; + JMP MIN_4 ; WGR exit with carry set ;AN000; +MIN_00: ; WGR ;AN000; + INC SI ; + INC SI ; ADVANCE SI TO POINT TO ID_NAME + ; + PUSH SI ; MOVE A COPY OF THE NAME TO CPD_CLASS + PUSH ES ; BEFORE IT IS Revised.... + PUSH CX ; + PUSH CS ; + POP ES ; + MOV CX,L_ID_NAMES ; + LEA DI,CPD_CLASS ; + REP MOVSB ; + POP CX ; + POP ES ; + POP SI ; + ; + LEA DI,MODIFY_NAME ; SET COMPARE STRING TO "EGA " + ; + PUSH DI ; SAVE REGISTERS BETWEEN PASSES + PUSH ES ; + PUSH SI ; + ; + PUSH CS ; + POP ES ; + MOV CX,L_ID_NAMES ; + REPE CMPSB ; TEST NAME (ALL 8 BYTES) AGAINST + ; THE NEXT NAME! + POP SI ; + POP ES ; + POP DI ; + JNE MIN_1 ; THIS MAY NOT BE THE MATCH.... + ; + CALL ASK_BIOS_FONT_SIZE ; CHECK IF THIS IS AN ADVANCED EGA? + JNC MIN_1 ; IF CY=0, THEN ADVANCED...ELSE, +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + MOV AH,12H ; SET FOR ALTERNATE SELECT, EGA INFO + MOV BL,10H ; + INT 10H ; ASK BIOS FOR INFORMATION + CMP BL,10H ; (CHECK IF THIS CALL IS INVALID?) + JE MIN_4 ; IF BL UNCHANGED, THEN NOT EGA! + ; ELSE, CL=SWITCH SETTINGS + MOV AX,L_ID_NAMES ; SET DEFAULT SUB-TYPE TO 1ST ENTRY + CMP BH,ONE ; IF ZERO THEN COLOUR, IF ONE THEN MONO + JE MIN_0 ; + ADD AX,L_ID_NAMES ; MOVE TO NEXT SUB-TYPE + AND CL,0FH ; STRIP OFF LEADING NIBBLE FROM SWITCH + CMP CL,9 ; SETTINGS AND TEST FOR 5154 CONFIG + JE MIN_0 ; + CMP CL,THREE ; + JE MIN_0 ; IF NOT 5154, 5151; THEN MUST BE 5153! + ADD AX,L_ID_NAMES ; + ; +MIN_0: ADD DI,AX ; SET UP INDEX REGISTER TO NEW SUBTYPE + PUSH DS ; + PUSH ES ; + ; + PUSH CS ; + POP ES ; + XCHG SI,DI ; SWITCH SOURCE-DESTINATION REGISTERS + MOV CX,L_ID_NAMES ; + REP MOVSB ; MOVE IN NEW STRING + POP ES ; + POP DS ; + ; +MIN_1: CLC ; + JUMP MIN_5 ; +MIN_4: STC ; +MIN_5: POP SI ; IF NOT FOUND, THEN ERROR... + POP CX ; + POP BX ; + POP AX ; + POP DI ; + RET ; +MODIFY_ID_NAME ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +.XLIST +MSG_SERVICES ; WGR ;AN000; +MSG_SERVICES ; WGR ;AN000; +MSG_SERVICES ; WGR ;AN000; +MSG_SERVICES ; WGR ;AN000; +MSG_SERVICES ; WGR ;AN000; +.LIST ; + ; +include msgdcl.inc ; + ; +CODE ENDS ; + END ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + diff --git a/v4.0/src/DEV/DISPLAY/INT10COM.INC b/v4.0/src/DEV/DISPLAY/INT10COM.INC new file mode 100644 index 0000000..6931ca6 --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/INT10COM.INC @@ -0,0 +1,1029 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; INT10COM.INC +; +; THESE FOLLOWING ROUTINES ARE USED TO LOCATE AND LOAD +; THE FONTS FOR THE SPECIFIED CODE PAGE. IT IS DESIGNED +; TO WORK ON THE FOLLOWING DISPLAY ADAPTERS; +; +; - EGA 1501200 (minimal configuration) no expansion card needed +; - PC Convertible (with LCD display adapter) +; - plus literally a half-dozen code-named unreleased IBM products +; +; SUPPORT FOR THE 'CGA' (Colour Graphics Adapter) and +; 'MONO' (Monochrome/Printer Adapter) IS LIMITED TO THE +; HARDWARE CODE PAGE ONLY (ie. not soft-loadable devices). +; +; PSEUDO CODE: +; =========== +; INT_10_PROC STARTS +; GET MODE (AL=?) +; CALL rom_int_10 +; GET FONT_SIZE +; if FONT_SIZE <> 0FFH +; if FONT_SIZE = available +; GET LOAD_MECHANISM +; if LOAD_MECHANISM = BIOS technique +; CALL LOAD_BIOS_CHAR +; endif +; if LOAD_MECHANISM = VECTOR technique +; CALL LOAD_VECTOR_CHAR +; endif +; endif +; endif +; IRET +; INT_10_PROC ENDS +; +; (C)Copyright 1988 Microsoft +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +IF1 ; + %OUT . �INT10COM.INC� +ENDIF + +;Modification history ********************************************************* +;AN001; P1497 Cursor disappearance problem after codepage switch 10/9/87 J.K. +;****************************************************************************** + PUBLIC MODE_VALUE ; + PUBLIC ROM_INT_10 ; + PUBLIC ROM_INT_1F ; + PUBLIC OLD_INT_1F ; + PUBLIC ROM_INT_44 ; + PUBLIC INT_10_COM ; + PUBLIC ASK_BIOS_FONT_SIZE ; + PUBLIC ASK_BIOS_SCAN_LINES ; + ; +ROM_INT_10 DW ? ; Int 10H vector offset + DW ? ; Int 10H vector segment +ROM_INT_1F DW ? ; Int 1FH vector offset + DW ? ; Int 1FH vector segment +OLD_INT_1F DW ? ; OLD Int 1FH vector offset + DW ? ; OLD Int 1FH vector segment +ROM_INT_44 DW ? ; Int 44H vector offset + DW ? ; Int 44H vector segment +MODE_VALUE DB ? ; VALUE OF AL DURING INT 10H (AH=0) +BYTES_PER_CHAR DB ? ; VALUE OF BYTES/CHARACTER IN MODES +LOAD_MECHANISM DB ? ; SUPPORT SCHEME FOR ACTIVE MODE +CHARACTER_SOURCE DB ? ; FLAG TO INDICATE: 0 = HDWR + ; 1 = DESG +INVALID_MODE EQU 0FFH ; +MASK_BIOS_LOAD EQU 00000011b ; +MASK_VECTOR_LOAD EQU 00110000B ; +MODE_MASK EQU 01111111B ; GHG Emulator Problem +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; CONFIGURATION TABLES FOR CHARACTER LOADING +; +; TABLE WILL BE FILLED IN BY INIT.ASM +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + PUBLIC LOAD_MECH ; +LOAD_MECH LABEL BYTE ; RESERVE 32 MODE SETTINGS + DB 32 DUP(?) ; REFER TO TABLES.INC FOR DETAILS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; CONFIGURATION TABLES FOR CHARACTER SIZES +; +; TABLE WILL BE FILLED IN BY INIT.ASM +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + PUBLIC FONT_SIZE ; +FONT_SIZE LABEL BYTE ; RESERVE 32 MODE SETTINGS + DB 32 DUP(?) ; REFER TO TABLES.INC FOR DETAILS +NUM_FONT_SIZES EQU ($-FONT_SIZE) ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; INTERRUPT 10H SUPPORT CODE +; +; THE INIT ROUTINE WILL INSTALL THIS CODE INTO THE +; INTERRUPT 10H VIDEO BIOS CALL. IT CHAINS TO THE +; LOWER LEVEL (usually BIOS for Device Drivers). +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +INT_10_COM PROC FAR ; + STI ; + OR AH,AH ; TEST THE SUBFUNCTION CALL=0 + JE INT_1 ; RESERVED FOR THE COM PATH! + JMP DWORD PTR CS:ROM_INT_10 ; + ; +INT_1: ; + PUSHF ; PREPARE FOR IRET! + CALL DWORD PTR CS:ROM_INT_10 ; call routine to handle the command + PUSH AX ; + PUSH BX ; WGR ;AN000; + MOV AH,GET_MODE ; WGR get actual mode set ;AN000; + PUSHF ; WGR ;AN000; + CALL DWORD PTR CS:ROM_INT_10 ; WGR ;AN000; + MOV CS:MODE_VALUE,AL ; SAVE MODE_VALUE BEFORE CALL + and CS:MODE_VALUE,mode_mask ; GHG Emulator Problem..... + POP BX ; WGR ;AN000; + ; + CALL TEST_CP ; FIND OUT IF CP CAN BE SUPPORTED? + JNC INT_2 ; + ; + MOV CS:CHARACTER_SOURCE,0 ; IF AN ERROR OCCURRED IN FINDING THE + MOV AL,INTER_1FH ; FONT DATA INFORMATION...THEN THE + CALL VECTOR_LOAD ; INTERRUPT 1F hex VECTOR MUST BE + JUMP INT_3 ; SET TO THE HDWR CP - ELSE WRONG + ; DATA MAY BE DISPLAYED +INT_2: MOV CS:SETMODE_FLAG,OFF ; WGR ;AN000; + CALL INVOKE_DATA ; IF SO, THEN LOAD THE DATA +INT_3: POP AX ; + ; + IRET ; +INT_10_COM ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; SET BLOCK SPECIFIER = 0 +; +; THIS IS USED TO ACTIVATE BLOCK = 0 FONT. THIS PERFORMS +; DIFFERENT OPERATIONS ON VARIOUS DISPLAY ADAPTERS. THE +; RESULTS OF WHICH ARE TO ACTIVATE THE DESIGNATED FONT. +; +; INPUT: +; none +; OUTPUT: +; none +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +SET_BLOCK_SP0 PROC ; + PUSH AX ; + PUSH BX ; + MOV AX,1103H ; SET BLOCK SPECIFIER + MOV BL,ZERO ; CHAR GEN BLOCK SPECIFIER + INT 10H ; PERFORM CALL... + POP BX ; + POP AX ; + RET ; +SET_BLOCK_SP0 ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; FIND_FONT +; +; THE ROUTINE STARTS WITH THE FONT DATA POINTER, AND +; TRIES TO FIND THE FONT RESOLUTION THAT IS NEEDED. +; THIS FONT RESOLUTION IS BASED ON THE PRESENT SCREEN +; MODE WHICH IS ACTIVE. +; +; INPUT: +; ES : DI points to beginning +; of font data +; OUTPUT: +; ES : DI points to font data +; for needed resolution +; CY = 0 if found +; = 1 if not found +; +; DS = CS assumed +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +FIND_FONT PROC ; + PUSH AX ; + PUSH CX ; + PUSH DX ; + ; + MOV CX,CPD_FONTS_N ; GET NUMBER OF FONT STYLES +FF_0: MOV AH,BYTES_PER_CHAR ; GET BYTES_PER_CHAR FOR COMPARISON + ; + MOV AL,ES:[DI] ; GET #ROWS OF POINTED DATA + CMP AL,AH ; COMPARE BYTES_PER_CHAR AGAINST #ROWS + JE FF_3 ; IF MATCHED...THEN ADJUST ES:DI (CY=0) + ; + PUSH CX ; ELSE, MOVE ES:DI TO NEXT FONT START + MOV CX,ES:[DI+4] ; GET count OF CHARACTERS IN LIST + XOR AH,AH ; PREPARE AX FOR MULT + MUL CX ; CALCULATE DELTA TO NEXT FONT START + POP CX ; + ; + ADD AX,SIX ; ADD FONT STYLE HEADER OF SIX BYTES + ADD DI,AX ; ADJUST THE DI POINTER + ; THERE CAN BE NO CARRY DUE TO STRUCTURE + LOOP FF_0 ; OF FONT DATA (ie. no straddling) + STC ; + JUMP FF_4 ; +FF_3: ADD DI,SIX ; POINT TO VERY START OF DATA + CLC ; SET FLAG TO OK! +FF_4: POP DX ; + POP CX ; + POP AX ; + RET ; +FIND_FONT ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; BIOS_LOAD +; +; THIS CALL IS USED TO LOAD THE ACTIVE CP. IT LOADS +; THE ACTIVE CP WHETHER IT IS DESIGNATED OR HDWR. THE +; ACTUAL LOADING OF THE FONT IS PERFORMED BY THE 'EGA CLASS' +; BIOS ROUTINES (different for some adapters). +; +; INPUT: +; AL = ? load mechanism +; +; 7 6 5 4 3 2 1 0 +; 0 0 0 0 0 0 x x +; � ��� 1 - AX=1100H +; ����� 1 = AX=1400H +; +; ES : DI points to start of font data +; CX = ? count of characters to load +; BH = bytes per character +; DS = CS assumed... +; +; OUTPUT: +; none +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +AX_1100H EQU 00000001b ; +AX_1400H EQU 00000010b ; +EGA_INFO EQU 0487H ; ADDRESS OF INFO BYTE +EGA_ACTIVE EQU 00001000b ; MASK FOR EGA_ACTIVE/NON-ACTIVE + ; +BIOS_LOAD PROC ; + CALL GET_CURSOR_POS ; ONE MUST RECORD THE CURSOR POS DURING + ; A FONT LOAD...ELSE CURSOR TO (1,1) + PUSH BX ; + PUSH DX ; + ; + MOV DX,ZERO ; CHARACTER OFFSET INTO TABLE + MOV BL,ZERO ; BLOCK TO LOAD (Block=0) + ; + TEST AL,AX_1100H ; DETERMINE IF EGA_TYPE LOAD? + JNZ BL_00 ; IF NOT, THEN TRY FOR LCD_TYPE... + JMP BL_3 ; + ; +BL_00: PUSH BP ; SAVE REGISTERS TO BE USED + PUSH AX ; + CMP CHARACTER_SOURCE,ZERO ; TEST IF CP = HDWR + JE BL_0 ; + ; + MOV BP,DI ; POINTER TO USER TABLE (ES:BP) + MOV AX,1100H ; USER ALPHA LOAD + JUMP BL_2 ; + ; +BL_0: MOV AX,1102H ; ROM 8X8 DOUBLE DOT + CMP BYTES_PER_CHAR,8 ; + JE BL_2 ; +BL_1: MOV AL,01H ; ROM MONOCHROME SET + CMP BYTES_PER_CHAR,14 ; + JE BL_2 ; + MOV AL,04H ; ROM 8X16 SET + CMP BYTES_PER_CHAR,16 ; + JE BL_2 ; + JUMP BL_2A ; PERFORM BIOS CALL... + ; +BL_2: PUSH DS ; THIS TEST VERIFIES THAT THE EGA + PUSH AX ; ADAPTER IS PRESENTLY ACTIVE. + XOR AX,AX ; IF IT IS NOT, THEN THE EGA WILL + MOV DS,AX ; REPROGRAM THE ACTIVE CRT TO THE EGA + MOV AL,DS:EGA_INFO ; SPECIFICATION....HAZARDOUS RESULTS! + AND AL,EGA_ACTIVE ; MASK FOR EGA ACTIVE/NON-ACTIVE + POP AX ; + POP DS ; + ; + JZ BL_2AA ; IF ZERO, THE EGA IS ACTIVE...AND OK! + STC ; ELSE, EGA IS NOT ACTIVE + POP AX ; + POP BP ; AND WE MUST + JUMP BL_7 ; LEAVE WITH AN ERROR.... + ; +BL_2AA: + CMP CS:SETMODE_FLAG,OFF ; WGR MODE SET REQUIRED?.. ;AN000; + JE BL_2B ; WGR NO...JUMP TO CHARACTER LOAD. ;AN000; + PUSH AX ; WGR ;AN000; + PUSH DS ; WGR ;AN000; + XOR AX,AX ; WGR ;AN000; + MOV DS,AX ; WGR ;AN000; + PUSH DS:[VIDEO_CTRL] ; WGR ;AN000; + MOV AL,CS:MODE_VALUE ; WGR GET CURRENT MODE ;AN000; + OR AL,NOT MODE_MASK ; WGR MODE SET WITHOUT BUFFER CLEARED ;AN000; + + call Info_Ansi_ModeSet ;J.K.Tell ANSI that DISPLAY.SYS is going to call INT 10h, SET MODE function. + + XOR AH,AH ; WGR MODE SET CALL.. ;AN000; + PUSHF ; WGR ;AN000; + CALL DWORD PTR CS:ROM_INT_10 ; WGR ;AN000; + + call Info_Ansi_ModeDone ;J.K.Tell ANSI that it is through. + + POP DS:[VIDEO_CTRL] ; WGR ;AN000; + POP DS ; WGR ;AN000; + POP AX ; WGR ;AN000; +BL_2B: ; WGR WAS ISSUED (BY ME) ;AN000; + OR AX,CS:RE_CALC ; WGR INCASE RECALC IS NEEDED. ;AN000; + INT 10H ; +;AN001; EGA ROM BIOS has a bug when AX=1110h, INT 10h is issued. +; Cursor type is changed to 0C0Dh which causes the cursor to +; disappear!!! +; We are going to set Cursor type back to 0607h for EGA. + + cmp ax, 1110h ;AN001; + jne Skip_Cursor_Problem ;AN001; + push cx ;AN001; + mov ah, 1 ;AN001; + mov cx, 0607h ;AN001; + int 10h ;AN001; + pop cx ;AN001; + +Skip_Cursor_Problem: + MOV CS:RE_CALC,OFF ; WGR RESET RE_CALC VALUE ;AN000; + CALL SET_BLOCK_SP0 ; AND THEN SET_BLOCK_SPECIFIER (0) +BL_2A: POP AX ; + POP BP ; + ; +BL_3: TEST AL,AX_1400H ; + JZ BL_6 ; + ; + PUSH AX ; SAVE INDICATOR + ; + CMP CHARACTER_SOURCE,ZERO ; TEST IF CP = HDWR + JE BL_4 ; + ; + MOV AX,1400H ; LOAD USER SPECIFIED FONT + JUMP BL_5 ; + ; +BL_4: MOV AX,1401H ; ASK FOR ROM LOAD FONT + MOV BL,ZERO ; +BL_5: INT 10H ; PERFORM THE LOAD! + CALL SET_BLOCK_SP0 ; AND ALSO DO THE SET BLOCK SPECIFIER + POP AX ; + ; +BL_6: CLC ; +BL_7: POP DX ; + POP BX ; + ; + CALL SET_CURSOR_POS ; RESTORE THE CURSOR POSITION + RET ; +BIOS_LOAD ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; ASK_BIOS_INFO +; +; THIS ROUTINE IS DESIGNED TO MAKE USE OF THE NEW BIOS +; CALL IN THE '???????' AND FOLLOW-ONS. REFER TO THE +; 'Personal Systems Architecture' DCR #405 (written +; by DD). IF THIS SUPPORT IS NOT FOUND ON THE +; DISPLAY ADAPTER, THEN THE CARRY FLAG IS SET! +; +; INPUT: +; none +; OUTPUT: +; CY = 0 if found +; 1 if not supported +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +RETURN_INFO LABEL BYTE ; + DW ? ; OFFSET TO STATIC FUNCTIONALITY INFO + DW ? ; SEGMENT TO STATIC FUNCTIONALITY INFO + DB ? ; VIDEO MODE + DW ? ; COLUMNS ON SCREEN + DW ? ; LEN OF REGEN BUFFER + DW ? ; START ADDRESS IN REGEN BUFFER + DW ? ; CURSOR POSITION OF PAGE #0 + DW ? ; CURSOR POSITION OF PAGE #1 + DW ? ; CURSOR POSITION OF PAGE #2 + DW ? ; CURSOR POSITION OF PAGE #3 + DW ? ; CURSOR POSITION OF PAGE #4 + DW ? ; CURSOR POSITION OF PAGE #5 + DW ? ; CURSOR POSITION OF PAGE #6 + DW ? ; CURSOR POSITION OF PAGE #7 + DW ? ; CURSOR MODE SETTING + DB ? ; ACTIVE DISPLAY PAGE + DW ? ; CRT CONTROLLER ADDRESS + DB ? ; CRT_MODE_SET + DB ? ; CRT_PALETTE + DB ? ; ROWS ON SCREEN +CHAR_H LABEL WORD ; + DW ? ; CHARACTER HEIGHT + DB ? ; DISPLAY COMBINATION (ACTIVE) + DB ? ; DISPLAY COMBINATION (ALTERNATE) +L_RET_INFO EQU ($-RETURN_INFO) ; + DB (40h-L_RET_INFO) DUP (?) ; REMAINING DATA.... + ; +STATIC_INFO STRUC ; + DB ? ; VIDEO MODES (part 1) + DB ? ; VIDEO MODES (part 2) + DB ? ; VIDEO MODES (part 3) + DB ? ; RESERVED + DB ? ; RESERVED + DB ? ; RESERVED + DB ? ; RESERVED +SI_LINE DB ? ; SCAN LINES AVAILABLE IN TEXT MODES +STATIC_INFO ENDS ; + ; +ASK_BIOS_INFO PROC ; + PUSH ES ; + PUSH DI ; + PUSH BX ; + PUSH AX ; + ; + MOV AX,1B00H ; BIOS CALL FOR 'EGA +' INFORMATION + MOV BX,0 ; + MOV DI,OFFSET RETURN_INFO ; SETUP THE RETURN ADDRESS (above) + PUSH CS ; + POP ES ; + INT 10H ; + ; + CMP AL,1BH ; IF AL <> 1BH, THEN ADAPTER DOES + JNZ ABI_3 ; NOT SUPPORT THIS CALL...EXIT w/ERROR + CLC ; + JUMP ABI_4 ; ELSE, LEAVE w/o ERROR + ; WITH THE TABLE ALL FILLED IN.... +ABI_3: STC ; +ABI_4: POP AX ; + POP BX ; + POP DI ; + POP ES ; + RET ; +ASK_BIOS_INFO ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; ASK_BIOS_FONT_SIZE +; +; THIS ROUTINE RETURNS THE PRESENT FONT RESOLUTION. +; IT IS SUPPORTED VIA THE ENHANCED INT 10H BIOS CALL. +; REFER TO THE 'ASK_BIOS_INFO' FOR DETAILS. +; +; INPUT: +; none +; OUTPUT: +; AL = bytes/character +; CY = 0 if found +; 1 if not supported (and AL = unchanged) +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +ASK_BIOS_FONT_SIZE PROC ; + PUSH BX ; + CALL ASK_BIOS_INFO ; + JC ABFS_1 ; + MOV BX,CHAR_H ; + MOV AL,BL ; + CMP AL,ZERO ; PERFORM CHECK FOR BIOS ERROR! + JNZ ABFS_0 ; + STC ; + JUMP ABFS_1 ; +ABFS_0: CLC ; +ABFS_1: POP BX ; + RET ; +ASK_BIOS_FONT_SIZE ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; ASK_BIOS_SCAN_LINES +; +; THIS IS SIMILAR TO THE ASK_BIOS_FONT_SIZE, EXCEPT IT +; WILL RETURN THE AVAILABLE VERTICAL SCAN LINES FOR ALL +; TEXT MODES. REFER TO REFERENCED DCR #405. +; +; INPUT: +; none +; OUTPUT: +; AL = encoded SCAN LINES (in text modes) +; CY = 0 if found +; 1 if not supported +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +ASK_BIOS_SCAN_LINES PROC ; + CALL ASK_BIOS_INFO ; ASK BIOS FOR DETAILED INFO... + JC ABSL_0 ; IF CY = 1, THEN BIOS NOT SMART ENOUGH! + PUSH BX ; + PUSH SI ; + PUSH ES ; + LEA SI,RETURN_INFO ; GET POINTERS TO STATIC TABLE.... + MOV BX,CS:[SI+2] ; GET STATIC INFO SEGMENT + MOV ES,BX ; & + MOV SI,CS:[SI] ; GET STATIC INFO OFFSET + MOV AL,ES:[SI].SI_LINE ; THEN, FINALLY THE ENCODED SCAN_LINES + POP ES ; + POP SI ; + POP BX ; +ABSL_0: RET ; +ASK_BIOS_SCAN_LINES ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; VECTOR_LOAD +; +; THIS ROUTINE WORKS SIMILARLY TO THE BIOS_LOAD, EXCEPT THAT +; THE FONT SUPPORT IS LOADED VIA A VECTOR MECHANISM...RATHER +; THAN USING BIOS. THE BIOS_LOAD METHOD IS USED EXCLUSIVELY +; FOR TEXT MODES ONLY....WHILE THE VECTOR_LOAD IS FOR APA +; (all points addressable). +; +; THE VECTOR SUPPORT IS BASED ON THE INTERRUPT VECTORS 1F hex +; AND 43 hex. THE INTERRUPT 1F hex HAS SPECIAL CONSIDERATIONS +; DUE TO THE 'GRAFTABL.COM' PROGRAM PROVIDED ON DOS. REFER +; TO THE 'CPS DESIGN DOCUMENT' (written by IBM Canada Lab) FOR +; DETAILS. +; +; INPUT: +; AL = ? load mechanism +; +; 7 6 5 4 3 2 1 0 +; x x x x 0 0 0 0 +; � ����������� 1 = INT 1FH +; ������������� 1 = INT 43H +; 1 = int 1FH special handling +; +; +; ES : DI points to start of font data +; CX = ? count of characters to load +; BH = bytes per character +; +; DS = CS assumed +; +; *********************************************************** +; ************** SCHEDULED FOR OPTIMIZATION ***************** +; *********************************************************** +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +VECTOR_MODE DB ? ; +INTER_43H EQU 00100000b ; +INTER_1FH EQU 00010000b ; +LCD_1FH EQU 01000000b ; +INTER_44H EQU 10000000b ; + ; +VECTOR_LOAD PROC ; + TEST AL,INTER_1FH ; CHECK IF ANY INTERRUPT 1FH PROCESSING + JNZ VL_00 ; IS NEEDED. + JUMP VL_3 ; IS NEEDED. + ; +VL_00: MOV CS:VECTOR_MODE,AL ; + PUSH AX ; SAVE AX REGISTER.... + MOV AX,0B000H ; INTERFACE CALL TO GRAFTABL TO SEE + INT 2FH ; IF SUPPORT IS LOADED. + CMP AL,0FFH ; IF SO, THEN EXIT! + POP AX ; RESTORE AX REGISTER.. + JNE VL_2AA ; IF NOT 0FFH=AL, THEN NOT LOADED! + JUMP VL_3 ; EXIT, GRAFTABL HAS CONTROL + ; +VL_2AA: CMP CHARACTER_SOURCE,0 ; TEST IF CP = HDWR + JE VL_1 ; + ; + PUSH DS ; + PUSH AX ; + XOR AX,AX ; + MOV DS,AX ; + MOV AX,DI ; PUT DI INTO AX FOR ADJUSTMENT + ADD AX,8*128 ; + ; + CLI ; + MOV DS:WORD PTR INT_1F_LOW,AX; SET THE HIGH 128 CHARACTERS + MOV DS:WORD PTR INT_1F_HI,ES; + STI ; + MOV CS:OLD_INT_1F,AX ; SAVE VALUE TO INTERNAL STORAGE + MOV CS:OLD_INT_1F+2,ES ; + POP AX ; + POP DS ; + JUMP VL_3 ; + ; +VL_1: TEST CS:VECTOR_MODE,LCD_1FH ; CHECK IF LCD ACTIVE + JZ VL_11A ; + ; + PUSH DS ; SET INT 44 hex WITH HDWR CP + PUSH DI ; + PUSH AX ; + XOR AX,AX ; + MOV DS,AX ; + CLI ; + MOV DI,CS:ROM_INT_1F ; + MOV DS:WORD PTR INT_1F_LOW,DI; SET NEW VECTOR + MOV CS:OLD_INT_1F,DI ; SAVE VALUE TO INTERNAL STORAGE + MOV DI,CS:ROM_INT_1F+2 ; + MOV DS:WORD PTR INT_1F_HI,DI; + MOV CS:OLD_INT_1F+2,DI ; + STI ; + POP AX ; + POP DI ; + POP DS ; + JUMP VL_3 ; + ; +VL_11A: PUSH ES ; SET INT 1F hex WITH HDWR CP + PUSH DS ; + PUSH BP ; + PUSH AX ; + PUSH BX ; + PUSH CX ; + PUSH DX ; + MOV AX,1130H ; GET EGA INFORMATION + MOV BH,4 ; GET ROM DOUBLE DOT PTR (TOP) + INT 10H ; + XOR AX,AX ; + MOV DS,AX ; + CLI ; + MOV DS:WORD PTR INT_1F_LOW,BP; SET THE HIGH 128 CHARACTERS + MOV DS:WORD PTR INT_1F_HI,ES; + STI ; + MOV CS:OLD_INT_1F,BP ; SAVE VALUE TO INTERNAL STORAGE + MOV CS:OLD_INT_1F+2,ES ; + POP DX ; + POP CX ; + POP BX ; + POP AX ; + POP BP ; + POP DS ; + POP ES ; + ; +VL_3: TEST AL,INTER_43H ; + JZ VL_8 ; + ; + CMP CHARACTER_SOURCE,0 ; TEST IF CP = HDWR + JE VL_5 ; + ; + PUSH DS ; SET INT 43 hex WITH USER TABLE + PUSH AX ; + XOR AX,AX ; + MOV DS,AX ; + CLI ; + MOV DS:WORD PTR INT_43_LOW,DI; + MOV DS:WORD PTR INT_43_HI,ES; + STI ; + POP AX ; + POP DS ; + JUMP VL_9 ; + ; +VL_5: PUSH BX ; SET INT 43 hex WITH HDWR CP + MOV BH,3 ; RETURN ROM DOUBLE DOT PTR + CMP BYTES_PER_CHAR,8 ; WORK FOR HARDWARE CP's + JE VL_6 ; + ; + MOV BH,2 ; RETURN ROM 8X14 PTR + CMP BYTES_PER_CHAR,14 ; + JE VL_6 ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; THIS IS BH=6 (??????? WAS IN ERROR). THE ?????? HAS +; THE LATEST FIX SUPPORT. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + MOV BH,6 ; SET FOR ROM 8X16 PTR + CMP BYTES_PER_CHAR,16 ; + JNE VL_7 ; + ; +VL_6: PUSH AX ; YES, ONCE AGAIN, SAVE THOSE REG'ies + PUSH CX ; + PUSH DX ; + PUSH DS ; + PUSH ES ; + PUSH BP ; + MOV AX,1130H ; GET EGA INFORMATION (PTR=ES:DI) + INT 10H ; + XOR AX,AX ; + MOV DS,AX ; + CLI ; + MOV DS:WORD PTR INT_43_LOW,BP; SET THE FULL CHARACTER SET + MOV DS:WORD PTR INT_43_HI,ES; + STI ; + POP BP ; + POP ES ; + POP DS ; + POP DX ; + POP CX ; + POP AX ; +VL_7: POP BX ; + ; +VL_8: TEST AL,INTER_44H ; Test for INTERRUPT 44 Hex + JZ VL_9 ; + ; + CMP CHARACTER_SOURCE,0 ; TEST IF CP = HDWR + JE VL_8A ; + ; + PUSH DS ; SET INT 43 hex WITH USER TABLE + PUSH AX ; + XOR AX,AX ; + MOV DS,AX ; + CLI ; + MOV DS:WORD PTR INT_44_LOW,DI; + MOV DS:WORD PTR INT_44_HI,ES; + STI ; + POP AX ; + POP DS ; + JUMP VL_9 ; + ; +VL_8A: PUSH DS ; SET INT 44 hex WITH HDWR CP + PUSH DI ; + PUSH AX ; + XOR AX,AX ; + MOV DS,AX ; + CLI ; + MOV DI,CS:ROM_INT_44 ; + MOV DS:WORD PTR INT_44_LOW,DI; + MOV DI,CS:ROM_INT_44+2 ; + MOV DS:WORD PTR INT_44_HI,DI; + STI ; + POP AX ; + POP DI ; + POP DS ; + ; +VL_9: RET ; +VECTOR_LOAD ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; LOAD CODE PAGE +; +; This routine is called by INVOKE_DATA and +; by the INT_10H code. +; +; EXIT: +; CP_ES points to the final CP data segment +; CP_DI points to the final CP data offset +; +; CY = 0 if no error detected +; 1 if error occurred +; AX = 0000 if hardware code page matched +; AX = 0001 if routine is presently busy +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +CP_ES DW ? ; +CP_DI DW ? ; +LOAD_CP_SEMA DB 0 ; SEMAPHORE TO TELL IF ROUTINE IS + ; ALREADY ACTIVE.... + ; +ANSI_BUFFER LABEL BYTE ; WGR BUFFER FOR ANSI ;AN000; + DB ZERO ; WGR INFO LEVEL ;AN000; + DB ZERO ; WGR ;AN000; + DW ANSI_BUF_SIZE ; WGR LENGTH OF DATA ;AN000; + DW ? ; WGR CONTROL FLAGS ;AN000; +D_MODE LABEL BYTE ; WGR DISPLAY MODE ;AN000; + DB ? ; WGR ;AN000; + DB ? ; WGR RESERVED ;AN000; + DW ? ; WGR COLORS ;AN000; + DW ? ; WGR WIDTH ;AN000; + DW ? ; WGR LENGTH ;AN000; + DW ? ; WGR COLUMNS ;AN000; +SCR_ROWS LABEL WORD ; WGR ROWS ;AN000; + DW ? ; WGR ;AN000; + ; +RE_CALC DW OFF ; WGR VALUE TO OR IN CHARACTER LOAD ;AN000; +SETMODE_FLAG DB OFF ; WGR FLAG INDICATING A MODE SET IS REQUIRED ;AN000; + ; +TEST_CP PROC ; + CMP CS:LOAD_CP_SEMA,ZERO ; TEST IF ALREADY ACTIVE! + JE I10_0 ; + STC ; IF ALREADY ACTIVE, THEN SET ERROR + MOV AX,ONE ; TO INDICATE THAT ACTIVE.... + RET ; + ; +I10_0: MOV CS:LOAD_CP_SEMA,ONE ; SET ROUTINE NOW ACTIVE... + PUSH BX ; + PUSH CX ; + PUSH DX ; WGR ;AN000; + PUSH SI ; + PUSH DI ; + PUSH DS ; + PUSH ES ; + ; + PUSH CS ; + POP DS ; SETUP DS SEGMENT TO CS + PUSH CS ; + POP ES ; SETUP ES SEGMENT TO CS + ; + XOR AH,AH ; AH=0 FOR MODE SET, AL=MODE_TYPE + MOV AL,MODE_VALUE ; + MOV SI,AX ; ESTABLISH INDEX INTO LOAD_MECH table + MOV AL,[SI].FONT_SIZE ; GET FONT_SIZE FOR THIS MODE_VALUE + OR AL,AL ; TEST FOR MODE_VALUE=0 + JNZ I10_2 ; + ; + CALL ASK_BIOS_FONT_SIZE ; GET BIOS TO INDICATE FONT_SIZE + JC I10_A ; IF CY=1 THEN ERROR OCCURRED + ; +I10_2: PUSH AX ; WGR SAVE FONT SIZE ;AN000; + MOV Ah,ANSI_2F ; WGR REQUEST TO ANSI FOR SCREEN SIZE ;AN000; + mov al,IOCTL_2F ; IOCTL request + MOV CL,GET_SUBFUNC ; WGR GET CHARACTERISTICS FUNCTION ;AN000; + LEA DX,ANSI_BUFFER ; WGR BUFFER FOR REQUEST STORAGE ;AN000; + INT 2FH ; WGR ;AN000; + JC I10_3 ; WGR IF CARRY THEN ERROR..CONT AS BEFORE ;AN000; + CMP AL,16H ; WGR ENSURE THAT ANSI WAS THERE.. ;AN000; + JNE I10_3 ; WGR NO....CONT AS BEFORE ;AN000; + CMP D_MODE,ON ; WGR ARE WE IN A TEXT MODE? ;AN000; + JNE I10_3 ; WGR NO...CONT AS BEFORE.. ;AN000; + CMP SCR_ROWS,DEFAULT_LEN ; WGR IS IT JUST 25 LINES?.. ;AN000; + JE I10_3 ; WGR THEN...CONT AS BEFORE.. ;AN000; + POP AX ; WGR GREATER THAN 25 LINES SO...POP OFF.. ;AN000; + MOV CS:RE_CALC,RECALC_ON ; WGR RECALCULATION REQUIRED ;AN000; + MOV CS:SETMODE_FLAG,ON ; WGR A MODE SET IS REQUIRED ;AN000; + MOV AL,EIGHT ; WGR OLD FONT SIZE AND USE AN 8 HIGH BOX. ;AN000; + JMP I10_4 ; WGR ;AN000; + ; +I10_3: POP AX ; WGR RESTORE OLD VALUE ;AN000; + MOV CS:SETMODE_FLAG,OFF ; WGR NO MODE SET IS REQUIRED. ;AN000; + ; +I10_4: MOV BYTES_PER_CHAR,AL ; SAVE VALUE DETERMINED + ; + MOV CX,CPD_ACTIVE ; + CMP CX,-1 ; CHECK IF ACTIVE CP=PLACE_HOLDER + JE I10_A ; IF SO, THEN STAY SLEEPING + ; + PUSH CX ; + CALL FIND_CP ; DETERMINE IF THE CODE PAGE=HDWR + MOV BL,CL ; + POP CX ; RESTORE CP VALUE FOR FUTURE REF + JC I10_A ; + MOV CHARACTER_SOURCE,BL ; + OR BL,BL ; TEST TYPE OF CP? + JE I10_B ; IF CODE PAGE=HDWR THEN RESOLUTION OK! + ; + CALL FIND_FONT ; CHECK IF THE FONT RESOLUTION IS HERE + JC I10_A ; IF CY=0 THEN ES:DI POINT TO FONT + MOV CS:CP_DI,DI ; + MOV DI,ES ; + MOV CS:CP_ES,DI ; + JUMP I10_B ; + ; +I10_A: XOR AX,AX ; + STC ; +I10_B: POP ES ; + POP DS ; + POP DI ; + POP SI ; + POP DX ; WGR ;AN000; + POP CX ; + POP BX ; + MOV CS:LOAD_CP_SEMA,ZERO ; SET ROUTINE NOW COMPLETED.... + RET ; +TEST_CP ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; INVOKE DATA +; +; THIS ROUTINE PERFORMS THE LOADING OF THE CODE PAGE +; INFORMATION. IT USES THE POINTERS FROM THE TEST_CP +; ROUTINE. +; +; ENTRY: +; CP_ES points to the actual data of CP segment +; CP_DI points to the actual data of CP offset +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +INVOKE_DATA PROC ; + PUSH BX ; + PUSH CX ; + PUSH SI ; + PUSH DI ; + PUSH DS ; + PUSH ES ; + ; + MOV DI,CS:CP_ES ; GET THE ES:DI COMBO FROM TEST_CP + MOV ES,DI ; + MOV DI,CS:CP_DI ; + ; + XOR AH,AH ; + MOV AL,MODE_VALUE ; CREATE INDEX TO GET LOAD_MECH + MOV SI,AX ; + MOV AL,[SI].LOAD_MECH ; + MOV LOAD_MECHANISM,AL ; SAVE THIS VALUE FOR OTHER ROUTINES + TEST AL,MASK_BIOS_LOAD ; FIND OUT IF INT 10H SUPPORTS + JZ INV_7 ; + ; + MOV CX,256 ; **** HARD CODED COUNT **** + MOV BH,BYTES_PER_CHAR ; + CALL BIOS_LOAD ; GET BIOS CODE TO GIVE THE CP SUPPORT + JC INV_A ; + ; +INV_7: TEST AL,MASK_VECTOR_LOAD ; + JZ INV_8 ; + ; + CALL VECTOR_LOAD ; ESTABLISH THE VECTORS FOR CP SUPPORT + JC INV_A ; + ; +INV_8: CLC ; + JUMP INV_B ; +INV_A: XOR AX,AX ; + STC ; +INV_B: POP ES ; + POP DS ; + POP DI ; + POP SI ; + POP CX ; + POP BX ; + RET ; +INVOKE_DATA ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; GET_CURSOR_POSITION +; +; This routine is called by BIOS_LOAD. It is used +; to ask for the cursor position before a character +; download...since BIOS puts the cursor to (1,1). +; +; +; INPUT: +; none +; OUTPUT: +; BX = page number +; DX = cursor position +; +; DS = CS assumed +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +ACTIVE_PAGE DW ? ; +CURSOR_POS DW ? ; + ; +GET_CURSOR_POS PROC ; + PUSHF ; + PUSH DX ; + PUSH CX ; + PUSH BX ; + PUSH AX ; + MOV AH,15 ; CALL TO GET CURRENT_VIDEO_STATE + PUSHF ; + CALL DWORD PTR CS:ROM_INT_10 ; call routine to handle the command + MOV ACTIVE_PAGE,BX ; + ; + MOV AH,3 ; + PUSHF ; + CALL DWORD PTR CS:ROM_INT_10 ; call routine to handle the command + MOV CURSOR_POS,DX ; + POP AX ; + POP BX ; + POP CX ; + POP DX ; + POPF ; + RET ; +GET_CURSOR_POS ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; SET_CURSOR_POSITION +; +; This routine is called by BIOS_LOAD. It is used +; to tell BIOS where to put the cursor. +; +; INPUT: +; BX = page number +; DX = cursor position +; OUTPUT: +; none +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +SET_CURSOR_POS PROC ; + PUSHF ; + PUSH DX ; + PUSH BX ; + PUSH AX ; + MOV AH,2 ; + MOV BX,ACTIVE_PAGE ; + MOV DX,CURSOR_POS ; + PUSHF ; + CALL DWORD PTR CS:ROM_INT_10 ; call routine to handle the command + POP AX ; + POP BX ; + POP DX ; + POPF ; + RET ; +SET_CURSOR_POS ENDP ; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Info_Ansi_ModeSet +; +; INPUT:None +; OUTPUT:None +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +Info_Ansi_ModeSet proc near + push ax + push dx + push ds + push si + pushf + push cs + pop ds + lea si, ANSI_DA_INFO + mov [si].DA_SETMODE_FLAG, 1 ;Tell ANSI we are calling int10h, Set Mode funciton + mov dx, si + mov ah, ANSI_2F + mov al, DA_INFO_2F + int 2fh ;We don't worry about whether ANSI installed or not. + popf + pop si + pop ds + pop dx + pop ax + ret +Info_Ansi_ModeSet endp + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Info_Ansi_ModeDone +; +; INPUT:None +; OUTPUT:None +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +Info_Ansi_ModeDone proc near + push ax + push dx + push ds + push si + pushf + push cs + pop ds + lea si, ANSI_DA_INFO + mov [si].DA_SETMODE_FLAG, 0 ;Tell ANSI we are done with int10h, Set Mode funciton + mov dx, si + mov ah, ANSI_2F + mov al, DA_INFO_2F + int 2fh ;We don't worry about whether ANSI installed or not. + popf + pop si + pop ds + pop dx + pop ax + ret +Info_Ansi_ModeDone endp + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/v4.0/src/DEV/DISPLAY/INT2FCOM.INC b/v4.0/src/DEV/DISPLAY/INT2FCOM.INC new file mode 100644 index 0000000..c6007a6 --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/INT2FCOM.INC @@ -0,0 +1,323 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; INTERRUPT 2F HEX COMMUNICATION ROUTINE +; +; This routine is used to communicate between the CON driver +; and the Keyboard routine. The various calls are as follows: +; +; 1) not yet defined +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +IF1 ; + %OUT . INT2FCOM.INC +ENDIF ; + PUBLIC ROM_INT_2F ; + PUBLIC INT_2F_COM ; + PUBLIC ABORT ; + ; +CON_REQ LABEL WORD ; THESE CALLS START AT '00H' + DW OFFSET CON_INSTALL ; + DW OFFSET CON_INVOKE ; + DW OFFSET CON_QUERY_CP ; + DW OFFSET CON_QUERY_PARAMETER ; +CON_MAX EQU ($-CON_REQ)/2 ; + ; +QPARM_TABLE LABEL WORD ; + DW OFFSET CPD_DESG_N ; + DW OFFSET CPD_FONTS_N ; + DW OFFSET CPD_HDWR_N ; +QPARM_ENTRY EQU ($-QPARM_TABLE)/2 ; + ; +ROM_INT_2F DW ? ; Int 2FH vector offset + DW ? ; Int 2FH vector segment +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; INTERRUPT 2F HEX +; +; Communication between the KEYBOARD (KEYB.COM) and the +; CON Device Driver. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +INT_2F_COM PROC FAR ; + STI ; + CMP AH,0ADH ; TEST THE SUBFUNCTION CALL + JNE I2C_6 ; RESERVED FOR THE COM PATH! + ; + CMP AL,10H ; WGR ;AN000; + JNE I2C_0 ; WGR ;AN000; + CALL CHECK_VALID ; WGR ;AN000; + PUSH SI ; WGR ;AN000; + JMP I2C_1 ; WGR ;AN000; +I2C_0: ; WGR + CMP AL,CON_MAX ; TEST IF IT IS ABOVE HIGH + JAE I2C_6 ; CON CALL? + ; + PUSH SI ; FORMULATE THE JUMP POINTER + PUSH AX ; + XOR AH,AH ; + MOV SI,AX ; + POP AX ; + ADD SI,SI ; + CALL CS:CON_REQ[SI] ; call routine to handle the command +I2C_1: ; + PUSH AX ; SAVE AX REGISTER TO PLAY WITH STACK + MOV SI,SP ; + MOV AX,SS:[SI+8] ; ACCOUNT FOR SI & AX ON STACK + JC I2C_2 ; + AND AX,NOT_CY ; + JUMP I2C_3 ; +I2C_2: OR AX,CY ; +I2C_3: MOV SS:[SI+8],AX ; + POP AX ; + POP SI ; +ABORT: IRET ; +I2C_6: JMP DWORD PTR CS:ROM_INT_2F ; +INT_2F_COM ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; CON_INSTALL +; +; A STRAIGHT FORWARD ROUTINE WHICH INDICATES WHETHER OR NOT +; ANY PC DOS CPS-CON SUPPORT WAS LOADED DURING BOOTSTRAP. +; THE INTERFACE IS AS PER 'DOS FUNCTIONAL SPEC' +; (Program Interfaces). +; +; INPUT: +; none +; +; OUTPUT: +; AX = (-1) if loaded +; no change if not....since this is not even loaded! +; BX = [upper nibble][lower nibble] = MAJOR - MINOR +; release number. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +CON_INSTALL PROC ; + MOV AX,-1 ; CHANGE AX TO '0FFFFH' AND BX TO + MOV BX,0100H ; MAJOR - MINOR VERSION # + CLC ; NO ERROR TO INDICATE.... + RET ; +CON_INSTALL ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; CHECK_VALID +; +; THIS ROUTINE CHECKS TO SEE IF THE CURRENT CODE PAGE HAS BEEN +; PREPARED FOR AN 8X8 RAM FONT. THIS IS AN INTERFACE TO ANSI.SYS +; TO ENSURE THAT A REQUEST FOR > 25 LINES IS VALID. +; +; INPUT: +; none +; +; OUTPUT: +; CF = 1 IF NOT FONT NOT AVAILABLE +; = 0 IF FONT IS AVAILABLE. +; +; AUTHOR: WGR +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +CHECK_VALID PROC ; ;AN000; + CMP CS:CPD_ACTIVE,-1 ; see if a code page has been.. ;AN000; + JNE CV_1 ; selected? ;AN000; + CLC ; no..therefore hardware code page.. ;AN000; + JMP CV_4 ; okay...exit with carry clear. ;AN000; +CV_1: ; ;AN000; + PUSH BX ; s ;AN000; + PUSH CX ; a ;AN000; + PUSH DX ; v ;AN000; + PUSH DI ; e ;AN000; + PUSH SI ; r ;AN000; + PUSH DS ; e ;AN000; + PUSH ES ; g ;AN000; + PUSH CS ; s. ;AN000; + POP DS ; establish addressibility to data ;AN000; + MOV CX,CPD_ACTIVE ; use active code page... ;AN000; + CALL FIND_CP ; is the code page prepared? ;AN000; + JC CV_3 ; no....problem..exit with carry set. ;AN000; + CMP CX,0 ; okay...check if hardware code page? ;AN000; + JNE CV_2 ; ;AN000; + CLC ; yes...so okay...exit with carry clear;AN000; + JMP CV_3 ; ;AN000; +CV_2: ; ;AN000; + MOV DL,CS:BYTES_PER_CHAR ; save current box size.. ;AN000; + PUSH DX ; ;AN000; + MOV CS:BYTES_PER_CHAR,8 ; check for 8x8 box (>25 line support) ;AN000; + CALL FIND_FONT ; is font size there?? ;AN000; + POP DX ; ;AN000; + MOV CS:BYTES_PER_CHAR,DL ; restore old box size...FIND_FONT... ;AN000; +CV_3: ; will have returned.. ;AN000; + POP ES ; with carry set appropriately ;AN000; + POP DS ; ;AN000; + POP SI ; restore ;AN000; + POP DI ; ;AN000; + POP DX ; registers. ;AN000; + POP CX ; ;AN000; + POP BX ; ;AN000; +CV_4: ; ;AN000; + RET ; return. ;AN000; +CHECK_VALID ENDP ; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; CON_INVOKE +; +; THIS ROUTINE IS A SECOND INTERFACE TO THE CPS CON DEVICE +; TO ACTIVATE A PARTICULAR CODE PAGE. THIS MAKE USE OF THE +; SAME ROUTINES AS THE GENERIC IOCTL CALLS (via INT 21H). +; A SEMAPHORE IS PROVIDED BY THE IOCTL CALLS TO PREVENT +; RE-ENTRANCY....WHICH MAY CAUSE INTERESTING RESULTS!! +; +; INPUT: +; BX = code page to activate +; +; OUTPUT: +; CY = 0 if CP was activated +; 1 if an error occurred during activation +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +CON_INVOKE PROC ; + PUSH DS ; + PUSH ES ; + CMP CS:G_IOCTL_SEMA,ONE ; ARE GENERIC IOCTL ROUTINES ACTIVE??? + JE CI_3 ; IF SO, THEN EXIT WITH ERROR... + ; + PUSH CS ; + POP DS ; + PUSH CS ; + POP ES ; + PUSH CPD_ACTIVE ; + MOV CPD_ACTIVE,BX ; SET THE ACTIVE CP = REQUESTED + CALL TEST_CP ; FIND OUT IF CP IS THERE.... + POP CPD_ACTIVE ; + JC CI_3 ; IF CY=1, THEN LEAVE OLD CP ALONE! + CALL INVOKE_DATA ; LOAD THE DATA.... + JC CI_3 ; IF ERROR, THEN FONT NOT AVAILABLE + MOV CPD_ACTIVE,BX ; + PUSH DX ; + MOV DX,BX ; + CALL SIGNAL_KBD_INVK ; + POP DX ; + JC CI_3 ; SET CARRY IF KEYBOARD ERROR OCCURRED. + CLC ; NO ERROR TO INDICATE.... + POP ES ; + POP DS ; + RET ; +CI_3: STC ; + POP ES ; + POP DS ; + RET ; +CON_INVOKE ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; CON_QUERY_CP +; +; RETURNS THE ACTIVE CODE PAGE VALUE....CPD_ACTIVE VALUE +; CHECKED FOR INVALID. +; +; INPUT: +; none +; OUTPUT: +; BX = CODE PAGE ACTIVATED <-1 IF NONE ACTIVE> +; CY = 1 IF CP INVALID (BX = -1) +; 0 IF CP VALID +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +CON_QUERY_CP PROC ; + MOV BX,CS:CPD_ACTIVE ; + CMP BX,-1 ; + JNE CQCP_0 ; + MOV AX,ONE ; SET ERROR CONDITION TO (non-active) + STC ; + RET ; +CQCP_0: CLC ; + RET ; +CON_QUERY_CP ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; QUERY PARAMETER INFORMATION +; +; ENTRY: ES:DI points to data table +; CX = max size of table to fill (in bytes) +; EXIT: ES:DI filled with formatted data; DW #DESG,#FONTS,#HDWR,CPx's +; CY = 1 if problem with table creation +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +CON_QUERY_PARAMETER PROC ; + PUSH DS ; + PUSH AX ; + PUSH BX ; + PUSH CX ; + PUSH DI ; + ; + PUSH CS ; + POP DS ; + ; PERFORM CHECK ON LGTH OF BUFFER + MOV BX,THREE ; MANDATORY THREE WORD-STARTER + ADD BX,CPD_HDWR_N ; ADD # CP's IN HARDWARE + ADD BX,CPD_DESG_N ; ADD # CP's IN DESIGNATION + SHL BX,1 ; CONVERT TO BYTES + CMP BX,CX ; VERIFY THAT TABLE WILL FIT... + JG CQP_3 ; SET ERROR CONDITION! + ; + LEA BX,QPARM_TABLE ; + MOV CX,QPARM_ENTRY ; +CQP_0: MOV SI,[BX] ; + MOV AX,[SI] ; + MOV ES:[DI],AX ; + INC BX ; + INC BX ; + INC DI ; + INC DI ; + LOOP CQP_0 ; + ; + CALL GET_HDWR_CP ; + MOV CX,[SI] ; + OR CX,CX ; + JZ CQP_1 ; + INC SI ; + INC SI ; + REP MOVSW ; + ; +CQP_1: CALL GET_DESG_CP ; + MOV CX,[SI] ; + OR CX,CX ; + JE CQP_2 ; + INC SI ; + INC SI ; + REP MOVSW ; + ; +CQP_2: POP DI ; + POP CX ; + POP BX ; + POP AX ; + POP DS ; + CLC ; CLEAR ERROR CONDITION! + RET ; + ; +CQP_3: POP DI ; + POP CX ; + POP BX ; + POP AX ; + POP DS ; + STC ; TELL CALLER THAT ERROR OCCURRED! + RET ; +CON_QUERY_PARAMETER ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; SIGNAL KEYBOARD THAT INVOKE JUST OCCURRED! +; +; INPUT: +; DX = code page just invoked! +; OUTPUT: +; none +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +SIGNAL_KBD_INVK PROC ; + PUSH AX ; + PUSH BX ; + MOV AX,0AD81H ; + MOV BX,DX ; + CLC ; CLEAR THE CARRY IN CASE NOT THERE + INT 2FH ; + POP BX ; + POP AX ; + RET ; +SIGNAL_KBD_INVK ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/v4.0/src/DEV/DISPLAY/LCD/437-CPI.ASM b/v4.0/src/DEV/DISPLAY/LCD/437-CPI.ASM new file mode 100644 index 0000000..7fa54e0 --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/LCD/437-CPI.ASM @@ -0,0 +1,290 @@ +CODE SEGMENT BYTE PUBLIC 'CODE' + ASSUME CS:CODE,DS:CODE + +IF1 + %OUT EGA.CPI creation file + %OUT . + %OUT CP SRC files: + %OUT . + %OUT . CODE PAGE: 437 +ENDIF + +EGA437: DW LEN_437 ;SIZE OF ENTRY HEADER + DW POST_EGA437,0 ;POINTER TO NEXT HEADER + DW 1 ;DEVICE TYPE + DB "LCD " ;DEVICE SUBTYPE ID + DW 437 ;CODE PAGE ID + DW 3 DUP(0) ;RESERVED + DW OFFSET DATA437,0 ;POINTER TO FONTS +LEN_437 EQU ($-EGA437) + +DATA437:DW 1 ;CART/NON-CART + DW 1 ;# OF FONTS + DW LEN_D437 ;LENGTH OF DATA +D437: ; + DB 8,8 ;CHARACTER BOX SIZE + DB 0,0 ;ASPECT RATIO (UNUSED) + DW 256 ;NUMBER OF CHARACTERS + Db 000h,000h,000h,000h,000h,000h,000h,000h ; Hex #0 + Db 03Ch,042h,0A5h,0A5h,081h,0BDh,05Ah,03Ch ; Hex #1 + Db 03Ch,07Eh,0DBh,0DBh,0FFh,0C3h,066h,03Ch ; Hex #2 + Db 036h,07Fh,07Fh,07Fh,03Eh,01Ch,008h,000h ; Hex #3 + Db 008h,01Ch,03Eh,07Fh,03Eh,01Ch,008h,000h ; Hex #4 + Db 01Ch,03Eh,01Ch,07Fh,07Fh,036h,008h,01Ch ; Hex #5 + Db 008h,01Ch,03Eh,07Fh,07Fh,036h,008h,01Ch ; Hex #6 + Db 000h,000h,018h,03Ch,03Ch,018h,000h,000h ; Hex #7 + Db 0FFh,0FFh,0E7h,0C3h,0C3h,0E7h,0FFh,0FFh ; Hex #8 + Db 000h,000h,03Ch,066h,066h,03Ch,000h,000h ; Hex #9 + Db 0FFh,0FFh,0C3h,099h,099h,0C3h,0FFh,0FFh ; Hex #A + Db 007h,003h,03Eh,066h,066h,066h,03Ch,000h ; Hex #B + Db 03Ch,066h,066h,066h,03Ch,018h,03Ch,018h ; Hex #C + Db 008h,00Ch,00Eh,00Ah,00Ah,008h,038h,030h ; Hex #D + Db 018h,016h,019h,017h,071h,061h,007h,006h ; Hex #E + Db 048h,06Bh,03Eh,0E4h,027h,07Ch,0D6h,012h ; Hex #F + Db 040h,070h,07Ch,07Fh,07Ch,070h,040h,000h ; Hex #10 + Db 001h,007h,01Fh,07Fh,01Fh,007h,001h,000h ; Hex #11 + Db 018h,03Ch,07Eh,018h,018h,07Eh,03Ch,018h ; Hex #12 + Db 036h,036h,036h,036h,036h,000h,036h,000h ; Hex #13 + Db 03Fh,06Ah,06Ah,03Ah,00Ah,00Ah,01Ah,000h ; Hex #14 + Db 03Ch,076h,038h,06Ch,036h,01Ch,06Eh,03Ch ; Hex #15 + Db 000h,000h,000h,07Fh,07Fh,07Fh,000h,000h ; Hex #16 + Db 018h,03Ch,07Eh,018h,07Eh,03Ch,018h,0FFh ; Hex #17 + Db 018h,03Ch,07Eh,05Ah,018h,018h,018h,000h ; Hex #18 + Db 018h,018h,018h,05Ah,07Eh,03Ch,018h,000h ; Hex #19 + Db 000h,00Ch,006h,07Fh,07Fh,006h,00Ch,000h ; Hex #1A + Db 000h,018h,030h,07Fh,07Fh,030h,018h,000h ; Hex #1B + Db 000h,000h,060h,060h,07Fh,07Fh,000h,000h ; Hex #1C + Db 000h,014h,036h,07Fh,07Fh,036h,014h,000h ; Hex #1D + Db 008h,008h,01Ch,01Ch,03Eh,03Eh,07Fh,000h ; Hex #1E + Db 07Fh,03Eh,03Eh,01Ch,01Ch,008h,008h,000h ; Hex #1F + Db 000h,000h,000h,000h,000h,000h,000h,000h ; Hex #20 + Db 018h,018h,018h,018h,018h,000h,018h,000h ; Hex #21 + Db 036h,036h,014h,000h,000h,000h,000h,000h ; Hex #22 + Db 00Ah,00Ah,03Fh,014h,07Eh,028h,028h,000h ; Hex #23 + Db 008h,03Eh,068h,03Eh,00Bh,07Eh,008h,000h ; Hex #24 + Db 001h,03Fh,052h,06Ch,01Bh,035h,076h,000h ; Hex #25 + Db 01Ch,036h,01Ch,03Bh,06Eh,066h,03Bh,000h ; Hex #26 + Db 018h,018h,030h,000h,000h,000h,000h,000h ; Hex #27 + Db 006h,00Ch,018h,018h,018h,00Ch,006h,000h ; Hex #28 + Db 030h,018h,00Ch,00Ch,00Ch,018h,030h,000h ; Hex #29 + Db 000h,036h,01Ch,07Fh,01Ch,036h,000h,000h ; Hex #2A + Db 000h,018h,018h,07Eh,018h,018h,000h,000h ; Hex #2B + Db 000h,000h,000h,000h,000h,018h,018h,030h ; Hex #2C + Db 000h,000h,000h,07Eh,000h,000h,000h,000h ; Hex #2D + Db 000h,000h,000h,000h,000h,018h,018h,000h ; Hex #2E + Db 003h,006h,00Ch,018h,030h,060h,040h,000h ; Hex #2F + Db 018h,02Ch,066h,066h,066h,034h,018h,000h ; Hex #30 + Db 018h,018h,038h,018h,018h,018h,03Ch,000h ; Hex #31 + Db 03Ch,066h,066h,00Ch,018h,032h,07Eh,000h ; Hex #32 + Db 03Ch,066h,00Ch,01Ch,006h,066h,03Ch,000h ; Hex #33 + Db 00Ch,01Ch,02Ch,06Ch,07Eh,00Ch,01Eh,000h ; Hex #34 + Db 07Eh,060h,07Ch,066h,006h,066h,03Ch,000h ; Hex #35 + Db 01Ch,030h,060h,07Ch,066h,066h,03Ch,000h ; Hex #36 + Db 07Eh,066h,04Ch,00Ch,018h,018h,038h,000h ; Hex #37 + Db 03Ch,066h,076h,03Ch,06Eh,066h,03Ch,000h ; Hex #38 + Db 03Ch,066h,066h,03Eh,006h,00Ch,038h,000h ; Hex #39 + Db 000h,018h,018h,000h,000h,018h,018h,000h ; Hex #3A + Db 000h,018h,018h,000h,000h,018h,018h,030h ; Hex #3B + Db 006h,00Ch,018h,030h,018h,00Ch,006h,000h ; Hex #3C + Db 000h,000h,07Eh,000h,07Eh,000h,000h,000h ; Hex #3D + Db 030h,018h,00Ch,006h,00Ch,018h,030h,000h ; Hex #3E + Db 03Ch,066h,026h,00Ch,018h,000h,018h,000h ; Hex #3F + Db 03Eh,041h,05Dh,055h,05Fh,040h,03Eh,000h ; Hex #40 + Db 01Ch,00Ch,01Ch,016h,03Eh,023h,063h,000h ; Hex #41 + Db 07Ch,036h,036h,03Eh,033h,033h,07Eh,000h ; Hex #42 + Db 01Dh,033h,061h,060h,060h,031h,01Eh,000h ; Hex #43 + Db 07Ch,036h,033h,033h,033h,036h,07Ch,000h ; Hex #44 + Db 07Fh,031h,034h,03Ch,034h,031h,07Fh,000h ; Hex #45 + Db 07Fh,031h,034h,03Ch,034h,030h,078h,000h ; Hex #46 + Db 01Dh,033h,061h,060h,067h,033h,01Fh,000h ; Hex #47 + Db 066h,066h,066h,07Eh,066h,066h,066h,000h ; Hex #48 + Db 03Ch,018h,018h,018h,018h,018h,03Ch,000h ; Hex #49 + Db 01Fh,006h,006h,006h,066h,066h,03Ch,000h ; Hex #4A + Db 067h,066h,06Ch,078h,06Ch,066h,067h,000h ; Hex #4B + Db 078h,030h,030h,030h,031h,033h,07Fh,000h ; Hex #4C + Db 041h,063h,077h,07Fh,06Bh,063h,063h,000h ; Hex #4D + Db 043h,063h,073h,07Bh,06Fh,067h,063h,000h ; Hex #4E + Db 01Ch,036h,063h,063h,063h,036h,01Ch,000h ; Hex #4F + Db 07Eh,033h,033h,03Eh,030h,030h,078h,000h ; Hex #50 + Db 01Ch,036h,063h,063h,06Bh,036h,01Ch,007h ; Hex #51 + Db 07Ch,066h,066h,07Ch,06Ch,066h,067h,000h ; Hex #52 + Db 03Eh,066h,070h,03Ch,00Eh,066h,07Ch,000h ; Hex #53 + Db 07Eh,05Ah,018h,018h,018h,018h,03Ch,000h ; Hex #54 + Db 063h,063h,063h,063h,063h,063h,03Eh,000h ; Hex #55 + Db 077h,062h,036h,034h,01Ch,018h,008h,000h ; Hex #56 + Db 063h,063h,06Bh,06Bh,03Eh,036h,022h,000h ; Hex #57 + Db 066h,066h,03Ch,018h,03Ch,066h,066h,000h ; Hex #58 + Db 0E7h,066h,034h,018h,018h,018h,03Ch,000h ; Hex #59 + Db 07Eh,066h,04Ch,018h,032h,066h,07Eh,000h ; Hex #5A + Db 01Eh,018h,018h,018h,018h,018h,01Eh,000h ; Hex #5B + Db 060h,030h,018h,00Ch,006h,003h,001h,000h ; Hex #5C + Db 03Ch,00Ch,00Ch,00Ch,00Ch,00Ch,03Ch,000h ; Hex #5D + Db 008h,01Ch,036h,000h,000h,000h,000h,000h ; Hex #5E + Db 000h,000h,000h,000h,000h,000h,000h,0FFh ; Hex #5F + Db 030h,018h,00Ch,000h,000h,000h,000h,000h ; Hex #60 + Db 000h,000h,03Ch,066h,01Eh,066h,07Bh,000h ; Hex #61 + Db 070h,030h,03Eh,03Bh,033h,03Bh,06Eh,000h ; Hex #62 + Db 000h,000h,03Eh,066h,060h,066h,03Ch,000h ; Hex #63 + Db 00Eh,006h,036h,06Eh,066h,066h,03Bh,000h ; Hex #64 + Db 000h,000h,03Ch,066h,07Eh,060h,03Eh,000h ; Hex #65 + Db 00Eh,01Bh,018h,03Eh,018h,018h,03Ch,000h ; Hex #66 + Db 000h,000h,03Dh,066h,038h,03Eh,063h,03Eh ; Hex #67 + Db 070h,030h,036h,03Bh,033h,033h,073h,000h ; Hex #68 + Db 018h,000h,038h,018h,018h,018h,03Ch,000h ; Hex #69 + Db 00Ch,000h,01Ch,00Ch,00Ch,06Ch,06Ch,038h ; Hex #6A + Db 070h,030h,033h,036h,03Ch,036h,077h,000h ; Hex #6B + Db 038h,018h,018h,018h,018h,018h,03Ch,000h ; Hex #6C + Db 000h,000h,076h,07Fh,06Bh,06Bh,06Bh,000h ; Hex #6D + Db 000h,000h,076h,03Bh,033h,033h,073h,000h ; Hex #6E + Db 000h,000h,03Ch,066h,066h,066h,03Ch,000h ; Hex #6F + Db 000h,000h,06Eh,033h,033h,03Eh,030h,078h ; Hex #70 + Db 000h,000h,03Ah,066h,066h,03Eh,006h,00Fh ; Hex #71 + Db 000h,000h,06Eh,03Bh,033h,030h,078h,000h ; Hex #72 + Db 000h,000h,03Eh,070h,03Ch,00Eh,07Ch,000h ; Hex #73 + Db 008h,018h,03Eh,018h,018h,01Ah,00Ch,000h ; Hex #74 + Db 000h,000h,066h,066h,066h,066h,03Bh,000h ; Hex #75 + Db 000h,000h,073h,032h,036h,01Ch,008h,000h ; Hex #76 + Db 000h,000h,06Bh,06Bh,07Fh,036h,022h,000h ; Hex #77 + Db 000h,000h,073h,036h,01Ch,036h,067h,000h ; Hex #78 + Db 000h,000h,077h,033h,01Ah,00Ch,06Ch,038h ; Hex #79 + Db 000h,000h,07Eh,04Ch,018h,032h,07Eh,000h ; Hex #7A + Db 00Eh,018h,018h,070h,018h,018h,00Eh,000h ; Hex #7B + Db 018h,018h,018h,018h,018h,018h,018h,000h ; Hex #7C + Db 070h,018h,018h,00Eh,018h,018h,070h,000h ; Hex #7D + Db 039h,04Eh,000h,000h,000h,000h,000h,000h ; Hex #7E + Db 008h,01Ch,01Ch,036h,026h,063h,07Fh,07Fh ; Hex #7F + Db 01Dh,033h,061h,060h,060h,031h,00Eh,01Ch ; Hex #80 + Db 06Ch,000h,066h,066h,066h,066h,03Bh,000h ; Hex #81 + Db 00Eh,018h,03Ch,066h,07Eh,060h,03Eh,000h ; Hex #82 + Db 018h,03Ch,03Ch,066h,01Eh,066h,07Bh,000h ; Hex #83 + Db 036h,000h,03Ch,066h,01Eh,066h,07Bh,000h ; Hex #84 + Db 030h,018h,03Ch,066h,01Eh,066h,07Bh,000h ; Hex #85 + Db 018h,018h,03Ch,066h,01Eh,066h,07Bh,000h ; Hex #86 + Db 000h,000h,03Eh,066h,060h,036h,01Ch,038h ; Hex #87 + Db 018h,03Ch,03Ch,066h,07Eh,060h,03Eh,000h ; Hex #88 + Db 036h,000h,03Ch,066h,07Eh,060h,03Eh,000h ; Hex #89 + Db 030h,018h,03Ch,066h,07Eh,060h,03Eh,000h ; Hex #8A + Db 06Ch,000h,038h,018h,018h,018h,03Ch,000h ; Hex #8B + Db 018h,03Ch,000h,038h,018h,018h,03Ch,000h ; Hex #8C + Db 030h,018h,000h,038h,018h,018h,03Ch,000h ; Hex #8D + Db 036h,008h,01Ch,016h,036h,03Fh,063h,000h ; Hex #8E + Db 01Ch,014h,01Ch,01Eh,036h,03Fh,063h,000h ; Hex #8F + Db 007h,00Ch,07Fh,031h,03Ch,031h,07Fh,000h ; Hex #90 + Db 000h,000h,076h,01Bh,03Fh,06Ch,077h,000h ; Hex #91 + Db 03Fh,03Dh,02Ch,03Eh,06Ch,06Dh,06Fh,000h ; Hex #92 + Db 018h,03Ch,03Ch,066h,066h,066h,03Ch,000h ; Hex #93 + Db 066h,000h,03Ch,066h,066h,066h,03Ch,000h ; Hex #94 + Db 070h,018h,03Ch,066h,066h,066h,03Ch,000h ; Hex #95 + Db 018h,03Ch,042h,066h,066h,066h,03Bh,000h ; Hex #96 + Db 070h,018h,066h,066h,066h,066h,03Bh,000h ; Hex #97 + Db 036h,000h,077h,033h,01Ah,00Ch,06Ch,038h ; Hex #98 + Db 063h,01Ch,036h,063h,063h,036h,01Ch,000h ; Hex #99 + Db 036h,041h,063h,063h,063h,063h,03Eh,000h ; Hex #9A + Db 006h,004h,03Ch,06Eh,068h,06Ah,03Ch,030h ; Hex #9B + Db 01Eh,033h,033h,07Ch,039h,05Bh,076h,000h ; Hex #9C + Db 066h,066h,03Ch,07Eh,018h,07Eh,018h,000h ; Hex #9D + Db 078h,06Ch,06Ch,07Ah,066h,06Fh,066h,003h ; Hex #9E + Db 00Eh,01Bh,018h,03Eh,018h,018h,058h,070h ; Hex #9F + Db 00Eh,018h,03Ch,066h,01Eh,066h,07Bh,000h ; Hex #A0 + Db 01Ch,030h,000h,038h,018h,018h,03Ch,000h ; Hex #A1 + Db 00Eh,018h,03Ch,066h,066h,066h,03Ch,000h ; Hex #A2 + Db 00Eh,018h,066h,066h,066h,066h,03Bh,000h ; Hex #A3 + Db 01Ah,02Ch,076h,03Bh,033h,033h,073h,000h ; Hex #A4 + Db 01Ah,02Ch,073h,07Bh,06Fh,067h,063h,000h ; Hex #A5 + Db 01Eh,036h,036h,01Fh,000h,03Fh,000h,000h ; Hex #A6 + Db 01Ch,036h,036h,01Ch,000h,03Eh,000h,000h ; Hex #A7 + Db 018h,000h,018h,030h,064h,066h,03Ch,000h ; Hex #A8 + Db 000h,000h,000h,07Eh,060h,060h,000h,000h ; Hex #A9 + Db 000h,000h,000h,07Eh,006h,006h,000h,000h ; Hex #AA + Db 060h,066h,06Ch,07Eh,03Bh,066h,04Ch,00Fh ; Hex #AB + Db 060h,066h,06Ch,07Bh,037h,06Bh,04Fh,003h ; Hex #AC + Db 018h,000h,018h,018h,018h,018h,018h,000h ; Hex #AD + Db 000h,01Bh,036h,06Ch,06Ch,036h,01Bh,000h ; Hex #AE + Db 000h,06Ch,036h,01Bh,01Bh,036h,06Ch,000h ; Hex #AF + Db 011h,044h,011h,044h,011h,044h,011h,044h ; Hex #B0 + Db 055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh ; Hex #B1 + Db 0EEh,0BBh,0EEh,0BBh,0EEh,0BBh,0EEh,0BBh ; Hex #B2 + Db 018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B3 + Db 018h,018h,018h,0F8h,0F8h,018h,018h,018h ; Hex #B4 + Db 018h,018h,0F8h,0F8h,018h,0F8h,018h,018h ; Hex #B5 + Db 034h,034h,034h,0F4h,0F4h,034h,034h,034h ; Hex #B6 + Db 000h,000h,000h,0F8h,0FCh,034h,034h,034h ; Hex #B7 + Db 000h,000h,0F0h,0F8h,018h,0F8h,018h,018h ; Hex #B8 + Db 034h,034h,0F4h,0F4h,004h,0F4h,034h,034h ; Hex #B9 + Db 034h,034h,034h,034h,034h,034h,034h,034h ; Hex #BA + Db 000h,000h,0F8h,0FCh,004h,0F4h,034h,034h ; Hex #BB + Db 034h,034h,0F4h,0F4h,004h,0FCh,000h,000h ; Hex #BC + Db 034h,034h,034h,0FCh,0FCh,000h,000h,000h ; Hex #BD + Db 018h,018h,0F8h,0F8h,018h,0F8h,000h,000h ; Hex #BE + Db 000h,000h,000h,0F8h,0F8h,018h,018h,018h ; Hex #BF + Db 018h,018h,018h,01Fh,01Fh,000h,000h,000h ; Hex #C0 + Db 018h,018h,018h,0FFh,0FFh,000h,000h,000h ; Hex #C1 + Db 000h,000h,000h,0FFh,0FFh,018h,018h,018h ; Hex #C2 + Db 018h,018h,018h,01Fh,01Fh,018h,018h,018h ; Hex #C3 + Db 000h,000h,000h,0FFh,0FFh,000h,000h,000h ; Hex #C4 + Db 018h,018h,018h,0FFh,0FFh,018h,018h,018h ; Hex #C5 + Db 018h,018h,01Fh,01Fh,018h,01Fh,018h,018h ; Hex #C6 + Db 034h,034h,034h,037h,037h,034h,034h,034h ; Hex #C7 + Db 034h,034h,037h,037h,030h,01Fh,000h,000h ; Hex #C8 + Db 000h,000h,03Fh,03Fh,030h,037h,034h,034h ; Hex #C9 + Db 034h,034h,0F7h,0F7h,000h,0FFh,000h,000h ; Hex #CA + Db 000h,000h,0FFh,0FFh,000h,0F7h,034h,034h ; Hex #CB + Db 034h,034h,037h,037h,030h,037h,034h,034h ; Hex #CC + Db 000h,000h,0FFh,0FFh,000h,0FFh,000h,000h ; Hex #CD + Db 034h,034h,0F7h,0F7h,000h,0F7h,034h,034h ; Hex #CE + Db 018h,018h,0FFh,0FFh,000h,0FFh,000h,000h ; Hex #CF + Db 034h,034h,034h,0FFh,0FFh,000h,000h,000h ; Hex #D0 + Db 000h,000h,0FFh,0FFh,000h,0FFh,018h,018h ; Hex #D1 + Db 000h,000h,000h,0FFh,0FFh,034h,034h,034h ; Hex #D2 + Db 034h,034h,034h,03Fh,01Fh,000h,000h,000h ; Hex #D3 + Db 018h,018h,01Fh,01Fh,018h,00Fh,000h,000h ; Hex #D4 + Db 000h,000h,01Fh,01Fh,018h,01Fh,018h,018h ; Hex #D5 + Db 000h,000h,000h,03Fh,03Fh,034h,034h,034h ; Hex #D6 + Db 034h,034h,034h,0FFh,0FFh,034h,034h,034h ; Hex #D7 + Db 018h,018h,0FFh,0FFh,018h,0FFh,018h,018h ; Hex #D8 + Db 018h,018h,018h,0F8h,0F8h,000h,000h,000h ; Hex #D9 + Db 000h,000h,000h,01Fh,01Fh,018h,018h,018h ; Hex #DA + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #DB + Db 000h,000h,000h,000h,0FFh,0FFh,0FFh,0FFh ; Hex #DC + Db 0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h ; Hex #DD + Db 00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh ; Hex #DE + Db 0FFh,0FFh,0FFh,0FFh,000h,000h,000h,000h ; Hex #DF + Db 000h,000h,03Dh,06Eh,066h,06Eh,03Bh,000h ; Hex #E0 + Db 03Ch,066h,06Ch,066h,063h,07Bh,06Eh,000h ; Hex #E1 + Db 07Fh,033h,031h,030h,030h,030h,078h,000h ; Hex #E2 + Db 000h,03Fh,07Eh,054h,014h,036h,066h,000h ; Hex #E3 + Db 07Fh,033h,018h,00Ch,018h,033h,07Fh,000h ; Hex #E4 + Db 000h,000h,03Fh,06Ch,06Ch,06Ch,038h,000h ; Hex #E5 + Db 000h,000h,033h,033h,033h,037h,06Dh,060h ; Hex #E6 + Db 000h,03Fh,07Eh,050h,018h,01Ch,00Ch,000h ; Hex #E7 + Db 01Ch,008h,03Eh,06Bh,03Eh,008h,01Ch,000h ; Hex #E8 + Db 01Ch,036h,063h,07Fh,063h,036h,01Ch,000h ; Hex #E9 + Db 01Ch,036h,063h,063h,036h,055h,077h,000h ; Hex #EA + Db 01Ch,030h,018h,02Ch,066h,066h,03Ch,000h ; Hex #EB + Db 000h,036h,07Fh,04Dh,059h,07Fh,036h,000h ; Hex #EC + Db 001h,003h,03Eh,067h,06Bh,073h,03Eh,040h ; Hex #ED + Db 000h,000h,01Eh,030h,03Eh,030h,01Eh,000h ; Hex #EE + Db 03Ch,066h,066h,066h,066h,066h,066h,000h ; Hex #EF + Db 000h,07Eh,000h,07Eh,000h,07Eh,000h,000h ; Hex #F0 + Db 018h,018h,07Eh,018h,018h,000h,07Eh,000h ; Hex #F1 + Db 060h,038h,00Eh,038h,060h,000h,07Eh,000h ; Hex #F2 + Db 006h,01Ch,070h,01Ch,006h,000h,07Eh,000h ; Hex #F3 + Db 00Eh,01Bh,01Ah,018h,018h,018h,018h,018h ; Hex #F4 + Db 018h,018h,018h,018h,058h,0D8h,070h,000h ; Hex #F5 + Db 018h,018h,000h,07Eh,000h,018h,018h,000h ; Hex #F6 + Db 000h,03Bh,06Eh,000h,03Bh,06Eh,000h,000h ; Hex #F7 + Db 01Ch,036h,036h,01Ch,000h,000h,000h,000h ; Hex #F8 + Db 000h,000h,018h,03Ch,018h,000h,000h,000h ; Hex #F9 + Db 000h,000h,000h,018h,000h,000h,000h,000h ; Hex #FA + Db 003h,002h,006h,024h,06Ch,038h,018h,010h ; Hex #FB + Db 076h,03Bh,033h,033h,033h,000h,000h,000h ; Hex #FC + Db 03Ch,066h,00Ch,038h,07Eh,000h,000h,000h ; Hex #FD + Db 000h,000h,03Ch,03Ch,03Ch,03Ch,000h,000h ; Hex #FE + Db 000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FF +LEN_D437 EQU ($-D437) + ; +POST_EGA437 EQU $ ; + ; +CODE ENDS + END + \ No newline at end of file diff --git a/v4.0/src/DEV/DISPLAY/LCD/850-CPI.ASM b/v4.0/src/DEV/DISPLAY/LCD/850-CPI.ASM new file mode 100644 index 0000000..317c65d --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/LCD/850-CPI.ASM @@ -0,0 +1,290 @@ +CODE SEGMENT BYTE PUBLIC 'CODE' + ASSUME CS:CODE,DS:CODE + +IF1 + %OUT EGA.CPI creation file + %OUT . + %OUT CP SRC files: + %OUT . + %OUT . CODE PAGE: 850 +ENDIF + +EGA850: DW LEN_850 ;SIZE OF ENTRY HEADER + DW POST_EGA850,0 ;POINTER TO NEXT HEADER + DW 1 ;DEVICE TYPE + DB "LCD " ;DEVICE SUBTYPE ID + DW 850 ;CODE PAGE ID + DW 3 DUP(0) ;RESERVED + DW OFFSET DATA850,0 ;POINTER TO FONTS +LEN_850 EQU ($-EGA850) + +DATA850:DW 1 ;CART/NON-CART + DW 1 ;# OF FONTS + DW LEN_D850 ;LENGTH OF DATA +D850: ; + DB 8,8 ;CHARACTER BOX SIZE + DB 0,0 ;ASPECT RATIO (UNUSED) + DW 256 ;NUMBER OF CHARACTERS + Db 000h,000h,000h,000h,000h,000h,000h,000h ; Hex #0 + Db 03Ch,042h,0A5h,0A5h,081h,0BDh,05Ah,03Ch ; Hex #1 + Db 03Ch,07Eh,0DBh,0DBh,0FFh,0C3h,066h,03Ch ; Hex #2 + Db 036h,07Fh,07Fh,07Fh,03Eh,01Ch,008h,000h ; Hex #3 + Db 008h,01Ch,03Eh,07Fh,03Eh,01Ch,008h,000h ; Hex #4 + Db 01Ch,03Eh,01Ch,07Fh,07Fh,036h,008h,01Ch ; Hex #5 + Db 008h,01Ch,03Eh,07Fh,07Fh,036h,008h,01Ch ; Hex #6 + Db 000h,000h,018h,03Ch,03Ch,018h,000h,000h ; Hex #7 + Db 0FFh,0FFh,0E7h,0C3h,0C3h,0E7h,0FFh,0FFh ; Hex #8 + Db 000h,000h,03Ch,066h,066h,03Ch,000h,000h ; Hex #9 + Db 0FFh,0FFh,0C3h,099h,099h,0C3h,0FFh,0FFh ; Hex #A + Db 007h,003h,03Eh,066h,066h,066h,03Ch,000h ; Hex #B + Db 03Ch,066h,066h,066h,03Ch,018h,03Ch,018h ; Hex #C + Db 008h,00Ch,00Eh,00Ah,00Ah,008h,038h,030h ; Hex #D + Db 018h,016h,019h,017h,071h,061h,007h,006h ; Hex #E + Db 048h,06Bh,03Eh,0E4h,027h,07Ch,0D6h,012h ; Hex #F + Db 040h,070h,07Ch,07Fh,07Ch,070h,040h,000h ; Hex #10 + Db 001h,007h,01Fh,07Fh,01Fh,007h,001h,000h ; Hex #11 + Db 018h,03Ch,07Eh,018h,018h,07Eh,03Ch,018h ; Hex #12 + Db 036h,036h,036h,036h,036h,000h,036h,000h ; Hex #13 + Db 03Fh,06Ah,06Ah,03Ah,00Ah,00Ah,01Ah,000h ; Hex #14 + Db 03Ch,076h,038h,06Ch,036h,01Ch,06Eh,03Ch ; Hex #15 + Db 000h,000h,000h,07Fh,07Fh,07Fh,000h,000h ; Hex #16 + Db 018h,03Ch,07Eh,018h,07Eh,03Ch,018h,0FFh ; Hex #17 + Db 018h,03Ch,07Eh,05Ah,018h,018h,018h,000h ; Hex #18 + Db 018h,018h,018h,05Ah,07Eh,03Ch,018h,000h ; Hex #19 + Db 000h,00Ch,006h,07Fh,07Fh,006h,00Ch,000h ; Hex #1A + Db 000h,018h,030h,07Fh,07Fh,030h,018h,000h ; Hex #1B + Db 000h,000h,060h,060h,07Fh,07Fh,000h,000h ; Hex #1C + Db 000h,014h,036h,07Fh,07Fh,036h,014h,000h ; Hex #1D + Db 008h,008h,01Ch,01Ch,03Eh,03Eh,07Fh,000h ; Hex #1E + Db 07Fh,03Eh,03Eh,01Ch,01Ch,008h,008h,000h ; Hex #1F + Db 000h,000h,000h,000h,000h,000h,000h,000h ; Hex #20 + Db 018h,018h,018h,018h,018h,000h,018h,000h ; Hex #21 + Db 036h,036h,014h,000h,000h,000h,000h,000h ; Hex #22 + Db 00Ah,00Ah,03Fh,014h,07Eh,028h,028h,000h ; Hex #23 + Db 008h,03Eh,068h,03Eh,00Bh,07Eh,008h,000h ; Hex #24 + Db 001h,03Fh,052h,06Ch,01Bh,035h,076h,000h ; Hex #25 + Db 01Ch,036h,01Ch,03Bh,06Eh,066h,03Bh,000h ; Hex #26 + Db 018h,018h,030h,000h,000h,000h,000h,000h ; Hex #27 + Db 006h,00Ch,018h,018h,018h,00Ch,006h,000h ; Hex #28 + Db 030h,018h,00Ch,00Ch,00Ch,018h,030h,000h ; Hex #29 + Db 000h,036h,01Ch,07Fh,01Ch,036h,000h,000h ; Hex #2A + Db 000h,018h,018h,07Eh,018h,018h,000h,000h ; Hex #2B + Db 000h,000h,000h,000h,000h,018h,018h,030h ; Hex #2C + Db 000h,000h,000h,07Eh,000h,000h,000h,000h ; Hex #2D + Db 000h,000h,000h,000h,000h,018h,018h,000h ; Hex #2E + Db 003h,006h,00Ch,018h,030h,060h,040h,000h ; Hex #2F + Db 018h,02Ch,066h,066h,066h,034h,018h,000h ; Hex #30 + Db 018h,018h,038h,018h,018h,018h,03Ch,000h ; Hex #31 + Db 03Ch,066h,066h,00Ch,018h,032h,07Eh,000h ; Hex #32 + Db 03Ch,066h,00Ch,01Ch,006h,066h,03Ch,000h ; Hex #33 + Db 00Ch,01Ch,02Ch,06Ch,07Eh,00Ch,01Eh,000h ; Hex #34 + Db 07Eh,060h,07Ch,066h,006h,066h,03Ch,000h ; Hex #35 + Db 01Ch,030h,060h,07Ch,066h,066h,03Ch,000h ; Hex #36 + Db 07Eh,066h,04Ch,00Ch,018h,018h,038h,000h ; Hex #37 + Db 03Ch,066h,076h,03Ch,06Eh,066h,03Ch,000h ; Hex #38 + Db 03Ch,066h,066h,03Eh,006h,00Ch,038h,000h ; Hex #39 + Db 000h,018h,018h,000h,000h,018h,018h,000h ; Hex #3A + Db 000h,018h,018h,000h,000h,018h,018h,030h ; Hex #3B + Db 006h,00Ch,018h,030h,018h,00Ch,006h,000h ; Hex #3C + Db 000h,000h,07Eh,000h,07Eh,000h,000h,000h ; Hex #3D + Db 030h,018h,00Ch,006h,00Ch,018h,030h,000h ; Hex #3E + Db 03Ch,066h,026h,00Ch,018h,000h,018h,000h ; Hex #3F + Db 03Eh,041h,05Dh,055h,05Fh,040h,03Eh,000h ; Hex #40 + Db 01Ch,00Ch,01Ch,016h,03Eh,023h,063h,000h ; Hex #41 + Db 07Ch,036h,036h,03Eh,033h,033h,07Eh,000h ; Hex #42 + Db 01Dh,033h,061h,060h,060h,031h,01Eh,000h ; Hex #43 + Db 07Ch,036h,033h,033h,033h,036h,07Ch,000h ; Hex #44 + Db 07Fh,031h,034h,03Ch,034h,031h,07Fh,000h ; Hex #45 + Db 07Fh,031h,034h,03Ch,034h,030h,078h,000h ; Hex #46 + Db 01Dh,033h,061h,060h,067h,033h,01Fh,000h ; Hex #47 + Db 066h,066h,066h,07Eh,066h,066h,066h,000h ; Hex #48 + Db 03Ch,018h,018h,018h,018h,018h,03Ch,000h ; Hex #49 + Db 01Fh,006h,006h,006h,066h,066h,03Ch,000h ; Hex #4A + Db 067h,066h,06Ch,078h,06Ch,066h,067h,000h ; Hex #4B + Db 078h,030h,030h,030h,031h,033h,07Fh,000h ; Hex #4C + Db 041h,063h,077h,07Fh,06Bh,063h,063h,000h ; Hex #4D + Db 043h,063h,073h,07Bh,06Fh,067h,063h,000h ; Hex #4E + Db 01Ch,036h,063h,063h,063h,036h,01Ch,000h ; Hex #4F + Db 07Eh,033h,033h,03Eh,030h,030h,078h,000h ; Hex #50 + Db 01Ch,036h,063h,063h,06Bh,036h,01Ch,007h ; Hex #51 + Db 07Ch,066h,066h,07Ch,06Ch,066h,067h,000h ; Hex #52 + Db 03Eh,066h,070h,03Ch,00Eh,066h,07Ch,000h ; Hex #53 + Db 07Eh,05Ah,018h,018h,018h,018h,03Ch,000h ; Hex #54 + Db 063h,063h,063h,063h,063h,063h,03Eh,000h ; Hex #55 + Db 077h,062h,036h,034h,01Ch,018h,008h,000h ; Hex #56 + Db 063h,063h,06Bh,06Bh,03Eh,036h,022h,000h ; Hex #57 + Db 066h,066h,03Ch,018h,03Ch,066h,066h,000h ; Hex #58 + Db 0E7h,066h,034h,018h,018h,018h,03Ch,000h ; Hex #59 + Db 07Eh,066h,04Ch,018h,032h,066h,07Eh,000h ; Hex #5A + Db 01Eh,018h,018h,018h,018h,018h,01Eh,000h ; Hex #5B + Db 060h,030h,018h,00Ch,006h,003h,001h,000h ; Hex #5C + Db 03Ch,00Ch,00Ch,00Ch,00Ch,00Ch,03Ch,000h ; Hex #5D + Db 008h,01Ch,036h,000h,000h,000h,000h,000h ; Hex #5E + Db 000h,000h,000h,000h,000h,000h,000h,0FFh ; Hex #5F + Db 030h,018h,00Ch,000h,000h,000h,000h,000h ; Hex #60 + Db 000h,000h,03Ch,066h,01Eh,066h,07Bh,000h ; Hex #61 + Db 070h,030h,03Eh,03Bh,033h,03Bh,06Eh,000h ; Hex #62 + Db 000h,000h,03Eh,066h,060h,066h,03Ch,000h ; Hex #63 + Db 00Eh,006h,036h,06Eh,066h,066h,03Bh,000h ; Hex #64 + Db 000h,000h,03Ch,066h,07Eh,060h,03Eh,000h ; Hex #65 + Db 00Eh,01Bh,018h,03Eh,018h,018h,03Ch,000h ; Hex #66 + Db 000h,000h,03Dh,066h,038h,03Eh,063h,03Eh ; Hex #67 + Db 070h,030h,036h,03Bh,033h,033h,073h,000h ; Hex #68 + Db 018h,000h,038h,018h,018h,018h,03Ch,000h ; Hex #69 + Db 00Ch,000h,01Ch,00Ch,00Ch,06Ch,06Ch,038h ; Hex #6A + Db 070h,030h,033h,036h,03Ch,036h,077h,000h ; Hex #6B + Db 038h,018h,018h,018h,018h,018h,03Ch,000h ; Hex #6C + Db 000h,000h,076h,07Fh,06Bh,06Bh,06Bh,000h ; Hex #6D + Db 000h,000h,076h,03Bh,033h,033h,073h,000h ; Hex #6E + Db 000h,000h,03Ch,066h,066h,066h,03Ch,000h ; Hex #6F + Db 000h,000h,06Eh,033h,033h,03Eh,030h,078h ; Hex #70 + Db 000h,000h,03Ah,066h,066h,03Eh,006h,00Fh ; Hex #71 + Db 000h,000h,06Eh,03Bh,033h,030h,078h,000h ; Hex #72 + Db 000h,000h,03Eh,070h,03Ch,00Eh,07Ch,000h ; Hex #73 + Db 008h,018h,03Eh,018h,018h,01Ah,00Ch,000h ; Hex #74 + Db 000h,000h,066h,066h,066h,066h,03Bh,000h ; Hex #75 + Db 000h,000h,073h,032h,036h,01Ch,008h,000h ; Hex #76 + Db 000h,000h,06Bh,06Bh,07Fh,036h,022h,000h ; Hex #77 + Db 000h,000h,073h,036h,01Ch,036h,067h,000h ; Hex #78 + Db 000h,000h,077h,033h,01Ah,00Ch,06Ch,038h ; Hex #79 + Db 000h,000h,07Eh,04Ch,018h,032h,07Eh,000h ; Hex #7A + Db 00Eh,018h,018h,070h,018h,018h,00Eh,000h ; Hex #7B + Db 018h,018h,018h,018h,018h,018h,018h,000h ; Hex #7C + Db 070h,018h,018h,00Eh,018h,018h,070h,000h ; Hex #7D + Db 039h,04Eh,000h,000h,000h,000h,000h,000h ; Hex #7E + Db 008h,01Ch,01Ch,036h,026h,063h,07Fh,07Fh ; Hex #7F + Db 01Dh,033h,061h,060h,060h,031h,00Eh,01Ch ; Hex #80 + Db 06Ch,000h,066h,066h,066h,066h,03Bh,000h ; Hex #81 + Db 00Ch,018h,03Ch,066h,07Eh,060h,03Eh,000h ; Hex #82 + Db 018h,03Ch,03Ch,066h,01Eh,066h,07Bh,000h ; Hex #83 + Db 036h,000h,03Ch,066h,01Eh,066h,07Bh,000h ; Hex #84 + Db 030h,018h,03Ch,066h,01Eh,066h,07Bh,000h ; Hex #85 + Db 018h,018h,03Ch,066h,01Eh,066h,07Bh,000h ; Hex #86 + Db 000h,000h,03Eh,066h,060h,036h,01Ch,038h ; Hex #87 + Db 018h,03Ch,03Ch,066h,07Eh,060h,03Eh,000h ; Hex #88 + Db 036h,000h,03Ch,066h,07Eh,060h,03Eh,000h ; Hex #89 + Db 030h,018h,03Ch,066h,07Eh,060h,03Eh,000h ; Hex #8A + Db 06Ch,000h,038h,018h,018h,018h,03Ch,000h ; Hex #8B + Db 018h,03Ch,000h,038h,018h,018h,03Ch,000h ; Hex #8C + Db 030h,018h,000h,038h,018h,018h,03Ch,000h ; Hex #8D + Db 036h,008h,01Ch,016h,036h,03Fh,063h,000h ; Hex #8E + Db 01Ch,014h,01Ch,01Eh,036h,03Fh,063h,000h ; Hex #8F + Db 006h,00Ch,07Fh,031h,03Ch,031h,07Fh,000h ; Hex #90 + Db 000h,000h,076h,01Bh,03Fh,06Ch,077h,000h ; Hex #91 + Db 03Fh,03Dh,02Ch,03Eh,06Ch,06Dh,06Fh,000h ; Hex #92 + Db 018h,03Ch,03Ch,066h,066h,066h,03Ch,000h ; Hex #93 + Db 066h,000h,03Ch,066h,066h,066h,03Ch,000h ; Hex #94 + Db 030h,018h,03Ch,066h,066h,066h,03Ch,000h ; Hex #95 + Db 018h,03Ch,042h,066h,066h,066h,03Bh,000h ; Hex #96 + Db 030h,018h,066h,066h,066h,066h,03Bh,000h ; Hex #97 + Db 036h,000h,077h,033h,01Ah,00Ch,06Ch,038h ; Hex #98 + Db 063h,01Ch,036h,063h,063h,036h,01Ch,000h ; Hex #99 + Db 036h,041h,063h,063h,063h,063h,03Eh,000h ; Hex #9A + Db 000h,004h,03Ch,06Eh,07Eh,076h,03Ch,020h ; Hex #9B + Db 01Eh,033h,033h,07Ch,039h,05Bh,076h,000h ; Hex #9C + Db 01Dh,036h,067h,06Bh,073h,036h,05Ch,000h ; Hex #9D + Db 000h,066h,03Ch,018h,03Ch,066h,000h,000h ; Hex #9E + Db 00Eh,01Bh,018h,03Eh,018h,018h,058h,070h ; Hex #9F + Db 00Ch,018h,03Ch,066h,01Eh,066h,07Bh,000h ; Hex #A0 + Db 018h,030h,000h,038h,018h,018h,03Ch,000h ; Hex #A1 + Db 00Ch,018h,03Ch,066h,066h,066h,03Ch,000h ; Hex #A2 + Db 00Ch,018h,066h,066h,066h,066h,03Bh,000h ; Hex #A3 + Db 01Ah,02Ch,076h,03Bh,033h,033h,073h,000h ; Hex #A4 + Db 01Ah,02Ch,073h,07Bh,06Fh,067h,063h,000h ; Hex #A5 + Db 01Eh,036h,036h,01Fh,000h,03Fh,000h,000h ; Hex #A6 + Db 01Ch,036h,036h,01Ch,000h,03Eh,000h,000h ; Hex #A7 + Db 018h,000h,018h,030h,064h,066h,03Ch,000h ; Hex #A8 + Db 03Eh,07Bh,055h,059h,05Dh,077h,03Eh,000h ; Hex #A9 + Db 000h,000h,000h,07Eh,006h,006h,000h,000h ; Hex #AA + Db 060h,066h,06Ch,07Eh,03Bh,066h,04Ch,00Fh ; Hex #AB + Db 060h,066h,06Ch,07Bh,037h,06Bh,04Fh,003h ; Hex #AC + Db 018h,000h,018h,018h,018h,018h,018h,000h ; Hex #AD + Db 000h,01Bh,036h,06Ch,06Ch,036h,01Bh,000h ; Hex #AE + Db 000h,06Ch,036h,01Bh,01Bh,036h,06Ch,000h ; Hex #AF + Db 011h,044h,011h,044h,011h,044h,011h,044h ; Hex #B0 + Db 055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh ; Hex #B1 + Db 0EEh,0BBh,0EEh,0BBh,0EEh,0BBh,0EEh,0BBh ; Hex #B2 + Db 018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B3 + Db 018h,018h,018h,0F8h,0F8h,018h,018h,018h ; Hex #B4 + Db 00Ch,018h,01Ch,016h,036h,03Fh,063h,000h ; Hex #B5 + Db 01Ch,036h,008h,01Eh,036h,03Fh,063h,000h ; Hex #B6 + Db 01Ch,006h,01Ch,016h,036h,03Fh,063h,000h ; Hex #B7 + Db 03Eh,06Bh,05Dh,051h,05Dh,06Bh,03Eh,000h ; Hex #B8 + Db 034h,034h,0F4h,0F4h,004h,0F4h,034h,034h ; Hex #B9 + Db 034h,034h,034h,034h,034h,034h,034h,034h ; Hex #BA + Db 000h,000h,0F8h,0FCh,004h,0F4h,034h,034h ; Hex #BB + Db 034h,034h,0F4h,0F4h,004h,0FCh,000h,000h ; Hex #BC + Db 006h,004h,03Ch,06Eh,068h,06Ah,03Ch,030h ; Hex #BD + Db 066h,066h,03Ch,07Eh,018h,07Eh,018h,000h ; Hex #BE + Db 000h,000h,000h,0F8h,0F8h,018h,018h,018h ; Hex #BF + Db 018h,018h,018h,01Fh,01Fh,000h,000h,000h ; Hex #C0 + Db 018h,018h,018h,0FFh,0FFh,000h,000h,000h ; Hex #C1 + Db 000h,000h,000h,0FFh,0FFh,018h,018h,018h ; Hex #C2 + Db 018h,018h,018h,01Fh,01Fh,018h,018h,018h ; Hex #C3 + Db 000h,000h,000h,0FFh,0FFh,000h,000h,000h ; Hex #C4 + Db 018h,018h,018h,0FFh,0FFh,018h,018h,018h ; Hex #C5 + Db 039h,04Eh,03Ch,066h,01Eh,066h,07Bh,000h ; Hex #C6 + Db 03Bh,06Eh,01Ch,016h,036h,03Fh,063h,000h ; Hex #C7 + Db 034h,034h,037h,037h,030h,01Fh,000h,000h ; Hex #C8 + Db 000h,000h,03Fh,03Fh,030h,037h,034h,034h ; Hex #C9 + Db 034h,034h,0F7h,0F7h,000h,0FFh,000h,000h ; Hex #CA + Db 000h,000h,0FFh,0FFh,000h,0F7h,034h,034h ; Hex #CB + Db 034h,034h,037h,037h,030h,037h,034h,034h ; Hex #CC + Db 000h,000h,0FFh,0FFh,000h,0FFh,000h,000h ; Hex #CD + Db 034h,034h,0F7h,0F7h,000h,0F7h,034h,034h ; Hex #CE + Db 000h,066h,07Eh,024h,024h,07Eh,066h,000h ; Hex #CF + Db 036h,018h,06Ch,036h,066h,066h,03Ch,000h ; Hex #D0 + Db 07Ch,036h,033h,07Bh,033h,036h,07Ch,000h ; Hex #D1 + Db 01Ch,036h,07Fh,031h,03Ch,031h,07Fh,000h ; Hex #D2 + Db 036h,000h,07Fh,031h,03Ch,031h,07Fh,000h ; Hex #D3 + Db 018h,00Ch,07Fh,031h,03Ch,031h,07Fh,000h ; Hex #D4 + Db 000h,000h,038h,018h,018h,018h,03Ch,000h ; Hex #D5 + Db 00Ch,018h,03Ch,018h,018h,018h,03Ch,000h ; Hex #D6 + Db 018h,024h,03Ch,018h,018h,018h,03Ch,000h ; Hex #D7 + Db 066h,000h,03Ch,018h,018h,018h,03Ch,000h ; Hex #D8 + Db 018h,018h,018h,0F8h,0F8h,000h,000h,000h ; Hex #D9 + Db 000h,000h,000h,01Fh,01Fh,018h,018h,018h ; Hex #DA + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #DB + Db 000h,000h,000h,000h,0FFh,0FFh,0FFh,0FFh ; Hex #DC + Db 018h,018h,018h,000h,000h,018h,018h,018h ; Hex #DD + Db 030h,018h,03Ch,018h,018h,018h,03Ch,000h ; Hex #DE + Db 0FFh,0FFh,0FFh,0FFh,000h,000h,000h,000h ; Hex #DF + Db 006h,00Ch,036h,063h,063h,036h,01Ch,000h ; Hex #E0 + Db 03Ch,066h,06Ch,06Eh,063h,07Bh,06Eh,000h ; Hex #E1 + Db 01Ch,036h,03Eh,063h,063h,036h,01Ch,000h ; Hex #E2 + Db 018h,00Ch,036h,063h,063h,036h,01Ch,000h ; Hex #E3 + Db 03Ah,06Eh,03Ch,066h,066h,066h,03Ch,000h ; Hex #E4 + Db 03Bh,06Eh,036h,063h,063h,036h,01Ch,000h ; Hex #E5 + Db 000h,000h,033h,033h,033h,037h,06Dh,060h ; Hex #E6 + Db 070h,030h,03Eh,033h,033h,03Eh,030h,078h ; Hex #E7 + Db 078h,03Eh,033h,033h,03Eh,030h,078h,000h ; Hex #E8 + Db 00Ch,05Bh,063h,063h,063h,063h,03Eh,000h ; Hex #E9 + Db 01Ch,077h,063h,063h,063h,063h,03Eh,000h ; Hex #EA + Db 018h,06Dh,063h,063h,063h,063h,03Eh,000h ; Hex #EB + Db 006h,00Ch,077h,033h,01Ah,00Ch,06Ch,038h ; Hex #EC + Db 00Ch,0DBh,066h,034h,018h,018h,03Ch,000h ; Hex #ED + Db 0FFh,000h,000h,000h,000h,000h,000h,000h ; Hex #EE + Db 00Ch,018h,030h,000h,000h,000h,000h,000h ; Hex #EF + Db 000h,000h,000h,07Eh,000h,000h,000h,000h ; Hex #F0 + Db 018h,018h,07Eh,018h,018h,000h,07Eh,000h ; Hex #F1 + Db 000h,000h,000h,000h,000h,0FFh,000h,0FFh ; Hex #F2 + Db 070h,05Bh,036h,05Fh,07Fh,03Bh,06Fh,043h ; Hex #F3 + Db 03Fh,06Ah,06Ah,03Ah,00Ah,00Ah,01Ah,000h ; Hex #F4 + Db 03Ch,076h,038h,06Ch,036h,01Ch,06Eh,03Ch ; Hex #F5 + Db 018h,018h,000h,07Eh,000h,018h,018h,000h ; Hex #F6 + Db 000h,000h,000h,000h,000h,000h,00Eh,01Ch ; Hex #F7 + Db 01Ch,036h,036h,01Ch,000h,000h,000h,000h ; Hex #F8 + Db 036h,000h,000h,000h,000h,000h,000h,000h ; Hex #F9 + Db 000h,000h,000h,018h,000h,000h,000h,000h ; Hex #FA + Db 018h,038h,018h,018h,03Ch,000h,000h,000h ; Hex #FB + Db 03Ch,066h,01Ch,066h,03Ch,000h,000h,000h ; Hex #FC + Db 03Ch,066h,00Ch,038h,07Eh,000h,000h,000h ; Hex #FD + Db 000h,000h,03Ch,03Ch,03Ch,03Ch,000h,000h ; Hex #FE + Db 000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FF +LEN_D850 EQU ($-D850) + ; +POST_EGA850 EQU $ ; + ; +CODE ENDS + END + \ No newline at end of file diff --git a/v4.0/src/DEV/DISPLAY/LCD/860-CPI.ASM b/v4.0/src/DEV/DISPLAY/LCD/860-CPI.ASM new file mode 100644 index 0000000..0c3e76c --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/LCD/860-CPI.ASM @@ -0,0 +1,290 @@ +CODE SEGMENT BYTE PUBLIC 'CODE' + ASSUME CS:CODE,DS:CODE + +IF1 + %OUT EGA.CPI creation file + %OUT . + %OUT CP SRC files: + %OUT . + %OUT . CODE PAGE: 860 +ENDIF + ; +EGA860: DW LEN_860 ;SIZE OF ENTRY HEADER + DW POST_EGA860,0 ;POINTER TO NEXT HEADER + DW 1 ;DEVICE TYPE + DB "LCD " ;DEVICE SUBTYPE ID + DW 860 ;CODE PAGE ID + DW 3 DUP(0) ;RESERVED + DW OFFSET DATA860,0 ;POINTER TO FONTS +LEN_860 EQU ($-EGA860) + +DATA860:DW 1 ;CART/NON-CART + DW 1 ;# OF FONTS + DW LEN_D860 ;LENGTH OF DATA +D860: ; + DB 8,8 ;CHARACTER BOX SIZE + DB 0,0 ;ASPECT RATIO (UNUSED) + DW 256 ;NUMBER OF CHARACTERS + Db 000h,000h,000h,000h,000h,000h,000h,000h ; Hex #0 + Db 03Ch,042h,0A5h,0A5h,081h,0BDh,05Ah,03Ch ; Hex #1 + Db 03Ch,07Eh,0DBh,0DBh,0FFh,0C3h,066h,03Ch ; Hex #2 + Db 036h,07Fh,07Fh,07Fh,03Eh,01Ch,008h,000h ; Hex #3 + Db 008h,01Ch,03Eh,07Fh,03Eh,01Ch,008h,000h ; Hex #4 + Db 01Ch,03Eh,01Ch,07Fh,07Fh,036h,008h,01Ch ; Hex #5 + Db 008h,01Ch,03Eh,07Fh,07Fh,036h,008h,01Ch ; Hex #6 + Db 000h,000h,018h,03Ch,03Ch,018h,000h,000h ; Hex #7 + Db 0FFh,0FFh,0E7h,0C3h,0C3h,0E7h,0FFh,0FFh ; Hex #8 + Db 000h,000h,03Ch,066h,066h,03Ch,000h,000h ; Hex #9 + Db 0FFh,0FFh,0C3h,099h,099h,0C3h,0FFh,0FFh ; Hex #A + Db 007h,003h,03Eh,066h,066h,066h,03Ch,000h ; Hex #B + Db 03Ch,066h,066h,066h,03Ch,018h,03Ch,018h ; Hex #C + Db 008h,00Ch,00Eh,00Ah,00Ah,008h,038h,030h ; Hex #D + Db 018h,016h,019h,017h,071h,061h,007h,006h ; Hex #E + Db 048h,06Bh,03Eh,0E4h,027h,07Ch,0D6h,012h ; Hex #F + Db 040h,070h,07Ch,07Fh,07Ch,070h,040h,000h ; Hex #10 + Db 001h,007h,01Fh,07Fh,01Fh,007h,001h,000h ; Hex #11 + Db 018h,03Ch,07Eh,018h,018h,07Eh,03Ch,018h ; Hex #12 + Db 036h,036h,036h,036h,036h,000h,036h,000h ; Hex #13 + Db 03Fh,06Ah,06Ah,03Ah,00Ah,00Ah,01Ah,000h ; Hex #14 + Db 03Ch,076h,038h,06Ch,036h,01Ch,06Eh,03Ch ; Hex #15 + Db 000h,000h,000h,07Fh,07Fh,07Fh,000h,000h ; Hex #16 + Db 018h,03Ch,07Eh,018h,07Eh,03Ch,018h,0FFh ; Hex #17 + Db 018h,03Ch,07Eh,05Ah,018h,018h,018h,000h ; Hex #18 + Db 018h,018h,018h,05Ah,07Eh,03Ch,018h,000h ; Hex #19 + Db 000h,00Ch,006h,07Fh,07Fh,006h,00Ch,000h ; Hex #1A + Db 000h,018h,030h,07Fh,07Fh,030h,018h,000h ; Hex #1B + Db 000h,000h,060h,060h,07Fh,07Fh,000h,000h ; Hex #1C + Db 000h,014h,036h,07Fh,07Fh,036h,014h,000h ; Hex #1D + Db 008h,008h,01Ch,01Ch,03Eh,03Eh,07Fh,000h ; Hex #1E + Db 07Fh,03Eh,03Eh,01Ch,01Ch,008h,008h,000h ; Hex #1F + Db 000h,000h,000h,000h,000h,000h,000h,000h ; Hex #20 + Db 018h,018h,018h,018h,018h,000h,018h,000h ; Hex #21 + Db 036h,036h,014h,000h,000h,000h,000h,000h ; Hex #22 + Db 00Ah,00Ah,03Fh,014h,07Eh,028h,028h,000h ; Hex #23 + Db 008h,03Eh,068h,03Eh,00Bh,07Eh,008h,000h ; Hex #24 + Db 001h,03Fh,052h,06Ch,01Bh,035h,076h,000h ; Hex #25 + Db 01Ch,036h,01Ch,03Bh,06Eh,066h,03Bh,000h ; Hex #26 + Db 018h,018h,030h,000h,000h,000h,000h,000h ; Hex #27 + Db 006h,00Ch,018h,018h,018h,00Ch,006h,000h ; Hex #28 + Db 030h,018h,00Ch,00Ch,00Ch,018h,030h,000h ; Hex #29 + Db 000h,036h,01Ch,07Fh,01Ch,036h,000h,000h ; Hex #2A + Db 000h,018h,018h,07Eh,018h,018h,000h,000h ; Hex #2B + Db 000h,000h,000h,000h,000h,018h,018h,030h ; Hex #2C + Db 000h,000h,000h,07Eh,000h,000h,000h,000h ; Hex #2D + Db 000h,000h,000h,000h,000h,018h,018h,000h ; Hex #2E + Db 003h,006h,00Ch,018h,030h,060h,040h,000h ; Hex #2F + Db 018h,02Ch,066h,066h,066h,034h,018h,000h ; Hex #30 + Db 018h,018h,038h,018h,018h,018h,03Ch,000h ; Hex #31 + Db 03Ch,066h,066h,00Ch,018h,032h,07Eh,000h ; Hex #32 + Db 03Ch,066h,00Ch,01Ch,006h,066h,03Ch,000h ; Hex #33 + Db 00Ch,01Ch,02Ch,06Ch,07Eh,00Ch,01Eh,000h ; Hex #34 + Db 07Eh,060h,07Ch,066h,006h,066h,03Ch,000h ; Hex #35 + Db 01Ch,030h,060h,07Ch,066h,066h,03Ch,000h ; Hex #36 + Db 07Eh,066h,04Ch,00Ch,018h,018h,038h,000h ; Hex #37 + Db 03Ch,066h,076h,03Ch,06Eh,066h,03Ch,000h ; Hex #38 + Db 03Ch,066h,066h,03Eh,006h,00Ch,038h,000h ; Hex #39 + Db 000h,018h,018h,000h,000h,018h,018h,000h ; Hex #3A + Db 000h,018h,018h,000h,000h,018h,018h,030h ; Hex #3B + Db 006h,00Ch,018h,030h,018h,00Ch,006h,000h ; Hex #3C + Db 000h,000h,07Eh,000h,07Eh,000h,000h,000h ; Hex #3D + Db 030h,018h,00Ch,006h,00Ch,018h,030h,000h ; Hex #3E + Db 03Ch,066h,026h,00Ch,018h,000h,018h,000h ; Hex #3F + Db 03Eh,041h,05Dh,055h,05Fh,040h,03Eh,000h ; Hex #40 + Db 01Ch,00Ch,01Ch,016h,03Eh,023h,063h,000h ; Hex #41 + Db 07Ch,036h,036h,03Eh,033h,033h,07Eh,000h ; Hex #42 + Db 01Dh,033h,061h,060h,060h,031h,01Eh,000h ; Hex #43 + Db 07Ch,036h,033h,033h,033h,036h,07Ch,000h ; Hex #44 + Db 07Fh,031h,034h,03Ch,034h,031h,07Fh,000h ; Hex #45 + Db 07Fh,031h,034h,03Ch,034h,030h,078h,000h ; Hex #46 + Db 01Dh,033h,061h,060h,067h,033h,01Fh,000h ; Hex #47 + Db 066h,066h,066h,07Eh,066h,066h,066h,000h ; Hex #48 + Db 03Ch,018h,018h,018h,018h,018h,03Ch,000h ; Hex #49 + Db 01Fh,006h,006h,006h,066h,066h,03Ch,000h ; Hex #4A + Db 067h,066h,06Ch,078h,06Ch,066h,067h,000h ; Hex #4B + Db 078h,030h,030h,030h,031h,033h,07Fh,000h ; Hex #4C + Db 041h,063h,077h,07Fh,06Bh,063h,063h,000h ; Hex #4D + Db 043h,063h,073h,07Bh,06Fh,067h,063h,000h ; Hex #4E + Db 01Ch,036h,063h,063h,063h,036h,01Ch,000h ; Hex #4F + Db 07Eh,033h,033h,03Eh,030h,030h,078h,000h ; Hex #50 + Db 01Ch,036h,063h,063h,06Bh,036h,01Ch,007h ; Hex #51 + Db 07Ch,066h,066h,07Ch,06Ch,066h,067h,000h ; Hex #52 + Db 03Eh,066h,070h,03Ch,00Eh,066h,07Ch,000h ; Hex #53 + Db 07Eh,05Ah,018h,018h,018h,018h,03Ch,000h ; Hex #54 + Db 063h,063h,063h,063h,063h,063h,03Eh,000h ; Hex #55 + Db 077h,062h,036h,034h,01Ch,018h,008h,000h ; Hex #56 + Db 063h,063h,06Bh,06Bh,03Eh,036h,022h,000h ; Hex #57 + Db 066h,066h,03Ch,018h,03Ch,066h,066h,000h ; Hex #58 + Db 0E7h,066h,034h,018h,018h,018h,03Ch,000h ; Hex #59 + Db 07Eh,066h,04Ch,018h,032h,066h,07Eh,000h ; Hex #5A + Db 01Eh,018h,018h,018h,018h,018h,01Eh,000h ; Hex #5B + Db 060h,030h,018h,00Ch,006h,003h,001h,000h ; Hex #5C + Db 03Ch,00Ch,00Ch,00Ch,00Ch,00Ch,03Ch,000h ; Hex #5D + Db 008h,01Ch,036h,000h,000h,000h,000h,000h ; Hex #5E + Db 000h,000h,000h,000h,000h,000h,000h,0FFh ; Hex #5F + Db 030h,018h,00Ch,000h,000h,000h,000h,000h ; Hex #60 + Db 000h,000h,03Ch,066h,01Eh,066h,07Bh,000h ; Hex #61 + Db 070h,030h,03Eh,03Bh,033h,03Bh,06Eh,000h ; Hex #62 + Db 000h,000h,03Eh,066h,060h,066h,03Ch,000h ; Hex #63 + Db 00Eh,006h,036h,06Eh,066h,066h,03Bh,000h ; Hex #64 + Db 000h,000h,03Ch,066h,07Eh,060h,03Eh,000h ; Hex #65 + Db 00Eh,01Bh,018h,03Eh,018h,018h,03Ch,000h ; Hex #66 + Db 000h,000h,03Dh,066h,038h,03Eh,063h,03Eh ; Hex #67 + Db 070h,030h,036h,03Bh,033h,033h,073h,000h ; Hex #68 + Db 018h,000h,038h,018h,018h,018h,03Ch,000h ; Hex #69 + Db 00Ch,000h,01Ch,00Ch,00Ch,06Ch,06Ch,038h ; Hex #6A + Db 070h,030h,033h,036h,03Ch,036h,077h,000h ; Hex #6B + Db 038h,018h,018h,018h,018h,018h,03Ch,000h ; Hex #6C + Db 000h,000h,076h,07Fh,06Bh,06Bh,06Bh,000h ; Hex #6D + Db 000h,000h,076h,03Bh,033h,033h,073h,000h ; Hex #6E + Db 000h,000h,03Ch,066h,066h,066h,03Ch,000h ; Hex #6F + Db 000h,000h,06Eh,033h,033h,03Eh,030h,078h ; Hex #70 + Db 000h,000h,03Ah,066h,066h,03Eh,006h,00Fh ; Hex #71 + Db 000h,000h,06Eh,03Bh,033h,030h,078h,000h ; Hex #72 + Db 000h,000h,03Eh,070h,03Ch,00Eh,07Ch,000h ; Hex #73 + Db 008h,018h,03Eh,018h,018h,01Ah,00Ch,000h ; Hex #74 + Db 000h,000h,066h,066h,066h,066h,03Bh,000h ; Hex #75 + Db 000h,000h,073h,032h,036h,01Ch,008h,000h ; Hex #76 + Db 000h,000h,06Bh,06Bh,07Fh,036h,022h,000h ; Hex #77 + Db 000h,000h,073h,036h,01Ch,036h,067h,000h ; Hex #78 + Db 000h,000h,077h,033h,01Ah,00Ch,06Ch,038h ; Hex #79 + Db 000h,000h,07Eh,04Ch,018h,032h,07Eh,000h ; Hex #7A + Db 00Eh,018h,018h,070h,018h,018h,00Eh,000h ; Hex #7B + Db 018h,018h,018h,018h,018h,018h,018h,000h ; Hex #7C + Db 070h,018h,018h,00Eh,018h,018h,070h,000h ; Hex #7D + Db 039h,04Eh,000h,000h,000h,000h,000h,000h ; Hex #7E + Db 008h,01Ch,01Ch,036h,026h,063h,07Fh,07Fh ; Hex #7F + Db 01Dh,033h,061h,060h,060h,031h,00Eh,01Ch ; Hex #80 + Db 06Ch,000h,066h,066h,066h,066h,03Bh,000h ; Hex #81 + Db 00Ch,018h,03Ch,066h,07Eh,060h,03Eh,000h ; Hex #82 + Db 018h,03Ch,03Ch,066h,01Eh,066h,07Bh,000h ; Hex #83 + Db 039h,04Eh,03Ch,066h,01Eh,066h,07Bh,000h ; Hex #84 + Db 030h,018h,03Ch,066h,01Eh,066h,07Bh,000h ; Hex #85 + Db 00Ch,018h,01Ch,016h,036h,03Fh,063h,000h ; Hex #86 + Db 000h,000h,03Eh,066h,060h,036h,01Ch,038h ; Hex #87 + Db 018h,03Ch,03Ch,066h,07Eh,060h,03Eh,000h ; Hex #88 + Db 01Ch,036h,07Fh,031h,03Ch,031h,07Fh,000h ; Hex #89 + Db 030h,018h,03Ch,066h,07Eh,060h,03Eh,000h ; Hex #8A + Db 00Ch,018h,03Ch,018h,018h,018h,03Ch,000h ; Hex #8B + Db 01Ch,036h,03Eh,063h,063h,036h,01Ch,000h ; Hex #8C + Db 030h,018h,000h,038h,018h,018h,03Ch,000h ; Hex #8D + Db 03Bh,06Eh,01Ch,016h,036h,03Fh,063h,000h ; Hex #8E + Db 01Ch,036h,008h,01Eh,036h,03Fh,063h,000h ; Hex #8F + Db 006h,00Ch,07Fh,031h,03Ch,031h,07Fh,000h ; Hex #90 + Db 01Ch,006h,01Ch,016h,036h,03Fh,063h,000h ; Hex #91 + Db 018h,00Ch,07Fh,031h,03Ch,031h,07Fh,000h ; Hex #92 + Db 018h,03Ch,03Ch,066h,066h,066h,03Ch,000h ; Hex #93 + Db 03Ah,06Eh,03Ch,066h,066h,066h,03Ch,000h ; Hex #94 + Db 030h,018h,03Ch,066h,066h,066h,03Ch,000h ; Hex #95 + Db 00Ch,05Bh,063h,063h,063h,063h,03Eh,000h ; Hex #96 + Db 030h,018h,066h,066h,066h,066h,03Bh,000h ; Hex #97 + Db 030h,018h,03Ch,018h,018h,018h,03Ch,000h ; Hex #98 + Db 03Bh,06Eh,036h,063h,063h,036h,01Ch,000h ; Hex #99 + Db 036h,041h,063h,063h,063h,063h,03Eh,000h ; Hex #9A + Db 006h,004h,03Ch,06Eh,068h,06Ah,03Ch,030h ; Hex #9B + Db 01Eh,033h,033h,07Ch,039h,05Bh,076h,000h ; Hex #9C + Db 018h,06Dh,063h,063h,063h,063h,03Eh,000h ; Hex #9D + Db 078h,06Ch,06Ch,07Ah,066h,06Fh,066h,003h ; Hex #9E + Db 006h,00Ch,036h,063h,063h,036h,01Ch,000h ; Hex #9F + Db 00Ch,018h,03Ch,066h,01Eh,066h,07Bh,000h ; Hex #A0 + Db 018h,030h,000h,038h,018h,018h,03Ch,000h ; Hex #A1 + Db 00Ch,018h,03Ch,066h,066h,066h,03Ch,000h ; Hex #A2 + Db 00Ch,018h,066h,066h,066h,066h,03Bh,000h ; Hex #A3 + Db 01Ah,02Ch,076h,03Bh,033h,033h,073h,000h ; Hex #A4 + Db 01Ah,02Ch,073h,07Bh,06Fh,067h,063h,000h ; Hex #A5 + Db 01Eh,036h,036h,01Fh,000h,03Fh,000h,000h ; Hex #A6 + Db 01Ch,036h,036h,01Ch,000h,03Eh,000h,000h ; Hex #A7 + Db 018h,000h,018h,030h,064h,066h,03Ch,000h ; Hex #A8 + Db 018h,00Ch,036h,063h,063h,036h,01Ch,000h ; Hex #A9 + Db 000h,000h,000h,07Eh,006h,006h,000h,000h ; Hex #AA + Db 060h,066h,06Ch,07Eh,03Bh,066h,04Ch,00Fh ; Hex #AB + Db 060h,066h,06Ch,07Bh,037h,06Bh,04Fh,003h ; Hex #AC + Db 018h,000h,018h,018h,018h,018h,018h,000h ; Hex #AD + Db 000h,01Bh,036h,06Ch,06Ch,036h,01Bh,000h ; Hex #AE + Db 000h,06Ch,036h,01Bh,01Bh,036h,06Ch,000h ; Hex #AF + Db 011h,044h,011h,044h,011h,044h,011h,044h ; Hex #B0 + Db 055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh ; Hex #B1 + Db 0EEh,0BBh,0EEh,0BBh,0EEh,0BBh,0EEh,0BBh ; Hex #B2 + Db 018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B3 + Db 018h,018h,018h,0F8h,0F8h,018h,018h,018h ; Hex #B4 + Db 018h,018h,0F8h,0F8h,018h,0F8h,018h,018h ; Hex #B5 + Db 034h,034h,034h,0F4h,0F4h,034h,034h,034h ; Hex #B6 + Db 000h,000h,000h,0F8h,0FCh,034h,034h,034h ; Hex #B7 + Db 000h,000h,0F0h,0F8h,018h,0F8h,018h,018h ; Hex #B8 + Db 034h,034h,0F4h,0F4h,004h,0F4h,034h,034h ; Hex #B9 + Db 034h,034h,034h,034h,034h,034h,034h,034h ; Hex #BA + Db 000h,000h,0F8h,0FCh,004h,0F4h,034h,034h ; Hex #BB + Db 034h,034h,0F4h,0F4h,004h,0FCh,000h,000h ; Hex #BC + Db 034h,034h,034h,0FCh,0FCh,000h,000h,000h ; Hex #BD + Db 018h,018h,0F8h,0F8h,018h,0F8h,000h,000h ; Hex #BE + Db 000h,000h,000h,0F8h,0F8h,018h,018h,018h ; Hex #BF + Db 018h,018h,018h,01Fh,01Fh,000h,000h,000h ; Hex #C0 + Db 018h,018h,018h,0FFh,0FFh,000h,000h,000h ; Hex #C1 + Db 000h,000h,000h,0FFh,0FFh,018h,018h,018h ; Hex #C2 + Db 018h,018h,018h,01Fh,01Fh,018h,018h,018h ; Hex #C3 + Db 000h,000h,000h,0FFh,0FFh,000h,000h,000h ; Hex #C4 + Db 018h,018h,018h,0FFh,0FFh,018h,018h,018h ; Hex #C5 + Db 018h,018h,01Fh,01Fh,018h,01Fh,018h,018h ; Hex #C6 + Db 034h,034h,034h,037h,037h,034h,034h,034h ; Hex #C7 + Db 034h,034h,037h,037h,030h,01Fh,000h,000h ; Hex #C8 + Db 000h,000h,03Fh,03Fh,030h,037h,034h,034h ; Hex #C9 + Db 034h,034h,0F7h,0F7h,000h,0FFh,000h,000h ; Hex #CA + Db 000h,000h,0FFh,0FFh,000h,0F7h,034h,034h ; Hex #CB + Db 034h,034h,037h,037h,030h,037h,034h,034h ; Hex #CC + Db 000h,000h,0FFh,0FFh,000h,0FFh,000h,000h ; Hex #CD + Db 034h,034h,0F7h,0F7h,000h,0F7h,034h,034h ; Hex #CE + Db 018h,018h,0FFh,0FFh,000h,0FFh,000h,000h ; Hex #CF + Db 034h,034h,034h,0FFh,0FFh,000h,000h,000h ; Hex #D0 + Db 000h,000h,0FFh,0FFh,000h,0FFh,018h,018h ; Hex #D1 + Db 000h,000h,000h,0FFh,0FFh,034h,034h,034h ; Hex #D2 + Db 034h,034h,034h,03Fh,01Fh,000h,000h,000h ; Hex #D3 + Db 018h,018h,01Fh,01Fh,018h,00Fh,000h,000h ; Hex #D4 + Db 000h,000h,01Fh,01Fh,018h,01Fh,018h,018h ; Hex #D5 + Db 000h,000h,000h,03Fh,03Fh,034h,034h,034h ; Hex #D6 + Db 034h,034h,034h,0FFh,0FFh,034h,034h,034h ; Hex #D7 + Db 018h,018h,0FFh,0FFh,018h,0FFh,018h,018h ; Hex #D8 + Db 018h,018h,018h,0F8h,0F8h,000h,000h,000h ; Hex #D9 + Db 000h,000h,000h,01Fh,01Fh,018h,018h,018h ; Hex #DA + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #DB + Db 000h,000h,000h,000h,0FFh,0FFh,0FFh,0FFh ; Hex #DC + Db 0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h ; Hex #DD + Db 00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh ; Hex #DE + Db 0FFh,0FFh,0FFh,0FFh,000h,000h,000h,000h ; Hex #DF + Db 000h,000h,03Dh,06Eh,066h,06Eh,03Bh,000h ; Hex #E0 + Db 03Ch,066h,06Ch,066h,063h,07Bh,06Eh,000h ; Hex #E1 + Db 07Fh,033h,031h,030h,030h,030h,078h,000h ; Hex #E2 + Db 000h,03Fh,07Eh,054h,014h,036h,066h,000h ; Hex #E3 + Db 07Fh,033h,018h,00Ch,018h,033h,07Fh,000h ; Hex #E4 + Db 000h,000h,03Fh,06Ch,06Ch,06Ch,038h,000h ; Hex #E5 + Db 000h,000h,033h,033h,033h,037h,06Dh,060h ; Hex #E6 + Db 000h,03Fh,07Eh,050h,018h,01Ch,00Ch,000h ; Hex #E7 + Db 01Ch,008h,03Eh,06Bh,03Eh,008h,01Ch,000h ; Hex #E8 + Db 01Ch,036h,063h,07Fh,063h,036h,01Ch,000h ; Hex #E9 + Db 01Ch,036h,063h,063h,036h,055h,077h,000h ; Hex #EA + Db 01Ch,030h,018h,02Ch,066h,066h,03Ch,000h ; Hex #EB + Db 000h,036h,07Fh,04Dh,059h,07Fh,036h,000h ; Hex #EC + Db 000h,000h,036h,06Fh,06Bh,03Eh,008h,00Ch ; Hex #ED + Db 000h,000h,01Eh,030h,03Eh,030h,01Eh,000h ; Hex #EE + Db 03Ch,066h,066h,066h,066h,066h,066h,000h ; Hex #EF + Db 000h,07Eh,000h,07Eh,000h,07Eh,000h,000h ; Hex #F0 + Db 018h,018h,07Eh,018h,018h,000h,07Eh,000h ; Hex #F1 + Db 060h,038h,00Eh,038h,060h,000h,07Eh,000h ; Hex #F2 + Db 006h,01Ch,070h,01Ch,006h,000h,07Eh,000h ; Hex #F3 + Db 00Eh,01Bh,01Ah,018h,018h,018h,018h,018h ; Hex #F4 + Db 018h,018h,018h,018h,058h,0D8h,070h,000h ; Hex #F5 + Db 018h,018h,000h,07Eh,000h,018h,018h,000h ; Hex #F6 + Db 000h,03Bh,06Eh,000h,03Bh,06Eh,000h,000h ; Hex #F7 + Db 01Ch,036h,036h,01Ch,000h,000h,000h,000h ; Hex #F8 + Db 000h,000h,018h,03Ch,018h,000h,000h,000h ; Hex #F9 + Db 000h,000h,000h,018h,000h,000h,000h,000h ; Hex #FA + Db 003h,002h,006h,024h,06Ch,038h,018h,010h ; Hex #FB + Db 076h,03Bh,033h,033h,033h,000h,000h,000h ; Hex #FC + Db 03Ch,066h,00Ch,038h,07Eh,000h,000h,000h ; Hex #FD + Db 000h,000h,03Ch,03Ch,03Ch,03Ch,000h,000h ; Hex #FE + Db 000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FF +LEN_D860 EQU ($-D860) + ; +POST_EGA860 EQU $ ; + ; +CODE ENDS + END + \ No newline at end of file diff --git a/v4.0/src/DEV/DISPLAY/LCD/863-CPI.ASM b/v4.0/src/DEV/DISPLAY/LCD/863-CPI.ASM new file mode 100644 index 0000000..90bd0ec --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/LCD/863-CPI.ASM @@ -0,0 +1,290 @@ +CODE SEGMENT BYTE PUBLIC 'CODE' + ASSUME CS:CODE,DS:CODE + +IF1 + %OUT EGA.CPI creation file + %OUT . + %OUT CP SRC files: + %OUT . + %OUT . CODE PAGE: 863 +ENDIF + +EGA863: DW LEN_863 ;SIZE OF ENTRY HEADER + DW POST_EGA863,0 ;POINTER TO NEXT HEADER + DW 1 ;DEVICE TYPE + DB "LCD " ;DEVICE SUBTYPE ID + DW 863 ;CODE PAGE ID + DW 3 DUP(0) ;RESERVED + DW OFFSET DATA863,0 ;POINTER TO FONTS +LEN_863 EQU ($-EGA863) + +DATA863:DW 1 ;CART/NON-CART + DW 1 ;# OF FONTS + DW LEN_D863 ;LENGTH OF DATA +D863: ; + DB 8,8 ;CHARACTER BOX SIZE + DB 0,0 ;ASPECT RATIO (UNUSED) + DW 256 ;NUMBER OF CHARACTERS + Db 000h,000h,000h,000h,000h,000h,000h,000h ; Hex #0 + Db 03Ch,042h,0A5h,0A5h,081h,0BDh,05Ah,03Ch ; Hex #1 + Db 03Ch,07Eh,0DBh,0DBh,0FFh,0C3h,066h,03Ch ; Hex #2 + Db 036h,07Fh,07Fh,07Fh,03Eh,01Ch,008h,000h ; Hex #3 + Db 008h,01Ch,03Eh,07Fh,03Eh,01Ch,008h,000h ; Hex #4 + Db 01Ch,03Eh,01Ch,07Fh,07Fh,036h,008h,01Ch ; Hex #5 + Db 008h,01Ch,03Eh,07Fh,07Fh,036h,008h,01Ch ; Hex #6 + Db 000h,000h,018h,03Ch,03Ch,018h,000h,000h ; Hex #7 + Db 0FFh,0FFh,0E7h,0C3h,0C3h,0E7h,0FFh,0FFh ; Hex #8 + Db 000h,000h,03Ch,066h,066h,03Ch,000h,000h ; Hex #9 + Db 0FFh,0FFh,0C3h,099h,099h,0C3h,0FFh,0FFh ; Hex #A + Db 007h,003h,03Eh,066h,066h,066h,03Ch,000h ; Hex #B + Db 03Ch,066h,066h,066h,03Ch,018h,03Ch,018h ; Hex #C + Db 008h,00Ch,00Eh,00Ah,00Ah,008h,038h,030h ; Hex #D + Db 018h,016h,019h,017h,071h,061h,007h,006h ; Hex #E + Db 048h,06Bh,03Eh,0E4h,027h,07Ch,0D6h,012h ; Hex #F + Db 040h,070h,07Ch,07Fh,07Ch,070h,040h,000h ; Hex #10 + Db 001h,007h,01Fh,07Fh,01Fh,007h,001h,000h ; Hex #11 + Db 018h,03Ch,07Eh,018h,018h,07Eh,03Ch,018h ; Hex #12 + Db 036h,036h,036h,036h,036h,000h,036h,000h ; Hex #13 + Db 03Fh,06Ah,06Ah,03Ah,00Ah,00Ah,01Ah,000h ; Hex #14 + Db 03Ch,076h,038h,06Ch,036h,01Ch,06Eh,03Ch ; Hex #15 + Db 000h,000h,000h,07Fh,07Fh,07Fh,000h,000h ; Hex #16 + Db 018h,03Ch,07Eh,018h,07Eh,03Ch,018h,0FFh ; Hex #17 + Db 018h,03Ch,07Eh,05Ah,018h,018h,018h,000h ; Hex #18 + Db 018h,018h,018h,05Ah,07Eh,03Ch,018h,000h ; Hex #19 + Db 000h,00Ch,006h,07Fh,07Fh,006h,00Ch,000h ; Hex #1A + Db 000h,018h,030h,07Fh,07Fh,030h,018h,000h ; Hex #1B + Db 000h,000h,060h,060h,07Fh,07Fh,000h,000h ; Hex #1C + Db 000h,014h,036h,07Fh,07Fh,036h,014h,000h ; Hex #1D + Db 008h,008h,01Ch,01Ch,03Eh,03Eh,07Fh,000h ; Hex #1E + Db 07Fh,03Eh,03Eh,01Ch,01Ch,008h,008h,000h ; Hex #1F + Db 000h,000h,000h,000h,000h,000h,000h,000h ; Hex #20 + Db 018h,018h,018h,018h,018h,000h,018h,000h ; Hex #21 + Db 036h,036h,014h,000h,000h,000h,000h,000h ; Hex #22 + Db 00Ah,00Ah,03Fh,014h,07Eh,028h,028h,000h ; Hex #23 + Db 008h,03Eh,068h,03Eh,00Bh,07Eh,008h,000h ; Hex #24 + Db 001h,03Fh,052h,06Ch,01Bh,035h,076h,000h ; Hex #25 + Db 01Ch,036h,01Ch,03Bh,06Eh,066h,03Bh,000h ; Hex #26 + Db 018h,018h,030h,000h,000h,000h,000h,000h ; Hex #27 + Db 006h,00Ch,018h,018h,018h,00Ch,006h,000h ; Hex #28 + Db 030h,018h,00Ch,00Ch,00Ch,018h,030h,000h ; Hex #29 + Db 000h,036h,01Ch,07Fh,01Ch,036h,000h,000h ; Hex #2A + Db 000h,018h,018h,07Eh,018h,018h,000h,000h ; Hex #2B + Db 000h,000h,000h,000h,000h,018h,018h,030h ; Hex #2C + Db 000h,000h,000h,07Eh,000h,000h,000h,000h ; Hex #2D + Db 000h,000h,000h,000h,000h,018h,018h,000h ; Hex #2E + Db 003h,006h,00Ch,018h,030h,060h,040h,000h ; Hex #2F + Db 018h,02Ch,066h,066h,066h,034h,018h,000h ; Hex #30 + Db 018h,018h,038h,018h,018h,018h,03Ch,000h ; Hex #31 + Db 03Ch,066h,066h,00Ch,018h,032h,07Eh,000h ; Hex #32 + Db 03Ch,066h,00Ch,01Ch,006h,066h,03Ch,000h ; Hex #33 + Db 00Ch,01Ch,02Ch,06Ch,07Eh,00Ch,01Eh,000h ; Hex #34 + Db 07Eh,060h,07Ch,066h,006h,066h,03Ch,000h ; Hex #35 + Db 01Ch,030h,060h,07Ch,066h,066h,03Ch,000h ; Hex #36 + Db 07Eh,066h,04Ch,00Ch,018h,018h,038h,000h ; Hex #37 + Db 03Ch,066h,076h,03Ch,06Eh,066h,03Ch,000h ; Hex #38 + Db 03Ch,066h,066h,03Eh,006h,00Ch,038h,000h ; Hex #39 + Db 000h,018h,018h,000h,000h,018h,018h,000h ; Hex #3A + Db 000h,018h,018h,000h,000h,018h,018h,030h ; Hex #3B + Db 006h,00Ch,018h,030h,018h,00Ch,006h,000h ; Hex #3C + Db 000h,000h,07Eh,000h,07Eh,000h,000h,000h ; Hex #3D + Db 030h,018h,00Ch,006h,00Ch,018h,030h,000h ; Hex #3E + Db 03Ch,066h,026h,00Ch,018h,000h,018h,000h ; Hex #3F + Db 03Eh,041h,05Dh,055h,05Fh,040h,03Eh,000h ; Hex #40 + Db 01Ch,00Ch,01Ch,016h,03Eh,023h,063h,000h ; Hex #41 + Db 07Ch,036h,036h,03Eh,033h,033h,07Eh,000h ; Hex #42 + Db 01Dh,033h,061h,060h,060h,031h,01Eh,000h ; Hex #43 + Db 07Ch,036h,033h,033h,033h,036h,07Ch,000h ; Hex #44 + Db 07Fh,031h,034h,03Ch,034h,031h,07Fh,000h ; Hex #45 + Db 07Fh,031h,034h,03Ch,034h,030h,078h,000h ; Hex #46 + Db 01Dh,033h,061h,060h,067h,033h,01Fh,000h ; Hex #47 + Db 066h,066h,066h,07Eh,066h,066h,066h,000h ; Hex #48 + Db 03Ch,018h,018h,018h,018h,018h,03Ch,000h ; Hex #49 + Db 01Fh,006h,006h,006h,066h,066h,03Ch,000h ; Hex #4A + Db 067h,066h,06Ch,078h,06Ch,066h,067h,000h ; Hex #4B + Db 078h,030h,030h,030h,031h,033h,07Fh,000h ; Hex #4C + Db 041h,063h,077h,07Fh,06Bh,063h,063h,000h ; Hex #4D + Db 043h,063h,073h,07Bh,06Fh,067h,063h,000h ; Hex #4E + Db 01Ch,036h,063h,063h,063h,036h,01Ch,000h ; Hex #4F + Db 07Eh,033h,033h,03Eh,030h,030h,078h,000h ; Hex #50 + Db 01Ch,036h,063h,063h,06Bh,036h,01Ch,007h ; Hex #51 + Db 07Ch,066h,066h,07Ch,06Ch,066h,067h,000h ; Hex #52 + Db 03Eh,066h,070h,03Ch,00Eh,066h,07Ch,000h ; Hex #53 + Db 07Eh,05Ah,018h,018h,018h,018h,03Ch,000h ; Hex #54 + Db 063h,063h,063h,063h,063h,063h,03Eh,000h ; Hex #55 + Db 077h,062h,036h,034h,01Ch,018h,008h,000h ; Hex #56 + Db 063h,063h,06Bh,06Bh,03Eh,036h,022h,000h ; Hex #57 + Db 066h,066h,03Ch,018h,03Ch,066h,066h,000h ; Hex #58 + Db 0E7h,066h,034h,018h,018h,018h,03Ch,000h ; Hex #59 + Db 07Eh,066h,04Ch,018h,032h,066h,07Eh,000h ; Hex #5A + Db 01Eh,018h,018h,018h,018h,018h,01Eh,000h ; Hex #5B + Db 060h,030h,018h,00Ch,006h,003h,001h,000h ; Hex #5C + Db 03Ch,00Ch,00Ch,00Ch,00Ch,00Ch,03Ch,000h ; Hex #5D + Db 008h,01Ch,036h,000h,000h,000h,000h,000h ; Hex #5E + Db 000h,000h,000h,000h,000h,000h,000h,0FFh ; Hex #5F + Db 030h,018h,00Ch,000h,000h,000h,000h,000h ; Hex #60 + Db 000h,000h,03Ch,066h,01Eh,066h,07Bh,000h ; Hex #61 + Db 070h,030h,03Eh,03Bh,033h,03Bh,06Eh,000h ; Hex #62 + Db 000h,000h,03Eh,066h,060h,066h,03Ch,000h ; Hex #63 + Db 00Eh,006h,036h,06Eh,066h,066h,03Bh,000h ; Hex #64 + Db 000h,000h,03Ch,066h,07Eh,060h,03Eh,000h ; Hex #65 + Db 00Eh,01Bh,018h,03Eh,018h,018h,03Ch,000h ; Hex #66 + Db 000h,000h,03Dh,066h,038h,03Eh,063h,03Eh ; Hex #67 + Db 070h,030h,036h,03Bh,033h,033h,073h,000h ; Hex #68 + Db 018h,000h,038h,018h,018h,018h,03Ch,000h ; Hex #69 + Db 00Ch,000h,01Ch,00Ch,00Ch,06Ch,06Ch,038h ; Hex #6A + Db 070h,030h,033h,036h,03Ch,036h,077h,000h ; Hex #6B + Db 038h,018h,018h,018h,018h,018h,03Ch,000h ; Hex #6C + Db 000h,000h,076h,07Fh,06Bh,06Bh,06Bh,000h ; Hex #6D + Db 000h,000h,076h,03Bh,033h,033h,073h,000h ; Hex #6E + Db 000h,000h,03Ch,066h,066h,066h,03Ch,000h ; Hex #6F + Db 000h,000h,06Eh,033h,033h,03Eh,030h,078h ; Hex #70 + Db 000h,000h,03Ah,066h,066h,03Eh,006h,00Fh ; Hex #71 + Db 000h,000h,06Eh,03Bh,033h,030h,078h,000h ; Hex #72 + Db 000h,000h,03Eh,070h,03Ch,00Eh,07Ch,000h ; Hex #73 + Db 008h,018h,03Eh,018h,018h,01Ah,00Ch,000h ; Hex #74 + Db 000h,000h,066h,066h,066h,066h,03Bh,000h ; Hex #75 + Db 000h,000h,073h,032h,036h,01Ch,008h,000h ; Hex #76 + Db 000h,000h,06Bh,06Bh,07Fh,036h,022h,000h ; Hex #77 + Db 000h,000h,073h,036h,01Ch,036h,067h,000h ; Hex #78 + Db 000h,000h,077h,033h,01Ah,00Ch,06Ch,038h ; Hex #79 + Db 000h,000h,07Eh,04Ch,018h,032h,07Eh,000h ; Hex #7A + Db 00Eh,018h,018h,070h,018h,018h,00Eh,000h ; Hex #7B + Db 018h,018h,018h,018h,018h,018h,018h,000h ; Hex #7C + Db 070h,018h,018h,00Eh,018h,018h,070h,000h ; Hex #7D + Db 039h,04Eh,000h,000h,000h,000h,000h,000h ; Hex #7E + Db 008h,01Ch,01Ch,036h,026h,063h,07Fh,07Fh ; Hex #7F + Db 01Dh,033h,061h,060h,060h,031h,00Eh,01Ch ; Hex #80 + Db 06Ch,000h,066h,066h,066h,066h,03Bh,000h ; Hex #81 + Db 00Ch,018h,03Ch,066h,07Eh,060h,03Eh,000h ; Hex #82 + Db 018h,03Ch,03Ch,066h,01Eh,066h,07Bh,000h ; Hex #83 + Db 01Ch,036h,008h,01Eh,036h,03Fh,063h,000h ; Hex #84 + Db 030h,018h,03Ch,066h,01Eh,066h,07Bh,000h ; Hex #85 + Db 03Fh,06Ah,06Ah,03Ah,00Ah,00Ah,01Ah,000h ; Hex #86 + Db 000h,000h,03Eh,066h,060h,036h,01Ch,038h ; Hex #87 + Db 018h,03Ch,03Ch,066h,07Eh,060h,03Eh,000h ; Hex #88 + Db 036h,000h,03Ch,066h,07Eh,060h,03Eh,000h ; Hex #89 + Db 030h,018h,03Ch,066h,07Eh,060h,03Eh,000h ; Hex #8A + Db 06Ch,000h,038h,018h,018h,018h,03Ch,000h ; Hex #8B + Db 018h,03Ch,000h,038h,018h,018h,03Ch,000h ; Hex #8C + Db 000h,000h,000h,000h,000h,0FFh,000h,0FFh ; Hex #8D + Db 01Ch,006h,01Ch,016h,036h,03Fh,063h,000h ; Hex #8E + Db 03Ch,076h,038h,06Ch,036h,01Ch,06Eh,03Ch ; Hex #8F + Db 006h,00Ch,07Fh,031h,03Ch,031h,07Fh,000h ; Hex #90 + Db 018h,00Ch,07Fh,031h,03Ch,031h,07Fh,000h ; Hex #91 + Db 01Ch,036h,07Fh,031h,03Ch,031h,07Fh,000h ; Hex #92 + Db 018h,03Ch,03Ch,066h,066h,066h,03Ch,000h ; Hex #93 + Db 036h,000h,07Fh,031h,03Ch,031h,07Fh,000h ; Hex #94 + Db 066h,000h,03Ch,018h,018h,018h,03Ch,000h ; Hex #95 + Db 018h,03Ch,042h,066h,066h,066h,03Bh,000h ; Hex #96 + Db 030h,018h,066h,066h,066h,066h,03Bh,000h ; Hex #97 + Db 000h,066h,07Eh,024h,024h,07Eh,066h,000h ; Hex #98 + Db 01Ch,036h,03Eh,063h,063h,036h,01Ch,000h ; Hex #99 + Db 036h,041h,063h,063h,063h,063h,03Eh,000h ; Hex #9A + Db 006h,004h,03Ch,06Eh,068h,06Ah,03Ch,030h ; Hex #9B + Db 01Eh,033h,033h,07Ch,039h,05Bh,076h,000h ; Hex #9C + Db 018h,06Dh,063h,063h,063h,063h,03Eh,000h ; Hex #9D + Db 01Ch,036h,041h,063h,063h,063h,03Eh,000h ; Hex #9E + Db 00Eh,01Bh,018h,03Eh,018h,018h,058h,070h ; Hex #9F + Db 018h,018h,018h,000h,000h,018h,018h,018h ; Hex #A0 + Db 00Ch,018h,030h,000h,000h,000h,000h,000h ; Hex #A1 + Db 00Ch,018h,03Ch,066h,066h,066h,03Ch,000h ; Hex #A2 + Db 00Ch,018h,066h,066h,066h,066h,03Bh,000h ; Hex #A3 + Db 036h,000h,000h,000h,000h,000h,000h,000h ; Hex #A4 + Db 000h,000h,000h,000h,000h,000h,00Eh,01Ch ; Hex #A5 + Db 03Ch,066h,01Ch,066h,03Ch,000h,000h,000h ; Hex #A6 + Db 0FFh,000h,000h,000h,000h,000h,000h,000h ; Hex #A7 + Db 018h,024h,03Ch,018h,018h,018h,03Ch,000h ; Hex #A8 + Db 000h,000h,000h,07Eh,060h,060h,000h,000h ; Hex #A9 + Db 000h,000h,000h,07Eh,006h,006h,000h,000h ; Hex #AA + Db 060h,066h,06Ch,07Eh,03Bh,066h,04Ch,00Fh ; Hex #AB + Db 060h,066h,06Ch,07Bh,037h,06Bh,04Fh,003h ; Hex #AC + Db 070h,05Bh,036h,05Fh,07Fh,03Bh,06Fh,043h ; Hex #AD + Db 000h,01Bh,036h,06Ch,06Ch,036h,01Bh,000h ; Hex #AE + Db 000h,06Ch,036h,01Bh,01Bh,036h,06Ch,000h ; Hex #AF + Db 011h,044h,011h,044h,011h,044h,011h,044h ; Hex #B0 + Db 055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh ; Hex #B1 + Db 0EEh,0BBh,0EEh,0BBh,0EEh,0BBh,0EEh,0BBh ; Hex #B2 + Db 018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B3 + Db 018h,018h,018h,0F8h,0F8h,018h,018h,018h ; Hex #B4 + Db 018h,018h,0F8h,0F8h,018h,0F8h,018h,018h ; Hex #B5 + Db 034h,034h,034h,0F4h,0F4h,034h,034h,034h ; Hex #B6 + Db 000h,000h,000h,0F8h,0FCh,034h,034h,034h ; Hex #B7 + Db 000h,000h,0F0h,0F8h,018h,0F8h,018h,018h ; Hex #B8 + Db 034h,034h,0F4h,0F4h,004h,0F4h,034h,034h ; Hex #B9 + Db 034h,034h,034h,034h,034h,034h,034h,034h ; Hex #BA + Db 000h,000h,0F8h,0FCh,004h,0F4h,034h,034h ; Hex #BB + Db 034h,034h,0F4h,0F4h,004h,0FCh,000h,000h ; Hex #BC + Db 034h,034h,034h,0FCh,0FCh,000h,000h,000h ; Hex #BD + Db 018h,018h,0F8h,0F8h,018h,0F8h,000h,000h ; Hex #BE + Db 000h,000h,000h,0F8h,0F8h,018h,018h,018h ; Hex #BF + Db 018h,018h,018h,01Fh,01Fh,000h,000h,000h ; Hex #C0 + Db 018h,018h,018h,0FFh,0FFh,000h,000h,000h ; Hex #C1 + Db 000h,000h,000h,0FFh,0FFh,018h,018h,018h ; Hex #C2 + Db 018h,018h,018h,01Fh,01Fh,018h,018h,018h ; Hex #C3 + Db 000h,000h,000h,0FFh,0FFh,000h,000h,000h ; Hex #C4 + Db 018h,018h,018h,0FFh,0FFh,018h,018h,018h ; Hex #C5 + Db 018h,018h,01Fh,01Fh,018h,01Fh,018h,018h ; Hex #C6 + Db 034h,034h,034h,037h,037h,034h,034h,034h ; Hex #C7 + Db 034h,034h,037h,037h,030h,01Fh,000h,000h ; Hex #C8 + Db 000h,000h,03Fh,03Fh,030h,037h,034h,034h ; Hex #C9 + Db 034h,034h,0F7h,0F7h,000h,0FFh,000h,000h ; Hex #CA + Db 000h,000h,0FFh,0FFh,000h,0F7h,034h,034h ; Hex #CB + Db 034h,034h,037h,037h,030h,037h,034h,034h ; Hex #CC + Db 000h,000h,0FFh,0FFh,000h,0FFh,000h,000h ; Hex #CD + Db 034h,034h,0F7h,0F7h,000h,0F7h,034h,034h ; Hex #CE + Db 018h,018h,0FFh,0FFh,000h,0FFh,000h,000h ; Hex #CF + Db 034h,034h,034h,0FFh,0FFh,000h,000h,000h ; Hex #D0 + Db 000h,000h,0FFh,0FFh,000h,0FFh,018h,018h ; Hex #D1 + Db 000h,000h,000h,0FFh,0FFh,034h,034h,034h ; Hex #D2 + Db 034h,034h,034h,03Fh,01Fh,000h,000h,000h ; Hex #D3 + Db 018h,018h,01Fh,01Fh,018h,00Fh,000h,000h ; Hex #D4 + Db 000h,000h,01Fh,01Fh,018h,01Fh,018h,018h ; Hex #D5 + Db 000h,000h,000h,03Fh,03Fh,034h,034h,034h ; Hex #D6 + Db 034h,034h,034h,0FFh,0FFh,034h,034h,034h ; Hex #D7 + Db 018h,018h,0FFh,0FFh,018h,0FFh,018h,018h ; Hex #D8 + Db 018h,018h,018h,0F8h,0F8h,000h,000h,000h ; Hex #D9 + Db 000h,000h,000h,01Fh,01Fh,018h,018h,018h ; Hex #DA + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #DB + Db 000h,000h,000h,000h,0FFh,0FFh,0FFh,0FFh ; Hex #DC + Db 0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h ; Hex #DD + Db 00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh ; Hex #DE + Db 0FFh,0FFh,0FFh,0FFh,000h,000h,000h,000h ; Hex #DF + Db 000h,000h,03Dh,06Eh,066h,06Eh,03Bh,000h ; Hex #E0 + Db 03Ch,066h,06Ch,066h,063h,07Bh,06Eh,000h ; Hex #E1 + Db 07Fh,033h,031h,030h,030h,030h,078h,000h ; Hex #E2 + Db 000h,03Fh,07Eh,054h,014h,036h,066h,000h ; Hex #E3 + Db 07Fh,033h,018h,00Ch,018h,033h,07Fh,000h ; Hex #E4 + Db 000h,000h,03Fh,06Ch,06Ch,06Ch,038h,000h ; Hex #E5 + Db 000h,000h,033h,033h,033h,037h,06Dh,060h ; Hex #E6 + Db 000h,03Fh,07Eh,050h,018h,01Ch,00Ch,000h ; Hex #E7 + Db 01Ch,008h,03Eh,06Bh,03Eh,008h,01Ch,000h ; Hex #E8 + Db 01Ch,036h,063h,07Fh,063h,036h,01Ch,000h ; Hex #E9 + Db 01Ch,036h,063h,063h,036h,055h,077h,000h ; Hex #EA + Db 01Ch,030h,018h,02Ch,066h,066h,03Ch,000h ; Hex #EB + Db 000h,036h,07Fh,04Dh,059h,07Fh,036h,000h ; Hex #EC + Db 000h,000h,036h,06Fh,06Bh,03Eh,008h,00Ch ; Hex #ED + Db 000h,000h,01Eh,030h,03Eh,030h,01Eh,000h ; Hex #EE + Db 03Ch,066h,066h,066h,066h,066h,066h,000h ; Hex #EF + Db 000h,07Eh,000h,07Eh,000h,07Eh,000h,000h ; Hex #F0 + Db 018h,018h,07Eh,018h,018h,000h,07Eh,000h ; Hex #F1 + Db 060h,038h,00Eh,038h,060h,000h,07Eh,000h ; Hex #F2 + Db 006h,01Ch,070h,01Ch,006h,000h,07Eh,000h ; Hex #F3 + Db 00Eh,01Bh,01Ah,018h,018h,018h,018h,018h ; Hex #F4 + Db 018h,018h,018h,018h,058h,0D8h,070h,000h ; Hex #F5 + Db 018h,018h,000h,07Eh,000h,018h,018h,000h ; Hex #F6 + Db 000h,03Bh,06Eh,000h,03Bh,06Eh,000h,000h ; Hex #F7 + Db 01Ch,036h,036h,01Ch,000h,000h,000h,000h ; Hex #F8 + Db 000h,000h,018h,03Ch,018h,000h,000h,000h ; Hex #F9 + Db 000h,000h,000h,018h,000h,000h,000h,000h ; Hex #FA + Db 003h,002h,006h,024h,06Ch,038h,018h,010h ; Hex #FB + Db 076h,03Bh,033h,033h,033h,000h,000h,000h ; Hex #FC + Db 03Ch,066h,00Ch,038h,07Eh,000h,000h,000h ; Hex #FD + Db 000h,000h,03Ch,03Ch,03Ch,03Ch,000h,000h ; Hex #FE + Db 000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FF +LEN_D863 EQU ($-D863) + ; +POST_EGA863 EQU $ ; + ; + ; +CODE ENDS ; + END ; diff --git a/v4.0/src/DEV/DISPLAY/LCD/865-CPI.ASM b/v4.0/src/DEV/DISPLAY/LCD/865-CPI.ASM new file mode 100644 index 0000000..3dff339 --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/LCD/865-CPI.ASM @@ -0,0 +1,292 @@ +CODE SEGMENT BYTE PUBLIC 'CODE' + ASSUME CS:CODE,DS:CODE + +IF1 + %OUT EGA.CPI creation file + %OUT . + %OUT CP SRC files: + %OUT . + %OUT . CODE PAGE: 865 +ENDIF + +EGA865: DW LEN_865 ;SIZE OF ENTRY HEADER +;;;;;;;;DW POST_EGA865,0 ;POINTER TO NEXT HEADER + DW -1,-1 ;NO MORE TO COME......LAST ENTRY + DW 1 ;DEVICE TYPE + DB "LCD " ;DEVICE SUBTYPE ID + DW 865 ;CODE PAGE ID + DW 3 DUP(0) ;RESERVED + DW OFFSET DATA865,0 ;POINTER TO FONTS +LEN_865 EQU ($-EGA865) + +DATA865:DW 1 ;CART/NON-CART + DW 1 ;# OF FONTS + DW LEN_D865 ;LENGTH OF DATA +D865: ; + DB 8,8 ;CHARACTER BOX SIZE + DB 0,0 ;ASPECT RATIO (UNUSED) + DW 256 ;NUMBER OF CHARACTERS + Db 000h,000h,000h,000h,000h,000h,000h,000h ; Hex #0 + Db 03Ch,042h,0A5h,0A5h,081h,0BDh,05Ah,03Ch ; Hex #1 + Db 03Ch,07Eh,0DBh,0DBh,0FFh,0C3h,066h,03Ch ; Hex #2 + Db 036h,07Fh,07Fh,07Fh,03Eh,01Ch,008h,000h ; Hex #3 + Db 008h,01Ch,03Eh,07Fh,03Eh,01Ch,008h,000h ; Hex #4 + Db 01Ch,03Eh,01Ch,07Fh,07Fh,036h,008h,01Ch ; Hex #5 + Db 008h,01Ch,03Eh,07Fh,07Fh,036h,008h,01Ch ; Hex #6 + Db 000h,000h,018h,03Ch,03Ch,018h,000h,000h ; Hex #7 + Db 0FFh,0FFh,0E7h,0C3h,0C3h,0E7h,0FFh,0FFh ; Hex #8 + Db 000h,000h,03Ch,066h,066h,03Ch,000h,000h ; Hex #9 + Db 0FFh,0FFh,0C3h,099h,099h,0C3h,0FFh,0FFh ; Hex #A + Db 007h,003h,03Eh,066h,066h,066h,03Ch,000h ; Hex #B + Db 03Ch,066h,066h,066h,03Ch,018h,03Ch,018h ; Hex #C + Db 008h,00Ch,00Eh,00Ah,00Ah,008h,038h,030h ; Hex #D + Db 018h,016h,019h,017h,071h,061h,007h,006h ; Hex #E + Db 048h,06Bh,03Eh,0E4h,027h,07Ch,0D6h,012h ; Hex #F + Db 040h,070h,07Ch,07Fh,07Ch,070h,040h,000h ; Hex #10 + Db 001h,007h,01Fh,07Fh,01Fh,007h,001h,000h ; Hex #11 + Db 018h,03Ch,07Eh,018h,018h,07Eh,03Ch,018h ; Hex #12 + Db 036h,036h,036h,036h,036h,000h,036h,000h ; Hex #13 + Db 03Fh,06Ah,06Ah,03Ah,00Ah,00Ah,01Ah,000h ; Hex #14 + Db 03Ch,076h,038h,06Ch,036h,01Ch,06Eh,03Ch ; Hex #15 + Db 000h,000h,000h,07Fh,07Fh,07Fh,000h,000h ; Hex #16 + Db 018h,03Ch,07Eh,018h,07Eh,03Ch,018h,0FFh ; Hex #17 + Db 018h,03Ch,07Eh,05Ah,018h,018h,018h,000h ; Hex #18 + Db 018h,018h,018h,05Ah,07Eh,03Ch,018h,000h ; Hex #19 + Db 000h,00Ch,006h,07Fh,07Fh,006h,00Ch,000h ; Hex #1A + Db 000h,018h,030h,07Fh,07Fh,030h,018h,000h ; Hex #1B + Db 000h,000h,060h,060h,07Fh,07Fh,000h,000h ; Hex #1C + Db 000h,014h,036h,07Fh,07Fh,036h,014h,000h ; Hex #1D + Db 008h,008h,01Ch,01Ch,03Eh,03Eh,07Fh,000h ; Hex #1E + Db 07Fh,03Eh,03Eh,01Ch,01Ch,008h,008h,000h ; Hex #1F + Db 000h,000h,000h,000h,000h,000h,000h,000h ; Hex #20 + Db 018h,018h,018h,018h,018h,000h,018h,000h ; Hex #21 + Db 036h,036h,014h,000h,000h,000h,000h,000h ; Hex #22 + Db 00Ah,00Ah,03Fh,014h,07Eh,028h,028h,000h ; Hex #23 + Db 008h,03Eh,068h,03Eh,00Bh,07Eh,008h,000h ; Hex #24 + Db 001h,03Fh,052h,06Ch,01Bh,035h,076h,000h ; Hex #25 + Db 01Ch,036h,01Ch,03Bh,06Eh,066h,03Bh,000h ; Hex #26 + Db 018h,018h,030h,000h,000h,000h,000h,000h ; Hex #27 + Db 006h,00Ch,018h,018h,018h,00Ch,006h,000h ; Hex #28 + Db 030h,018h,00Ch,00Ch,00Ch,018h,030h,000h ; Hex #29 + Db 000h,036h,01Ch,07Fh,01Ch,036h,000h,000h ; Hex #2A + Db 000h,018h,018h,07Eh,018h,018h,000h,000h ; Hex #2B + Db 000h,000h,000h,000h,000h,018h,018h,030h ; Hex #2C + Db 000h,000h,000h,07Eh,000h,000h,000h,000h ; Hex #2D + Db 000h,000h,000h,000h,000h,018h,018h,000h ; Hex #2E + Db 003h,006h,00Ch,018h,030h,060h,040h,000h ; Hex #2F + Db 018h,02Ch,066h,066h,066h,034h,018h,000h ; Hex #30 + Db 018h,018h,038h,018h,018h,018h,03Ch,000h ; Hex #31 + Db 03Ch,066h,066h,00Ch,018h,032h,07Eh,000h ; Hex #32 + Db 03Ch,066h,00Ch,01Ch,006h,066h,03Ch,000h ; Hex #33 + Db 00Ch,01Ch,02Ch,06Ch,07Eh,00Ch,01Eh,000h ; Hex #34 + Db 07Eh,060h,07Ch,066h,006h,066h,03Ch,000h ; Hex #35 + Db 01Ch,030h,060h,07Ch,066h,066h,03Ch,000h ; Hex #36 + Db 07Eh,066h,04Ch,00Ch,018h,018h,038h,000h ; Hex #37 + Db 03Ch,066h,076h,03Ch,06Eh,066h,03Ch,000h ; Hex #38 + Db 03Ch,066h,066h,03Eh,006h,00Ch,038h,000h ; Hex #39 + Db 000h,018h,018h,000h,000h,018h,018h,000h ; Hex #3A + Db 000h,018h,018h,000h,000h,018h,018h,030h ; Hex #3B + Db 006h,00Ch,018h,030h,018h,00Ch,006h,000h ; Hex #3C + Db 000h,000h,07Eh,000h,07Eh,000h,000h,000h ; Hex #3D + Db 030h,018h,00Ch,006h,00Ch,018h,030h,000h ; Hex #3E + Db 03Ch,066h,026h,00Ch,018h,000h,018h,000h ; Hex #3F + Db 03Eh,041h,05Dh,055h,05Fh,040h,03Eh,000h ; Hex #40 + Db 01Ch,00Ch,01Ch,016h,03Eh,023h,063h,000h ; Hex #41 + Db 07Ch,036h,036h,03Eh,033h,033h,07Eh,000h ; Hex #42 + Db 01Dh,033h,061h,060h,060h,031h,01Eh,000h ; Hex #43 + Db 07Ch,036h,033h,033h,033h,036h,07Ch,000h ; Hex #44 + Db 07Fh,031h,034h,03Ch,034h,031h,07Fh,000h ; Hex #45 + Db 07Fh,031h,034h,03Ch,034h,030h,078h,000h ; Hex #46 + Db 01Dh,033h,061h,060h,067h,033h,01Fh,000h ; Hex #47 + Db 066h,066h,066h,07Eh,066h,066h,066h,000h ; Hex #48 + Db 03Ch,018h,018h,018h,018h,018h,03Ch,000h ; Hex #49 + Db 01Fh,006h,006h,006h,066h,066h,03Ch,000h ; Hex #4A + Db 067h,066h,06Ch,078h,06Ch,066h,067h,000h ; Hex #4B + Db 078h,030h,030h,030h,031h,033h,07Fh,000h ; Hex #4C + Db 041h,063h,077h,07Fh,06Bh,063h,063h,000h ; Hex #4D + Db 043h,063h,073h,07Bh,06Fh,067h,063h,000h ; Hex #4E + Db 01Ch,036h,063h,063h,063h,036h,01Ch,000h ; Hex #4F + Db 07Eh,033h,033h,03Eh,030h,030h,078h,000h ; Hex #50 + Db 01Ch,036h,063h,063h,06Bh,036h,01Ch,007h ; Hex #51 + Db 07Ch,066h,066h,07Ch,06Ch,066h,067h,000h ; Hex #52 + Db 03Eh,066h,070h,03Ch,00Eh,066h,07Ch,000h ; Hex #53 + Db 07Eh,05Ah,018h,018h,018h,018h,03Ch,000h ; Hex #54 + Db 063h,063h,063h,063h,063h,063h,03Eh,000h ; Hex #55 + Db 077h,062h,036h,034h,01Ch,018h,008h,000h ; Hex #56 + Db 063h,063h,06Bh,06Bh,03Eh,036h,022h,000h ; Hex #57 + Db 066h,066h,03Ch,018h,03Ch,066h,066h,000h ; Hex #58 + Db 0E7h,066h,034h,018h,018h,018h,03Ch,000h ; Hex #59 + Db 07Eh,066h,04Ch,018h,032h,066h,07Eh,000h ; Hex #5A + Db 01Eh,018h,018h,018h,018h,018h,01Eh,000h ; Hex #5B + Db 060h,030h,018h,00Ch,006h,003h,001h,000h ; Hex #5C + Db 03Ch,00Ch,00Ch,00Ch,00Ch,00Ch,03Ch,000h ; Hex #5D + Db 008h,01Ch,036h,000h,000h,000h,000h,000h ; Hex #5E + Db 000h,000h,000h,000h,000h,000h,000h,0FFh ; Hex #5F + Db 030h,018h,00Ch,000h,000h,000h,000h,000h ; Hex #60 + Db 000h,000h,03Ch,066h,01Eh,066h,07Bh,000h ; Hex #61 + Db 070h,030h,03Eh,03Bh,033h,03Bh,06Eh,000h ; Hex #62 + Db 000h,000h,03Eh,066h,060h,066h,03Ch,000h ; Hex #63 + Db 00Eh,006h,036h,06Eh,066h,066h,03Bh,000h ; Hex #64 + Db 000h,000h,03Ch,066h,07Eh,060h,03Eh,000h ; Hex #65 + Db 00Eh,01Bh,018h,03Eh,018h,018h,03Ch,000h ; Hex #66 + Db 000h,000h,03Dh,066h,038h,03Eh,063h,03Eh ; Hex #67 + Db 070h,030h,036h,03Bh,033h,033h,073h,000h ; Hex #68 + Db 018h,000h,038h,018h,018h,018h,03Ch,000h ; Hex #69 + Db 00Ch,000h,01Ch,00Ch,00Ch,06Ch,06Ch,038h ; Hex #6A + Db 070h,030h,033h,036h,03Ch,036h,077h,000h ; Hex #6B + Db 038h,018h,018h,018h,018h,018h,03Ch,000h ; Hex #6C + Db 000h,000h,076h,07Fh,06Bh,06Bh,06Bh,000h ; Hex #6D + Db 000h,000h,076h,03Bh,033h,033h,073h,000h ; Hex #6E + Db 000h,000h,03Ch,066h,066h,066h,03Ch,000h ; Hex #6F + Db 000h,000h,06Eh,033h,033h,03Eh,030h,078h ; Hex #70 + Db 000h,000h,03Ah,066h,066h,03Eh,006h,00Fh ; Hex #71 + Db 000h,000h,06Eh,03Bh,033h,030h,078h,000h ; Hex #72 + Db 000h,000h,03Eh,070h,03Ch,00Eh,07Ch,000h ; Hex #73 + Db 008h,018h,03Eh,018h,018h,01Ah,00Ch,000h ; Hex #74 + Db 000h,000h,066h,066h,066h,066h,03Bh,000h ; Hex #75 + Db 000h,000h,073h,032h,036h,01Ch,008h,000h ; Hex #76 + Db 000h,000h,06Bh,06Bh,07Fh,036h,022h,000h ; Hex #77 + Db 000h,000h,073h,036h,01Ch,036h,067h,000h ; Hex #78 + Db 000h,000h,077h,033h,01Ah,00Ch,06Ch,038h ; Hex #79 + Db 000h,000h,07Eh,04Ch,018h,032h,07Eh,000h ; Hex #7A + Db 00Eh,018h,018h,070h,018h,018h,00Eh,000h ; Hex #7B + Db 018h,018h,018h,018h,018h,018h,018h,000h ; Hex #7C + Db 070h,018h,018h,00Eh,018h,018h,070h,000h ; Hex #7D + Db 039h,04Eh,000h,000h,000h,000h,000h,000h ; Hex #7E + Db 008h,01Ch,01Ch,036h,026h,063h,07Fh,07Fh ; Hex #7F + Db 01Dh,033h,061h,060h,060h,031h,00Eh,01Ch ; Hex #80 + Db 06Ch,000h,066h,066h,066h,066h,03Bh,000h ; Hex #81 + Db 00Ch,018h,03Ch,066h,07Eh,060h,03Eh,000h ; Hex #82 + Db 018h,03Ch,03Ch,066h,01Eh,066h,07Bh,000h ; Hex #83 + Db 036h,000h,03Ch,066h,01Eh,066h,07Bh,000h ; Hex #84 + Db 030h,018h,03Ch,066h,01Eh,066h,07Bh,000h ; Hex #85 + Db 018h,018h,03Ch,066h,01Eh,066h,07Bh,000h ; Hex #86 + Db 000h,000h,03Eh,066h,060h,036h,01Ch,038h ; Hex #87 + Db 018h,03Ch,03Ch,066h,07Eh,060h,03Eh,000h ; Hex #88 + Db 036h,000h,03Ch,066h,07Eh,060h,03Eh,000h ; Hex #89 + Db 030h,018h,03Ch,066h,07Eh,060h,03Eh,000h ; Hex #8A + Db 06Ch,000h,038h,018h,018h,018h,03Ch,000h ; Hex #8B + Db 018h,03Ch,000h,038h,018h,018h,03Ch,000h ; Hex #8C + Db 030h,018h,000h,038h,018h,018h,03Ch,000h ; Hex #8D + Db 036h,008h,01Ch,016h,036h,03Fh,063h,000h ; Hex #8E + Db 01Ch,014h,01Ch,01Eh,036h,03Fh,063h,000h ; Hex #8F + Db 006h,00Ch,07Fh,031h,03Ch,031h,07Fh,000h ; Hex #90 + Db 000h,000h,076h,01Bh,03Fh,06Ch,077h,000h ; Hex #91 + Db 03Fh,03Dh,02Ch,03Eh,06Ch,06Dh,06Fh,000h ; Hex #92 + Db 018h,03Ch,03Ch,066h,066h,066h,03Ch,000h ; Hex #93 + Db 066h,000h,03Ch,066h,066h,066h,03Ch,000h ; Hex #94 + Db 030h,018h,03Ch,066h,066h,066h,03Ch,000h ; Hex #95 + Db 018h,03Ch,042h,066h,066h,066h,03Bh,000h ; Hex #96 + Db 030h,018h,066h,066h,066h,066h,03Bh,000h ; Hex #97 + Db 036h,000h,077h,033h,01Ah,00Ch,06Ch,038h ; Hex #98 + Db 063h,01Ch,036h,063h,063h,036h,01Ch,000h ; Hex #99 + Db 036h,041h,063h,063h,063h,063h,03Eh,000h ; Hex #9A + Db 000h,004h,03Ch,06Eh,07Eh,076h,03Ch,020h ; Hex #9B + Db 01Eh,033h,033h,07Ch,039h,05Bh,076h,000h ; Hex #9C + Db 01Dh,036h,067h,06Bh,073h,036h,05Ch,000h ; Hex #9D + Db 078h,06Ch,06Ch,07Ah,066h,06Fh,066h,003h ; Hex #9E + Db 00Eh,01Bh,018h,03Eh,018h,018h,058h,070h ; Hex #9F + Db 00Ch,018h,03Ch,066h,01Eh,066h,07Bh,000h ; Hex #A0 + Db 018h,030h,000h,038h,018h,018h,03Ch,000h ; Hex #A1 + Db 00Ch,018h,03Ch,066h,066h,066h,03Ch,000h ; Hex #A2 + Db 00Ch,018h,066h,066h,066h,066h,03Bh,000h ; Hex #A3 + Db 01Ah,02Ch,076h,03Bh,033h,033h,073h,000h ; Hex #A4 + Db 01Ah,02Ch,073h,07Bh,06Fh,067h,063h,000h ; Hex #A5 + Db 01Eh,036h,036h,01Fh,000h,03Fh,000h,000h ; Hex #A6 + Db 01Ch,036h,036h,01Ch,000h,03Eh,000h,000h ; Hex #A7 + Db 018h,000h,018h,030h,064h,066h,03Ch,000h ; Hex #A8 + Db 000h,000h,000h,07Eh,060h,060h,000h,000h ; Hex #A9 + Db 000h,000h,000h,07Eh,006h,006h,000h,000h ; Hex #AA + Db 060h,066h,06Ch,07Eh,03Bh,066h,04Ch,00Fh ; Hex #AB + Db 060h,066h,06Ch,07Bh,037h,06Bh,04Fh,003h ; Hex #AC + Db 018h,000h,018h,018h,018h,018h,018h,000h ; Hex #AD + Db 000h,01Bh,036h,06Ch,06Ch,036h,01Bh,000h ; Hex #AE + Db 000h,066h,07Eh,024h,024h,07Eh,066h,000h ; Hex #AF + Db 011h,044h,011h,044h,011h,044h,011h,044h ; Hex #B0 + Db 055h,0AAh,055h,0AAh,055h,0AAh,055h,0AAh ; Hex #B1 + Db 0EEh,0BBh,0EEh,0BBh,0EEh,0BBh,0EEh,0BBh ; Hex #B2 + Db 018h,018h,018h,018h,018h,018h,018h,018h ; Hex #B3 + Db 018h,018h,018h,0F8h,0F8h,018h,018h,018h ; Hex #B4 + Db 018h,018h,0F8h,0F8h,018h,0F8h,018h,018h ; Hex #B5 + Db 034h,034h,034h,0F4h,0F4h,034h,034h,034h ; Hex #B6 + Db 000h,000h,000h,0F8h,0FCh,034h,034h,034h ; Hex #B7 + Db 000h,000h,0F0h,0F8h,018h,0F8h,018h,018h ; Hex #B8 + Db 034h,034h,0F4h,0F4h,004h,0F4h,034h,034h ; Hex #B9 + Db 034h,034h,034h,034h,034h,034h,034h,034h ; Hex #BA + Db 000h,000h,0F8h,0FCh,004h,0F4h,034h,034h ; Hex #BB + Db 034h,034h,0F4h,0F4h,004h,0FCh,000h,000h ; Hex #BC + Db 034h,034h,034h,0FCh,0FCh,000h,000h,000h ; Hex #BD + Db 018h,018h,0F8h,0F8h,018h,0F8h,000h,000h ; Hex #BE + Db 000h,000h,000h,0F8h,0F8h,018h,018h,018h ; Hex #BF + Db 018h,018h,018h,01Fh,01Fh,000h,000h,000h ; Hex #C0 + Db 018h,018h,018h,0FFh,0FFh,000h,000h,000h ; Hex #C1 + Db 000h,000h,000h,0FFh,0FFh,018h,018h,018h ; Hex #C2 + Db 018h,018h,018h,01Fh,01Fh,018h,018h,018h ; Hex #C3 + Db 000h,000h,000h,0FFh,0FFh,000h,000h,000h ; Hex #C4 + Db 018h,018h,018h,0FFh,0FFh,018h,018h,018h ; Hex #C5 + Db 018h,018h,01Fh,01Fh,018h,01Fh,018h,018h ; Hex #C6 + Db 034h,034h,034h,037h,037h,034h,034h,034h ; Hex #C7 + Db 034h,034h,037h,037h,030h,01Fh,000h,000h ; Hex #C8 + Db 000h,000h,03Fh,03Fh,030h,037h,034h,034h ; Hex #C9 + Db 034h,034h,0F7h,0F7h,000h,0FFh,000h,000h ; Hex #CA + Db 000h,000h,0FFh,0FFh,000h,0F7h,034h,034h ; Hex #CB + Db 034h,034h,037h,037h,030h,037h,034h,034h ; Hex #CC + Db 000h,000h,0FFh,0FFh,000h,0FFh,000h,000h ; Hex #CD + Db 034h,034h,0F7h,0F7h,000h,0F7h,034h,034h ; Hex #CE + Db 018h,018h,0FFh,0FFh,000h,0FFh,000h,000h ; Hex #CF + Db 034h,034h,034h,0FFh,0FFh,000h,000h,000h ; Hex #D0 + Db 000h,000h,0FFh,0FFh,000h,0FFh,018h,018h ; Hex #D1 + Db 000h,000h,000h,0FFh,0FFh,034h,034h,034h ; Hex #D2 + Db 034h,034h,034h,03Fh,01Fh,000h,000h,000h ; Hex #D3 + Db 018h,018h,01Fh,01Fh,018h,00Fh,000h,000h ; Hex #D4 + Db 000h,000h,01Fh,01Fh,018h,01Fh,018h,018h ; Hex #D5 + Db 000h,000h,000h,03Fh,03Fh,034h,034h,034h ; Hex #D6 + Db 034h,034h,034h,0FFh,0FFh,034h,034h,034h ; Hex #D7 + Db 018h,018h,0FFh,0FFh,018h,0FFh,018h,018h ; Hex #D8 + Db 018h,018h,018h,0F8h,0F8h,000h,000h,000h ; Hex #D9 + Db 000h,000h,000h,01Fh,01Fh,018h,018h,018h ; Hex #DA + Db 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; Hex #DB + Db 000h,000h,000h,000h,0FFh,0FFh,0FFh,0FFh ; Hex #DC + Db 0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h,0F0h ; Hex #DD + Db 00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh,00Fh ; Hex #DE + Db 0FFh,0FFh,0FFh,0FFh,000h,000h,000h,000h ; Hex #DF + Db 000h,000h,03Dh,06Eh,066h,06Eh,03Bh,000h ; Hex #E0 + Db 03Ch,066h,06Ch,066h,063h,07Bh,06Eh,000h ; Hex #E1 + Db 07Fh,033h,031h,030h,030h,030h,078h,000h ; Hex #E2 + Db 000h,03Fh,07Eh,054h,014h,036h,066h,000h ; Hex #E3 + Db 07Fh,033h,018h,00Ch,018h,033h,07Fh,000h ; Hex #E4 + Db 000h,000h,03Fh,06Ch,06Ch,06Ch,038h,000h ; Hex #E5 + Db 000h,000h,033h,033h,033h,037h,06Dh,060h ; Hex #E6 + Db 000h,03Fh,07Eh,050h,018h,01Ch,00Ch,000h ; Hex #E7 + Db 01Ch,008h,03Eh,06Bh,03Eh,008h,01Ch,000h ; Hex #E8 + Db 01Ch,036h,063h,07Fh,063h,036h,01Ch,000h ; Hex #E9 + Db 01Ch,036h,063h,063h,036h,055h,077h,000h ; Hex #EA + Db 01Ch,030h,018h,02Ch,066h,066h,03Ch,000h ; Hex #EB + Db 000h,036h,07Fh,04Dh,059h,07Fh,036h,000h ; Hex #EC + Db 001h,003h,03Eh,067h,06Bh,073h,03Eh,040h ; Hex #ED + Db 000h,000h,01Eh,030h,03Eh,030h,01Eh,000h ; Hex #EE + Db 03Ch,066h,066h,066h,066h,066h,066h,000h ; Hex #EF + Db 000h,07Eh,000h,07Eh,000h,07Eh,000h,000h ; Hex #F0 + Db 018h,018h,07Eh,018h,018h,000h,07Eh,000h ; Hex #F1 + Db 060h,038h,00Eh,038h,060h,000h,07Eh,000h ; Hex #F2 + Db 006h,01Ch,070h,01Ch,006h,000h,07Eh,000h ; Hex #F3 + Db 00Eh,01Bh,01Ah,018h,018h,018h,018h,018h ; Hex #F4 + Db 018h,018h,018h,018h,058h,0D8h,070h,000h ; Hex #F5 + Db 018h,018h,000h,07Eh,000h,018h,018h,000h ; Hex #F6 + Db 000h,03Bh,06Eh,000h,03Bh,06Eh,000h,000h ; Hex #F7 + Db 01Ch,036h,036h,01Ch,000h,000h,000h,000h ; Hex #F8 + Db 000h,000h,018h,03Ch,018h,000h,000h,000h ; Hex #F9 + Db 000h,000h,000h,018h,000h,000h,000h,000h ; Hex #FA + Db 003h,002h,006h,024h,06Ch,038h,018h,010h ; Hex #FB + Db 076h,03Bh,033h,033h,033h,000h,000h,000h ; Hex #FC + Db 03Ch,066h,00Ch,038h,07Eh,000h,000h,000h ; Hex #FD + Db 000h,000h,03Ch,03Ch,03Ch,03Ch,000h,000h ; Hex #FE + Db 000h,000h,000h,000h,000h,000h,000h,000h ; Hex #FF +LEN_D865 EQU ($-D865) + ; +POST_EGA865 EQU $ ; + ; +include copyrigh.inc + +CODE ENDS + END diff --git a/v4.0/src/DEV/DISPLAY/LCD/COPYRIGH.ASM b/v4.0/src/DEV/DISPLAY/LCD/COPYRIGH.ASM new file mode 100644 index 0000000..d144cf9 --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/LCD/COPYRIGH.ASM @@ -0,0 +1,10 @@ +CODE SEGMENT BYTE PUBLIC 'CODE' + ASSUME CS:CODE,DS:CODE + + DB 13,10 + DB "Microsoft MS-DOS (R) LCD Display Font File",13,10 +include copyrigh.inc + DB 1Ah + +CODE ENDS + END diff --git a/v4.0/src/DEV/DISPLAY/LCD/FONT-R3.ASM b/v4.0/src/DEV/DISPLAY/LCD/FONT-R3.ASM new file mode 100644 index 0000000..b450e61 --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/LCD/FONT-R3.ASM @@ -0,0 +1,15 @@ +CODE SEGMENT BYTE PUBLIC 'CODE' + ASSUME CS:CODE,DS:CODE + +BEGIN: ORG 0 + +FNTHEAD:DB 0FFH,"FONT " ;FILE TAG + DB 8 DUP(0) ;RESERVED + DW 1 ;CNT OF POINTERS IN HEADER + DB 1 ;TYPE FOR INFO POINTER + DW OFFSET INFO,0 ;POINTER TO INFO IN FILE +INFO: DW 5 ;COUNT OF ENTRIES + +CODE ENDS + END + \ No newline at end of file diff --git a/v4.0/src/DEV/DISPLAY/LCD/LCD.LNK b/v4.0/src/DEV/DISPLAY/LCD/LCD.LNK new file mode 100644 index 0000000..ef24e8f --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/LCD/LCD.LNK @@ -0,0 +1,8 @@ +FONT-R3+ +437-CPI+ +850-CPI+ +860-CPI+ +863-CPI+ +865-CPI+ +COPYRIGH; + \ No newline at end of file diff --git a/v4.0/src/DEV/DISPLAY/LCD/MAKEFILE b/v4.0/src/DEV/DISPLAY/LCD/MAKEFILE new file mode 100644 index 0000000..18ba576 --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/LCD/MAKEFILE @@ -0,0 +1,32 @@ +#************************ Makefile for Display\LCD ************************ + +inc =..\..\..\inc +msg =..\..\..\message +dos =..\..\..\dos +hinc =..\..\..\h + +# +######################### Dependencies Begin Here ######################### +# + +all: lcd.cpi + +865-cpi.obj: 865-cpi.asm + +860-cpi.obj: 860-cpi.asm + +437-cpi.obj: 437-cpi.asm + +863-cpi.obj: 863-cpi.asm + +850-cpi.obj: 850-cpi.asm + +copyrigh.obj: copyrigh.asm $(inc)\copyrigh.inc + +font-r3.obj: font-r3.asm + +lcd.cpi: font-r3.obj 437-cpi.obj 850-cpi.obj 860-cpi.obj \ + 863-cpi.obj 865-cpi.obj copyrigh.obj lcd.lnk makefile + link @lcd.lnk + exe2bin font-r3.exe lcd.cpi + del font-r3.exe diff --git a/v4.0/src/DEV/DISPLAY/MACROS.INC b/v4.0/src/DEV/DISPLAY/MACROS.INC new file mode 100644 index 0000000..6e316ac --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/MACROS.INC @@ -0,0 +1,29 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; *** MACROS **** MACROS **** MACROS **** +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +IF1 ; + %OUT . MACROS .INC +ENDIF ; + ; +JUMP MACRO LBL ; + LOCAL A ; +.XCREF ; + IFNDEF LBL&_J ; IS THIS FIRST INVOKATION +A: JMP LBL ; + ELSE ; + IF (LBL&_J GE $) OR ($-LBL&_J GT 126) +A: JMP LBL ; IS THE JUMP TOO FAR AWAY? + ELSE ; +A: JMP LBL&_J ; PERFORM SHORT JUMP + ENDIF ; + ENDIF ; +LBL&_J=A ; +.CREF ; + ENDM ; +.XCREF JUMP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; *** MACROS **** MACROS **** MACROS **** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + \ No newline at end of file diff --git a/v4.0/src/DEV/DISPLAY/MAKEFILE b/v4.0/src/DEV/DISPLAY/MAKEFILE new file mode 100644 index 0000000..a0eb06e --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/MAKEFILE @@ -0,0 +1,53 @@ +#************************* Makefile for Display *************************** + +inc =..\..\inc +msg =..\..\messages +dos =..\..\dos +hinc =..\..\h +make =nmake + +# +######################## Dependencies Begin Here ########################## + +all: display.sys ega.cpi lcd.cpi + +display.ctl: display.skl $(msg)\$(COUNTRY).msg + +display.obj: display.asm makefile \ + macros.inc \ + def-equ.inc \ + int2fcom.inc \ + int10com.inc \ + cps-func.inc \ + write.inc \ + f-parser.inc + +init.obj: init.asm makefile \ + macros.inc \ + def-equ.inc \ + $(inc)\sysmsg.inc \ + $(inc)\versiona.inc \ + display.ctl \ + tables.inc + +parser.obj: parser.asm makefile \ + def-equ.inc \ + $(inc)\struc.inc \ + $(inc)\parse.asm + +display.sys: display.obj init.obj parser.obj display.lnk makefile zero.dat + link @display.lnk + exe2bin display.exe display.sys < zero.dat + del display.exe + +ega.cpi: + cd ega + $(make) + cd .. + +lcd.cpi: + cd lcd + $(make) + cd .. + + diff --git a/v4.0/src/DEV/DISPLAY/PARSER.ASM b/v4.0/src/DEV/DISPLAY/PARSER.ASM new file mode 100644 index 0000000..d72a40e --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/PARSER.ASM @@ -0,0 +1,809 @@ +PAGE ,132 +TITLE PARSE CODE AND CONTROL BLOCKS FOR DISPLAY.SYS + +;****************** START OF SPECIFICATIONS ************************** +; +; MODULE NAME: PARSER.ASM +; +; DESCRIPTIVE NAME: PARSES THE DEVICE= STATEMENT IN CONFIG.SYS FOR +; DISPLAY.SYS +; +; FUNCTION: THE COMMAND LINE PASSED TO DISPLAY.SYS IN THE CONFIG.SYS +; STATEMENT IS PARSED TO CHECK FOR CORRECT SYNTAX. A TABLE +; IS SETUP CONTAINING THE VALUES FOUND. +; +; ENTRY POINT: PARSER +; +; INPUT: ES:DI POINTS TO REQUEST HEADER +; +; AT EXIT: +; NORMAL: TABLE SET UP WITH VALUES FOUND. +; +; ERROR: 0 RETURNED IN FIRST WORD OF TABLE. +; +; INTERNAL REFERENCES: +; +; ROUTINES: SYSPARSE - PARSING CODE +; +; DATA AREAS: PARMSx - PARSE CONTROL BLOCK FOR SYSPARSE +; TABLE - TO CONTAIN VALUES FOUND IN DEVICE= LINE +; +; EXTERNAL REFERENCES: +; +; ROUTINES: N/A +; +; DATA AREAS: N/A +; +; NOTES: +; +; REVISION HISTORY: +; AN000; - DOS Version 4.00 +; AN001 - GHG P897 - Changes to the parser forced the inclusion +; of the '=' in the device ID. +; +; Label: "The DOS DISPLAY.SYS Device Driver" +; "Version 4.00 (C) Copyright 1988 Microsoft +; "Licensed Material - Program Property of Microsoft" +; +;****************** END OF SPECIFICATIONS **************************** +;Modification history ********************************************************* +;AN002; P1895 DISPLAY.SYS rejects command CON=(cga,(437),(0,0)) 10/22/87 J.K. +;****************************************************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; The following is the table structure of the parser. All fields are +; two bytes field (accept for the device and id name) +; +; TABLE HEADER : +; +; Ŀ +; N = Number of devices. +; Ĵ +; Device # 1 offset >Ŀ +; Ĵ +; Device # 2 offset Table_1 (a) +; Ĵ +; Device # 3 offset +; Ĵ +; Device # 4 offset +; +; +; +; N = 1,2,3 or 4. A two bytes number indicating the number of device specified. +; DEVICE # N OFFSET : a two bytes offset address to table_1. (ie. Device #1 offset +; is a pointer to table_1 (a). Device #2 offset is a pointer to table_1 +; (b)...etc.). If an error was detected in the command N is set to zero. +; +; +; +; TABLE_1 : +; +; +; Ŀ Ŀ +; N = Number of Offsets. +; Ĵ ij Table_2 (a) +; Device Name offset +; Ĵ +; Device Id offset Ŀ +; Ĵ Ŀ +; Device HWCP offset Ŀ +; Ĵ ij Table_3 (a) +; Device Desg offset Ŀ +; Ĵ +; "Reserved" +; Ŀ +; +; ij Table_4 (a) +; +; +; Ŀ +; +; ij Table_5 (a) +; +; +; +; +; N=Length of table_1, or the number of offsets contained in table_1. +; The offsets are pointers (two bytes) to the parameters value of the device. +; "Reserved" : a two byte memory reserved for future use of the "PARMS" option. +; +; +; TABLE_2 : +; +; +; Ŀ +; N = Length of devices name +; Ĵ +; Device name +; +; +; N = Length of device name. Device length is always 8 byte long. +; Device Name : the name of the device (eg. LPT1, CON, PRN). The name +; is paded with spaces to make up the rest of the 8 characters. +; +; +; +; TABLE_3 : +; +; +; Ŀ +; N = Length of Id name. +; Ĵ +; Id Name +; +; +; N = Length of id name. Id name length is always 8 byte long. +; Id Name : the name of the id (eg. EGA, VGA). The name +; is paded with spaces to make up the rest of the 8 character. +; +; +; +; TABLE_4 : +; +; +; Ŀ +; N = Length of table. +; Ĵ +; HWCP # 1 +; Ĵ +; HWCP # 2 +; Ĵ +; . +; . +; . +; Ĵ +; HWCP # 10 +; +; +; +; N = Length of table in words. Or the number of HWCP's. +; HWCP # N : a hardware code page number converted to binary. The maximum +; number of pages allowed is 10. +; +; +; +; TABLE_5 : +; +; +; Ŀ +; N = Length of table. +; Ĵ +; Designate +; Ĵ +; Font +; +; +; N = Lenght of table. 0 - nothing was specified +; 1 - Only a designate was specified. +; 2 - Designate and font were given. If the Desg field +; was left empty in the DEVICE command then the +; Designate field is filled with 0FFFFH. +; Designate, Font : Are the Desg. and Font binary numbers. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +INCLUDE DEF-EQU.INC ; structures and equates ;AN000; + +.XLIST +INCLUDE STRUC.INC ; Structured macros ;AN000; +.LIST + +PUBLIC PARSER ; near procedure for parsing DEVICE= statement ;AN000; +PUBLIC TABLE ; table for variable storage used by INIT module. ;AN000; +PUBLIC GET_DEVICE_ID ; procedure to determine device adapter ;AN000; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Set assemble switches for parse code +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +DateSW EQU 0 ;AN000; +DrvSW EQU 0 ;AN000; +SwSW EQU 0 ;AN000; +Val1SW EQU 0 ;AN000; +Val2SW EQU 0 ;AN000; +Val3SW EQU 0 ;AN000; + + +CODE SEGMENT PUBLIC BYTE 'CODE' + ASSUME CS:CODE + + +.XLIST +INCLUDE PARSE.ASM ; Parsing code ;AN000; +.LIST + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PARM control block for DISPLAY.SYS - DEVICE= command statement. +; Command line looks like: +; +; DEVICE=[d:][path]DISPLAY.SYS CON[:]=(type[,[hwcp][,n]]) +; or +; DEVICE=[d:][path]DISPLAY.SYS CON[:]=(type[,[hwcp][,(n,m)]]) +; or, for compatibility with DOS 3.3; PTM P1895 +; DEVICE=[d:][path]DISPLAY.SYS CON[:]=(type[,[(hwcp)][,n|(n,m)]]) +; +; The command line will be parsed from left to right, taking care of the +; nesting of complex lists as they occur. +; +; The first level of control blocks is shown below. +; Complex list control blocks follow. +; Null VALUE LIST and RESULT BUFFER are placed after all other PARSE control +; blocks. +; +; d:\path\DISPLAY.SYS CON=(complex list) +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +PARMS1 LABEL WORD ;AN000; + DW PARMSX1 ;AN000; + DB 0 ; no extra delimeters or EOLs. ;AN000; + +PARMSX1 LABEL BYTE ;AN000; + DB 1,1 ; min,max positional operands ;AN000; + DW D_NAME ; pointer to control block ;AN000; + DB 0 ; no switches ;AN000; + DB 1 ; 1 keywords ;AN000; + DW DSP_LIST ; pointer to control block ;AN000; + +D_NAME LABEL WORD ;AN000; + DW 0200H ; file spec ;AN000; + DW 0001H ; cap result by file table ;AN000; + DW RESULT_BUF ; result ;AN000; + DW NOVALS ; no value checking done ;AN000; + DB 0 ; no keyword/switch synonyms ;AN000; + +DSP_LIST LABEL WORD ;AN000; + DW 0400H ; complex list, ignore colon ;AN000; + DW 0012H ; cap result by char table ;AN000; + DW RESULT_BUF ; result ;AN000; + DW NOVALS ; no value checking done ;AN000; + DB 2 ; 1 keyword ;AN000; + DB "CON=",0 ;GHG CON[:]= keyword ;AN001; + DB "CON:=",0 ;GHG ;AN001; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PARM control block for second level of nesting. +; ie. complex list from first level of nesting +; +; (type, hwcp, n or complex list) +;or, +; (type, (hwcp), n or complex list) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +PARMS2 LABEL WORD ;AN000; + DW PARMSX2 ;AN000; + DB 0 ; no extra delimeters or EOLs. ;AN000; + +PARMSX2 LABEL BYTE ;AN000; + DB 0,3 ; min,max positional operands ;AN000; + DW DSP_TYPE ; pointer to control block ;AN000; + DW HWCP ; pointer to control block ;AN000; + DW CP_PREPS ; pointer to control block ;AN000; + DB 0 ; no switches ;AN000; + DB 0 ; no keywords ;AN000; + +DSP_TYPE LABEL BYTE ;AN000; + DW 2001H ; sstring (optional) ;AN000; + DW 0002H ; cap by char table ;AN000; + DW RESULT_BUF ; result ;AN000; + DW NOVALS ; value list ;AN000; + DB 0 ; no keyword/switch synonyms ;AN000; + + +HWCP LABEL BYTE ;AN000; + DW 8401H ;AN002; numeric or complex list (optional) + DW 0 ; no functions ;AN000; + DW RESULT_BUF ; result ;AN000; + DW NOVALS ; no value checking done ;AN000; + DB 0 ; no keyword/switch synonyms ;AN000; + +CP_PREPS LABEL BYTE ;AN000; + DW 8401H ; numeric or complex list (optional) ;AN000; + DW 0 ; no functions ;AN000; + DW RESULT_BUF ; result ;AN000; + DW NOVALS ; value list ;AN000; + DB 0 ; no keyword/switch synonyms ;AN000; + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PARM control block for third level of nesting. +; ie. complex list from second nesting level +; +; (hwcp) +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +PARMS3_X LABEL WORD ;AN002; + DW PARMSX3_X ;AN002; + DB 0 ;AN002; no extra delimeters or EOLs. + +PARMSX3_X LABEL BYTE ;AN002; + DB 1,1 ;AN002; min,max positional operands + DW PREPS ;AN002; pointer to control block + DB 0 ;AN002; no switches + DB 0 ;AN002; no keywords + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PARM control block for third level of nesting. +; ie. complex list from second nesting level +; +; (n,m) +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +PARMS3 LABEL WORD ;AN000; + DW PARMSX3 ;AN000; + DB 0 ; no extra delimeters or EOLs. ;AN000; + +PARMSX3 LABEL BYTE ;AN000; + DB 1,2 ; min,max positional operands ;AN000; + DW PREPS ; pointer to control block ;AN000; + DW SUBFONTS ; pointer to control block ;AN000; + DB 0 ; no switches ;AN000; + DB 0 ; no keywords ;AN000; + +PREPS LABEL BYTE ;AN000; + DW 8000H ; numeric ;AN000; + DW 0 ; no functions ;AN000; + DW RESULT_BUF ; result ;AN000; + DW NOVALS ; value list ;AN000; + DB 0 ; no keyword/switch synonyms ;AN000; + +SUBFONTS LABEL BYTE ;AN000; + DW 8001H ; numeric (optional) ;AN000; + DW 0 ; no functions ;AN000; + DW RESULT_BUF ; result ;AN000; + DW NOVALS ; no value checking done ;AN000; + DB 0 ; no keyword/switch synonyms ;AN000; + +; Null VALUE LIST and RESULT BUFFER for all PARSE control blocks ;AN000; + +NOVALS LABEL BYTE ;AN000; + DB 0 ; no value checking done ;AN000; + +RESULT_BUF LABEL BYTE ;AN000; +RESULT_TYPE DB ? ; type returned (number, string, etc.) ;AN000; + DB ? ; matched item tag (if applicable) ;AN000; + DW ? ; synonym ptr (if applicable) ;AN000; +RESULT_VAL DD ? ; value ;AN000; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; TABLE STRUCTURE FOR RETURNING VALUES TO THE INIT MODULE +; (ADAPTED FROM VERSION 1.0 DISPLAY.SYS) +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +TABLE LABEL BYTE ; table header ;AN000; +DEVICE_NUM DW ONE ; should only be one device ;AN000; +TABLE2_PTR DW TABLE2 ; pointer to table 2 ;AN000; + +TABLE2 LABEL WORD ;AN000; +OFFSET_NUM DW FOUR ; 4 pointer follow ;AN000; +TABLE3_PTR DW TABLE3 ; pointer to table 3 (device name) ;AN000; +TABLE4_PTR DW TABLE4 ; pointer to table 4 (device id) ;AN000; +TABLE5_PTR DW TABLE5 ; pointer to table 5 (hwcp's) ;AN000; +TABLE6_PTR DW TABLE6 ; pointer to table 6 (num desg's and fonts) ;AN000; + +TABLE3 LABEL WORD ; device name (ie. CON) ;AN000; +T3_LENGTH DW EIGHT ; length ;AN000; +T3_NAME DB "CON " ; value ;AN000; + +TABLE4 LABEL WORD ; device id. (eg. EGA,MONO...) ;AN000; +T4_LENGTH DW ZERO ; length ;AN000; +T4_NAME DB " " ; value ;AN000; + +TABLE5 LABEL WORD ; hardware code pages ;AN000; +T5_NUM DW ZERO ; only 1 for CON ;AN000; +T5_VALUE DW ? ; value ;AN000; + +TABLE6 LABEL WORD ; Designates and fonts ;AN000; +T6_NUM DW ZERO ; values given (0 - 2 valid) ;AN000; +T6_DESG DW ? ; n value ;AN000; +T6_FONT DW ? ; m value ;AN000; + + +OK_FLAG DB ON ; FLAG INDICATING PARSE STATUS ;AN000; +LOOP1 DB ZERO ;AN000; +LOOP2 DB ZERO ;AN000; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: PARSER +; +; FUNCTION: +; THIS PROCEDURE PARSES THE DEVICE= PARAMETERS FROM THE INIT REQUEST +; BLOCK. +; +; AT ENTRY: ES:DI POINTS TO REQUEST HEADER +; +; AT EXIT: +; NORMAL: TABLE SET UP WITH VALUES FOUND +; +; ERROR: 0 LOADED IN FIRST WORD OF TABLE +; +; AUTHOR: WGR +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +PARSER PROC NEAR ;AN000; + PUSH ES ;AN000; + PUSH BX ;AN000; + PUSH DS ; ;AN000; + PUSH SI ; ;AN000; + LDS SI,RH.RH0_BPBA ; ;AN000; + PUSH CS ; establish ES .. ;AN000; + POP ES ; addressability to data ;AN000; + LEA DI,PARMS1 ; point to PARMS control block ;AN000; + XOR CX,CX ; clear both CX and DX for ;AN000; + XOR DX,DX ; SYSPARSE ;AN000; + CALL SYSPARSE ; move pointer past file spec ;AN000; + CALL SYSPARSE ; do first parse ;AN000; + .WHILE AND ; EOL?...then end parse...and.. ;AN000; + .WHILE ; make sure that flag still ok.. ;AN000; + .IF ; parse error? ;AN000; + MOV OK_FLAG,OFF ; yes...reset flag ;AN000; + .ELSE ; no...process.. ;AN000; + .SELECT ; ;AN000; + .WHEN ; complex string found? ;AN000; + INC LOOP1 ; increment count ;AN000; + .IF ; more than one? ;AN000; + MOV OK_FLAG,OFF ; yes....we have an error ;AN000; + .ELSE ; no .. ;AN000; + CALL PARSE_MAIN ; process complex string.. ;AN000; + .ENDIF ; ;AN000; + .OTHERWISE ; not a complex string so.. ;AN000; + MOV OK_FLAG,OFF ; we have a problem...reset flag ;AN000; + .ENDSELECT ; ;AN000; + CALL SYSPARSE ; continue parsing.. ;AN000; + .ENDIF ; ;AN000; + .ENDWHILE ; ;AN000; + .IF OR ; flag indicating error? ;AN000; + .IF ; or no parameters specified? ;AN000; + MOV DEVICE_NUM,ZERO ; yes...set device number to 0 ;AN000; + STC ; ;AN000; + .ELSE ; ;AN000; + CLC ; ;AN000; + .ENDIF ; ;AN000; + POP SI ; ;AN000; + POP DS ; ;AN000; + POP BX ; ;AN000; + POP ES ; ;AN000; + RET ; ;AN000; +PARSER ENDP ;AN000; + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: PARSE_MAIN +; +; FUNCTION: +; THIS PROCEDURE PARSES THE CON=( ) COMPLEX LIST DEVICE= LINE FOUND +; IN CONFIG.SYS +; +; AT ENTRY: RESULT BUFFER CONTAINS POINTER TO COMPLEX STRING +; +; AT EXIT: +; NORMAL: TABLE SET UP WITH VALUES FOUND +; +; ERROR: OK_FLAG = 0 +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +PARSE_MAIN PROC NEAR ;AN000; + PUSH DI ; setup to parse the nested.. ;AN000; + PUSH DS ; complex string...but save.. ;AN000; + PUSH SI ; current parsing status. ;AN000; + PUSH CX ; ;AN000; + XOR CX,CX ; ;AN000; + LEA DI,PARMS2 ; next control block.. ;AN000; + LDS SI,RESULT_VAL ; point to stored string ;AN000; + CALL SYSPARSE ; ;AN000; + .WHILE AND ; not EOL? and.. ;AN000; + .WHILE ; error flag still ok? ;AN000; + .IF ; check for parse errors ;AN000; + MOV OK_FLAG,OFF ; yes....reset error flag ;AN000; + .ELSE ; no...process ;AN000; + INC LOOP2 ; ;AN000; + .SELECT ; ;AN000; + .WHEN ; simple string ;AN000; + CALL PARSE_STR ; yes...process ;AN000; + .WHEN ; number?.. ;AN000; + CALL PARSE_NUM ; yes...process ;AN000; + .WHEN ; complex string? ;AN000; + CALL PARSE_COMPLEX ;AN002; + .OTHERWISE ; anything else is.. ;AN000; + MOV OK_FLAG,OFF ; an error...reset flag. ;AN000; + .ENDSELECT ; ;AN000; + CALL SYSPARSE ; continue parsing ;AN000; + .ENDIF ; ;AN000; + .ENDWHILE ; ;AN000; + POP CX ; restore original parse.. ;AN000; + POP SI ; registers. ;AN000; + POP DS ; ;AN000; + POP DI ; ;AN000; + RET ; ;AN000; +PARSE_MAIN ENDP + +; +PARSE_COMPLEX PROC ;AN002; + .IF ;AN002; Should be for HWCP + CALL PARSE_COMP_X ;AN002; for (hwcp) + .ELSE ;AN002; + CALL PARSE_COMP ; yes...process for (n,m) ;AN000; + .ENDIF ;AN002; + ret ;AN002; +PARSE_COMPLEX ENDP + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: PARSE_COMP_X +; +; FUNCTION: +; THIS PROCEDURE PARSES A COMPLEX LIST FOUND WITHIN THE CON=( ) +; COMPLEX LIST for (hwcp). +; +; AT ENTRY: RESULT BUFFER CONTAINS POINTER TO COMPLEX STRING +; +; AT EXIT: +; NORMAL: TABLE SET UP WITH VALUES FOUND +; +; ERROR: OK_FLAG = 0 +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +PARSE_COMP_X PROC NEAR ;AN002; + PUSH DI ;AN002; setup ro parse the nested.. + PUSH DS ;AN002; complex string..saving the.. + PUSH SI ;AN002; current parse status. + PUSH CX ;AN002; + XOR CX,CX ;AN002; + LEA DI,PARMS3_X ;AN002; next control block + LDS SI,RESULT_VAL ;AN002; point to stored string. + CALL SYSPARSE ;AN002; + .WHILE AND ;AN002; not EOL?...and.. + .WHILE ;AN002; error flag still okay? + .IF OR ;AN002; parse error?...or.. + .IF ;AN002; something other than a number.. + MOV OK_FLAG,OFF ;AN002; found?....yes..reset flag. + .ELSE ;AN002; no...process.. + INC T5_NUM ;AN002; increment counter + MOV AX,WORD PTR RESULT_VAL ;AN002; get numeric value into word + MOV T5_VALUE,AX ;AN002; yes...number of designates. + CALL SYSPARSE ;AN002; continue parsing + .ENDIF ;AN002; + .ENDWHILE ;AN002; + POP CX ;AN002; restore previous parse.. + POP SI ;AN002; registers. + POP DS ;AN002; + POP DI ;AN002; + RET ;AN002; +PARSE_COMP_X ENDP ;AN002; + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: PARSE_COMP +; +; FUNCTION: +; THIS PROCEDURE PARSES A COMPLEX LIST FOUND WITHIN THE CON=( ) +; COMPLEX LIST for (n,m). +; +; AT ENTRY: RESULT BUFFER CONTAINS POINTER TO COMPLEX STRING +; +; AT EXIT: +; NORMAL: TABLE SET UP WITH VALUES FOUND +; +; ERROR: OK_FLAG = 0 +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +PARSE_COMP PROC NEAR ;AN000; + PUSH DI ; setup ro parse the nested.. ;AN000; + PUSH DS ; complex string..saving the.. ;AN000; + PUSH SI ; current parse status. ;AN000; + PUSH CX ; ;AN000; + XOR CX,CX ; ;AN000; + LEA DI,PARMS3 ; next control block ;AN000; + LDS SI,RESULT_VAL ; point to stored string. ;AN000; + CALL SYSPARSE ; ;AN000; + .WHILE AND ; not EOL?...and.. ;AN000; + .WHILE ; error flag still okay? ;AN000; + .IF OR ; parse error?...or.. ;AN000; + .IF ; something other than a number.. ;AN000; + MOV OK_FLAG,OFF ; found?....yes..reset flag. ;AN000; + .ELSE ; no...process.. ;AN000; + INC T6_NUM ; increment counter ;AN000; + MOV AX,WORD PTR RESULT_VAL ; get numeric value into word ;AN000; + .IF ; first value found? ;AN000; + MOV T6_DESG,AX ; yes...number of designates. ;AN000; + .ELSE ; else.. ;AN000; + MOV T6_FONT,AX ; second number...number of fonts. ;AN000; + .ENDIF ; ;AN000; + CALL SYSPARSE ; continue parsing ;AN000; + .ENDIF ; ;AN000; + .ENDWHILE ; ;AN000; + POP CX ; restore previous parse.. ;AN000; + POP SI ; registers. ;AN000; + POP DS ; ;AN000; + POP DI ; ;AN000; + RET ; ;AN000; +PARSE_COMP ENDP + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: PARSE_STR +; +; FUNCTION: +; THIS PROCEDURE PARSES A STRING FOUND WITHIN THE CON=( ) STATEMENT +; +; AT ENTRY: RESULT BUFFER POINTS TO ASCIIZ STRING +; +; AT EXIT: +; NORMAL: TABLE SET UP WITH VALUES FOUND +; +; ERROR: N/A +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +PARSE_STR PROC NEAR ;AN000; + PUSH DI ; get source and.. ;AN000; + PUSH DS ; destination registers.. ;AN000; + PUSH SI ; setup. ;AN000; + LDS SI,RESULT_VAL ; ;AN000; + .IF < NE ZERO> ; check for null string ;AN000; + LEA DI,T4_NAME ; ;AN000; + LODSB ; load first character. ;AN000; + .WHILE ; while not at end of ASCIIZ do.. ;AN000; + STOSB ; store.. ;AN000; + LODSB ; load next character.. ;AN000; + .ENDWHILE ; ;AN000; + MOV T4_LENGTH,EIGHT ; value found. ;AN000; + .ENDIF ; ;AN000; + POP SI ; restore registers. ;AN000; + POP DS ; ;AN000; + POP DI ; ;AN000; + RET ;AN000; +PARSE_STR ENDP + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: PARSE_NUM +; +; FUNCTION: +; THIS PROCEDURE PARSES NUMBERS FOUND IN THE CON=( ) STATEMENT +; BLOCK. +; +; AT ENTRY: RESULT BUFFER CONTAINS A DWORD NUMBER VALUE +; +; AT EXIT: +; NORMAL: TABLE SET UP WITH VALUES FOUND +; +; ERROR: N/A +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +PARSE_NUM PROC NEAR ;AN000; + MOV AX,WORD PTR RESULT_VAL ; get value into word form ;AN000; + .IF ; if this is the code page then.. ;AN000; + MOV T5_VALUE,AX ; load that value. ;AN000; + INC T5_NUM ; ;AN000; + .ELSEIF ; ;AN000; + MOV T6_DESG,AX ; must be number of designates.. ;AN000; + INC T6_NUM ; load and increment count ;AN000; + .ENDIF ; ;AN000; + RET ; ;AN000; +PARSE_NUM ENDP ;AN000; + + + ASSUME CS:CODE,DS:CODE + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: GET_DEVICE_ID +; +; FUNCTION: +; THIS PROCEDURE RETURNS THE DISPLAY DEVICE TO THE INIT ROUTINE WHEN +; A DEVICE ID IS NOT SUPPLIED. +; +; AT ENTRY: N/A +; +; AT EXIT: +; NORMAL: DEVICE ID PLACED WITHIN THE TABLE. (EGA OR LCD) +; CARRY IS CLEARED. +; +; ERROR: DEVICE ID IS MONO OR CGA +; CARRY IS SET. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +FUNC_INFO INFO_BLOCK <> ;AN000; + +DEVICE_N_LENGTH EQU EIGHT ;AN000; + +DEVICE_TYPES DB "EGA " ;AN000; + DB "LCD " ;AN000; + +NUM_DEVICE_TYPES EQU ($-DEVICE_TYPES)/DEVICE_N_LENGTH ;AN000; + +DEVICE_FLAG DB 00000000B ;AN000; + + +GET_DEVICE_ID PROC NEAR ;AN000; + PUSH AX ;AN000; + PUSH BX ; ;AN000; + PUSH CX ; s ;AN000; + PUSH DX ; a r ;AN000; + PUSH DI ; v e ;AN000; + PUSH SI ; e g ;AN000; + PUSH ES ; i ;AN000; + PUSH DS ; s ;AN000; + PUSH CS ; t ;AN000; + POP DS ; e ;AN000; + PUSH CS ; r ;AN000; + POP ES ; s ;AN000; + XOR AX,AX ; ;AN000; + MOV AH,FUNC_CALL ; ;AN000; + LEA DI,FUNC_INFO ; ;AN000; + XOR BX,BX ; ;AN000; + INT 10H ; try VGA functionality call ;AN000; + .IF ; worked?....then ;AN000; + OR DEVICE_FLAG,VGA_FOUND ; VGA found. ;AN000; + .ELSE ; no VGA...try EGA ;AN000; + MOV AH,ALT_SELECT ; ;AN000; + MOV BL,EGA_INFO_CALL ; ;AN000; + INT 10H ; ;AN000; + .IF ; if changed then EGA present.. ;AN000; + OR DEVICE_FLAG,EGA_FOUND ; mark as found. ;AN000; + .ELSE ; no EGA...try LCD. ;AN000; + MOV AH,GET_SYS_ID ; get system id.. ;AN000; + INT 15H ; yup....its a convertible..so ;AN000; + .IF AND ;AN000; + MOV AH,GET_STATUS ; check for LCD.. ;AN000; + INT 15H ; ;AN000; + .IF ; yes....bit says LCD..so.. ;AN000; + OR DEVICE_FLAG,LCD_FOUND ; mark as LCD. ;AN000; + .ENDIF ; ;AN000; + .ENDIF ; ;AN000; + .ENDIF ; ;AN000; + .IF ; nothing found?..then exit (eg. MONO) ;AN000; + LEA SI,DEVICE_TYPES ; start of new id's ;AN000; + SAR DEVICE_FLAG,ONE ; shift flag into carry bit ;AN000; + .WHILE NC ; carry not set yet.. ;AN000; + ADD SI,DEVICE_N_LENGTH ; next id ;AN000; + SAR DEVICE_FLAG,ONE ; next flag... ;AN000; + .ENDWHILE ; ;AN000; + PUSH CS ; found....transfer id.. ;AN000; + POP ES ; into the table.. ;AN000; + LEA DI,T4_NAME ; ;AN000; + MOV CX,DEVICE_N_LENGTH ; ;AN000; + REP MOVSB ; ;AN000; + MOV T4_LENGTH,EIGHT ; ;AN000; + CLC ; clear error flag ;AN000; + .ELSE ; ;AN000; + STC ; set error (ie. MONO or CGA found) ;AN000; + .ENDIF ; ;AN000; + POP DS ; r ;AN000; + POP ES ; e r ;AN000; + POP SI ; s e ;AN000; + POP DI ; t g ;AN000; + POP DX ; o i ;AN000; + POP CX ; r s ;AN000; + POP BX ; e t ;AN000; + POP AX ; e ;AN000; + RET ; r ;AN000; +GET_DEVICE_ID ENDP ; s + + + +CODE ENDS + END diff --git a/v4.0/src/DEV/DISPLAY/TABLES.INC b/v4.0/src/DEV/DISPLAY/TABLES.INC new file mode 100644 index 0000000..930762b --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/TABLES.INC @@ -0,0 +1,368 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; TABLES.INC +; +; THIS FILE CONTAINS THE CONFIGURATION INFORMATION FOR THE CPS CON +; DEVICE DRIVER. THE INFORMATION IS INDEXED USING THE FULL DEVICE +; SUB-TYPE ID. +; +; THE TABLE STRUCTURE IS AS FOLLOWS: +; +; DB "........" device sub-type id +; DB 00000xxxb encoded font resolution byte +; DW OFFSET modes pointer to list of display modes +; DW OFFSET fonts pointer to list of font resolutions +; +; Ŀ +; Loading mechanism bit incoding +; +; USER ? +; BIOS SUPPORT +; Ŀ Ŀ +; +; 7 6 5 4 3 2 1 0 +; x x x x 0 0 x x +; 1 - INT 10 - AX=1100H +; +; 1 = INT 10 - AX=1400H +; +; 1 = INT 1FH +; +; 1 = INT 43H +; +; 1 = LCD 1FH handling needed +; +; 1 = LCD 44H handling needed +; +; +; Ŀ +; Memory Requirements +; +; 7 6 5 4 3 2 1 0 +; 0 0 0 0 x x x x +; 200 scan lines +; 350 scan lines +; 400 scan lines +; 480 scan lines +; +; +; +; THE TABLES ARE FILLED BEYOND THE SUPPORTED MODES. THIS +; IS 'GUESSING' AT THE APPROACH FOR ANY FUTURE DISPLAY MODES +; WHICH MAY BE BEYOND THE CON-CPS V1.0 SUPPORT. TO DATE, +; NO ADAPTER SUPPORTS THE EXTRA MODES - NOT EVEN . +; +; Numerous WOULD USE THE +; SUBSET OF THE EGA MODES. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +IF1 + %OUT . TABLES .INC +ENDIF + ; +DISPLAY_CONFIG LABEL BYTE ; + DB "EGA " ; EGA SUPPORT +DC_FONT DB 00000111b ; + DW OFFSET EGA_MODES ; + DW OFFSET EGA_FONT_SIZE ; +DC_ENTRY EQU ($-DISPLAY_CONFIG) ; + DB "EGA 8 " ; EGA (5153) + DB 00000001b ; + DW OFFSET EGA_MODES ; + DW OFFSET EGA8_FONT_SIZE ; + DB "EGA 14 " ; EGA (5154) + DB 00000011b ; + DW OFFSET EGA_MODES ; + DW OFFSET EGA14_FONT_SIZE ; + DB "EGA 14M " ; EGA (5151) + DB 00000011b ; WGR load 8x8 for > 25. ;AN000; + DW OFFSET EGAM_MODES ; + DW OFFSET EGA14_FONT_SIZE ; + DB "LCD " ; CONVERTIBLE + DB 00000001b ; + DW OFFSET LCD_MODES ; + DW OFFSET LCD_FONT_SIZE ; + DB "MONO " ; MONOCHROME ADAPTER + DB 00000000b ; + DW OFFSET MONO_MODES ; + DW OFFSET MONO_FONT_SIZE ; + DB "CGA " ; COLOUR GRAPHICS ADAPTER + DB 00000000b ; + DW OFFSET MONO_MODES ; + DW OFFSET MONO_FONT_SIZE ; +NUM_DISPLAY_CONFIG EQU ($-DISPLAY_CONFIG)/DC_ENTRY +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +EGA_MODES: ; + DB 00000001b ;0 + DB 00000001b ;1 + DB 00000001b ;2 + DB 00000001b ;3 + DB 00110000b ;4 + DB 00110000b ;5 + DB 00110000b ;6 + DB 00000001b ;7 + DB 11111111b ;D;8 Ŀ + DB 11111111b ;D;9 + DB 11111111b ;D;A RESERVED + DB 11111111b ;D;B + DB 11111111b ;D;C + DB 00110000b ;D + DB 00110000b ;E + DB 00100000b ;F + DB 00100000b ;10 + DB 00100000b ;11 + DB 00100000b ;12 + DB 00110000b ;13 + DB 00110000b ;14 + DB 00110000b ;15 + DB 00110000b ;16 + DB 00110000b ;17 + DB 00110000b ;18 + DB 00110000b ;19 + DB 00110000b ;1A + DB 00110000b ;1B + DB 00110000b ;1C + DB 00110000b ;1D + DB 00110000b ;1E + DB 00110000b ;1F +NUM_MODES EQU ($-EGA_MODES) ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +EGAM_MODES: ; + DB 11111111b ;0 + DB 11111111b ;1 + DB 11111111b ;2 + DB 11111111b ;3 + DB 11111111b ;4 + DB 11111111b ;5 + DB 11111111b ;6 + DB 00010001b ;7 + DB 11111111b ;D;8 Ŀ + DB 11111111b ;D;9 + DB 11111111b ;D;A RESERVED + DB 11111111b ;D;B + DB 11111111b ;D;C + DB 11111111b ;D + DB 11111111b ;E + DB 00100000b ;F + DB 11111111b ;10 + DB 11111111b ;11 + DB 11111111b ;12 + DB 11111111b ;13 + DB 11111111b ;14 + DB 11111111b ;15 + DB 11111111b ;16 + DB 11111111b ;17 + DB 11111111b ;18 + DB 11111111b ;19 + DB 11111111b ;1A + DB 11111111b ;1B + DB 11111111b ;1C + DB 11111111b ;1D + DB 11111111b ;1E + DB 11111111b ;1F +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +LCD_MODES: ; + DB 00000010b ;0 + DB 00000010b ;1 + DB 00000010b ;2 + DB 00000010b ;3 + DB 11010000b ;4 + DB 11010000b ;5 + DB 11010000b ;6 + DB 00000010b ;7 + DB 11111111b ;D;8 Ŀ + DB 11111111b ;D;9 + DB 11111111b ;D;A RESERVED + DB 11111111b ;D;B + DB 11111111b ;D;C + DB 11010000b ;D + DB 11010000b ;E + DB 11010000b ;F + DB 11010000b ;10 + DB 11010000b ;11 + DB 11010000b ;12 + DB 11010000b ;13 + DB 11010000b ;14 + DB 11010000b ;15 + DB 11010000b ;16 + DB 11010000b ;17 + DB 11010000b ;18 + DB 11010000b ;19 + DB 11010000b ;1A + DB 11010000b ;1B + DB 11010000b ;1C + DB 11010000b ;1D + DB 11010000b ;1E + DB 11010000b ;1F +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +MONO_MODES: ; +MONO_FONT_SIZE: ; + DB 11111111b ;0 + DB 11111111b ;1 + DB 11111111b ;2 + DB 11111111b ;3 + DB 11111111b ;4 + DB 11111111b ;5 + DB 11111111b ;6 + DB 11111111b ;7 + DB 11111111b ;D;8 Ŀ + DB 11111111b ;D;9 + DB 11111111b ;D;A RESERVED + DB 11111111b ;D;B + DB 11111111b ;D;C + DB 11111111b ;D + DB 11111111b ;E + DB 11111111b ;F + DB 11111111b ;10 + DB 11111111b ;11 + DB 11111111b ;12 + DB 11111111b ;13 + DB 11111111b ;14 + DB 11111111b ;15 + DB 11111111b ;16 + DB 11111111b ;17 + DB 11111111b ;18 + DB 11111111b ;19 + DB 11111111b ;1A + DB 11111111b ;1B + DB 11111111b ;1C + DB 11111111b ;1D + DB 11111111b ;1E + DB 11111111b ;1F +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +EGA_FONT_SIZE: ; this needs to be adjusted + DB 0 ;0 ************************* + DB 0 ;1 ************************* + DB 0 ;2 + DB 0 ;3 + DB 8 ;4 + DB 8 ;5 + DB 8 ;6 + DB 0 ;7 + DB 0FFH ;D;8 Ŀ + DB 0FFH ;D;9 + DB 0FFH ;D;A RESERVED + DB 0FFH ;D;B + DB 0FFH ;D;C + DB 0 ;D + DB 0 ;E + DB 0 ;F + DB 0 ;10 + DB 0 ;11 + DB 0 ;12 + DB 0 ;13 + DB 0 ;14 + DB 0 ;15 + DB 0 ;16 + DB 0 ;17 + DB 0 ;18 + DB 0 ;19 + DB 0 ;1A + DB 0 ;1B + DB 0 ;1C + DB 0 ;1D + DB 0 ;1E + DB 0 ;1F +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +EGA8_FONT_SIZE: ; + DB 8 ;0 + DB 8 ;1 + DB 8 ;2 + DB 8 ;3 + DB 8 ;4 + DB 8 ;5 + DB 8 ;6 + DB 0FFH ;7 + DB 0FFH ;D;8 Ŀ + DB 0FFH ;D;9 + DB 0FFH ;D;A RESERVED + DB 0FFH ;D;B + DB 0FFH ;D;C + DB 8 ;D + DB 8 ;E + DB 8 ;F + DB 0FFH ;10 + DB 0FFH ;11 + DB 0FFH ;12 + DB 0FFH ;13 + DB 0FFH ;14 + DB 0FFH ;15 + DB 0FFH ;16 + DB 0FFH ;17 + DB 0FFH ;18 + DB 0FFH ;19 + DB 0FFH ;1A + DB 0FFH ;1B + DB 0FFH ;1C + DB 0FFH ;1D + DB 0FFH ;1E + DB 0FFH ;1F +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +EGA14_FONT_SIZE: ; + DB 14 ;0 + DB 14 ;1 + DB 14 ;2 + DB 14 ;3 + DB 8 ;4 + DB 8 ;5 + DB 8 ;6 + DB 14 ;7 + DB 0FFH ;D;8 Ŀ + DB 0FFH ;D;9 + DB 0FFH ;D;A RESERVED + DB 0FFH ;D;B + DB 0FFH ;D;C + DB 8 ;D + DB 8 ;E + DB 14 ;F + DB 14 ;10 + DB 0FFH ;11 + DB 0FFH ;12 + DB 0FFH ;13 + DB 0FFH ;14 + DB 0FFH ;15 + DB 0FFH ;16 + DB 0FFH ;17 + DB 0FFH ;18 + DB 0FFH ;19 + DB 0FFH ;1A + DB 0FFH ;1B + DB 0FFH ;1C + DB 0FFH ;1D + DB 0FFH ;1E + DB 0FFH ;1F +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +LCD_FONT_SIZE: ; + DB 8 ;0 + DB 8 ;1 + DB 8 ;2 + DB 8 ;3 + DB 8 ;4 + DB 8 ;5 + DB 8 ;6 + DB 8 ;7 + DB 0FFH ;D;8 Ŀ + DB 0FFH ;D;9 + DB 0FFH ;D;A RESERVED + DB 0FFH ;D;B + DB 0FFH ;D;C + DB 8 ;D + DB 8 ;E + DB 8 ;F + DB 8 ;10 + DB 8 ;11 + DB 8 ;12 + DB 8 ;13 + DB 8 ;14 + DB 8 ;15 + DB 8 ;16 + DB 8 ;17 + DB 8 ;18 + DB 8 ;19 + DB 8 ;1A + DB 8 ;1B + DB 8 ;1C + DB 8 ;1D + DB 8 ;1E + DB 8 ;1F +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/v4.0/src/DEV/DISPLAY/WRITE.INC b/v4.0/src/DEV/DISPLAY/WRITE.INC new file mode 100644 index 0000000..0d6338e --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/WRITE.INC @@ -0,0 +1,373 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; WRITE ROUTINE FOR DESIGNATE WRITE +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +IF1 ; + %OUT . WRITE .INC +ENDIF ; + PUBLIC REDUCED_SUPPORT ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; WRITE DESIGNATE SUPPORT +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +DESG_WRITE PROC ; + CMP CS:DESG_SEMAPHORE,ZERO ; TEST IF DESIGNATE IS ON... + JNE DW_2 ; PASS ONTO DOS + CLC ; + RET ; +DW_2: CMP CS:DESG_SEMAPHORE,ONE ; CHECK IF PROPER DESIGNATE + JE DW_4 ; + OR BUF.STATUS,TEN ; IF NOT, THEN DEVICE ERROR + STC ; + RET ; +DW_4: CALL WRITE ; + RET ; +DESG_WRITE ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +REDUCED_SUPPORT EQU $ ; THIS IS A MARKER FOR REDUCED CPS + ; SUPPORT WITH 0 DESGINATES (CGA,MONO) +WRITE PROC ; + PUSH DS ; + ; + PUSH CS ; + POP DS ; + ; + PUSH SI ;S; + CLI ;S; + MOV SI,SP ;S; + MOV OLD_STACK_O,SI ;S; + MOV SI,SS ;S; + MOV OLD_STACK_S,SI ;S; + MOV AX,OFFSET STACK_START ;S; + MOV SI,CS ;S; + MOV SS,SI ;S; + MOV SP,AX ;S; + STI ;S; + ; + LES DI,DWORD PTR BUF.RH_PTRO; RESTORE ES:DI AS REQUEST HEADER PTR + LEA SI,FTABLE ; GET BASE ADDRESS OF PARSER TABLE + ; + MOV DS:[SI].FLAG,0 ; NO RESTART + MOV AX,RH.RH3_CNT ; + MOV DS:[SI].BUFFER_LEN,AX ; LENGTH OF REQUEST PACKET + ; + PUSH SI ; + LEA SI,[SI].BUFFER_ADDR ; PACKET ADDRESS + MOV AX,RH.RH3_DTAO ; + MOV DS:[SI],AX ; + INC SI ; + INC SI ; + MOV AX,RH.RH3_DTAS ; + MOV DS:[SI],AX ; + POP SI ; + ; + CALL FONT_PARSER ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; FONT PARSER HAS BEEN CALLED, NOW CHECK ALL OF THE +; APPROPRIATE TABLES FOR DATA INFORMATION, ERROR +; CONDITIONS, etc.... +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + LEA SI,FTABLE ; GET BASE ADDRESS OF PARSER TABLE + MOV CX,[SI].NUM_FTBLK ; CX = NUMBER OF PARSING TABLES + LEA SI,FTB1 ; THEN SET SI = FIRST PARSING TABLE + ; +W_1: MOV AX,DS:[SI].FTB_STATUS ; + CMP AX,0FFF0H ; CHECK THE PARSER STATUS + JNB W_3 ; + ; + OR BUF.STATUS,FAIL ; IF THE PARSER FAILED ON THE DATA + MOV RH.RHC_STA,AX ; FILE, THEN SET FLAG AND... + CALL HANDLE_WRITE_ERROR ; + JUMP W_7 ; ERROR HAS BEEN FOUND..DON'T CONTINUE + ; +W_3: CMP AX,FSTAT_FONT ; + JNE W_6 ; + ; + MOV AX,DS:[SI].FTB_DLEN ; + CALL HANDLE_DATA_WRITE ; + ; +W_6: ADD SI,TYPE FTBLK ; ADVANCE SI POINTER TO NEXT TABLE + LOOP W_1 ; CHECK OUT ALL PARSING TABLES + ; +W_7: CLI ;S; + MOV SI,OLD_STACK_S ;S; + MOV AX,OLD_STACK_O ;S; + MOV SS,SI ;S; + MOV SP,AX ;S; + STI ;S; + POP SI ;S; + POP DS ; + STC ; INDICATE NOT TO PASS ON DATA + RET ; +WRITE ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; THIS IS USED TO SET THE CPS DRIVER IN THE CASE OF A +; DESIGNATE ERROR. IT WILL RESET THE DESIGNATED CP's +; TO INVALID, AND IF THE ACTIVE_CP WAS A DESIGNATED CP, +; THEN IT TOO BECOMES INVALID. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +HANDLE_WRITE_ERROR PROC ; + PUSH DS ; + PUSH AX ; + PUSH CX ; + PUSH SI ; + ; + MOV AX,-1 ; ...SET DESGINATE LIST TO (-1)'S + MOV CX,CPD_REQ_DESG ; GET NUMBER AND + MOV SI,2 ; +2 +HWE_3: CMP CPD_REQ_DESG[SI],AX ; CHECK IF REQUESTED PREP WAS VALID + JE HWE_4 ; IF REQUESTED WAS VALID, THEN THE ERROR + MOV CPD_DESG_N[SI],AX ; SETS ACTUAL PREP LIST ENTRY TO INVALID +HWE_4: INC SI ; + INC SI ; + LOOP HWE_3 ; REPEAT FOR #DESIGNATES + ; + MOV CX,CPD_ACTIVE ; + CALL FIND_CP ; CHECK IF ACTIVE_CP=STILL VALID + JNC HWE_2 ; + MOV CX,-1 ; + MOV CPD_ACTIVE,CX ; + ; +HWE_2: POP SI ; + POP CX ; + POP AX ; + POP DS ; + RET ; +HANDLE_WRITE_ERROR ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; THIS SUBROUTINE TAKES THE DATA INFORMATION ISOLATED +; BY THE FONT PARSER AND MOVES INTO THE INTERNAL FONT +; FONT BUFFERS. IT COPIES THE DATA BASED ON THE SIZE +; OF THE INTERNAL FONTS & THE REQUIRED FONT SIZES. +; +; +; INPUT: +; AX = LENGTH OF DATA +; CX = TABLE # TO PARSE +; DS:SI = POINTER TO 'FTBLK' +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +NUM_DATA_FONTS DW ? ; +TABLE_INDEX DW ? ; +LEN_DATA DW ? ; +INDEX_WRITE_PNTER DW ? ; + ; +HANDLE_DATA_WRITE PROC ; + PUSH AX ; + PUSH BX ; + PUSH CX ; + PUSH SI ; + PUSH DI ; + PUSH DS ; + PUSH ES ; + ; + PUSH CX ; + MOV CX,DS:[SI].FTB_FONTS ; READ IN #FONTS FROM DATA FILE + MOV CS:NUM_DATA_FONTS,CX ; + POP CX ; + ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; ROUTINE TO FIND TABLE_INDEX FOR DATA WRITE'S +; THIS WAS ADDED TO ACCOUNT FOR A REPLACEMENT +; TECHNIQUE APPROACH.....(Sept 3/86) +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + PUSH AX ; + PUSH CX ; + PUSH ES ; + ; + PUSH CS ; + POP ES ; + MOV AX,DS:[SI].FTB_CP ; GET THE CODE PAGE OF THIS FONT BLOCK + MOV CX,CPD_DESG_N ; GET THE NUMBER OF CP's TO CHECK + MOV DI,TWO ; +BBB_0: CMP AX,CPD_DESG_N[DI] ; LOOKING FOR A MATCHED CODE PAGE + JE BBB_1 ; + INC DI ; + INC DI ; + LOOP BBB_0 ; + ; +;;;;;;INVALID???;;;;;;;;;;;;;;;;;;;;;;;;; + ; +BBB_1: MOV DI,CPD_DESG_N ; + SUB DI,CX ; + MOV CS:TABLE_INDEX,DI ; +BBB_2: POP ES ; + POP CX ; + POP AX ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + PUSH SI ; + LEA SI,FTABLE ; GET BASE ADDRESS OF PARSER TABLE + SHL DI,1 ; + SHL DI,1 ; MULTIPLY INDEX BY FOUR..SEG:OFFSET + CALL GET_WRITE_PNTR ; GET LOCATION OF 1ST FONT_WRITE PNTER + ADD DI,SI ; DI NOW IS THE POINTER TO WRITE_START + POP SI ; + ; + MOV CS:INDEX_WRITE_PNTER,DI ; SAVE ADDRESS OF INDEX WRITE PNTER + ; + MOV ES,CS:[DI+2] ; SET ES : DI WITH WRITE POINTER! + MOV DI,CS:[DI] ; + ; + MOV CX,DS:[SI].FTB_DAHI ; GET SEGMENT OF DATA + MOV SI,DS:[SI].FTB_DALO ; GET OFFSET OF DATA + MOV DS,CX ; + ; <> + MOV CX,AX ; SAVE LENGTH OF DATA TO COPY + MOV CS:LEN_DATA,CX ; SAVE THIS VALUE + AND CX,CX ; TEST LENGTH OF DATA + JNZ TEMP_0 ; + JUMP HDW_8 ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; NOW DS : SI POINTS TO SOURCE DATA INFORMATION, +; ES : DI POINTS TO THE DESTINATION BUFFER! +; CX = NUMBER OF INFORMATION BYTES AVAILABLE +; THE DATA MUST BE CHECKED FOR THE FONT RESOLUTIONS +; AS THEY ARE TO FIT INTO THE INTERNAL BUFFERS. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +TEMP_0: PUSH AX ; + PUSH BX ; + PUSH CX ; + PUSH SI ; + PUSH DI ; + ; + LEA BX,CPD_FONT_DATA ; TEST IF THERE IS OUTSTANDING DATA + ADD BX,CS:TABLE_INDEX ; FOR INFORMATION TO COPY or SKIP OVER. + ADD BX,CS:TABLE_INDEX ; (ACCOUNT FOR WORD VALUE) + MOV AX,CS:[BX] ; + OR AX,AX ; + JE HDW_00 ; IF NOTHING TO CONSIDER, THEN MOVE ON + TEST AX,8000H ;;;;SKIP/COPY;;;;; TEST IF OUTSTANDING DATA TO COPY/SKIP + JNZ HDW_P0 ; + MOV CX,AX ; SET VALUE IN CX.... + MOV AX,CS:NUM_DATA_FONTS ; + PUSH AX ; + JUMP HDW_3AA ; +HDW_P0: AND AX,7FFFH ; STRIP OFF FIRST BIT... + MOV CX,AX ; + MOV AX,CS:NUM_DATA_FONTS ; + PUSH AX ; + JUMP HDW_5AA ; + ; +HDW_00: MOV CX,CS:NUM_DATA_FONTS ; +HDW_0: CMP CS:LEN_DATA,0 ; TEST IF THERE IS ANY DATA LEFT? + JNE HDW_0A ; + JUMP HDW_6 ; IF 0 LEFT...THEN END... + ; +HDW_0A: MOV AL,[SI] ; GET #ROWS FROM DATA + PUSH CX ; SAVE COUNT + MOV CX,NUM_FONT_PRIORITY ; + LEA BX,FONT_PRIORITY ; SET DI TO START OF TABLE +HDW_1: CMP AL,CS:[BX] ; + JE HDW_3 ; IF EQUAL, THEN ALREADY IN TABLE + INC BX ; OTHERWISE, TAKE THIS MODES FONT RES + LOOP HDW_1 ; AND COMPARE AGAINST NEXT PRIOR.VALUE + JUMP HDW_5 ; IF NO MATCH, THEN IGNORE THIS FONT!!! + ; +HDW_3: XOR AH,AH ; FONT SIZE NEEDED...GET IT! + MOV CX,[SI+4] ; GET THE #CHARACTERS IN TABLE + PUSH DX ; + MUL CX ; + POP DX ; + ADD AX,SIX ; ACCOUNT FOR DATA HEADER + MOV CX,AX ; SET COUNT INTO CX.... + ; +HDW_3AA:CMP CX,CS:LEN_DATA ; TEST IF SUPPLIED DATA>=NEEDED + JBE HDW_3A ; + SUB CX,CS:LEN_DATA ; IF NOT ENOUGH DATA HERE, THEN FORWARD + MOV AX,CX ; VALUE TO NEXT DATA CALL. + CALL SET_CPD_FONT_DATA ; + MOV CX,CS:LEN_DATA ; + JUMP HDW_3B ; + ; +HDW_3A: XOR AX,AX ; + CALL SET_CPD_FONT_DATA ; +HDW_3B: SUB CS:LEN_DATA,CX ; + CLD ; + REP MOVSB ; MOVE THAT RESOLUTION IN... + ; +HDW_4: POP CX ; RESTORE #FONTS IN DATA + LOOP HDW_0 ; + JUMP HDW_6 ; + ; +HDW_5: XOR AH,AH ; FONT SIZE NEEDED...GET IT! + MOV CX,[SI+4] ; GET THE #CHARACTERS IN TABLE + PUSH DX ; + MUL CX ; + POP DX ; + ADD AX,SIX ; ACCOUNT FOR DATA HEADER + MOV CX,AX ; PUT IN CX FOR NOW + ; +HDW_5AA:CMP CX,CS:LEN_DATA ; TEST IF SUPPLIED DATA>=NEEDED + JBE HDW_5A ; + SUB CX,CS:LEN_DATA ; IF NOT ENOUGH DATA HERE, THEN FORWARD + MOV AX,CX ; VALUE TO NEXT DATA CALL. + OR AX,8000H ; SET TO SKIP NEXT DATA.... + CALL SET_CPD_FONT_DATA ; + MOV CX,CS:LEN_DATA ; + JUMP HDW_5B ; + ; +HDW_5A: XOR AX,AX ; + CALL SET_CPD_FONT_DATA ; +HDW_5B: SUB CS:LEN_DATA,CX ; + ADD SI,CX ; ADVANCE SOURCE POINTER OVER THIS FONT + JUMP HDW_4 ; + ; +HDW_6: MOV SI,CS:INDEX_WRITE_PNTER ; + MOV CS:[SI],DI ; + MOV CS:[SI+2],ES ; + ; + POP DI ; + POP SI ; + POP CX ; + POP BX ; + POP AX ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +HDW_8: POP ES ; + POP DS ; + POP DI ; + POP SI ; + POP CX ; + POP BX ; + POP AX ; + RET ; +HANDLE_DATA_WRITE ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; SET_CPD_FONT_DATA +; +; THIS ROUTINE IS USED TO SET THE COPY/SKIP VALUE +; CONTAINED IN 'AX'. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +SET_CPD_FONT_DATA PROC ; + PUSH SI ; + MOV SI,CS:TABLE_INDEX ; + ADD SI,SI ; + MOV CS:CPD_FONT_DATA.[SI],AX; + POP SI ; + RET ; +SET_CPD_FONT_DATA ENDP ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + \ No newline at end of file diff --git a/v4.0/src/DEV/DISPLAY/ZERO.DAT b/v4.0/src/DEV/DISPLAY/ZERO.DAT new file mode 100644 index 0000000..573541a --- /dev/null +++ b/v4.0/src/DEV/DISPLAY/ZERO.DAT @@ -0,0 +1 @@ +0 diff --git a/v4.0/src/DEV/DRIVER/DRIVER.ASM b/v4.0/src/DEV/DRIVER/DRIVER.ASM new file mode 100644 index 0000000..4832e07 --- /dev/null +++ b/v4.0/src/DEV/DRIVER/DRIVER.ASM @@ -0,0 +1,1296 @@ + PAGE 64,132 ; +; SCCSID = @(#)driver.asm 4.13 85/10/15 +; SCCSID = @(#)driver.asm 4.13 85/10/15 +; +; External block device driver +; Hooks into existing routines in IBMBIO block driver via Int 2F mpx # 8. +; This technique minimizes the size of the driver. +; + +; Revised Try_h: to test for flagheads as msg was being displayed on FormFactor +; this caused the FormFactor to be set in the Head +; Revised the # of sectors/cluster for F0h to 1 +;============================================================================== +;REVISION HISTORY: +;AN000 - New for DOS Version 4.00 - J.K. +;AC000 - Changed for DOS Version 4.00 - J.K. +;AN00x - PTM number for DOS Version 4.00 - J.K. +;============================================================================== +;AN001 - d55 Unable the fixed disk accessibility of DRIVER.SYS. 7/7/87 J.K. +;AN002 - p196 Driver.sys does not signal init. failure 8/17/87 J.K. +;AN003 - p267 "No driver letter..." message 8/19/87 J.K. +;AN004 - p268 "Too many parameter..." message 8/20/87 J.K. +;AN005 - p300 "Bad 1.44MB BPB information..." 8/20/87 J.K. +;AN006 - p490 Driver should reject identical parms 8/28/87 J.K. +;AN007 - p921 Parser.ASM problem 9/18/87 J.K. +;AN008 - d493 New init request structure 2/25/88 J.K. +;============================================================================== + +code segment byte public +assume cs:code,ds:code,es:code + +;AN000; +.xlist +include SYSMSG.INC ;equates and macros +.list +MSG_UTILNAME + +iTEST = 0 +;--------------------------------------------------- +; +; Device entry point +; +DSKDEV LABEL WORD + DW -1,-1 ; link to next device + DW 0000100001000000B ; bit 6 indicates DOS 3.20 driver + DW STRATEGY + DW DSK$IN +DRVMAX DB 1 + +; +; Various equates +; +CMDLEN equ 0 ;LENGTH OF THIS COMMAND +UNIT equ 1 ;SUB UNIT SPECIFIER +CMD equ 2 ;COMMAND CODE +STATUS equ 3 ;STATUS +MEDIA equ 13 ;MEDIA DESCRIPTOR +TRANS equ 14 ;TRANSFER ADDRESS +COUNT equ 18 ;COUNT OF BLOCKS OR CHARACTERS +START equ 20 ;FIRST BLOCK TO TRANSFER +EXTRA equ 22 ;Usually a pointer to Vol Id for error 15 +CONFIG_ERRMSG equ 23 ;AN009; To set this field to Non-zero + ; to display "Error in CONFIG.SYS..." + +PTRSAV DD 0 + + +STRATP PROC FAR + +STRATEGY: + MOV WORD PTR CS:[PTRSAV],BX + MOV WORD PTR CS:[PTRSAV+2],ES + RET + +STRATP ENDP + +DSK$IN: + push es + push bx + push ax + les bx,cs:[ptrsav] + cmp byte ptr es:[bx].cmd,0 + jnz Not_Init + jmp DSK$INIT + +not_init: +; Because we are passing the call onto the block driver in IBMBIO, we need to +; ensure that the unit number corresponds to the logical (DOS) unit number, as +; opposed to the one that is relevant to this device driver. + mov al,byte ptr cs:[DOS_Drive_Letter] + mov byte ptr es:[bx].UNIT,al + mov ax,0802H + int 2fH +; +; We need to preserve the flags that are returned by IBMBIO. YUK!!!!! +; + pushf + pop bx + add sp,2 + push bx + popf + +exitp proc far +DOS_Exit: + pop ax + POP BX + POP ES + RET ;RESTORE REGS AND RETURN +EXITP ENDP + +include msbds.inc ; include BDS structures +;include versiona.inc + +BDS DW -1 ;Link to next structure + DW -1 + DB 1 ;Int 13 Drive Number + DB 3 ;Logical Drive Letter +FDRIVE: + DW 512 ;Physical sector size in bytes + DB -1 ;Sectors/allocation unit + DW 1 ;Reserved sectors for DOS + DB 2 ;No. allocation tables + DW 64 ;Number directory entries + DW 9*40 ;Number sectors (at 512 bytes ea.) + DB 00000000B ;Media descriptor, initially 00H. + DW 2 ;Number of FAT sectors + DW 9 ;Sector limit + DW 1 ;Head limit + DW 0 ;Hidden sector count + dw 0 ;AN000; Hidden sector count (High) + dw 0 ;AN000; Number sectors (low) + dw 0 ;AN000; Number sectors (high) + DB 0 ; TRUE => Large fats +OPCNT1 DW 0 ;Open Ref. Count + DB 2 ;Form factor +FLAGS1 DW 0020H ;Various flags + DW 80 ;Number of cylinders in device +RecBPB1 DW 512 ; default is that of 3.5" disk + DB 2 + DW 1 + DB 2 + DW 70h + DW 2*9*80 + DB 0F9H + DW 3 + DW 9 + DW 2 + DW 0 + dw 0 ;AN000; + dw 0 ;AN000; + dw 0 ;AN000; + db 6 dup (0) ;AC000; +TRACK1 DB -1 ;Last track accessed on this drive +TIM_LO1 DW -1 ;Keep these two contiguous (?) +TIM_HI1 DW -1 +VOLID1 DB "NO NAME ",0 ;Volume ID for this disk +VOLSER dd 0 ;AN000; +FILE_ID db "FAT12 ",0 ;AN000; + +DOS_Drive_Letter db ? ; Logical drive associated with this unit + +ENDCODE LABEL WORD ; Everything below this is thrown away + ; after initialisation. + +DskDrv dw offset FDRIVE ; "array" of BPBs + +;AN000; For system parser; + +FarSW equ 0 ; Near call expected + +DateSW equ 0 ; Check date format + +TimeSW equ 0 ; Check time format + +FileSW equ 0 ; Check file specification + +CAPSW equ 0 ; Perform CAPS if specified + +CmpxSW equ 0 ; Check complex list + +NumSW equ 1 ; Check numeric value + +KeySW equ 0 ; Support keywords + +SwSW equ 1 ; Support switches + +Val1SW equ 1 ; Support value definition 1 + +Val2SW equ 1 ; Support value definition 2 + +Val3SW equ 0 ; Support value definition 3 + +DrvSW equ 0 ; Support drive only format + +QusSW equ 0 ; Support quoted string format +;--------------------------------------------------- +;.xlist +assume ds:nothing ;AN007;!!!Parse.ASM sometimes assumes DS + ; to access its own variable!!! + include PARSE.ASM ;together with PSDATA.INC +assume ds:code ;AN007; +;.list +;Control block definitions for PARSER. +;--------------------------------------------------- +Parms label byte + dw Parmsx ;AN000; + db 0 ;AN000;No extras + +Parmsx label byte ;AN000; + db 0,0 ;AN000;No positionals + db 5 ;AN000;5 switch control definitions + dw D_Control ;AN000;/D + dw T_Control ;AN000;/T + dw HS_Control ;AN000;/H, /S + dw CN_Control ;AN000;/C, /N + dw F_Control ;AN000;/F + db 0 ;AN000;no keywords + +D_Control label word ;AN000; + dw 8000h ;AN000;numeric value + dw 0 ;AN000;no functions + dw Result_Val ;AN000;result buffer + dw D_Val ;AN000;value defintions + db 1 ;AN000;# of switch in the following list +Switch_D label byte ;AN000; + db '/D',0 ;AN000; + +D_Val label byte ;AN000; + db 1 ;AN000;# of value defintions + db 1 ;AN000;# of ranges + db 1 ;AN000;Tag value when match +; dd 0,255 ;AN000; + dd 0,127 ;AN001;Do not allow a Fixed disk. + +Result_Val label byte ;AN000; + db ? ;AN000; +Item_Tag label byte ;AN000; + db ? ;AN000; +Synonym_ptr label word ;AN000; + dw ? ;AN000;es:offset -> found Synonym +RV_Byte label byte ;AN000; +RV_Word label word ;AN000; +RV_Dword label dword ;AN000; + dd ? ;AN000;value if number, or seg:off to string + +T_Control label word ;AN000; + dw 8000h ;AN000;numeric value + dw 0 ;AN000;no functions + dw Result_Val ;AN000;result buffer + dw T_Val ;AN000;value defintions + db 1 ;AN000;# of switch in the following list +Switch_T label byte ;AN000; + db '/T',0 ;AN000; + +T_Val label byte ;AN000; + db 1 ;AN000;# of value defintions + db 1 ;AN000;# of ranges + db 1 ;AN000;Tag value when match + dd 1,999 ;AN000; + +HS_Control label word ;AN000; + dw 8000h ;AN000;numeric value + dw 0 ;AN000;no function flag + dw Result_Val ;AN000;Result_buffer + dw HS_VAL ;AN000;value definition + db 2 ;AN000;# of switch in following list +Switch_H label byte ;AN000; + db '/H',0 ;AN000; +Switch_S label byte ;AN000; + db '/S',0 ;AN000; + +HS_Val label byte ;AN000; + db 1 ;AN000;# of value defintions + db 1 ;AN000;# of ranges + db 1 ;AN000;Tag value when match + dd 1,99 ;AN000; + +CN_Control label word ;AN000; + dw 0 ;AN000;no match flags + dw 0 ;AN000;no function flag + dw Result_Val ;AN000;no values returned + dw NoVal ;AN000;no value definition +; db 2 ;AN000;# of switch in following list + db 1 ;AN001; +Switch_C label byte ;AN000; + db '/C',0 ;AN000; +;Switch_N label byte ;AN000; +; db '/N',0 ;AN000; + +Noval db 0 ;AN000; + +F_Control label word ;AN000; + dw 8000h ;AN000;numeric value + dw 0 ;AN000;no function flag + dw Result_Val ;AN000;Result_buffer + dw F_VAL ;AN000;value definition + db 1 ;AN000;# of switch in following list +Switch_F label byte ;AN000; + db '/F',0 ;AN000; + +F_Val label byte ;AN000; + db 2 ;AN000;# of value definitions (Order dependent) + db 0 ;AN000;no ranges + db 4 ;AN000;# of numeric choices +F_Choices label byte ;AN000; + db 1 ;AN000;1st choice (item tag) + dd 0 ;AN000;0 + db 2 ;AN000;2nd choice + dd 1 ;AN000;1 + db 3 ;AN000;3rd choice + dd 2 ;AN000;2 + db 4 ;AN000;4th choice + dd 7 ;AN000;7 + + +;AN000;System messages handler data +;AN000;Put the data here +.sall +MSG_SERVICES + +;AN000;Place the messages here +MSG_SERVICES + +;AN000;Put messages handler code here. +MSG_SERVICES +.xall + +; +; Sets ds:di -> BDS for this drive +; +SetDrive: + push cs + pop ds + mov di,offset BDS + ret + +; +; Place for DSK$INIT to exit +; +ERR$EXIT: + MOV AH,10000001B ;MARK ERROR RETURN + lds bx, cs:[ptrsav] + mov byte ptr ds:[bx.MEDIA], 0 ;AN002; # of units + mov word ptr ds:[bx.CONFIG_ERRMSG], -1 ;AN009;Show IBMBIO error message too. + JMP SHORT ERR1 + +Public EXIT +EXIT: MOV AH,00000001B +ERR1: LDS BX,CS:[PTRSAV] + MOV WORD PTR [BX].STATUS,AX ;MARK OPERATION COMPLETE + +RestoreRegsAndReturn: + POP DS + POP BP + POP DI + POP DX + POP CX + POP AX + POP SI + jmp dos_exit + + +drivenumb db 5 +cyln dw 80 +heads dw 2 +ffactor db 2 +slim dw 9 + +Switches dw 0 + +Drive_Let_Sublist label dword + db 11 ;AN000;length of this table + db 0 ;AN000;reserved + dw D_Letter;AN000; +D_Seg dw ? ;AN000;Segment value. Should be CS + db 1 ;AN000;DRIVER.SYS has only %1 + db 00000000b ;AN000;left align(in fact, Don't care), a character. + db 1 ;AN000;max field width 1 + db 1 ;AN000;min field width 1 + db ' ' ;AN000;character for pad field (Don't care). + +D_Letter db "A" + +if iTEST +Message: + push ax + push ds + push cs + pop ds + mov ah,9 + int 21h + pop ds + pop ax + ret +extrn nodrive:byte,loadokmsg:byte,letter:byte, badvermsg:byte +endif + + +if iTEST +%OUT Testing On +initmsg db "Initializing device driver",13,10,"$" +stratmsg db "In strategy of driver",10,13,"$" +dskinmsg db "In DSKIN part of driver",10,13,"$" +outinitmsg db "Out of init code ",10,13,"$" +exitmsg db "Exiting from driver",10,13,"$" +parsemsg db "Parsing switches",10,13,"$" +errmsg db "Error occurred",10,13,"$" +linemsg db "Parsed line",10,13,"$" +int2fokmsg db "****************Int2f loaded**************",10,13,"$" +mediamsg db "Media check ok",10,13,"$" +getbpbmsg db "getbpb ok",10,13,"$" +iookmsg db "Successful I/O",10,13,"$" +parseokmsg db "Parsing done fine",10,13,"$" +nummsg db "Number read is " +number db "00 ",10,13,"$" +drvmsg db "Process drive " +driven db "0",10,13,"$" +cylnmsg db "Process cylinder ",10,13,"$" +slimmsg db "Process sec/trk ",10,13,"$" +hdmsg db "Process head " +hdnum db "0",10,13,"$" +ffmsg db "Process form factor " +ffnum db "0",10,13,"$" +nxtmsg db "Next switch ",10,13,"$" +msg48tpi db "Got a 48 tpi drive",10,13,"$" + +ENDIF + +DSK$INIT: + PUSH SI + PUSH AX + PUSH CX + PUSH DX + PUSH DI + PUSH BP + PUSH DS + + LDS BX,CS:[PTRSAV] ;GET POINTER TO I/O PACKET + + MOV AL,BYTE PTR DS:[BX].UNIT ;AL = UNIT CODE + MOV AH,BYTE PTR DS:[BX].MEDIA ;AH = MEDIA DESCRIP + MOV CX,WORD PTR DS:[BX].COUNT ;CX = COUNT + MOV DX,WORD PTR DS:[BX].START ;DX = START SECTOR + + LES DI,DWORD PTR DS:[BX].TRANS + + PUSH CS + POP DS + + ASSUME DS:CODE + + cld + push cs ;AN000; Initialize Segment of Sub list. + pop [D_Seg] ;AN000; + call SYSLOADMSG ;AN000; linitialize message handler + jnc GoodVer ;AN000; Error. Do not install driver. + mov cx, 0 ;AN000; No substitution + mov dh, -1 ;AN000; Utility message + call Show_Message ;AN000; Show message + jmp err$exitj2 ;AN000; and exit + +;; check for correct DOS version +; mov ah,30h +; int 21H + +; cmp ax,expected_version +; je GoodVer + +; cmp al,DOSVER_HI +; jnz BadDOSVer +; cmp ah,DOSVER_LO +; jz GoodVer + +;BadDOSVer: +; Mov dx,offset BadVerMsg +; call message +; jmp err$exitj2 ; do not install driver + +GoodVer: + mov ax,0800H + int 2fH ; see if installed + cmp al,0FFH + jnz err$exitj2 ; do not install driver if not present + lds bx,[ptrsav] + mov si,word ptr [bx].count ; get pointer to line to be parsed + mov ax,word ptr [bx].count+2 + mov ds,ax + call Skip_Over_Name ; skip over file name of driver + mov di,offset BDS ; point to BDS for drive + push cs + pop es ; es:di -> BDS + Call ParseLine + jc err$exitj2 + LDS BX,cs:[PTRSAV] + mov al,byte ptr [bx].extra ; get DOS drive letter + mov byte ptr es:[di].DriveLet,al + mov cs:[DOS_Drive_Letter],al + add al,"A" +; mov cs:[letter],al ; set up for printing final message + mov cs:[D_Letter], al ;AN000; + call SetDrvParms ; Set up BDS according to switches + jc err$exitj2 + mov ah,8 ; Int 2f multiplex number + mov al,1 ; install the BDS into the list + push cs + pop ds ; ds:di -> BDS for drive + mov di,offset BDS + int 2FH + lds bx,dword ptr cs:[ptrsav] + mov ah,1 + mov cs:[DRVMAX],ah + mov byte ptr [bx].media,ah + mov ax,offset ENDCODE + mov word ptr [bx].TRANS,AX ; set address of end of code + mov word ptr [bx].TRANS+2,CS + mov word ptr [bx].count,offset DskDrv + mov word ptr [bx].count+2,cs + + push dx + push cs + pop ds + mov si, offset Drive_Let_SubList ;AC000; + mov ax, LOADOK_MSG_NUM ;load ok message + mov cx, 1 ;AN000; 1 substitution + mov dh, -1 ;AN000; utility message + call Show_Message +; mov dx,offset loadokmsg +; call message + pop dx + jmp EXIT + +err$exitj2: + stc + jmp err$exit + +; +; Skips over characters at ds:si until it hits a `/` which indicates a switch +; J.K. If it hits 0Ah or 0Dh, then will return with SI points to that character. +Skip_Over_Name: + call scanblanks +loop_name: + lodsb + cmp al,CR ;AN003; + je End_SkipName ;AN003; + cmp al,LF ;AN003; + je End_SkipName ;AN003; + cmp al,'/' + jnz loop_name +End_SkipName: ;AN003; + dec si ; go back one character + RET + +;ParseLine: +; push di +; push ds +; push si +; push es +;Next_Swt: +;IF iTEST +; mov dx,offset nxtmsg +; call message +;ENDIF +; call ScanBlanks +; lodsb +; cmp al,'/' +; jz getparm +; cmp al,13 ; carriage return +; jz done_line +; CMP AL,10 ; line feed +; jz done_line +; cmp al,0 ; null string +; jz done_line +; mov ax,-2 ; mark error invalid-character-in-input +; stc +; jmp short exitparse +; +;getparm: +; call Check_Switch +; mov cs:Switches,BX ; save switches read so far +; jnc Next_Swt +; cmp ax,-1 ; mark error number-too-large +; stc +; jz exitparse +; mov ax,-2 ; mark invalid parameter +; stc +; jmp short exitparse +; +;done_line: +; test cs:Switches,flagdrive ; see if drive specified +; jnz okay +; push dx +; mov ax, 2 +; call Show_Message +; mov dx,offset nodrive +; call message +; pop dx +; mov ax,-3 ; mark error no-drive-specified +; stc +; jmp short exitparse +; +;okay: +; call SetDrive ; ds:di points to BDS now. +; mov ax,cs:Switches +; and ax,fChangeline+fNon_Removable ; get switches for Non_Removable and Changeline +; or ds:[di].flags,ax +; xor ax,ax ; everything is fine +; +;; +;; Can detect status of parsing by examining value in AX. +;; 0 ==> Successful +;; -1 ==> Number too large +;; -2 ==> Invalid character in input +;; -3 ==> No drive specified +; +; clc +;exitparse: +; pop es +; pop si +; pop ds +; pop di +; ret + + + +ParseLine proc near +;In) DS:SI -> Input string +; ES = CS +; ES:DI -> BDS table inside this program +; +;Out) +; if successfule, then { AX will be set according to the switch +; flag value. BDS.Flag, Drivenumb, cylin, +; slim, heads ffactor are set } +; else +; { +; If (no drive specified) then { display messages }; +; Set carry; +; } +; +;Subroutine to be called: +; SYSPARSE:NEAR, SHOW_MESSAGE:NEAR, GET_RESULT:NEAR +; +;Logic: +;{ While (Not end_of_Line) +; { +; SYSPARSE (); +; if (no error) then +; GET_RESULT () +; else +; Set carry; +; }; +; +; if (carry set) then Exit; /* Initialization failed */ +; if (No drive number entered) /* Drive number is a requirement */ +; then { Show_Message (); +; exit; +; }; +; + assume ds:nothing ;AN000;make sure + push di ;AN000;save BDS pointer + mov di, offset PARMS ;AN000;now, es:di -> parse control definition +SysP_While: ;AN000; + xor cx, cx ;AN004; I don't have positionals. + xor dx, dx ;AN000; + call SYSPARSE ;AN000; + cmp ax, $P_RC_EOL ;AN000;end of line? + je SysP_End ;AN000; + cmp ax, $P_NO_ERROR ;AN000;no error? + jne SysP_Fail ;AN000; + call Get_Result ;AN000; + jmp SysP_While ;AN000; +SysP_End: ;AN000; + test Switches, FLAGDRIVE ;AN000;drive number specified? + jnz SysP_Ok ;AN000;Drive number is a requirement + push ds ;AN000; + mov ax, NODRIVE_MSG_NUM ;AN000;no drive specification + mov cx, 0 ;AN000;no substitutions + mov dh, -1 ;AN000;utility message + call Show_Message ;AN000; + pop ds ;AN000; + jmp short SysP_Err ;AN003; +SysP_Fail: ;AN000; + mov dh, 2 ;AN000; parse error + mov cx, 0 ;AN000; + call Show_Message ;AN000; Show parse error +SysP_Err: ;AN003; + stc ;AN000; + jmp short PL_Ret ;AN000; +SysP_Ok: ;AN000; + clc ;AN000; +PL_Ret: ;AN000; + pop di ;AN000;restore BDS pointer + ret ;AN000; +ParseLine endp + +; +Get_Result proc near +;In) A successful result of SYSPARSE in Result_Val +; es = cs, ds = command line segment +;Out) +; Switches set according to the user option. +; Drivenumb, Cyln, Heads, Slim, ffactor set if specified. +;Logic) +; Switch (Synonym_Ptr) +; { case Switch_D: Switches = Switches | FLAGDRIVE; /* Set switches */ +; Drivenumb = Reg_DX.Value_L; +; break; +; +; case Switch_T: Switches = Switches | Flagcyln; +; Cyln = Reg_DX.Value_L; +; break; +; +; case Switch_H: Switches = Switches | Flagheads; +; Heads = Reg_DX.Value_L; +; break; +; +; case Switch_S: Switches = Switches | FlagSecLim; +; Slim = Reg_DX.Value_L; +; break; +; +; case Switch_C: Switches = Switches | fChangeline; +; break; +; +;; case Switch_N: Switches = Switches | fNon_Removable; +;; break; +; +; case Switch_F: Switches = Switches | Flagff; +; Reg_DX = (Reg_DX.ITEM_Tag - 1)*5;/*Get the offset of +; /*the choice. +; ffactor = byte ptr (F_Choices + DX + 1); +; /*Get the value of it */ +; break; +; +; } +; + + + mov ax, Synonym_Ptr ;AN000; + push ax ;AN006; save Synonym_ptr + cmp ax, offset Switch_D ;AN000; + jne Stch_T ;AN000; + or Switches, FLAGDRIVE ;AN000; + mov al, RV_Byte ;AN000; + mov Drivenumb, al ;AN000; + jmp GR_Ret ;AN000; +Stch_T: ;AN000; + cmp ax, offset Switch_T ;AN000; + jne Stch_H ;AN000; + or Switches, FLAGCYLN ;AN000; + mov ax, RV_Word ;AN000; + mov Cyln, ax ;AN000; + jmp GR_Ret ;AN000; +Stch_H: ;AN000; + cmp ax, offset Switch_H ;AN000; + jne Stch_S ;AN000; + or Switches, FLAGHEADS ;AN000; + mov ax, RV_Word ;AN000; + mov Heads, ax ;AN000; + jmp GR_Ret ;AN000; +Stch_S: ;AN000; + cmp ax, offset Switch_S ;AN000; + jne Stch_C ;AN000; + or Switches, FLAGSECLIM ;AN000; + mov ax, RV_Word ;AN000; + mov Slim, ax ;AN000; + jmp GR_Ret ;AN000; +Stch_C: ;AN000; + cmp ax, offset Switch_C ;AN000; +; jne Stch_N ;AN000; + jne Stch_F ;AN001; + or Switches, fCHANGELINE ;AN000; + jmp GR_Ret ;AN000; +;Stch_N: ;AN000; +; cmp ax, offset Switch_N ;AN000; +; jne Stch_F ;AN000; +; or Switches, fNON_REMOVABLE ;AN000; +; jmp GR_Ret ;AN000; +Stch_F: ;AN000; + cmp ax, offset Switch_F ;AN000; + jne GR_Not_Found_Ret ;AN000;error in SYSPARSE + or Switches, FLAGFF ;AN000; + push si ;AN004; + mov si, offset F_Choices ;AN000; + xor ax, ax ;AN000; + mov al, Item_Tag ;AN000; + dec al ;AN000; + mov cl, 5 ;AN000; + mul cl ;AN000; + add si, ax ;AN000; + mov al, byte ptr es:[si+1] ;AN000;get the result of choices + mov ffactor, al ;AN000;set form factor + pop si ;AN004; +GR_Ret: ;AN000; + pop ax ;AN006; Restore Synonym ptr + push di ;AN006; Save di + push ax ;AN006; + pop di ;AN006; + mov byte ptr es:[di], ' ' ;AN006;We don't have this switch any more. + pop di ;AN006; + jmp short Gr_Done_Ret ;AN006; +GR_Not_Found_Ret: + pop ax ;AN006;adjust stack +GR_Done_Ret: + ret ;AN000; +Get_Result endp + + +; +; Scans an input line for blank or tab characters. On return, the line pointer +; will be pointing to the next non-blank character. +; +ScanBlanks: + lodsb + cmp al,' ' + jz ScanBlanks + cmp al,9 ; Tab character + jz ScanBlanks + dec si + ret + +; +; Gets a number from the input stream, reading it as a string of characters. +; It returns the number in AX. It assumes the end of the number in the input +; stream when the first non-numeric character is read. It is considered an error +; if the number is too large to be held in a 16 bit register. In this case, AX +; contains -1 on return. +; +;GetNum: +; push bx +; push dx +; xor ax,ax +; xor bx,bx +; xor dx,dx +; +;next_char: +; lodsb +; cmp al,'0' ; check for valid numeric input +; jb num_ret +; cmp al,'9' +; ja num_ret +; sub al,'0' +; xchg ax,bx ; save intermediate value +; push bx +; mov bx,10 +; mul bx +; pop bx +; add al,bl +; adc ah,0 +; xchg ax,bx ; stash total +; jc got_large +; cmp dx,0 +; jz next_char +;got_large: +; mov ax,-1 +; jmp short get_ret +; +;num_ret: +; mov ax,bx +; dec si ; put last character back into buffer +; +;get_ret: +; pop dx +; pop bx +; ret + + +; +; Processes a switch in the input. It ensures that the switch is valid, and +; gets the number, if any required, following the switch. The switch and the +; number *must* be separated by a colon. Carry is set if there is any kind of +; error. +; +;Check_Switch: +; lodsb +; and al,0DFH ; convert it to upper case +; cmp al,'A' +; jb err_swtch +; cmp al,'Z' +; ja err_swtch +; mov cl,cs:switchlist ; get number of valid switches +; mov ch,0 +; push es +; push cs +; pop es ; set es:di -> switches +; push di +; mov di,1+offset switchlist ; point to string of valid switches +; repne scasb +; pop di +; pop es +; jnz err_swtch +; mov ax,1 +; shl ax,cl ; set bit to indicate switch +; mov bx,cs:switches +; or bx,ax ; save this with other switches +; mov cx,ax +; test ax,7cH ; test against switches that require number to follow +; jz done_swtch +; lodsb +; cmp al,':' +; jnz reset_swtch +; call ScanBlanks +; call GetNum +; cmp ax,-1 ; was number too large? +; jz reset_swtch +;IF iTEST +; push ax +; add al,'0' +; add ah,'0' +; mov cs:number,ah +; mov cs:number+1,al +; mov dx,offset nummsg +; call message +; pop ax +;ENDIF +; call Process_Num +; +;done_swtch: +; ret +; +;reset_swtch: +; xor bx,cx ; remove this switch from the records +;err_swtch: +; stc +; jmp short done_swtch + +; +; This routine takes the switch just input, and the number following (if any), +; and sets the value in the appropriate variable. If the number input is zero +; then it does nothing - it assumes the default value that is present in the +; variable at the beginning. +; +;Process_Num: +; push ds +; push cs +; pop ds +; test Switches,cx ; if this switch has been done before, +; jnz done_ret ; ignore this one. +; test cx,flagdrive +; jz try_f +; mov drivenumb,al +;IF iTEST +; add al,"0" +; mov driven,al +; mov dx,offset drvmsg +; call message +;ENDIF +; jmp short done_ret +; +;try_f: +; test cx,flagff +; jz try_t +; mov ffactor,al +;IF iTEST +; add al,"0" +; mov ffnum,al +; mov dx,offset ffmsg +; call message +;ENDIF +; +;try_t: +; cmp ax,0 +; jz done_ret ; if number entered was 0, assume default value +; test cx,flagcyln +; jz try_s +; mov cyln,ax +;IF iTEST +; mov dx,offset cylnmsg +; call message +;ENDIF +; jmp short done_ret +; +;try_s: +; test cx,flagseclim +; jz try_h +; mov slim,ax +;IF iTEST +; mov dx,offset slimmsg +; call message +;ENDIF +; jmp short done_ret +; +;; Switch must be one for number of Heads. +;try_h: +; test cx,flagheads +; jz done_ret +; mov heads,ax +;IF iTEST +; add al,"0" +; mov hdnum,al +; mov dx,offset hdmsg +; call message +;ENDIF +; +;done_ret: +; pop ds +; ret + +; +; SetDrvParms sets up the recommended BPB in each BDS in the system based on +; the form factor. It is assumed that the BPBs for the various form factors +; are present in the BPBTable. For hard files, the Recommended BPB is the same +; as the BPB on the drive. +; No attempt is made to preserve registers since we are going to jump to +; SYSINIT straight after this routine. +; +SetDrvParms: + push cs + pop es + xor bx,bx + call SetDrive ; ds:di -> BDS + ;test cs:switches,flagff ; has formfactor been specified? + ;jz formfcont + mov bl,cs:[ffactor] + mov byte ptr [di].formfactor,bl ; replace with new value +formfcont: + mov bl,[di].FormFactor +;AC000; The followings are redundanat since there is no input specified for Hard file. +; cmp bl,ffHardFile +; jnz NotHardFF +; mov ax,[di].DrvLim +; cmp ax, 0 ;AN000;32 bit sector number? +; push ax +; mov ax,word ptr [di].hdlim +; mul word ptr [di].seclim +; mov cx,ax ; cx has # sectors per cylinder +; pop ax +; xor dx,dx ; set up for div +; div cx ; div #sec by sec/cyl to get # cyl +; or dx,dx +; jz No_Cyl_Rnd ; came out even +; inc ax ; round up +;No_Cyl_Rnd: +; mov cs:[cyln],ax +; mov si,di +; add si,BytePerSec ; ds:si -> BPB for hard file +; jmp short Set_RecBPB +;NotHardFF: +;AC000; End of deletion. + cmp bl,ff48tpi + jnz Got_80_cyln +IF iTEST + mov dx,offset msg48tpi + call message +ENDIF + mov cx,40 + mov cs:[cyln],cx +Got_80_cyln: + shl bx,1 ; bx is word index into table of BPBs + mov si,offset BPBTable + mov si,word ptr [si+bx] ; get address of BPB +Set_RecBPB: + add di,RBytePerSec ; es:di -> Recommended BPB + mov cx,BPBSIZ + cld + repe movsb ; move BPBSIZ bytes + + call Handle_Switches ; replace with 'new' values as + ; specified in switches. +; +; We need to set the media byte and the total number of sectors to reflect the +; number of heads. We do this by multiplying the number of heads by the number +; of 'sectors per head'. This is not a fool-proof scheme!! +; + mov ax,[di].Rdrvlim ; this is OK for two heads + sar ax,1 ; ax contains # of sectors/head + mov cx,[di].Rhdlim + dec cl ; get it 0-based + sal ax,cl + jc Set_All_Done_BRG ; We have too many sectors - overflow!! + mov [di].Rdrvlim,ax + cmp cl,1 +; We use media descriptor byte F0H for any type of medium that is not currently +; defined i.e. one that does not fall into the categories defined by media +; bytes F8H, F9H, FCH-FFH. + + JE HEAD_2_DRV + MOV AL, 1 ;1 sector/cluster + MOV BL, BYTE PTR [DI].Rmediad + CMP BYTE PTR [DI].FormFactor, ffOther + JE GOT_CORRECT_MEDIAD + MOV CH, BYTE PTR [DI].FormFactor + CMP CH, ff48tpi + JE SINGLE_MEDIAD + MOV BL, 0F0h + JMP GOT_CORRECT_MEDIAD +Set_All_Done_BRG:jmp Set_All_Done +SINGLE_MEDIAD: + CMP WORD PTR [DI].RSecLim, 8 ;8 SEC/TRACK? + JNE SINGLE_9_SEC + MOV BL, 0FEh + JMP GOT_CORRECT_MEDIAD +SINGLE_9_SEC: + MOV BL, 0FCh + JMP GOT_CORRECT_MEDIAD +HEAD_2_DRV: + MOV BL, 0F0h ;default 0F0h + MOV AL, 1 ;1 sec/cluster + CMP BYTE PTR [DI].FormFactor, ffOther + JE GOT_CORRECT_MEDIAD + CMP BYTE PTR [DI].FormFactor, ff48tpi + JNE NOT_48TPI + MOV AL, 2 + CMP WORD PTR [DI].RSecLim, 8 ;8 SEC/TRACK? + JNE DOUBLE_9_SEC + MOV BL, 0FFh + JMP GOT_CORRECT_MEDIAD +DOUBLE_9_SEC: + MOV BL, 0FDh + JMP GOT_CORRECT_MEDIAD +NOT_48TPI: + CMP BYTE PTR [DI].FormFactor, ff96tpi + JNE NOT_96TPI + MOV AL, 1 ;1 sec/cluster + MOV BL, 0F9h + JMP GOT_CORRECT_MEDIAD +NOT_96TPI: + CMP BYTE PTR [DI].FormFactor, ffSmall ;3-1/2, 720kb + JNE GOT_CORRECT_MEDIAD ;Not ffSmall. Strange Media device. + MOV AL, 2 ;2 sec/cluster + MOV BL, 0F9h + +;J.K. 12/9/86 THE ABOVE IS A QUICK FIX FOR 3.3 DRIVER.SYS PROB. OLD LOGIC IS COMMENTED OUT. +; mov bl,0F0H ; assume strange media +; mov al,1 ; AL is sectors/cluster - match 3.3 bio dcl. 6/27/86 +; ja Got_Correct_Mediad +;; We check to see if the form factor specified was "other" +; cmp byte ptr [di].FormFactor,ffOther +; jz Got_Correct_Mediad +;; We must have 1 or 2 heads (0 is ignored) +; mov bl,byte ptr [di].Rmediad +; cmp cl,1 +; jz Got_Correct_Mediad +;; We must have one head - OK for 48tpi media +; mov al,1 ; AL is sectors/cluster +; mov ch,byte ptr [di].FormFactor +; cmp ch,ff48tpi +; jz Dec_Mediad +; mov bl,0F0H +; jmp short Got_Correct_Mediad +;Dec_Mediad: +; dec bl ; adjust for one head +;J.K. END OF OLD LOGIC + +Got_Correct_Mediad: + mov byte ptr [di].RSecPerClus,al + mov byte ptr [di].Rmediad,bl +; Calculate the correct number of Total Sectors on medium + mov ax,word ptr [di].Ccyln + mov bx,word ptr [di].RHdLim + mul bx + mov bx,word ptr [di].RSecLim + mul bx +; AX contains the total number of sectors on the disk + mov word ptr [di].RDrvLim,ax +;J.K. For ffOther type of media, we should set Sec/FAT, and # of Root directory +;J.K. accordingly. + cmp byte ptr [di].FormFactor, ffOther ;AN005; + jne Set_All_Ok ;AN005; + xor dx, dx ;AN005; + dec ax ;AN005; DrvLim - 1. + mov bx, 3 ;AN005; Assume 12 bit fat. + mul bx ;AN005; = 1.5 byte + mov bx, 2 ;AN005; + div bx ;AN005; + xor dx, dx ;AN005; + mov bx, 512 ;AN005; + div bx ;AN005; + inc ax ;AN005; + mov [di].RCSecFat, ax ;AN005; + mov [di].RCDir, 0E0h ;AN005; directory entry # = 224 +Set_All_Ok: ;AN005; + clc +Set_All_Done: + RET + +; +; Handle_Switches replaces the values that were entered on the command line in +; config.sys into the recommended BPB area in the BDS. +; NOTE: +; No checking is done for a valid BPB here. +; +Handle_Switches: + call setdrive ; ds:di -> BDS + test cs:switches,flagdrive + jz done_handle ; if drive not specified, exit + mov al,cs:[drivenumb] + mov byte ptr [di].DriveNum,al +; test cs:switches,flagcyln +; jz no_cyln + mov ax,cs:[cyln] + mov word ptr [di].cCyln,ax +no_cyln: + test cs:switches,flagseclim + jz no_seclim + mov ax,cs:[slim] + mov word ptr [di].RSeclim,ax +no_seclim: + test cs:switches,flagheads + jz done_handle + mov ax,cs:[heads] + mov word ptr [di].RHdlim,ax +done_handle: + RET + + +Show_Message proc near +;In) AX = message number +; DS:SI -> Substitution list if necessary. +; CX = 0 or n depending on the substitution number +; DH = -1 FOR UTILITY MSG CLASS, 2 FOR PARSE ERROR +;Out) Message displayed using DOS function 9 with no keyboard input. + push cs ;AN000; + pop ds ;AN000; + mov bx, -1 ;AN000; + mov dl, 0 ;AN000;no input + call SYSDISPMSG ;AN000; + ret ;AN000; +Show_Message endp + +; +; The following are the recommended BPBs for the media that we know of so +; far. + +; 48 tpi diskettes + +BPB48T DW 512 + DB 2 + DW 1 + DB 2 + DW 112 + DW 2*9*40 + DB 0FDH + DW 2 + DW 9 + DW 2 + DW 0 + +; 96tpi diskettes + +BPB96T DW 512 + DB 1 + DW 1 + DB 2 + DW 224 + DW 2*15*80 + DB 0F9H + DW 7 + DW 15 + DW 2 + DW 0 + +BPBSIZ = $-BPB96T + +; 3 1/2 inch diskette BPB + +BPB35 DW 512 + DB 2 + DW 1 ; Double sided with 9 sec/trk + DB 2 + DW 70h + DW 2*9*80 + DB 0F9H + DW 3 + DW 9 + DW 2 + DW 0 + + +BPBTable dw BPB48T ; 48tpi drives + dw BPB96T ; 96tpi drives + dw BPB35 ; 3.5" drives +; The following are not supported, so we default to 3.5" layout + dw BPB35 ; Not used - 8" drives + dw BPB35 ; Not Used - 8" drives + dw BPB35 ; Not Used - hard files + dw BPB35 ; Not Used - tape drives + dw BPB35 ; Not Used - Other + +switchlist db 7,"FHSTDCN" ; Preserve the positions of N and C. + +; The following depend on the positions of the various letters in SwitchList + +flagdrive equ 0004H +flagcyln equ 0008H +flagseclim equ 0010H +flagheads equ 0020H +flagff equ 0040H + +;AN000; +;Equates for message number +NODRIVE_MSG_NUM equ 2 +LOADOK_MSG_NUM equ 3 + +code ends + +end diff --git a/v4.0/src/DEV/DRIVER/DRIVER.LNK b/v4.0/src/DEV/DRIVER/DRIVER.LNK new file mode 100644 index 0000000..6dbd484 --- /dev/null +++ b/v4.0/src/DEV/DRIVER/DRIVER.LNK @@ -0,0 +1,3 @@ +DRIVER.OBJ +DRIVER.EXE; + \ No newline at end of file diff --git a/v4.0/src/DEV/DRIVER/DRIVER.MAK b/v4.0/src/DEV/DRIVER/DRIVER.MAK new file mode 100644 index 0000000..8748f44 --- /dev/null +++ b/v4.0/src/DEV/DRIVER/DRIVER.MAK @@ -0,0 +1,19 @@ +COM=..\COMMON +MSG=..\MESSAGES +country=usa + + +DRIVER.CTL: DRIVER.SKL $(MSG)\$(COUNTRY).MSG + MSGBUILD DRIVER.SKL + +DRIVER.OBJ: DRIVER.ASM $(COM)\IBMBDS.INC $(COM)\VERSIONA.INC \ + $(COM)\PARSE.ASM $(COM)\PSDATA.INC \ + DRIVER.CTL $(COM)\SYSMSG.INC $(COM)\MSGSERV.ASM + ASM87 DRIVER + +DRIVER.SYS: DRIVER.OBJ $(COM)\setver.bat DRIVER.ARF + LINK @DRIVER.ARF + EXE2BIN DRIVER.EXE DRIVER.SYS + TAG DRIVER.SYS + DEL DRIVER.EXE + \ No newline at end of file diff --git a/v4.0/src/DEV/DRIVER/DRIVER.SKL b/v4.0/src/DEV/DRIVER/DRIVER.SKL new file mode 100644 index 0000000..4fb910f --- /dev/null +++ b/v4.0/src/DEV/DRIVER/DRIVER.SKL @@ -0,0 +1,21 @@ +;================================================ +; DRIVER.SYS Message Skeleton File +;================================================ + +:util DRIVER +:class 2 +:use PARSE1 +:use PARSE2 +:use PARSE3 +:use PARSE4 +:use PARSE6 +:use PARSE7 +:use PARSE8 + +:class A +:use 1 COMMON1 ;"Incorrect DOS version" +:def 2 "No Drive Specified",CR,LF,"$" +:def 3 "Loaded External Disk Driver for Drive %1",CR,LF,"$" + +:end + \ No newline at end of file diff --git a/v4.0/src/DEV/DRIVER/MAKEFILE b/v4.0/src/DEV/DRIVER/MAKEFILE new file mode 100644 index 0000000..5f382d6 --- /dev/null +++ b/v4.0/src/DEV/DRIVER/MAKEFILE @@ -0,0 +1,23 @@ +#************************ makefile for dev\driver ************************ + +msg =..\..\messages +dos =..\..\dos +inc =..\..\inc +hinc =..\..\h + +# +####################### dependencies begin here. ######################### +# + +all: driver.sys + +driver.ctl: driver.skl $(msg)\$(COUNTRY).msg + +driver.obj: driver.asm $(inc)\msbds.inc $(inc)\versiona.inc \ + $(inc)\parse.asm $(inc)\psdata.inc \ + driver.ctl $(inc)\sysmsg.inc $(inc)\msgserv.asm + +driver.sys: driver.obj driver.lnk + link @driver.lnk + exe2bin driver.exe driver.sys + del driver.exe diff --git a/v4.0/src/DEV/KEYBOARD/KDF.ASM b/v4.0/src/DEV/KEYBOARD/KDF.ASM new file mode 100644 index 0000000..3073dc8 --- /dev/null +++ b/v4.0/src/DEV/KEYBOARD/KDF.ASM @@ -0,0 +1,393 @@ + + + PAGE ,132 + TITLE DOS - Keyboard Definition File + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DOS - - NLS Support - Keyboard Definition File +;; (c) Copyright 1988 Microsoft +;; +;; This the file header and table pointers ONLY. +;; The actual tables are contained in seperate source files. +;; These are: +;; KDFSP.ASM - Spanish +;; KDFPO.ASM - Portuguese +;; KDFGR.ASM - German +;; KDFIT.ASM - Italian +;; KDFFR.ASM - French +;; KDFSG.ASM - Swiss German +;; KDFSF.ASM - Swiss French +;; KDFDK.ASM - Danish +;; KDFUK.ASM - English +;; KDFBE.ASM - Belgium +;; KDFNL.ASM - Netherlands +;; KDFNO.ASM - Norway +;; KDFLA.ASM - Latin American +;; KDFSV.ASM - SWEDEN +;; KDFSU.ASM - Finland +;; Dummy US - US +;; Linkage Instructions: +;; The following instructions are contained in KDFLINK.BAT: +;; +;; LINK KDF+KDFSP+KDFGE+KDFFR+KDFIT+KDFPO+KDFUK+KDFSG+KDFDK+KDFEOF; +;; EXE2BIN KDF.EXE KEYBOARD.SYS +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +CODE SEGMENT PUBLIC 'CODE' ;; + ASSUME CS:CODE,DS:CODE ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; File Header +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +DB 0FFh,'KEYB ' ;; signature +DB 8 DUP(0) ;; reserved +DW 650 ;; maximum size of Common Xlat Sect +DW 350 ;; max size of Specific Xlat Sect +DW 400 ;; max size of State Logic +DD 0 ;; reserved +DW 17 ;; number of languages +DB 'SP' +DW OFFSET SP_LANG_ENT,0 +DB 'PO' +DW OFFSET PO_LANG_ENT,0 +DB 'FR' +DW OFFSET FR_LANG_ENT,0 +DB 'DK' +DW OFFSET DK_LANG_ENT,0 +DB 'SG' +DW OFFSET SG_LANG_ENT,0 +DB 'GR' +DW OFFSET GE_LANG_ENT,0 +DB 'IT' +DW OFFSET IT_LANG_ENT,0 +DB 'UK' +DW OFFSET UK_LANG_ENT,0 +DB 'SF' +DW OFFSET SF_LANG_ENT,0 +DB 'BE' +DW OFFSET BE_LANG_ENT,0 +DB 'NL' +DW OFFSET NL_LANG_ENT,0 +DB 'NO' +DW OFFSET NO_LANG_ENT,0 +DB 'CF' +DW OFFSET CF_LANG_ENT,0 +DB 'SV' +DW OFFSET SV_LANG_ENT,0 +DB 'SU' +DW OFFSET SV_LANG_ENT,0 +DB 'LA' +DW OFFSET LA_LANG_ENT,0 +DB 'US' +DW OFFSET DUMMY_ENT,0 +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; Language Entries +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + EXTRN SP_LOGIC:NEAR ;; + EXTRN SP_437_XLAT:NEAR ;; + EXTRN SP_850_XLAT:NEAR ;; + ;; +SP_LANG_ENT: ;; language entry for SPANISH + DB 'SP' ;; + DW 0 ;; reserved + DW OFFSET SP_LOGIC,0 ;; pointer to LANG kb table + DW 2 ;; number of code pages + DW 437 ;; code page + DW OFFSET SP_437_XLAT,0 ;; table pointer + DW 850 ;; code page + DW OFFSET SP_850_XLAT,0 ;; table pointer + ;; +;**************************************************************************** + EXTRN PO_LOGIC:NEAR ;; + EXTRN PO_860_XLAT:NEAR ;; + EXTRN PO_850_XLAT:NEAR ;; + ;; +PO_LANG_ENT: ;; language entry for POTUGAL + DB 'PO' ;; + DW 0 ;; reserved + DW OFFSET PO_LOGIC,0 ;; pointer to LANG kb table + DW 2 ;; number of code pages + DW 860 ;; code page + DW OFFSET PO_860_XLAT,0 ;; table pointer + DW 850 ;; code page + DW OFFSET PO_850_XLAT,0 ;; table pointer + ;; +;***************************************************************************** + EXTRN FR_LOGIC:NEAR ;; + EXTRN FR_437_XLAT:NEAR ;; + EXTRN FR_850_XLAT:NEAR ;; + ;; + FR_LANG_ENT: ;; language entry for POTUGAL + DB 'FR' ;; + DW 0 ;; reserved + DW OFFSET FR_LOGIC,0 ;; pointer to LANG kb table + DW 2 ;; number of code pages + DW 437 ;; code page + DW OFFSET FR_437_XLAT,0 ;; table pointer + DW 850 ;; code page + DW OFFSET FR_850_XLAT,0 ;; table pointer + ;; +;***************************************************************************** + EXTRN DK_LOGIC:NEAR ;; + EXTRN DK_865_XLAT:NEAR ;; + EXTRN DK_850_XLAT:NEAR ;; + ;; + DK_LANG_ENT: ;; language entry for POTUGAL + DB 'DK' ;; + DW 0 ;; reserved + DW OFFSET DK_LOGIC,0 ;; pointer to LANG kb table + DW 2 ;; number of code pages + DW 865 ;; code page + DW OFFSET DK_865_XLAT,0 ;; table pointer + DW 850 ;; code page + DW OFFSET DK_850_XLAT,0 ;; table pointer + ;; +;***************************************************************************** + EXTRN SG_LOGIC:NEAR ;; + EXTRN SG_437_XLAT:NEAR ;; + EXTRN SG_850_XLAT:NEAR ;; + ;; +SG_LANG_ENT: ;; language entry for POTUGAL + DB 'SG' ;; + DW 0 ;; reserved + DW OFFSET SG_LOGIC,0 ;; pointer to LANG kb table + DW 2 ;; number of code pages + DW 437 ;; code page + DW OFFSET SG_437_XLAT,0 ;; table pointer + DW 850 ;; code page + DW OFFSET SG_850_XLAT,0 ;; table pointer + ;; +;***************************************************************************** + EXTRN SF_LOGIC:NEAR ;; + EXTRN SF_437_XLAT:NEAR ;; + EXTRN SF_850_XLAT:NEAR ;; + ;; +SF_LANG_ENT: ;; language entry for SWISS FRENCH + DB 'SF' ;; + DW 0 ;; reserved + DW OFFSET SF_LOGIC,0 ;; pointer to LANG kb table + DW 2 ;; number of code pages + DW 437 ;; code page + DW OFFSET SF_437_XLAT,0 ;; table pointer + DW 850 ;; code page + DW OFFSET SF_850_XLAT,0 ;; table pointer + ;; +;***************************************************************************** + EXTRN GE_LOGIC:NEAR ;; + EXTRN GE_437_XLAT:NEAR ;; + EXTRN GE_850_XLAT:NEAR ;; + ;; +GE_LANG_ENT: ;; language entry for POTUGAL + DB 'GR' ;; + DW 0 ;; reserved + DW OFFSET GE_LOGIC,0 ;; pointer to LANG kb table + DW 2 ;; number of code pages + DW 437 ;; code page + DW OFFSET GE_437_XLAT,0 ;; table pointer + DW 850 ;; code page + DW OFFSET GE_850_XLAT,0 ;; table pointer + ;; +;***************************************************************************** + EXTRN IT_LOGIC:NEAR ;; + EXTRN IT_437_XLAT:NEAR ;; + EXTRN IT_850_XLAT:NEAR ;; + ;; + IT_LANG_ENT: ;; language entry for POTUGAL + DB 'IT' ;; + DW 0 ;; reserved + DW OFFSET IT_LOGIC,0 ;; pointer to LANG kb table + DW 2 ;; number of code pages + DW 437 ;; code page + DW OFFSET IT_437_XLAT,0 ;; table pointer + DW 850 ;; code page + DW OFFSET IT_850_XLAT,0 ;; table pointer + ;; +;***************************************************************************** + EXTRN UK_LOGIC:FAR ;; + EXTRN UK_437_XLAT:FAR ;; + EXTRN UK_850_XLAT:FAR ;; + ;; + UK_LANG_ENT: ;; language entry for POTUGAL + DB 'UK' ;; + DW 0 ;; reserved + DW OFFSET UK_LOGIC,0 ;; pointer to LANG kb table + DW 2 ;; number of code pages + DW 437 ;; code page + DW OFFSET UK_437_XLAT,0 ;; table pointer + DW 850 ;; code page + DW OFFSET UK_850_XLAT,0 ;; table pointer + ;; +;***************************************************************************** + EXTRN BE_LOGIC:NEAR ;; + EXTRN BE_437_XLAT:NEAR ;; + EXTRN BE_850_XLAT:NEAR ;; + ;; +BE_LANG_ENT: ;; language entry for POTUGAL + DB 'BE' ;; + DW 0 ;; reserved + DW OFFSET BE_LOGIC,0 ;; pointer to LANG kb table + DW 2 ;; number of code pages + DW 437 ;; code page + DW OFFSET BE_437_XLAT,0 ;; table pointer + DW 850 ;; code page + DW OFFSET BE_850_XLAT,0 ;; table pointer + ;; +;***************************************************************************** +;***************************************************************************** + EXTRN NL_LOGIC:NEAR ;; + EXTRN NL_437_XLAT:NEAR ;; + EXTRN NL_850_XLAT:NEAR ;; + ;; + NL_LANG_ENT: ;; language entry for NETHERLANDS + DB 'NL' ;; + DW 0 ;; reserved + DW OFFSET NL_LOGIC,0 ;; pointer to LANG kb table + DW 2 ;; number of code pages + DW 437 ;; code page + DW OFFSET NL_437_XLAT,0 ;; table pointer + DW 850 ;; code page + DW OFFSET NL_850_XLAT,0 ;; table pointer + ;; +;***************************************************************************** +;***************************************************************************** + EXTRN NO_LOGIC:NEAR ;; + EXTRN NO_865_XLAT:NEAR ;; + EXTRN NO_850_XLAT:NEAR ;; + ;; + NO_LANG_ENT: ;; language entry for NORWAY + DB 'NO' ;; + DW 0 ;; reserved + DW OFFSET NO_LOGIC,0 ;; pointer to LANG kb table + DW 2 ;; number of code pages + DW 865 ;; code page + DW OFFSET NO_865_XLAT,0 ;; table pointer + DW 850 ;; code page + DW OFFSET NO_850_XLAT,0 ;; table pointer + ;; +;***************************************************************************** +;***************************************************************************** + EXTRN SV_LOGIC:NEAR ;; + EXTRN SV_437_XLAT:NEAR ;; + EXTRN SV_850_XLAT:NEAR ;; + ;; + SV_LANG_ENT: ;; language entry for SWEDEN + DB 'SV' ;; + DW 0 ;; reserved + DW OFFSET SV_LOGIC,0 ;; pointer to LANG kb table + DW 2 ;; number of code pages + DW 437 ;; code page + DW OFFSET SV_437_XLAT,0 ;; table pointer + DW 850 ;; code page + DW OFFSET SV_850_XLAT,0 ;; table pointer + ;; +;***************************************************************************** +;***************************************************************************** +; EXTRN SU_LOGIC:NEAR ;; +; EXTRN SU_437_XLAT:NEAR ;; +; EXTRN SU_850_XLAT:NEAR ;; +; ;; +; SU_LANG_ENT: ;; language entry for FINLAND +; DB 'SU' ;; +; DW 0 ;; reserved +; DW OFFSET SU_LOGIC,0 ;; pointer to LANG kb table +; DW 2 ;; number of code pages +; DW 437 ;; code page +; DW OFFSET SU_437_XLAT,0 ;; table pointer +; DW 850 ;; code page +; DW OFFSET SU_850_XLAT,0 ;; table pointer +; ;; +;***************************************************************************** +;***************************************************************************** + EXTRN CF_LOGIC:NEAR ;; + EXTRN CF_863_XLAT:NEAR ;; + EXTRN CF_850_XLAT:NEAR ;; + ;; + CF_LANG_ENT: ;; language entry for Canadian-French + DB 'CF' ;; + DW 0 ;; reserved + DW OFFSET CF_LOGIC,0 ;; pointer to LANG kb table + DW 2 ;; number of code pages + DW 863 ;; code page + DW OFFSET CF_863_XLAT,0 ;; table pointer + DW 850 ;; code page + DW OFFSET CF_850_XLAT,0 ;; table pointer + ;; +;***************************************************************************** + EXTRN LA_LOGIC:NEAR ;; + EXTRN LA_850_XLAT:NEAR ;; + EXTRN LA_437_XLAT:NEAR ;; + ;; + LA_LANG_ENT: ;; language entry for Canadian-French + DB 'LA' ;; + DW 0 ;; reserved + DW OFFSET LA_LOGIC,0 ;; pointer to LANG kb table + DW 2 ;; number of code pages + DW 850 ;; code page + DW OFFSET LA_850_XLAT,0 ;; table pointer + DW 437 ;; code page + DW OFFSET LA_437_XLAT,0 ;; table pointer + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +DUMMY_ENT: ;; language entry + DB 'XX' ;; + DW 0 ;; reserved + DW OFFSET DUMMY_LOGIC,0 ;; pointer to LANG kb table + DW 5 ;; number of code pages + DW 437 ;; code page + DW OFFSET DUMMY_XLAT_437,0 ;; table pointer + DW 850 ;; code page + DW OFFSET DUMMY_XLAT_850,0 ;; table pointer + DW 860 ;; code page + DW OFFSET DUMMY_XLAT_860,0 ;; table pointer + DW 863 ;; code page + DW OFFSET DUMMY_XLAT_863,0 ;; table pointer + DW 865 ;; code page + DW OFFSET DUMMY_XLAT_865,0 ;; table pointer + ;; +DUMMY_LOGIC: ;; + DW LOGIC_END-$ ;; length + DW 0 ;; special features + DB 92H,0,0 ;; EXIT_STATE_LOGIC_COMMAND +LOGIC_END: ;; + ;; +DUMMY_XLAT_437: ;; + DW 6 ;; length of section + DW 437 ;; code page + DW 0 ;; LAST STATE + ;; +DUMMY_XLAT_850: ;; + DW 6 ;; length of section + DW 850 ;; code page + DW 0 ;; LAST STATE + ;; +DUMMY_XLAT_860: ;; + DW 6 ;; length of section + DW 860 ;; code page + DW 0 ;; LAST STATE + ;; +DUMMY_XLAT_865: ;; + DW 6 ;; length of section + DW 865 ;; code page + DW 0 ;; LAST STATE + ;; +DUMMY_XLAT_863: ;; + DW 6 ;; length of section + DW 863 ;; code page + DW 0 ;; LAST STATE + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;***************************************************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CODE ENDS ;; + END ;; diff --git a/v4.0/src/DEV/KEYBOARD/KDFBE.ASM b/v4.0/src/DEV/KEYBOARD/KDFBE.ASM new file mode 100644 index 0000000..ac5b1e4 --- /dev/null +++ b/v4.0/src/DEV/KEYBOARD/KDFBE.ASM @@ -0,0 +1,1833 @@ +; ACUTE lc y added +; ****** CNS 12/18 +; ****** CNS 01/21 NUM PAD + PAGE ,132 + TITLE DOS - Keyboard Definition File + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DOS - - NLS Support - Keyboard Defintion File +;; (c) Copyright 1988 Microsoft +;; +;; This file contains the keyboard tables for Belgium. +;; +;; Linkage Instructions: +;; Refer to KDF.ASM. +;; +;; +;; Modded from French - DTF 11-Sep-86 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + INCLUDE KEYBSHAR.INC ;; + INCLUDE POSTEQU.INC ;; + INCLUDE KEYBMAC.INC ;; + ;; + PUBLIC BE_LOGIC ;; + PUBLIC BE_437_XLAT ;; + PUBLIC BE_850_XLAT ;; + ;; +CODE SEGMENT PUBLIC 'CODE' ;; + ASSUME CS:CODE,DS:CODE ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Standard translate table options are a liner search table +;; (TYPE_2_TAB) and ASCII entries ONLY (ASCII_ONLY) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +STANDARD_TABLE EQU TYPE_2_TAB+ASCII_ONLY + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; BE State Logic +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +BE_LOGIC: + + DW LOGIC_END-$ ;; length + ;; + DW TYPEWRITER_CAPS_LK ;; special features + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; COMMANDS START HERE + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; OPTIONS: If we find a scan match in +;; an XLATT or SET_FLAG operation then +;; exit from INT 9. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + OPTION EXIT_IF_FOUND ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Dead key definitions must come before +;; dead key translations to handle +;; dead key + dead key. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + IFF EITHER_ALT,NOT ;; + ANDF EITHER_CTL,NOT ;; + IFF CAPS_STATE + SET_FLAG DEAD_UPPER + ELSEF + IFF EITHER_SHIFT ;; + SET_FLAG DEAD_UPPER ;; + ELSEF ;; + SET_FLAG DEAD_LOWER ;; + ENDIFF ;; + ENDIFF + ELSEF ;; + IFF EITHER_SHIFT,NOT ;; + IFKBD XT_KB+AT_KB + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + SET_FLAG DEAD_THIRD ;; + ENDIFF ;; + ELSEF + IFF R_ALT_SHIFT ;; + ANDF EITHER_CTL,NOT ;; + ANDF LC_E0,NOT ;; + SET_FLAG DEAD_THIRD ;; + ENDIFF ;; + ENDIFF + ENDIFF + ENDIFF ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ACUTE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +ACUTE_PROC: ;; + ;; + IFF ACUTE,NOT ;; + GOTO TILDE_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT ACUTE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT ACUTE_LOWER ;; + ELSEF ;; + XLATT ACUTE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT ACUTE_UPPER ;; + ELSEF ;; + XLATT ACUTE_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_ACUTE: ;; + PUT_ERROR_CHAR ACUTE_LOWER ;; If we get here then either the XLATT + BEEP ;; failed or we are ina bad shift state. + GOTO NON_DEAD ;; Either is invalid so BEEP and fall + ;; through to generate the second char. + ;; Note that the dead key flag will be + ;; reset before we get here. + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; TILDE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +TILDE_PROC: ;; + ;; + IFF TILDE,NOT ;; + GOTO DIARESIS_PROC ;; + ENDIFF ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT TILDE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT TILDE_LOWER ;; + ELSEF ;; + XLATT TILDE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT TILDE_LOWER ;; + ELSEF ;; + XLATT TILDE_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_TILDE: ;; + PUT_ERROR_CHAR TILDE_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DIARESIS ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +DIARESIS_PROC: ;; + ;; + IFF DIARESIS,NOT ;; + GOTO GRAVE_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT DIARESIS_SPACE ;; exist for 437 so beep for + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_LOWER ;; + ELSEF ;; + XLATT DIARESIS_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_UPPER ;; + ELSEF ;; + XLATT DIARESIS_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_DIARESIS: ;; + PUT_ERROR_CHAR DIARESIS_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; GRAVE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +GRAVE_PROC: ;; + ;; + IFF GRAVE,NOT ;; + GOTO CIRCUMFLEX_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT GRAVE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_GRAVE: ;; + PUT_ERROR_CHAR GRAVE_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CIRCUMFLEX ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CIRCUMFLEX_PROC: ;; + ;; + IFF CIRCUMFLEX,NOT ;; + GOTO NON_DEAD ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT CIRCUMFLEX_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_CIRCUMFLEX: ;; + PUT_ERROR_CHAR CIRCUMFLEX_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Upper, lower and third shifts +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +;*************************** +NON_DEAD: ;; +;ADDED FOR DIVIDE SIGN ;; + IFKBD G_KB+P12_KB ;; Avoid accidentally translating + ANDF LC_E0 ;; the "/" on the numeric pad of the + IFF EITHER_CTL,NOT + ANDF EITHER_ALT,NOT + XLATT DIVIDE_SIGN ;; + ENDIFF + EXIT_STATE_LOGIC ;; + ENDIFF ;; +;BD END OF ADDITION +;**************************** +;NON_DEAD: ;; +; ;; +; IFKBD G_KB+P12_KB ;; Avoid accidentally translating +; ANDF LC_E0 ;; the "/" on the numeric pad of the +; EXIT_STATE_LOGIC ;; G keyboard +; ENDIFF ;; + ;; + IFF EITHER_ALT,NOT ;; + ANDF EITHER_CTL,NOT ;; + IFF EITHER_SHIFT ;; +;****************************************** +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE,NOT ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION +;******************************************* + IFF CAPS_STATE ;; + XLATT ALPHA_LOWER ;; + XLATT NON_ALPHA_LOWER ;; + ELSEF ;; + XLATT ALPHA_UPPER ;; + XLATT NON_ALPHA_UPPER ;; + ENDIFF ;; + ELSEF ;; +;****************************************** +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION +;****************************************** + IFF CAPS_STATE ;; + XLATT ALPHA_UPPER ;; + XLATT NON_ALPHA_UPPER ;; + ELSEF ;; + XLATT ALPHA_LOWER ;; + XLATT NON_ALPHA_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_SHIFT,NOT ;; + IFKBD XT_KB+AT_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_CTL,NOT ;; + ANDF R_ALT_SHIFT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ENDIFF ;; + IFKBD AT_KB+XT_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ENDIFF ;; + IFKBD G_KB+P12_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; +;IFF EITHER_SHIFT,NOT ;; + IFKBD AT_KB+XT_KB ;; + IFF EITHER_CTL,NOT ;; + IFF ALT_SHIFT ;; ALT - case + XLATT ALT_CASE ;; + ENDIFF ;; + ELSEF ;; + XLATT CTRL_CASE ;; + ENDIFF ;; + ENDIFF ;; + ;; + IFKBD G_KB+P12_KB ;; + IFF EITHER_CTL,NOT ;; + IFF ALT_SHIFT ;; ALT - case + ANDF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_ALT,NOT ;; + XLATT CTRL_CASE ;; + ENDIFF ;; + ENDIFF ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + ANDF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ENDIFF ;; + ;; + EXIT_STATE_LOGIC ;; + ;; +LOGIC_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; BE Common Translate Section +;; This section contains translations for the lower 128 characters +;; only since these will never change from code page to code page. +;; In addition the dead key "Set Flag" tables are here since the +;; dead keys are on the same keytops for all code pages. +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC BE_COMMON_XLAT ;; +BE_COMMON_XLAT: ;; + ;; + DW COMMON_XLAT_END-$ ;; length of section + DW -1 ;; code page + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alt Case +;; KEYBOARD TYPES: G + P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_ALT_K1_END-$ ;; length of state section + DB ALT_CASE ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW COM_ALT_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; + DB 8 ;; Number of entries + DB 12,-1,-1 ;; + DB 13,0,82H ;; + DB 16,0,1EH ;; A + DB 17,0,2CH ;; Z + DB 30,0,10H ;; Q + DB 39,0,32H ;; M + DB 44,0,11H ;; W + DB 50,-1,-1 ;; U.S. 'M' +COM_ALT_K1_T1_END: ;; + ;; + DW 0 ;; + ;; +COM_ALT_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: G + P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K1_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW COM_CTRL_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; + DB 10 ;; Number of entries + DB 12,-1,-1 ;; + DB 13,31,13 ;; + DB 16,01,16 ;; A + DB 17,26,17 ;; Z + DB 30,17,30 ;; Q + DB 39,13,39 ;; M + DB 43,-1,-1 ;; \ + DB 44,23,44 ;; W + DB 50,-1,-1 ;; U.S. 'M' + DB 86,28,86 ;; +COM_CTRL_K1_T1_END: ;; + ;; + DW 0 ;; + ;; +COM_CTRL_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alt Case +;; KEYBOARD TYPES: AT + XT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_ALT_K2_END-$ ;; length of state section + DB ALT_CASE ;; State ID + DW AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW COM_ALT_K2_T2_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; + DB 6 ;; Number of entries +; DB 12,-1,-1 ;; invalid key U.S. alt - +; DB 13,0,82H ;; alt - (minus sign) +; DB 53,0,83H ;; alt = (equal sign) + DB 16,0,1EH ;; A + DB 17,0,2CH ;; Z + DB 30,0,10H ;; Q + DB 39,0,32H ;; M + DB 44,0,11H ;; W + DB 50,-1,-1 ;; U.S. 'M' +COM_ALT_K2_T2_END: ;; + ;; + DW 0 ;; + ;; +COM_ALT_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K2_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW COM_CTRL_K2_T2_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; + DB 11 ;; Number of entries + DB 12,-1,-1 ;; invalid U.S. - + DB 43,-1,-1 ;; invalid U.S. \ + DB 41,28,41 ;; valid ctl + \ + DB 07,30,07 ;; ctl + number six key + DB 13,31,13 ;; ctl - or _ + DB 16,01,16 ;; A + DB 17,26,17 ;; Z + DB 30,17,30 ;; Q + DB 39,13,39 ;; M + DB 44,23,44 ;; W + DB 50,-1,-1 ;; U.S. 'M' +COM_CTRL_K2_T2_END: ;; + ;; + DW 0 ;; + ;; +COM_CTRL_K2_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: XT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K3_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW COM_CTRL_K3_T3_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; + DB 11 ;; Number of entries + DB 12,-1,-1 ;; + DB 43,-1,-1 ;; + DB 43,28,43 ;; valid ctl + \ + DB 07,30,07 ;; ctl + number six key + DB 13,31,13 ;; ctl - or _ + DB 16,01,16 ;; A + DB 17,26,17 ;; Z + DB 30,17,30 ;; Q + DB 39,13,39 ;; M + DB 44,23,44 ;; W + DB 50,-1,-1 ;; U.S. 'M' +COM_CTRL_K3_T3_END: ;; + ;; + DW 0 ;; + ;; +COM_CTRL_K3_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Lower Shift Dead Key +;; KEYBOARD TYPES: All +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_LO_END-$ ;; length of state section + DB DEAD_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 1 ;; number of entries + DB 26 ;; scan code + FLAG CIRCUMFLEX ;; flag bit to set + ;; + ;; +COM_DK_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Upper Shift Dead Key +;; KEYBOARD TYPES: All +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_UP_END-$ ;; length of state section + DB DEAD_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 1 ;; number of entries + DB 26 ;; scan code + FLAG DIARESIS ;; flag bit to set + ;; +COM_DK_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift Dead Key +;; KEYBOARD TYPES: G, P12,AT +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_TH_END-$ ;; length of state section + DB DEAD_THIRD ;; State ID + DW G_KB+P12_KB+AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 3 ;; number of entries + DB 40 ;; + FLAG ACUTE ;; + DB 43 ;; + FLAG GRAVE ;; + DB 53 ;; + FLAG TILDE ;; + ;; +COM_DK_TH_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift Dead Key +;; KEYBOARD TYPES: XT + +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_TH_K1_END-$ ;; length of state section + DB DEAD_THIRD ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 3 ;; number of entries + DB 40 ;; + FLAG ACUTE ;; + DB 41 ;; + FLAG GRAVE ;; + DB 53 ;; + FLAG TILDE ;; + ;; +COM_DK_TH_K1_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;**************************************************** CODE eliminated********** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; NUM PAD altered ******** +;; CODE PAGE: 850 CNS engraved "," out +;; STATE: Numeric Pad - Divide Sign +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ;; +;; DW CP850_DIVID_END-$ ;; length of state section +;; DB DIVIDE_SIGN ;; State ID +;; DW G_KB+P12_KB ;; Keyboard Type +;; DB -1,-1 ;; error character = standalone accent +;; ;; +;; DW CP850_DIVID_T1_END-$ ;; Size of xlat table +;; DB TYPE_2_TAB ;; xlat options: +;; DB 2 ;; number of scans +;; DB 0E0H,',',0E0H ;; DIVIDE SIGN +;; DB 51,',',0E0H ;; +;; CP850_DIVID_T1_END: ;; +;; ;; +;; DW 0 ;; Size of xlat table - null table +;; ;; +;; CP850_DIVID_END: ;; +;; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Numeric Key Pad - Multiplication +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ;; +;; DW CP850_PAD_K1_END-$ ;; length of state section +;; DB NUMERIC_PAD ;; State ID +;; DW P12_KB ;; Keyboard Type +;; DB -1,-1 ;; Buffer entry for error character +;; ;; +;; DW CP850_PAD_K1_T1_END-$ ;; Size of xlat table +;; DB STANDARD_TABLE ;; xlat options: +;; DB 1 ;; number of entries +;; DB 51,',' ; (removed *** CNS ****) ;; MULTIPLICATION SIGN +;; CP850_PAD_K1_T1_END: ;; +;; ;; +;; DW 0 ;; Size of xlat table - null table +;; ;; +;; CP850_PAD_K1_END: ;; +;; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;********************************************************* +;; CODE PAGE: Common +;; STATE: Alpha Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AL_LO_END-$ ;; length of state section + DB ALPHA_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_AL_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 5 ;; number of entries + DB 16,'a' ;; small a + DB 17,'z' ;; small z + DB 30,'q' ;; small q + DB 39,'m' ;; small m + DB 44,'w' ;; small w +COM_AL_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AL_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alpha Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AL_UP_END-$ ;; length of state section + DB ALPHA_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_AL_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 5 ;; number of entries + DB 16,'A' ;; caps A + DB 17,'Z' ;; caps Z + DB 30,'Q' ;; caps Q + DB 39,'M' ;; caps M + DB 44,'W' ;; caps W +COM_AL_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AL_UP_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 20 ;; number of entries + DB 41,"" ;; superscript 2 + DB 2,"&" ;; + DB 3,"" ;; acute - e + DB 4,'"' ;; + DB 5,"'" ;; + DB 6,"(" ;; + DB 8,"" ;; grave - e + DB 9,"!" ;; + DB 10,"" ;; c - cedilla small + DB 11,"" ;; + DB 12,")" ;; + DB 13,"-" ;; + DB 27,"$" ;; + DB 40,"" ;; grave - u + DB 43,0E6H ;; mu + DB 86,'<' ;; + DB 50,',' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'=' ;; +COM_NA_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES:AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K2_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_T1_K2_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 19 ;; number of entries + DB 41,"<" ;; + DB 2,"&" ;; + DB 3,"" ;; acute - e + DB 4,'"' ;; + DB 5,"'" ;; + DB 6,"(" ;; + DB 8,"" ;; grave - e + DB 9,"!" ;; + DB 10,"" ;; c - cedilla small + DB 11,"" ;; + DB 12,")" ;; + DB 13,"-" ;; + DB 27,"$" ;; + DB 40,"" ;; grave - u + DB 43,0E6H ;; mu + DB 50,',' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'=' ;; +COM_NA_LO_T1_K2_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K2_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: XT, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K1_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 19 ;; number of entries + DB 2,"&" ;; + DB 3,"" ;; acute - e + DB 4,'"' ;; + DB 5,"'" ;; + DB 6,"(" ;; + DB 8,"" ;; + DB 9,"!" ;; + DB 10,"" ;; c - cedilla small + DB 11,"" ;; + DB 12,")" ;; + DB 13,"-" ;; + DB 27,"$" ;; + DB 40,"" ;; grave - u + DB 41,0E6H ;; mu + DB 43,'<' ;; + DB 50,',' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'=' ;; +COM_NA_LO_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 20 ;; number of entries + DB 2,'1' ;; + DB 3,'2' ;; + DB 4,'3' ;; + DB 5,'4' ;; + DB 6,'5' ;; + DB 7,'6' ;; + DB 8,'7' ;; + DB 9,'8' ;; + DB 10,'9' ;; + DB 11,'0' ;; + DB 12,0F8H ;; degree symbol + DB 13,"_" ;; + DB 27,"*" ;; + DB 40,'%' ;; + DB 43,'' ;; + DB 86,'>' ;; + DB 50,'?' ;; + DB 51,'.' ;; + DB 52,'/' ;; + DB 53,'+' ;; +COM_NA_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: XT + +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 20 ;; number of entries + DB 41,'' ;; + DB 2,'1' ;; + DB 3,'2' ;; + DB 4,'3' ;; + DB 5,'4' ;; + DB 6,'5' ;; + DB 7,'6' ;; + DB 8,'7' ;; + DB 9,'8' ;; + DB 10,'9' ;; + DB 11,'0' ;; + DB 12,0F8H ;; degree symbol + DB 13,"_" ;; + DB 27,"*" ;; + DB 40,'%' ;; + DB 43,'>' ;; + DB 50,'?' ;; + DB 51,'.' ;; + DB 52,'/' ;; + DB 53,'+' ;; +COM_NA_UP_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K1_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K2_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_T1_K2_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 20 ;; number of entries + DB 41,'>' ;; + DB 2,'1' ;; + DB 3,'2' ;; + DB 4,'3' ;; + DB 5,'4' ;; + DB 6,'5' ;; + DB 7,'6' ;; + DB 8,'7' ;; + DB 9,'8' ;; + DB 10,'9' ;; + DB 11,'0' ;; + DB 12,0F8H ;; degree symbol + DB 13,"_" ;; + DB 27,"*" ;; + DB 40,'%' ;; + DB 43,'' ;; + DB 50,'?' ;; + DB 51,'.' ;; + DB 52,'/' ;; + DB 53,'+' ;; +COM_NA_UP_T1_K2_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K2_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 9 ;; number of entries + DB 2,"|" ;; + DB 3,'@' ;; + DB 4,'#' ;; + DB 7,'^' ;; + DB 10,'{' ;; + DB 11,'}' ;; + DB 26,'[' ;; + DB 27,']' ;; + DB 86,'\' ;; +COM_THIRD_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: XT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K1_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 9 ;; number of entries + DB 2,"|" ;; + DB 3,'@' ;; + DB 4,'#' ;; + DB 7,'^' ;; + DB 10,'{' ;; + DB 11,'}' ;; + DB 26,'[' ;; + DB 27,']' ;; + DB 43,'\' ;; +COM_THIRD_T1_K1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K1_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K2_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_T1_K2_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 9 ;; number of entries + DB 2,"|" ;; + DB 3,'@' ;; + DB 4,'#' ;; + DB 7,'^' ;; + DB 10,'{' ;; + DB 11,'}' ;; + DB 26,'[' ;; + DB 27,']' ;; + DB 41,'\' ;; +COM_THIRD_T1_K2_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K2_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Lower +;; KEYBOARD TYPES: ALL +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_GR_LO_END-$ ;; length of state section + DB GRAVE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW COM_GR_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 16,'' ;; scan code,ASCII - a + DB 24,'' ;; scan code,ASCII - o + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i +COM_GR_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_GR_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_GR_UP_END-$ ;; length of state section + DB GRAVE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW COM_GR_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 0 ;; number of scans +COM_GR_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_GR_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_GR_SP_END-$ ;; length of state section + DB GRAVE_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW COM_GR_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,96 ;; STANDALONE GRAVE +COM_GR_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_GR_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_LO_END-$ ;; length of state section + DB CIRCUMFLEX_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW COM_CI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 16,'' ;; scan code,ASCII - a + DB 18,'' ;; scan code,ASCII - e + DB 24,'' ;; scan code,ASCII - o + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i +COM_CI_LO_T1_END: ;; + ;; + DW 0 ;; + ;; +COM_CI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex Upper +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_UP_END-$ ;; length of state section + DB CIRCUMFLEX_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW COM_CI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 0 ;; number of scans +COM_CI_UP_T1_END: ;; + ;; + DW 0 ;; + ;; +COM_CI_UP_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_SP_END-$ ;; length of state section + DB CIRCUMFLEX_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW COM_CI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,94 ;; STANDALONE CIRCUMFLEX +COM_CI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CI_SP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Tilde Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_TI_SP_END-$ ;; length of state section + DB TILDE_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 126,0 ;; error character = standalone accent + ;; + DW COM_TI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,126 ;; STANDALONE TIDLE +COM_TI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_TI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; Last State +COMMON_XLAT_END: ;; + ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; BE Specific Translate Section for 437 +;; +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC BE_437_XLAT ;; +BE_437_XLAT: ;; + ;; + DW CP437_XLAT_END-$ ;; length of section + DW 437 ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_NA_LO_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; default ignore error state + ;; + DW CP437_NA_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of scans + DB 7,15H ;; Section Symbol +CP437_NA_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_NA_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_NA_UP_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; default ignore error state + ;; + DW CP437_NA_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 41,00H ;; 3 Superscript +CP437_NA_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_NA_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Acute Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_AC_LO_END-$ ;; length of state section + DB ACUTE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW CP437_AC_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 16,'' ;; a acute + DB 18,'' ;; e acute + DB 23,'' ;; i acute + DB 24,'' ;; o acute + DB 22,'' ;; u acute +CP437_AC_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_AC_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Acute Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_AC_UP_END-$ ;; length of state section + DB ACUTE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW CP437_AC_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 18,'' ;; scan code,ASCII - e +CP437_AC_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_AC_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Acute Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_AC_SP_END-$ ;; length of state section + DB ACUTE_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW CP437_AC_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,39 ;; scan code,ASCII - SPACE +CP437_AC_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_AC_SP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Tilde Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_TI_LO_END-$ ;; length of state section + DB TILDE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 126,0 ;; error character = standalone accent + ;; + DW CP437_TI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 49,164 ;; scan code,ASCII - n +CP437_TI_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_TI_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Tilde Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_TI_UP_END-$ ;; length of state section + DB TILDE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 126,0 ;; error character = standalone accent + ;; + DW CP437_TI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 49,165 ;; scan code,ASCII - N +CP437_TI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_TI_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Diaresis Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_DI_LO_END-$ ;; length of state section + DB DIARESIS_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 0FEH,0 ;; error character = standalone accent + ;; + DW CP437_DI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 16,'' ;; scan code,ASCII - a + DB 24,'' ;; scan code,ASCII - o + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 21,'' ;; scan code,ASCII - y +CP437_DI_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_DI_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Diaresis Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_DI_UP_END-$ ;; length of state section + DB DIARESIS_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 0FEH,0 ;; error character = standalone accent + ;; + DW CP437_DI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 3 ;; number of scans + DB 16,'' ;; scan code,ASCII - a + DB 24,'' ;; scan code,ASCII - o + DB 22,'' ;; scan code,ASCII - u +CP437_DI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_DI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Diaresis Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; ;; +; DW CP437_DI_SP_END-$ ;; length of state section +; DB DIARESIS_SPACE ;; State ID +; DW ANY_KB ;; Keyboard Type +; DB 0FEH,0 ;; error character = standalone accent +; ;; +; DW CP437_DI_SP_T1_END-$ ;; Size of xlat table +; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: +; DB 1 ;; number of scans +; DB 57,0FEH ;; error character = standalone accent +;CP437_DI_SP_T1_END: ;; +; ;; +; DW 0 ;; Size of xlat table - null table +;CP437_DI_SP_END: ;; length of state section +; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; LAST STATE + ;; +CP437_XLAT_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; BE Specific Translate Section for 850 +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC BE_850_XLAT ;; +BE_850_XLAT: ;; + ;; + DW CP850_XLAT_END-$ ;; length of section + DW 850 ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_NA_LO_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; default ignore error state + ;; + DW CP850_NA_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of scans + DB 7,0F5H ;; Section symbol -  +CP850_NA_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_NA_LO_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_NA_UP_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; default ignore error state + ;; + DW CP850_NA_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of scans + DB 41,0FCH ;; 3 Superscript +CP850_NA_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_NA_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Third Shift +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_THIRD_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; default ignore error state + ;; + DW CP850_THIRD_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 0 ;; number of scans +CP850_THIRD_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_THIRD_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP850 +;; STATE: Tilde Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_TI_LO_END-$ ;; length of state section + DB TILDE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 126,0 ;; error character = standalone accent + ;; + DW CP850_TI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 3 ;; number of scans + DB 49,164 ;; scan code,ASCII - n + DB 16,0C6H ;; a + DB 24,0E4H ;; o +CP850_TI_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_TI_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP850 +;; STATE: Tilde Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_TI_UP_END-$ ;; length of state section + DB TILDE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 126,0 ;; error character = standalone accent + ;; + DW CP850_TI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 3 ;; number of scans + DB 49,165 ;; scan code,ASCII - N + DB 16,0C7H ;; A + DB 24,0E5H ;; O +CP850_TI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_TI_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP850 +;; STATE: Acute Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_LO_END-$ ;; length of state section + DB ACUTE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 0EFH,0 ;; error character = standalone accent + DW CP850_AC_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 16,'' ;; a acute + DB 18,'' ;; e acute + DB 23,'' ;; i acute + DB 24,'' ;; o acute + DB 22,'' ;; u acute + DB 21,0ECH ;; y acute ADDED 12/16 CNS ********** +CP850_AC_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP850 +;; STATE: Acute Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_UP_END-$ ;; length of state section + DB ACUTE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 0EFH,0 ;; error character = standalone accent + DW CP850_AC_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 16,0B5H ;; A acute + DB 18,090H ;; E acute + DB 23,0D6H ;; I acute + DB 24,0E0H ;; O acute + DB 22,0E9H ;; U acute + DB 21,0EDH ;; Y acute +CP850_AC_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_UP_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP850 +;; STATE: Acute Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_SP_END-$ ;; length of state section + DB ACUTE_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 0EFH,0 ;; error character = standalone accent + ;; + DW CP850_AC_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,0EFH ;; scan code,ASCII - SPACE +CP850_AC_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_SP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP850 +;; STATE: Diaresis Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_LO_END-$ ;; length of state section + DB DIARESIS_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW CP850_DI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 16,'' ;; scan code,ASCII - a + DB 24,'' ;; scan code,ASCII - o + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 21,'' ;; scan code,ASCII - y +CP850_DI_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_DI_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; +;; CODE PAGE: 850 +;; STATE: Diaresis Upper +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_UP_END-$ ;; length of state section + DB DIARESIS_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW CP850_DI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 16,8EH ;; A di + DB 18,0D3H ;; E diaeresis + DB 23,0D8H ;; I diaeresis + DB 24,99H ;; O di + DB 22,9AH ;; U di +CP850_DI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_DI_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP850 +;; STATE: Diaeresis Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_SP_END-$ ;; length of state section + DB DIARESIS_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 0FEH,0 ;; error character = standalone accent + ;; + DW CP850_DI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,0F9H ;; scan code,ASCII - SPACE +CP850_DI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_DI_SP_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Grave Upper +;; KEYBOARD TYPES: ALL +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_GR_UP_END-$ ;; length of state section + DB GRAVE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW CP850_GR_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 16,0B7H ;; A grave + DB 18,0D4H ;; E grave + DB 23,0DEH ;; I grave + DB 24,0E3H ;; O grave + DB 22,0EBH ;; U grave +CP850_GR_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_GR_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Circumflex Upper +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_CI_UP_END-$ ;; length of state section + DB CIRCUMFLEX_UPPER ;; State ID + DW ANY_KB ;; + DB 94,0 ;; error character = standalone accent + ;; + DW CP850_CI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 16,0B6H ;; A circumflex + DB 18,0D2H ;; E circumflex + DB 23,0D7H ;; I circumflex + DB 24,0E2H ;; O circumflex + DB 22,0EAH ;; U circumflex +CP850_CI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_CI_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ;; + DW 0 ;; LAST STATE + ;; +CP850_XLAT_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CODE ENDS ;; + END ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/v4.0/src/DEV/KEYBOARD/KDFCF.ASM b/v4.0/src/DEV/KEYBOARD/KDFCF.ASM new file mode 100644 index 0000000..a8469dd --- /dev/null +++ b/v4.0/src/DEV/KEYBOARD/KDFCF.ASM @@ -0,0 +1,1769 @@ + + PAGE ,132 + TITLE DOS - KEYBOARD.SYS + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DOS - - NLS Support - KEYBOARD.SYS +;; (c) Copyright 1988 Microsoft +;; +;; This file contains the keyboard table for Canadian French +;; +;; Linkage Instructions: +;; Refer to KDF.ASM +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + INCLUDE KEYBSHAR.INC ;; + INCLUDE POSTEQU.INC ;; + INCLUDE KEYBMAC.INC ;; + ;; + PUBLIC CF_LOGIC ;; + PUBLIC CF_863_XLAT ;; + PUBLIC CF_850_XLAT ;; + ;; +CODE SEGMENT PUBLIC 'CODE' ;; + ASSUME CS:CODE,DS:CODE ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Standard translate table options are a liner search table +;; (TYPE_2_TAB) and ASCII entries ONLY (ASCII_ONLY) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +STANDARD_TABLE EQU TYPE_2_TAB+ASCII_ONLY + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; CF State Logic +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CF_LOGIC: ;; + ;; + DW LOGIC_END-$ ;; length + ;; + DW JR_HOT_KEY_1_2 ;; special features + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; COMMANDS START HERE + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; OPTIONS: If we find a scan match in +;; an XLATT or SET_FLAG operation then +;; exit from INT 9. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + OPTION EXIT_IF_FOUND ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Dead key definitions must come before +;; dead key translations to handle +;; dead key + dead key. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + IFF EITHER_ALT,NOT ;; + ANDF EITHER_CTL,NOT ;; + IFF CIRCUMFLEX ;; + RESET_NLS ;; + XLATT CIRCUMFLEX_CIRCUMFLEX ;; + GOTO CIRCUMFLEX_ON ;; + ENDIFF ;; + IFF GRAVE ;; + RESET_NLS ;; + XLATT GRAVE_GRAVE ;; + GOTO GRAVE_ON ;; + ENDIFF ;; + IFF EITHER_SHIFT ;; + IFF DIARESIS ;; + RESET_NLS ;; + XLATT DIARESIS_DIARESIS ;; + GOTO DIARESIS_ON ;; + ENDIFF ;; + SET_FLAG DEAD_UPPER ;; + ELSEF ;; + IFF CEDILLA ;; + RESET_NLS ;; + XLATT CEDILLA_CEDILLA ;; + GOTO CEDILLA_ON ;; + ENDIFF ;; + SET_FLAG DEAD_LOWER ;; + ENDIFF ;; + ELSEF ;; + IFF R_ALT_SHIFT,NOT ;; + ANDF ALT_SHIFT ;; + IFF EITHER_SHIFT ;; Third shift is activated by ALT_GR + ;; OR ALT + SHIFT. + IFF ACUTE ;; + RESET_NLS ;; + XLATT ACUTE_ACUTE ;; + GOTO ACUTE_ON ;; + ENDIFF ;; + SET_FLAG DEAD_THIRD ;; + ENDIFF ;; + ELSEF ;; + IFF R_ALT_SHIFT ;; +;;;************************************** +;;; BIOS sets ALT_SHIFT when R_ALT_SHIFT is pressed. +;;; We must suppress this to detect both ALT keys simultaneously. +;;; ANDF ALT_SHIFT,NOT ;; +;;;************************************** + ANDF EITHER_SHIFT,NOT ;; + IFF ACUTE ;; + RESET_NLS ;; + XLATT ACUTE_ACUTE ;; + GOTO ACUTE_ON ;; + ENDIFF ;; + SET_FLAG DEAD_THIRD ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ACUTE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +ACUTE_PROC: ;; + ;; + IFF ACUTE,NOT ;; + GOTO GRAVE_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; +ACUTE_ON: ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT ACUTE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT ACUTE_LOWER ;; + ELSEF ;; + XLATT ACUTE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT ACUTE_UPPER ;; + ELSEF ;; + XLATT ACUTE_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_ACUTE: ;; + ;; If we get here then either the XLATT + BEEP ;; failed or we are ina bad shift state. + EXIT_INT_9 ;; Either is invalid so BEEP. + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; GRAVE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +GRAVE_PROC: ;; + ;; + IFF GRAVE,NOT ;; + GOTO DIARESIS_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; +GRAVE_ON: ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT GRAVE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT GRAVE_UPPER ;; + ELSEF ;; + XLATT GRAVE_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_GRAVE: ;; + ;; If we get here then either the XLATT + BEEP ;; failed or we are ina bad shift state. + EXIT_INT_9 ;; Either is invalid so BEEP. + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DIARESIS ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +DIARESIS_PROC: ;; + ;; + IFF DIARESIS,NOT ;; + GOTO CIRCUMFLEX_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; +DIARESIS_ON: ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT DIARESIS_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_LOWER ;; + ELSEF ;; + XLATT DIARESIS_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_UPPER ;; + ELSEF ;; + XLATT DIARESIS_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_DIARESIS: ;; + ;; If we get here then either the XLATT + BEEP ;; failed or we are ina bad shift state. + EXIT_INT_9 ;; Either is invalid so BEEP. + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CIRCUMFLEX ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CIRCUMFLEX_PROC: ;; + ;; + IFF CIRCUMFLEX,NOT ;; + GOTO CEDILLA_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; +CIRCUMFLEX_ON: ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT CIRCUMFLEX_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT CIRCUMFLEX_UPPER ;; + ELSEF ;; + XLATT CIRCUMFLEX_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_CIRCUMFLEX: ;; + ;; If we get here then either the XLATT + BEEP ;; failed or we are ina bad shift state. + EXIT_INT_9 ;; Either is invalid so BEEP. + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CEDILLA ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CEDILLA_PROC: ;; + ;; + IFF CEDILLA,NOT ;; + GOTO NON_DEAD ;; + ENDIFF ;; + ;; + RESET_NLS ;; +CEDILLA_ON: ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT CEDILLA_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT CEDILLA_LOWER ;; + ELSEF ;; + XLATT CEDILLA_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT CEDILLA_UPPER ;; + ELSEF ;; + XLATT CEDILLA_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_CEDILLA: ;; + ;; If we get here then either the XLATT + BEEP ;; failed or we are ina bad shift state. + EXIT_INT_9 ;; Either is invalid so BEEP. + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Upper, lower and third shifts +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +NON_DEAD: ;; + IFKBD G_KB+P12_KB ;; + ANDF LC_E0 ;; + EXIT_STATE_LOGIC ;; + ENDIFF ;; + ;; + IFF EITHER_ALT,NOT ;; Lower and upper case. Alphabetic + ANDF EITHER_CTL,NOT ;; keys are affected by CAPS LOCK. + GOTO NO_THIRD ;; + ENDIFF ;; + ;; + IFF R_ALT_SHIFT,NOT ;; Third shift is activated by ALT_GR + ANDF ALT_SHIFT ;; OR ALT + SHIFT. + IFF EITHER_SHIFT ;; + XLATT THIRD_SHIFT ;; + IFF SCAN_MATCH,NOT ;; + EXIT_INT_9 ;; + ENDIFF ;; + ENDIFF ;; + ELSEF ;; + IFF R_ALT_SHIFT ;; +;;;************************************** +;;; BIOS sets ALT_SHIFT when R_ALT_SHIFT is pressed. +;;; We must suppress this to detect both ALT keys simultaneously. +;;; ANDF ALT_SHIFT,NOT ;; +;;;************************************** + ANDF EITHER_SHIFT,NOT ;; + XLATT THIRD_SHIFT ;; + IFF SCAN_MATCH,NOT ;; + EXIT_INT_9 ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; + EXIT_STATE_LOGIC ;; + ;; + ;; +NO_THIRD: ;; Lower and upper case. Alphabetic + ;; keys are affected by CAPS LOCK. + IFF EITHER_SHIFT ;; Numeric keys are not. + XLATT NON_ALPHA_UPPER ;; + IFF CAPS_STATE ;; + XLATT ALPHA_LOWER ;; + ELSEF ;; + XLATT ALPHA_UPPER ;; + ENDIFF ;; + ELSEF ;; + XLATT NON_ALPHA_LOWER ;; + IFF CAPS_STATE ;; + XLATT ALPHA_UPPER ;; + ELSEF ;; + XLATT ALPHA_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ;; + EXIT_STATE_LOGIC ;; + ;; +LOGIC_END: ;; + ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; CF Common Translate Section +;; This section contains translations for the lower 128 characters +;; only since these will never change from code page to code page. +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC CF_COMMON_XLAT ;; +CF_COMMON_XLAT: ;; + ;; + DW COMMON_XLAT_END-$ ;; length of Common Tranlate Section + DW -1 ;; code page + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Lower Shift Dead Key +;; KEYBOARD: All +;; TABLE TYPE: Set Dead Key Flag +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW COM_DE_LO_END-$ ;; + ;; label format: + ;; codepage_state_n_END + ;; codepage = COMmon + ;; codepage1, + ;; codepage2. + ;; state refers to + ;; alpha, case, and dead: + ;; DE_LO: DEAD_LOWER + ;; DE_UP: DEAD_UPPER + ;; DE_TH: DEAD_THIRD + ;; AL_LO: ALPHA_LOWER + ;; AL_UP: ALPHA_UPPER + ;; NA_LO: NON_ALPHA_LOWER + ;; NA_UP: NON_ALPHA_UPPER + ;; NA_TH: THIRD_SHIFT + ;; AC_LO: ACUTE_LOWER + ;; AC_UP: ACUTE_UPPER + ;; AC_SP: ACUTE_SPACE + ;; AC_AC: ACUTE_ACUTE + ;; GR_LO: GRAVE_LOWER + ;; GR_UP: GRAVE_UPPER + ;; GR_SP: GRAVE_SPACE + ;; GR_GR: GRAVE_GRAVE + ;; DI_LO: DIARESIS_LOWER + ;; DI_UP: DIARESIS_UPPER + ;; DI_SP: DIARESIS_SPACE + ;; DI_DI: DIARESIS_DIARESIS + ;; CI_LO: CIRCUMFLEX_LOWER + ;; CI_UP: CIRCUMFLEX_UPPER + ;; CI_SP: CIRCUMFLEX_SPACE + ;; CI_CI: CIRCUMFLEX_CIRCUMFLEX + ;; CE_LO: CEDILLA_LOWER + ;; CE_UP: CEDILLA_UPPER + ;; CE_SP: CEDILLA_SPACE + ;; CE_CE: CEDILLA_CEDILLA + ;; + ;; n = 1,2,... to distinguish + ;; for different KB + DB DEAD_LOWER ;; + DW ANY_KB ;; + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 3 ;; number of dead keys + DB 40 ;; scan code + FLAG GRAVE ;; flag bit assignment + DB 26 ;; + FLAG CIRCUMFLEX ;; + DB 27 ;; + FLAG CEDILLA ;; +COM_DE_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Upper Shift Dead Key +;; KEYBOARD: ALL +;; TABLE TYPE: Set Dead Key Flag +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW COM_DE_UP_END-$ ;; + DB DEAD_UPPER ;; + DW ANY_KB ;; + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 3 ;; number of dead keys + DB 40 ;; scan code + FLAG GRAVE ;; flag bit assignment + DB 26 ;; + FLAG CIRCUMFLEX ;; + DB 27 ;; + FLAG DIARESIS ;; +COM_DE_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift Dead Key +;; KEYBOARD: All +;; TABLE TYPE: Set Dead Key Flag +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW COM_DE_TH_END-$ ;; + DB DEAD_THIRD ;; + DW ANY_KB ;; + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 1 ;; number of dead keys + DB 53 ;; scan code + FLAG ACUTE ;; flag bit assignment +COM_DE_TH_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alpha Lower Case +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AL_LO_END-$ ;; Length of state section + DB ALPHA_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_000400-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of scans + DB 53,'' ;; +CF_000400: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AL_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alpha Upper Case +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AL_UP_END-$ ;; + DB ALPHA_UPPER ;; + DW ANY_KB ;; + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_002400-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of scans + DB 53,'' ;; +CF_002400: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AL_UP_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-alpha lower Case +;; KEYBOARD: G_KB, P_KB, P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_1_END-$ ;; Length of state section + DB NON_ALPHA_LOWER ;; + DW G_KB+P_KB+P12_KB ;; + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_004300-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 3 ;; number of scans + DB 41,'#' ;; + DB 43,'<' ;; + DB 86,'' ;; +CF_004300: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-alpha lower Case +;; KEYBOARD: XT_KB, AT_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_2_END-$ ;; Length of state section + DB NON_ALPHA_LOWER ;; + DW XT_KB+AT_KB ;; + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_004400-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 2 ;; number of scans + DB 41,'<' ;; + DB 43,'\' ;; +CF_004400: ;; + ;; + DW 0 ;; Size of xlat table : null + ;; +COM_NA_LO_2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-alpha lower Case +;; KEYBOARD: JR_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_3_END-$ ;; Length of state section + DB NON_ALPHA_LOWER ;; + DW JR_KB ;; + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_004401-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of scans + DB 51,',' ;; +CF_004401: ;; + ;; + DW 0 ;; Size of xlat table : null + ;; +COM_NA_LO_3_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-alpha Upper Case +;; KEYBOARD: G_KB, P_KB, P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_1_END-$ ;; Length of state section + DB NON_ALPHA_UPPER ;; + DW G_KB+P_KB+P12_KB ;; + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_005300-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 8 ;; number of scans + DB 3,'"' ;; + DB 4,'/' ;; + DB 7,'?' ;; + DB 41,'|' ;; + DB 43,'>' ;; + DB 51,27H ;; single quote + DB 52,'.' ;; + DB 86,'' ;; +CF_005300: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_1_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-alpha Upper Case +;; KEYBOARD: XT_KB+AT_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_2_END-$ ;; Length of state section + DB NON_ALPHA_UPPER ;; + DW XT_KB+AT_KB ;; + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_005400-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 7 ;; number of scans + DB 3,'"' ;; + DB 4,'/' ;; + DB 7,'?' ;; + DB 41,'>' ;; + DB 43,'|' ;; + DB 51,27H ;; single quote + DB 52,'.' ;; period +CF_005400: ;; + ;; + DW 0 ;; Size of xlat table : null + ;; +COM_NA_UP_2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-alpha Upper Case +;; KEYBOARD: JR_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_3_END-$ ;; Length of state section + DB NON_ALPHA_UPPER ;; + DW JR_KB ;; + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_005100-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 5 ;; + DB 3,'"' ;; + DB 4,'/' ;; + DB 7,'?' ;; + DB 51,27H ;; single quote + DB 52,02EH ;; period +CF_005100: ;; + ;; + DW 0 ;; Size of xlat table : null + ;; + ;; +COM_NA_UP_3_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-alpha Third Case +;; KEYBOARD: G_KB, P_KB, P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_TH_1_END-$ ;; Length of state section + DB THIRD_SHIFT ;; + DW G_KB+P_KB+P12_KB ;; + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_007760-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 18 ;; number of scans + DB 2,'' ;; + DB 3,'@' ;; + DB 4,'' ;; + DB 7,'' ;; + DB 9,'' ;; + DB 11,'' ;; + DB 12,'' ;; + DB 26,'[' ;; + DB 27,']' ;; + DB 39,'~' ;; + DB 40,'{' ;; + DB 41,'\' ;; + DB 43,'}' ;; + DB 47,'' ;; + DB 48,'' ;; + DB 49,'' ;; + DB 50,'' ;; + DB 86,'' ;; +CF_007760: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_TH_1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-alpha Third Case +;; KEYBOARD: XT_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_TH_2_END-$ ;; Length of state section + DB THIRD_SHIFT ;; + DW XT_KB ;; + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_006500-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 17 ;; number of scans + DB 2,'' ;; + DB 3,'@' ;; + DB 4,'' ;; + DB 7,'' ;; + DB 9,'' ;; + DB 11,'' ;; + DB 12,'' ;; + DB 26,'[' ;; + DB 27,']' ;; + DB 39,'~' ;; + DB 40,'{' ;; + DB 41,'}' ;; + DB 43,'#' ;; + DB 47,'' ;; + DB 48,'' ;; + DB 49,'' ;; + DB 50,'' ;; +CF_006500: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_TH_2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-alpha Third Case +;; KEYBOARD: AT_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_TH_3_END-$ ;; Length of state section + DB THIRD_SHIFT ;; + DW AT_KB ;; + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_006300-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 17 ;; number of scans + DB 2,'' ;; + DB 3,'@' ;; + DB 4,'' ;; + DB 7,'' ;; + DB 9,'' ;; + DB 11,'' ;; + DB 12,'' ;; + DB 26,'[' ;; + DB 27,']' ;; + DB 38,'~' ;; + DB 39,'{' ;; + DB 40,'}' ;; + DB 43,'#' ;; + DB 47,'' ;; + DB 48,'' ;; + DB 49,'' ;; + DB 50,'' ;; +CF_006300: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_TH_3_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-alpha Third Case +;; KEYBOARD: PCJR +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CF_COM_NA_TH_4_END-$ ;; Length of state section + DB THIRD_SHIFT ;; + DW JR_KB ;; + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_007100-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 21 ;; + DB 2,'' ;; + DB 3,'@' ;; + DB 4,'' ;; + DB 7,'' ;; + DB 9,'' ;; + DB 11,'' ;; + DB 16,'' ;; + DB 17,'' ;; + DB 26,'[' ;; + DB 27,']' ;; + DB 30,'<' ;; + DB 31,'>' ;; + DB 38,'~' ;; + DB 39,'{' ;; + DB 40,'}' ;; + DB 44,'\' ;; + DB 45,'#' ;; + DB 46,'|' ;; + DB 47,'' ;; + DB 48,'' ;; + DB 49,'' ;; +CF_007100: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CF_COM_NA_TH_4_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Acute Lower Case +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AC_LO_END-$ ;; Length of state section + DB ACUTE_LOWER ;; + DW ANY_KB ;; + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_001100-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 3 ;; number of scans + DB 18,'' ;; + DB 24,'' ;; + DB 22,'' ;; +CF_001100: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AC_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Acute Upper Case +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AC_UP_END-$ ;; Length of state section + DB ACUTE_UPPER ;; + DW ANY_KB ;; + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_003100-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 18,'' ;; +CF_003100: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AC_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Lower Case +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_GR_LO_END-$ ;; Length of state section + DB GRAVE_LOWER ;; + DW ANY_KB ;; + DB '`',0 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_001200-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 3 ;; number of scans + DB 30,'' ;; + DB 18,'' ;; + DB 22,'' ;; +CF_001200: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_GR_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave + Space Bar +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_GR_SP_END-$ ;; Length of state section + DB GRAVE_SPACE ;; + DW ANY_KB ;; + DB '`',0 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_004500-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,'`' ;; +CF_004500: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_GR_SP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave + Grave +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_GR_GR_END-$ ;; Length of state section + DB GRAVE_GRAVE ;; + DW ANY_KB ;; + DB '`',0 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_004501-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 40,'`' ;; +CF_004501: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_GR_GR_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Diaresis Lower Case +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DI_LO_END-$ ;; Length of state section + DB DIARESIS_LOWER ;; + DW ANY_KB ;; + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_001400-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 3 ;; number of scans + DB 18,'' ;; + DB 23,'' ;; + DB 22,'' ;; +CF_001400: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_DI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex Lower Case +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_LO_END-$ ;; Length of state section + DB CIRCUMFLEX_LOWER ;; + DW ANY_KB ;; + DB '^',0 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_001300-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 30,'' ;; + DB 18,'' ;; + DB 23,'' ;; + DB 24,'' ;; + DB 22,'' ;; +CF_001300: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex + Space Bar +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_SP_END-$ ;; Length of state section + DB CIRCUMFLEX_SPACE ;; + DW ANY_KB ;; + DB '^',0 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_004555-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,'^' ;; +CF_004555: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CI_SP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex + Circumflex +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_CI_END-$ ;; Length of state section + DB CIRCUMFLEX_CIRCUMFLEX ;; + DW ANY_KB ;; + DB '^',0 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_004551-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 26,'^' ;; +CF_004551: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CI_CI_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Diaresis Upper Case +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DI_UP_END-$ ;; Length of state section + DB DIARESIS_UPPER ;; + DW ANY_KB ;; + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_003300-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 22,'' ;; +CF_003300: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_DI_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Cedilla Lower Case +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CE_LO_END-$ ;; Length of state section + DB CEDILLA_LOWER ;; + DW ANY_KB ;; + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_001500-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 46,'' ;; +CF_001500: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CE_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Cedilla Upper Case +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CE_UP_END-$ ;; Length of state section + DB CEDILLA_UPPER ;; + DW ANY_KB ;; + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_003400-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 46,'' ;; +CF_003400: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CE_UP_END: ;; + ;; + DW 0 ;; Last State +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +COMMON_XLAT_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; CF 863 Translate Section +;; This section contains translations for the UPPER 128 characters +;; of Code Page 863. +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC CF_863_XLAT ;; +CF_863_XLAT: ;; + ;; + DW CP863_XLAT_END-$ ;; length of 863 Tranlate Section + DW 863 ;; code page id + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 863 +;; STATE: Non-alpha Third Case +;; KEYBOARD: G_B, P_KB, P12_KB +;; XT_KB, AT_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP863_NA_TH_1_END-$ ;; Length of state section + DB THIRD_SHIFT ;; + DW G_KB+P_KB+P12_KB+XT_KB+AT_KB ;; + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_106300-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 8 ;; number of scan + DB 5,'' ;; + DB 6,98H ;; international currency symbol + DB 8,0A0H ;; vertical line broken + DB 10,0A6H ;; superscript 3 + DB 13,0ADH ;; 3 quarters + DB 24,08FH ;; section + DB 25,086H ;; paragraph + DB 51,0A7H ;; overscore +CF_106300: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP863_NA_TH_1_END: ;; Length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 863 +;; STATE: Non-alpha Third Case +;; KEYBOARD: JR_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP863_NA_TH_2_END-$ ;; Length of state section + DB THIRD_SHIFT ;; + DW JR_KB ;; + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_106600-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 8 ;; number of scan + DB 5,'' ;; + DB 6,98H ;; international currency symbol + DB 8,0A0H ;; vertical line broken + DB 12,0A6H ;; superscript 3 + DB 18,0ADH ;; 3 quarters + DB 24,08FH ;; section + DB 25,086H ;; paragraph + DB 51,0A7H ;; overscore +CF_106600: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP863_NA_TH_2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 863 +;; STATE: Acute INPUT: Space Bar +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP863_AC_SP_END-$ ;; Length of state section + DB ACUTE_SPACE ;; + DW ANY_KB ;; + DB 0A1H,0 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_104500-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,0A1H ;; acute +CF_104500: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP863_AC_SP_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 863 +;; STATE: Acute INPUT: Acute +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP863_AC_AC_END-$ ;; Length of state section + DB ACUTE_ACUTE ;; + DW ANY_KB ;; + DB 0A1H,0 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_104505-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 53,0A1H ;; acute +CF_104505: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP863_AC_AC_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 863 +;; STATE: Grave Upper Case +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP863_GR_UP_END-$ ;; Length of state section + DB GRAVE_UPPER ;; + DW ANY_KB ;; + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_104700-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 3 ;; number of scans + DB 30,8EH ;; A grave + DB 18,91H ;; E grave + DB 22,9DH ;; U grave +CF_104700: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP863_GR_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 863 +;; STATE: Diaresis Upper Case +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP863_DI_UP_END-$ ;; Length of state section + DB DIARESIS_UPPER ;; + DW ANY_KB ;; + DB 0A4H,0 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_104800-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 2 ;; number of scans + DB 18,94H ;; E diaeresis + DB 23,95H ;; I diaeresis +CF_104800: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP863_DI_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 863 +;; STATE: Diaresis INPUT: Space Bar +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP863_DI_SP_END-$ ;; Length of state section + DB DIARESIS_SPACE ;; + DW ANY_KB ;; + DB 0A4H,0 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_104550-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,0A4H ;; diaeresis +CF_104550: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP863_DI_SP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 863 +;; STATE: Diaresis INPUT: Diaresis +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP863_DI_DI_END-$ ;; Length of state section + DB DIARESIS_DIARESIS ;; + DW ANY_KB ;; + DB 0A4H,0 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_104551-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 27,0A4H ;; diaeresis +CF_104551: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP863_DI_DI_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 863 +;; STATE: Circumflex Upper Case +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP863_CI_UP_END-$ ;; Length of state section + DB CIRCUMFLEX_UPPER ;; + DW ANY_KB ;; + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_104750-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 30,84H ;; A circumflex + DB 18,92H ;; E circumflex + DB 23,0A8H ;; I circumflex + DB 24,99H ;; O circumflex + DB 22,9EH ;; U circumflex +CF_104750: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP863_CI_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 863 +;; STATE: Cedilla INPUT: Space Bar +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP863_CE_SP_END-$ ;; Length of state section + DB CEDILLA_SPACE ;; + DW ANY_KB ;; + DB 0A5H,0 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_104600-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,0A5H ;; cedilla +CF_104600: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP863_CE_SP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 863 +;; STATE: Cedilla INPUT: Cedilla +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP863_CE_CE_END-$ ;; Length of state section + DB CEDILLA_CEDILLA ;; + DW ANY_KB ;; + DB 0A5H,0 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_104601-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 27,0A5H ;; cedilla +CF_104601: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP863_CE_CE_END: ;; + ;; + ;; + DW 0 ;; Last State +CP863_XLAT_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; CF 850 Translate Section +;; This section contains translations for the UPPER 128 characters +;; of Code Page 850. +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC CF_850_XLAT ;; +CF_850_XLAT: ;; + ;; + DW CP850_XLAT_END-$ ;; length of 850 Tranlate Section + DW 850 ;; code page id + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Non-alpha Third Case +;; KEYBOARD: G_KB, P_KB, P12_KB +;; XT_KB, AT_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_NA_TH_1_END-$ ;; Length of state section + DB THIRD_SHIFT ;; + DW G_KB+P_KB+P12_KB+XT_KB+AT_KB ;; + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_206300-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 8 ;; number of scan + DB 5,0BDH ;; cent + DB 6,0CFH ;; international currency symbol + DB 8,0DDH ;; vertical line broken + DB 10,0FCH ;; superscript 3 + DB 13,0F3H ;; 3 quarters + DB 24,0F5H ;; section + DB 25,0F4H ;; paragraph + DB 51,0EEH ;; overscore +CF_206300: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_NA_TH_1_END: ;; Length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Non-alpha Third Case +;; KEYBOARD: JR_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_NA_TH_2_END-$ ;; Length of state section + DB THIRD_SHIFT ;; + DW JR_KB ;; + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_206600-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 8 ;; number of scan + DB 5,0BDH ;; cent + DB 6,0CFH ;; international currency symbol + DB 8,0DDH ;; vertical line broken + DB 12,0FCH ;; superscript 3 + DB 18,0F3H ;; 3 quarters + DB 24,0F5H ;; section + DB 25,0F4H ;; paragraph + DB 51,0EEH ;; overscore +CF_206600: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_NA_TH_2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Acute Lower Case +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_LO_END-$ ;; Length of state section + DB ACUTE_LOWER ;; + DW ANY_KB ;; + DB 0EFH,0 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_201100-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 3 ;; number of scans + DB 30,'' ;; + DB 23,'' ;; + DB 21,0ECH ;; y acute +CF_201100: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Acute Upper Case +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_UP_END-$ ;; Length of state section + DB ACUTE_UPPER ;; + DW ANY_KB ;; + DB 0EFH,0 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_203100-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 30,0B5H ;; A acute + DB 23,0D6H ;; I acute + DB 24,0E0H ;; O acute + DB 22,0E9H ;; U acute + DB 21,0EDH ;; Y acute +CF_203100: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Acute INPUT: Space Bar +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_SP_END-$ ;; Length of state section + DB ACUTE_SPACE ;; + DW ANY_KB ;; + DB 0EFH,0 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_204500-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,0EFH ;; acute +CF_204500: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_SP_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Acute INPUT: Acute +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_AC_END-$ ;; Length of state section + DB ACUTE_ACUTE ;; + DW ANY_KB ;; + DB 0EFH,0 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_204501-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 53,0EFH ;; acute +CF_204501: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_AC_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Grave Lower Case +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_GR_LO_END-$ ;; Length of state section + DB GRAVE_LOWER ;; + DW ANY_KB ;; + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_201200-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 2 ;; number of scans + DB 23,'' ;; + DB 24,'' ;; +CF_201200: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_GR_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Grave Upper Case +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_GR_UP_END-$ ;; Length of state section + DB GRAVE_UPPER ;; + DW ANY_KB ;; + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_203200-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 30,0B7H ;; A grave + DB 18,0D4H ;; E grave + DB 23,0DEH ;; I grave + DB 24,0E3H ;; O grave + DB 22,0EBH ;; U grave +CF_203200: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_GR_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Diaresis Lower Case +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_LO_END-$ ;; Length of state section + DB DIARESIS_LOWER ;; + DW ANY_KB ;; + DB 0F9H,0 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_201400-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 3 ;; number of scans + DB 30,'' ;; + DB 24,'' ;; + DB 21,'' ;; +CF_201400: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_DI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Diaresis Upper Case +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_UP_END-$ ;; Length of state section + DB DIARESIS_UPPER ;; + DW ANY_KB ;; + DB 0F9H,0 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_203400-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 4 ;; number of scans + DB 30,'' ;; + DB 18,0D3H ;; E diaeresis + DB 23,0D8H ;; I diaeresis + DB 24,'' ;; +CF_203400: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_DI_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Diaresis INPUT: Space Bar +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_SP_END-$ ;; Length of state section + DB DIARESIS_SPACE ;; + DW ANY_KB ;; + DB 0F9H,0 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_204550-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,0F9H ;; diaeresis +CF_204550: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_DI_SP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Diaresis INPUT: Diaresis +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_DI_END-$ ;; Length of state section + DB DIARESIS_DIARESIS ;; + DW ANY_KB ;; + DB 0F9H,0 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_204551-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 27,0F9H ;; diaeresis +CF_204551: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_DI_DI_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Circumflex Upper Case +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_CI_UP_END-$ ;; Length of state section + DB CIRCUMFLEX_UPPER ;; + DW ANY_KB ;; + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_003305-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 30,0B6H ;; A circumflex + DB 18,0D2H ;; E circumflex + DB 23,0D7H ;; I circumflex + DB 24,0E2H ;; O circumflex + DB 22,0EAH ;; U circumflex +CF_003305: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_CI_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Cedilla INPUT: Space Bar +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_CE_SP_END-$ ;; Length of state section + DB CEDILLA_SPACE ;; + DW ANY_KB ;; + DB 0F7H,0 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_204600-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,0F7H ;; cedilla +CF_204600: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_CE_SP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Cedilla INPUT: Cedilla +;; KEYBOARD: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_CE_CE_END-$ ;; Length of state section + DB CEDILLA_CEDILLA ;; + DW ANY_KB ;; + DB 0F7H,0 ;; Buffer entry for error character + ;; Set Flag Table + DW CF_204601-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 27,0F7H ;; cedilla +CF_204601: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_CE_CE_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; no more states + ;; +CP850_XLAT_END: ;; + +CODE ENDS + END diff --git a/v4.0/src/DEV/KEYBOARD/KDFDK.ASM b/v4.0/src/DEV/KEYBOARD/KDFDK.ASM new file mode 100644 index 0000000..4ae463a --- /dev/null +++ b/v4.0/src/DEV/KEYBOARD/KDFDK.ASM @@ -0,0 +1,1631 @@ + PAGE ,132 + TITLE DOS - Keyboard Definition File + +;; LATEST CHANGE P12 NUMERIC +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DOS - - NLS Support - Keyboard Definition File +;; (c) Copyright 1988 Microsoft +;; +;; This file contains the keyboard tables for Danish +;; +;; Linkage Instructions: +;; Refer to KDF.ASM. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + INCLUDE KEYBSHAR.INC ;; + INCLUDE POSTEQU.INC ;; + INCLUDE KEYBMAC.INC ;; + ;; + PUBLIC DK_LOGIC ;; + PUBLIC DK_865_XLAT ;; + PUBLIC DK_850_XLAT ;; + ;; +CODE SEGMENT PUBLIC 'CODE' ;; + ASSUME CS:CODE,DS:CODE ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Standard translate table options are a linear search table +;; (TYPE_2_TAB) and ASCII entries ONLY (ASCII_ONLY) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +STANDARD_TABLE EQU TYPE_2_TAB+ASCII_ONLY + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; DK State Logic +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +DK_LOGIC: + + DW LOGIC_END-$ ;; length + ;; + DW 0 ;; special features + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; COMMANDS START HERE + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; OPTIONS: If we find a scan match in +;; an XLATT or SET_FLAG operation then +;; exit from INT 9. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + OPTION EXIT_IF_FOUND ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Dead key definitions must come before +;; dead key translations to handle +;; dead key + dead key. +;; ***BD - THIS SECTION HAS BEEN UPDATED +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + IFF EITHER_CTL,NOT ;; + IFF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + SET_FLAG DEAD_UPPER ;; + ELSEF ;; + SET_FLAG DEAD_LOWER ;; + ENDIFF ;; + ELSEF ;; + IFKBD G_KB+P12_KB ;; For ENHANCED keyboard some + ANDF R_ALT_SHIFT ;; dead keys are on third shift + ANDF EITHER_SHIFT,NOT ;; which is accessed via the altgr key + SET_FLAG DEAD_THIRD ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ACUTE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +ACUTE_PROC: ;; + ;; + IFF ACUTE,NOT ;; + GOTO DIARESIS_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT ACUTE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT ACUTE_LOWER ;; + ELSEF ;; + XLATT ACUTE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT ACUTE_UPPER ;; + ELSEF ;; + XLATT ACUTE_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_ACUTE: ;; + PUT_ERROR_CHAR ACUTE_LOWER ;; If we get here then either the XLATT + BEEP ;; failed or we are ina bad shift state. + GOTO NON_DEAD ;; Either is invalid so BEEP and fall + ;; through to generate the second char. + ;; Note that the dead key flag will be + ;; reset before we get here. + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DIARESIS ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +DIARESIS_PROC: ;; + ;; + IFF DIARESIS,NOT ;; + GOTO GRAVE_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT DIARESIS_SPACE ;; exist for 437 so beep for + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_LOWER ;; + ELSEF ;; + XLATT DIARESIS_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_UPPER ;; + ELSEF ;; + XLATT DIARESIS_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_DIARESIS: ;; + PUT_ERROR_CHAR DIARESIS_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; GRAVE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +GRAVE_PROC: ;; + ;; + IFF GRAVE,NOT ;; + GOTO TILDE_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT GRAVE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_GRAVE: ;; + PUT_ERROR_CHAR GRAVE_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; TILDE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +TILDE_PROC: ;; + ;; + IFF TILDE,NOT ;; + GOTO CIRCUMFLEX_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT TILDE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT TILDE_LOWER ;; + ELSEF ;; + XLATT TILDE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT TILDE_UPPER ;; + ELSEF ;; + XLATT TILDE_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_TILDE: ;; + PUT_ERROR_CHAR TILDE_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CIRCUMFLEX ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CIRCUMFLEX_PROC: ;; + ;; + IFF CIRCUMFLEX,NOT ;; + GOTO NON_DEAD ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT CIRCUMFLEX_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_CIRCUMFLEX: ;; + PUT_ERROR_CHAR CIRCUMFLEX_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Upper, lower and third shifts +;; ***BD - NON_DEAD THRU LOGIC_END IS UPDATED +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +NON_DEAD: ;; + ;; + IFKBD G_KB+P12_KB ;; Avoid accidentally translating + ANDF LC_E0 ;; the "/" on the numeric pad of the + EXIT_STATE_LOGIC ;; G keyboard + ENDIFF ;; + ;; + IFF EITHER_CTL,NOT ;; Lower and upper case. Alphabetic + IFF EITHER_ALT,NOT ;; keys are affected by CAPS LOCK. + IFF EITHER_SHIFT ;; Numeric keys are not. +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE,NOT ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION + XLATT NON_ALPHA_UPPER ;; + IFF CAPS_STATE ;; + XLATT ALPHA_LOWER ;; + ELSEF ;; + XLATT ALPHA_UPPER ;; + ENDIFF ;; + ELSEF ;; +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION + XLATT NON_ALPHA_LOWER ;; + IFF CAPS_STATE ;; + XLATT ALPHA_UPPER ;; + ELSEF ;; + XLATT ALPHA_LOWER ;; + ENDIFF ;; + ENDIFF ;; Third and Fourth shifts + ELSEF ;; ctl off, alt on at this point + IFKBD XT_KB+AT_KB ;; XT, AT, keyboards. Nordics + IFF EITHER_SHIFT ;; only. + XLATT FOURTH_SHIFT ;; ALT + shift + ELSEF ;; + XLATT THIRD_SHIFT ;; ALT + ENDIFF ;; + ELSEF ;; ENHANCED keyboard + IFF R_ALT_SHIFT ;; ALTGr + ANDF EITHER_SHIFT,NOT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; +;**************************************;; + IFF EITHER_SHIFT,NOT ;; + IFKBD XT_KB+AT_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ENDIFF ;; + IFKBD G_KB+P12_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; +;**************************************;; + IFKBD AT_KB+XT_KB ;; + IFF EITHER_CTL,NOT ;; + IFF ALT_SHIFT ;; ALT - case + XLATT ALT_CASE ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_ALT,NOT ;; CTRL - case + XLATT CTRL_CASE ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; + IFKBD G_KB+P12_KB ;; + IFF EITHER_CTL,NOT ;; + IFF ALT_SHIFT ;; ALT - case + ANDF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_ALT,NOT ;; CTRL - case + XLATT CTRL_CASE ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; + EXIT_STATE_LOGIC ;; + ;; +LOGIC_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;********************************************************************** +;; DK Common Translate Section +;; This section contains translations for the lower 128 characters +;; only since these will never change from code page to code page. +;; Some common Characters are included from 128 - 165 where appropriate. +;; In addition the dead key "Set Flag" tables are here since the +;; dead keys are on the same keytops for all code pages. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC DK_COMMON_XLAT ;; +DK_COMMON_XLAT: ;; + ;; + DW COMMON_XLAT_END-$ ;; length of section + DW -1 ;; code page + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Lower Shift Dead Key +;; KEYBOARD TYPES: All +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_LO_END-$ ;; length of state section + DB DEAD_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 2 ;; number of entries + DB 13 ;; scan code + FLAG ACUTE ;; flag bit to set + DB 27 ;; + FLAG DIARESIS ;; + ;; + ;; +COM_DK_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Upper Shift Dead Key +;; KEYBOARD TYPES: All +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_UP_END-$ ;; length of state section + DB DEAD_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 2 ;; number of entries + DB 13 ;; scan code + FLAG GRAVE ;; flag bit to set + DB 27 ;; + FLAG CIRCUMFLEX ;; + ;; +COM_DK_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift Dead Key +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_TH_END-$ ;; length of state section + DB DEAD_THIRD ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 1 ;; number of entries + DB 27 ;; scan code + FLAG TILDE ;; flag bit to set + ;; +COM_DK_TH_END: ;; + ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;****************************** +;;***BD - ADDED FOR NUMERIC PAD (DECIMAL SEPERATOR) +;;****************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common ;;change **********CNS ************** +;; STATE: Numeric Key Pad +;; KEYBOARD TYPES: All except the p12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_PAD_K1_END-$ ;; length of state section + DB NUMERIC_PAD ;; State ID + DW G_KB+AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_PAD_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 83,',' ;; decimal seperator = , +COM_PAD_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_PAD_K1_END: ;; + ;; +;;****************************** +;;***BD - ADDED FOR ALT CASE +;;****************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alt Case +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_ALT_K1_END-$ ;; length of state section + DB ALT_CASE ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_ALT_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 0 ;; 2 number of entries +; DB 12,-1,-1 ;; +; DB 53,0,082H ;; +COM_ALT_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_ALT_K1_END: ;; + ;; +;;****************************** +;;***BD - ADDED FOR CTRL CASE +;;****************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: XT, , AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K1_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW XT_KB+AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_CTRL_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 2 ;; number of entries + DB 12,-1,-1 ;; + DB 53,01FH,35h ;; +COM_CTRL_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CTRL_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K2_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_CTRL_K2_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 8 ;; number of entries + DB 9,01BH,09H ;; + DB 10,01DH,0AH ;; + DB 12,-1,-1 ;; + DB 26,-1,-1 ;; + DB 27,-1,-1 ;; + DB 43,-1,-1 ;; + DB 53,01FH,35H ;; + DB 86,01CH,56H ;; +COM_CTRL_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CTRL_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alpha Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AL_LO_END-$ ;; length of state section + DB ALPHA_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_AL_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 3 ;; number of entries + DB 26,086H ;; a-overcircle + DB 39,091H ;; ae-dipthong + DB 40,09BH ;; o-slash +COM_AL_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AL_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alpha Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AL_UP_END-$ ;; length of state section + DB ALPHA_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_AL_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 3 ;; number of entries + DB 26,08FH ;; A-OVERCIRCLE + DB 39,092H ;; AE-DIPTHONG + DB 40,09DH ;; O-SLASH +COM_AL_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AL_UP_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: G + P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K1_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 5 ;; number of entries + DB 41,0ABH ;; + DB 12,"+" ;; + INCLUDED FOR SIMPLIC. + DB 43,"'" ;; ' + DB 86,"<" ;; < + DB 53,"-" ;; - +COM_NA_LO_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: XT + +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K2_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K2_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 4 ;; number of entries + DB 41,"'" ;; ' + DB 12,"+" ;; + + DB 43,"<" ;; < + DB 53,"-" ;; - +COM_NA_LO_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K3_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K3_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 4 ;; number of entries + DB 12,"+" ;; + + DB 41,"<" ;; < + DB 43,"'" ;; ' + DB 53,"-" ;; - +COM_NA_LO_K3_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K3_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G + P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 12 ;; number of entries + DB 3,'"' ;; + DB 7,'&' ;; + DB 8,'/' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,'=' ;; + DB 12,'?' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'_' ;; + DB 43,'*' ;; + DB 86,'>' ;; +COM_NA_UP_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: XT + +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K2_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_K2_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 12 ;; number of entries + DB 3,'"' ;; + DB 7,'&' ;; + DB 8,'/' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,'=' ;; + DB 12,'?' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'_' ;; + DB 41,'*' ;; + DB 43,'>' ;; +COM_NA_UP_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K2_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K3_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_K3_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 12 ;; number of entries + DB 3,'"' ;; + DB 7,'&' ;; + DB 8,'/' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,'=' ;; + DB 12,'?' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'_' ;; + DB 41,'>' ;; + DB 43,'*' ;; +COM_NA_UP_K3_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K3_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB+P12_KB ;; Keyboard Type FERRARI + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 9 ;; number of entries + DB 3,'@' ;; + DB 4,09CH ;; + DB 5,'$' ;; + DB 8,'{' ;; + DB 9,'[' ;; + DB 10,']' ;; + DB 11,'}' ;; + DB 13,'|' ;; Broken Vertical Line + DB 86,'\' ;; +COM_THIRD_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift (ALTERNATE) +;; KEYBOARD TYPES: XT, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K1_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 9 ;; number of entries + DB 12,'-','-' ;; + DB 13,'=','=' ;; + DB 26,'[','[' ;; + DB 27,']',']' ;; + DB 39,';',';' ;; + DB 40,027H,027H ;; + DB 41,060H,060H ;; + DB 43,'\','\' ;; + DB 53,'/','/' ;; +COM_THIRD_K1_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift (ALTERNATE) +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K2_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_K2_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 9 ;; number of entries + DB 12,'-','-' ;; + DB 13,'=','=' ;; + DB 26,'[','[' ;; + DB 27,']',']' ;; + DB 39,';',';' ;; + DB 40,027H,027H ;; + DB 41,'\','\' ;; + DB 43,060H,060H ;; + DB 53,'/','/' ;; +COM_THIRD_K2_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Fourth Shift (ALTERNATE+SHIFT) +;; KEYBOARD TYPES: XT, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_FOURTH_END-$ ;; length of state section + DB FOURTH_SHIFT ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_FOURTH_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 18 ;; number of entries + DB 3,'@','@' ;; + DB 5,'$','$' ;; + DB 7,'^','^' ;; + DB 8,'&','&' ;; + DB 9,'*','*' ;; + DB 10,'(','(' ;; + DB 11,')',')' ;; + DB 12,'_','_' ;; + DB 13,'+','+' ;; + DB 26,'{','{' ;; + DB 27,'}','}' ;; + DB 39,':',':' ;; + DB 40,'"','"' ;; + DB 41,'~','~' ;; + DB 43,'|','|' ;; + DB 51,'<','<' ;; + DB 52,'>','>' ;; + DB 53,'?','?' ;; +COM_FOURTH_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_FOURTH_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Fourth Shift (ALTERNATE+SHIFT) +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_FOURTH_K1_END-$ ;; length of state section + DB FOURTH_SHIFT ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_FOURTH_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 18 ;; number of entries + DB 3,'@','@' ;; + DB 5,'$','$' ;; + DB 7,'^','^' ;; + DB 8,'&','&' ;; + DB 9,'*','*' ;; + DB 10,'(','(' ;; + DB 11,')',')' ;; + DB 12,'_','_' ;; + DB 13,'+','+' ;; + DB 26,'{','{' ;; + DB 27,'}','}' ;; + DB 39,':',':' ;; + DB 40,'"','"' ;; + DB 41,'|','|' ;; + DB 43,'~','~' ;; + DB 51,'<','<' ;; + DB 52,'>','>' ;; + DB 53,'?','?' ;; +COM_FOURTH_K1_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_FOURTH_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_GR_LO_END-$ ;; length of state section + DB GRAVE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW COM_GR_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +COM_GR_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_GR_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_GR_SP_END-$ ;; length of state section + DB GRAVE_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW COM_GR_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,96 ;; STANDALONE GRAVE +COM_GR_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_GR_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_LO_END-$ ;; length of state section + DB CIRCUMFLEX_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW COM_CI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +COM_CI_LO_T1_END: ;; + ;; + DW 0 ;; + ;; +COM_CI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_SP_END-$ ;; length of state section + DB CIRCUMFLEX_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW COM_CI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,94 ;; STANDALONE CIRCUMFLEX +COM_CI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Tilde Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_TI_LO_END-$ ;; length of state section + DB TILDE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW COM_TI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 49,0A4H ;; scan code,ASCII - + COM_TI_LO_T1_END: ;; + ;; + DW 0 ;; + ;; + COM_TI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; CODE PAGE: Common +;;; STATE: Tilde Upper Case +;;; KEYBOARD TYPES: All +;;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_TI_UP_END-$ ;; length of state section + DB TILDE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW COM_TI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 49,0A5H ;; scan code,ASCII - + COM_TI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; + COM_TI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Tilde Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_TI_SP_END-$ ;; length of state section + DB TILDE_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW COM_TI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,07EH ;; STANDALONE TILDE +COM_TI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_TI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; Last State +COMMON_XLAT_END: ;; + ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; DK Specific Translate Section for 865 +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC DK_865_XLAT ;; +DK_865_XLAT: ;; + ;; + DW CP865_XLAT_END-$ ;; length of section + DW 865 ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 865 +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: XT, , AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP865_NA_UP_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW XT_KB+AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP865_NA_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 5,0AFH ;; International Currency Symb +CP865_NA_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP865_NA_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 865 +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP865_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP865_NA_UP_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 2 ;; number of entries + DB 5,0AFH ;; International Currency Symb + DB 41,015H ;; SECTION Symb +CP865_NA_UP_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP865_NA_UP_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 865 +;; STATE: Acute Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP865_AC_LO_END-$ ;; length of state section + DB ACUTE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW CP865_AC_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +CP865_AC_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP865_AC_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 865 +;; STATE: Acute Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP865_AC_UP_END-$ ;; length of state section + DB ACUTE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW CP865_AC_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of entries + DB 18,'' ;; scan code,ASCII - +CP865_AC_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP865_AC_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 865 +;; STATE: Acute Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP865_AC_SP_END-$ ;; length of state section + DB ACUTE_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW CP865_AC_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,39 ;; scan code,ASCII - SPACE +CP865_AC_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP865_AC_SP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP865 +;; STATE: Diaresis Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP865_DI_LO_END-$ ;; length of state section + DB DIARESIS_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 254,0 ;; error character = standalone accent + ;; + DW CP865_DI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 21,'' ;; scan code,ASCII - y + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +CP865_DI_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP865_DI_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP865 +;; STATE: Diaresis Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP865_DI_UP_END-$ ;; length of state section + DB DIARESIS_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 254,0 ;; error character = standalone accent + ;; + DW CP865_DI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 3 ;; number of scans + DB 22,'' ;; scan code,ASCII - U + DB 24,'' ;; scan code,ASCII - O + DB 30,'' ;; scan code,ASCII - A +CP865_DI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP865_DI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 865 +;; STATE: Diaresis Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; ;; +; DW CP865_DI_SP_END-$ ;; length of state section +; DB DIARESIS_SPACE ;; State ID +; DW ANY_KB ;; Keyboard Type +; DB 254,0 ;; error character = standalone accent +; ;; +; DW CP865_DI_SP_T1_END-$ ;; Size of xlat table +; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: +; DB 1 ;; number of scans +; DB 57,254 ;; error character = standalone accent +;CP865_DI_SP_T1_END: ;; +; ;; +; DW 0 ;; Size of xlat table - null table +;CP865_DI_SP_END: ;; length of state section +; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW 0 ;; LAST STATE + ;; +CP865_XLAT_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; DK Specific Translate Section for 850 +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC DK_850_XLAT ;; +DK_850_XLAT: ;; + ;; + DW CP850_XLAT_END-$ ;; length of section + DW 850 ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: XT, , AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_NA_UP_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW XT_KB+AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP850_NA_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 5,0CFH ;; International Currency Symb +CP850_NA_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_NA_UP_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP850_NA_UP_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 2 ;; number of entries + DB 5,0CFH ;; International Currency Symb + DB 41,0F5H ;; SECTION Symb +CP850_NA_UP_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_NA_UP_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Acute Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_LO_END-$ ;; length of state section + DB ACUTE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 239,0 ;; error character = standalone accent + ;; + DW CP850_AC_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 21,0ECH ;; y acute + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +CP850_AC_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Acute Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_UP_END-$ ;; length of state section + DB ACUTE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 239,0 ;; error character = standalone accent + ;; + DW CP850_AC_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of entries + DB 18,090H ;; E acute + DB 21,0EDH ;; Y acute + DB 22,0E9H ;; U acute + DB 23,0D6H ;; I acute + DB 24,0E0H ;; O acute + DB 30,0B5H ;; A acute +CP850_AC_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Acute Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_SP_END-$ ;; length of state section + DB ACUTE_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 239,0 ;; error character = standalone accent + ;; + DW CP850_AC_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,239 ;; scan code,ASCII - SPACE +CP850_AC_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_SP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Diaresis Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_LO_END-$ ;; length of state section + DB DIARESIS_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW CP850_DI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 21,'' ;; scan code,ASCII - y + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +CP850_DI_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_DI_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Diaresis Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_UP_END-$ ;; length of state section + DB DIARESIS_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW CP850_DI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,0D3H ;; E Diaeresis + DB 22,'' ;; U Diaeresis + DB 23,0D8H ;; I Diaeresis + DB 24,'' ;; O Diaeresis + DB 30,'' ;; A Diaeresis +CP850_DI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_DI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Diaresis Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_SP_END-$ ;; length of state section + DB DIARESIS_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW CP850_DI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,249 ;; error character = standalone accent +CP850_DI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table +CP850_DI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Grave Upper +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_GR_UP_END-$ ;; length of state section + DB GRAVE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW CP850_GR_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,0D4H ;; E grave + DB 22,0EBH ;; U grave + DB 23,0DEH ;; I grave + DB 24,0E3H ;; O grave + DB 30,0B7H ;; A grave +CP850_GR_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_GR_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Tilde Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_TI_LO_END-$ ;; length of state section + DB TILDE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW CP850_TI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 2 ;; number of scans + DB 24,0E4H ;; scan code,ASCII - o tilde + DB 30,0C6H ;; scan code,ASCII - a tilde + CP850_TI_LO_T1_END: ;; + ;; + DW 0 ;; + ;; + CP850_TI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; CODE PAGE: 850 +;;; STATE: Tilde Upper Case +;;; KEYBOARD TYPES: All +;;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_TI_UP_END-$ ;; length of state section + DB TILDE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW CP850_TI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 2 ;; number of scans + DB 24,0E5H ;; scan code,ASCII - O tilde + DB 30,0C7H ;; scan code,ASCII - A tilde + CP850_TI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; + CP850_TI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Circumflex Upper +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_CI_UP_END-$ ;; length of state section + DB CIRCUMFLEX_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW CP850_CI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,0D2H ;; E circumflex + DB 22,0EAH ;; U circumflex + DB 23,0D7H ;; I circumflex + DB 24,0E2H ;; O circumflex + DB 30,0B6H ;; A circumflex +CP850_CI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_CI_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW 0 ;; LAST STATE + ;; +CP850_XLAT_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CODE ENDS ;; + END ;; + diff --git a/v4.0/src/DEV/KEYBOARD/KDFEOF.ASM b/v4.0/src/DEV/KEYBOARD/KDFEOF.ASM new file mode 100644 index 0000000..020b5e1 --- /dev/null +++ b/v4.0/src/DEV/KEYBOARD/KDFEOF.ASM @@ -0,0 +1,32 @@ + + + + PAGE ,132 + TITLE DOS Keyboard Definition File + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DOS - NLS Support - Keyboard Definition File +;; (c) Copyright 1988 Microsoft +;; +;; This file contains the eof marker for the entire table +;; and the keyboard.sys copyright +;; +;; Linkage Instructions: +;; Refer to KDF.ASM. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +CODE SEGMENT PUBLIC 'CODE' ;; + ASSUME CS:CODE,DS:CODE ;; + ;; + ;; + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +include copyrigh.inc + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DB 1AH ;; EOF + ;; +CODE ENDS ;; + END ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/v4.0/src/DEV/KEYBOARD/KDFFR.ASM b/v4.0/src/DEV/KEYBOARD/KDFFR.ASM new file mode 100644 index 0000000..0dd5e4b --- /dev/null +++ b/v4.0/src/DEV/KEYBOARD/KDFFR.ASM @@ -0,0 +1,1529 @@ +;; LATEST CHANGE ALT & CTL disenabled US invalids +;; Section symbol scan code incorrect +;; zero scan code tag deleted from end of tag field +;; Changed key #5 for the XT "/" instead of "'"..Pubs error +;; ****************** CNS 12/18/86************************* + + PAGE ,132 + TITLE DOS - Keyboard Definition File + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DOS - - NLS Support - Keyboard Defintion File +;; (c) Copyright 1988 Microsoft +;; +;; This file contains the keyboard tables for Spanish. +;; +;; Linkage Instructions: +;; Refer to KDF.ASM. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + INCLUDE KEYBSHAR.INC ;; + INCLUDE POSTEQU.INC ;; + INCLUDE KEYBMAC.INC ;; + ;; + PUBLIC FR_LOGIC ;; + PUBLIC FR_437_XLAT ;; + PUBLIC FR_850_XLAT ;; + ;; +CODE SEGMENT PUBLIC 'CODE' ;; + ASSUME CS:CODE,DS:CODE ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Standard translate table options are a liner search table +;; (TYPE_2_TAB) and ASCII entries ONLY (ASCII_ONLY) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +STANDARD_TABLE EQU TYPE_2_TAB+ASCII_ONLY + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; FR State Logic +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +FR_LOGIC: + + DW LOGIC_END-$ ;; length + ;; + DW TYPEWRITER_CAPS_LK ;; special features (shift lock state) + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; COMMANDS START HERE + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; OPTIONS: If we find a scan match in +;; an XLATT or SET_FLAG operation then +;; exit from INT 9. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + OPTION EXIT_IF_FOUND ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Dead key definitions must come before +;; dead key translations to handle +;; dead key + dead key. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + IFF EITHER_ALT,NOT ;; + ANDF EITHER_CTL,NOT ;; + IFF CAPS_STATE + SET_FLAG DEAD_UPPER + ELSEF + IFF EITHER_SHIFT ;; + SET_FLAG DEAD_UPPER ;; + ELSEF ;; + SET_FLAG DEAD_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ACUTE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +ACUTE_PROC: ;; + ;; + IFF ACUTE,NOT ;; + GOTO DIARESIS_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT ACUTE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT ACUTE_LOWER ;; + ELSEF ;; + XLATT ACUTE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT ACUTE_UPPER ;; + ELSEF ;; + XLATT ACUTE_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_ACUTE: ;; + PUT_ERROR_CHAR ACUTE_LOWER ;; If we get here then either the XLATT + BEEP ;; failed or we are ina bad shift state. + GOTO NON_DEAD ;; Either is invalid so BEEP and fall + ;; through to generate the second char. + ;; Note that the dead key flag will be + ;; reset before we get here. + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DIARESIS ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +DIARESIS_PROC: ;; + ;; + IFF DIARESIS,NOT ;; + GOTO GRAVE_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT DIARESIS_SPACE ;; exist for 437 so beep for + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_LOWER ;; + ELSEF ;; + XLATT DIARESIS_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_UPPER ;; + ELSEF ;; + XLATT DIARESIS_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_DIARESIS: ;; + PUT_ERROR_CHAR DIARESIS_SPACE ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; GRAVE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +GRAVE_PROC: ;; + ;; + IFF GRAVE,NOT ;; + GOTO CIRCUMFLEX_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT GRAVE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_GRAVE: ;; + PUT_ERROR_CHAR GRAVE_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CIRCUMFLEX ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CIRCUMFLEX_PROC: ;; + ;; + IFF CIRCUMFLEX,NOT ;; + GOTO NON_DEAD ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT CIRCUMFLEX_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_CIRCUMFLEX: ;; + PUT_ERROR_CHAR CIRCUMFLEX_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Upper, lower and third shifts +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +NON_DEAD: ;; + ;; + IFKBD G_KB+P12_KB ;; Avoid accidentally translating + ANDF LC_E0 ;; the "/" on the numeric pad of the + EXIT_STATE_LOGIC ;; G keyboard + ENDIFF ;; +;;***BD ADDED FOR ALT, CTRL CASES ;; + IFF EITHER_CTL,NOT ;; + IFF ALT_SHIFT ;; ALT - case + ANDF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_ALT,NOT ;; CTRL - case + XLATT CTRL_CASE ;; + ENDIFF ;; + ENDIFF ;; +;;***BD END OF ADDITION + ;; + IFF EITHER_ALT,NOT ;; Lower and upper case. Alphabetic + ANDF EITHER_CTL,NOT ;; keys are affected by CAPS LOCK. + IFF EITHER_SHIFT ;; Numeric keys are not. +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE,NOT ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION +; XLATT NON_ALPHA_UPPER ;; + IFF CAPS_STATE ;; + XLATT ALPHA_LOWER ;; + XLATT NON_ALPHA_LOWER ;; + ELSEF ;; + XLATT ALPHA_UPPER ;; + XLATT NON_ALPHA_UPPER ;; + ENDIFF ;; + ELSEF ;; +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION +; XLATT NON_ALPHA_LOWER ;; + IFF CAPS_STATE ;; + XLATT ALPHA_UPPER ;; + XLATT NON_ALPHA_UPPER ;; + ELSEF ;; + XLATT ALPHA_LOWER ;; + XLATT NON_ALPHA_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_SHIFT,NOT ;; + IFKBD XT_KB+AT_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_CTL,NOT ;; + ANDF R_ALT_SHIFT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; + EXIT_STATE_LOGIC ;; + ;; +LOGIC_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; ;; +;NON_DEAD: ;; +; ;; +; IFF EITHER_ALT,NOT ;; Lower and upper case. Alphabetic +; ANDF EITHER_CTL,NOT ;; keys are affected by CAPS LOCK. +; IFF EITHER_SHIFT ;; Numeric keys are not. +; XLATT NON_ALPHA_UPPER ;; +; IFF CAPS_STATE ;; +; XLATT ALPHA_LOWER ;; +; ELSEF ;; +; XLATT ALPHA_UPPER ;; +; ENDIFF ;; +; ELSEF ;; +; XLATT NON_ALPHA_LOWER ;; +; IFF CAPS_STATE ;; +; XLATT ALPHA_UPPER ;; +; ELSEF ;; +; XLATT ALPHA_LOWER ;; +; ENDIFF ;; +; ENDIFF ;; +; ELSEF ;; +; IFF EITHER_SHIFT,NOT ;; +; IFKBD XT_KB+AT_KB ;; +; IFF EITHER_CTL ;; +; ANDF ALT_SHIFT ;; +; XLATT THIRD_SHIFT ;; +; ENDIFF ;; +; ELSEF ;; +; IFF EITHER_CTL,NOT ;; +; ANDF R_ALT_SHIFT ;; +; XLATT THIRD_SHIFT ;; +; ENDIFF ;; +; ENDIFF ;; +; ENDIFF ;; +; ENDIFF ;; +; ;; +; EXIT_STATE_LOGIC ;; +; ;; +;LOGIC_END: ;; +; ;; +; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; FR Common Translate Section +;; This section contains translations for the lower 128 characters +;; only since these will never change from code page to code page. +;; In addition the dead key "Set Flag" tables are here since the +;; dead keys are on the same keytops for all code pages. +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC FR_COMMON_XLAT ;; +FR_COMMON_XLAT: ;; + ;; + DW COMMON_XLAT_END-$ ;; length of section + DW -1 ;; code page + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Lower Shift Dead Key +;; KEYBOARD TYPES: All +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_LO_END-$ ;; length of state section + DB DEAD_LOWER ;; State ID + DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 1 ;; number of entries + DB 26 ;; scan code + FLAG CIRCUMFLEX ;; flag bit to set +; DB 40 eliminate ;; +; FLAG ACUTE ;; + ;; + ;; +COM_DK_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Upper Shift Dead Key +;; KEYBOARD TYPES: All +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_UP_END-$ ;; length of state section + DB DEAD_UPPER ;; State ID + DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 1 ;; number of entries + DB 26 ;; scan code + FLAG DIARESIS ;; flag bit to set +; DB 40 eliminate ;; +; FLAG DIARESIS ;; + ;; +COM_DK_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;********************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift Dead Key +;; KEYBOARD TYPES: All +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ;; +;; DW COM_DK_TH_END-$ ;; length of state section +;; DB DEAD_THIRD ;; State ID +;; DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type +;; DB -1,-1 ;; Buffer entry for error character +;; ;; Set Flag Table +;; DW 1 ;; number of entries +;; DB 8 ;; scan code +;; FLAG GRAVE ;; flag bit to set +;; ;; +;;COM_DK_TH_END: ;; +;; ;; +;; ;; +;; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alt Case +;; KEYBOARD TYPES: G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_ALT_K1_END-$ ;; length of state section + DB ALT_CASE ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW COM_ALT_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; + DB 10 ;; Number of entries + DB 12,-1,-1 ;; invalid key U.S. alt - + DB 13,-1,-1 ;; invalid key U.S. alt = + DB 07,0,82H ;; alt - (minus sign) + DB 13,0,83H ;; alt = (equal sign) + DB 16,0,1EH ;; A + DB 17,0,2CH ;; Z + DB 30,0,10H ;; Q + DB 39,0,32H ;; M + DB 44,0,11H ;; W + DB 50,-1,-1 ;; U.S. 'M' +COM_ALT_K1_T1_END: ;; + ;; + DW 0 ;; + ;; +COM_ALT_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: G_KB+P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K1_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW COM_CTRL_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; + DB 12 ;; Number of entries + DB 12,-1,-1 ;; + DB 07,30,07 ;; ctl + number six key + DB 12,29,12 ;; ctl + ] + DB 13,31,13 ;; + DB 16,01,16 ;; A + DB 17,26,17 ;; Z + DB 30,17,30 ;; Q + DB 39,13,39 ;; M + DB 43,-1,-1 ;; \ + DB 44,23,44 ;; W + DB 50,-1,-1 ;; U.S. 'M' + DB 9,28,9 ;; \ position (this is also the underscore position) +COM_CTRL_K1_T1_END: ;; + ;; + DW 0 ;; + ;; +COM_CTRL_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alt Case +;; KEYBOARD TYPES: AT + XT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_ALT_K2_END-$ ;; length of state section + DB ALT_CASE ;; State ID + DW AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW COM_ALT_K2_T2_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; + DB 9 ;; Number of entries + DB 12,-1,-1 ;; invalid key U.S. alt - + DB 13,0,82H ;; alt - (minus sign) + DB 53,0,83H ;; alt = (equal sign) + DB 16,0,1EH ;; A + DB 17,0,2CH ;; Z + DB 30,0,10H ;; Q + DB 39,0,32H ;; M + DB 44,0,11H ;; W + DB 50,-1,-1 ;; U.S. 'M' +COM_ALT_K2_T2_END: ;; + ;; + DW 0 ;; + ;; +COM_ALT_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K2_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW COM_CTRL_K2_T2_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; + DB 11 ;; Number of entries + DB 12,-1,-1 ;; invalid U.S. - + DB 43,-1,-1 ;; invalid U.S. \ + DB 41,28,41 ;; valid ctl + \ + DB 07,30,07 ;; ctl + number six key + DB 13,31,13 ;; ctl - or _ + DB 16,01,16 ;; A + DB 17,26,17 ;; Z + DB 30,17,30 ;; Q + DB 39,13,39 ;; M + DB 44,23,44 ;; W + DB 50,-1,-1 ;; U.S. 'M' +COM_CTRL_K2_T2_END: ;; + ;; + DW 0 ;; + ;; +COM_CTRL_K2_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: XT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K3_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW COM_CTRL_K3_T3_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; + DB 11 ;; Number of entries + DB 12,-1,-1 ;; + DB 43,-1,-1 ;; + DB 43,28,43 ;; valid ctl + \ + DB 07,30,07 ;; ctl + number six key + DB 13,31,13 ;; ctl - or _ + DB 16,01,16 ;; A + DB 17,26,17 ;; Z + DB 30,17,30 ;; Q + DB 39,13,39 ;; M + DB 44,23,44 ;; W + DB 50,-1,-1 ;; U.S. 'M' +COM_CTRL_K3_T3_END: ;; + ;; + DW 0 ;; + ;; +COM_CTRL_K3_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;****************************************************************************** +;; CODE PAGE: Common +;; STATE: Alpha Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AL_LO_END-$ ;; length of state section + DB ALPHA_LOWER ;; State ID + DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_AL_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 5 ;; number of entries + DB 16,'a' ;; small a + DB 17,'z' ;; small z + DB 30,'q' ;; small q + DB 39,'m' ;; small m + DB 44,'w' ;; small w +COM_AL_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AL_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alpha Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AL_UP_END-$ ;; length of state section + DB ALPHA_UPPER ;; State ID + DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_AL_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 5 ;; number of entries + DB 16,'A' ;; caps A + DB 17,'Z' ;; caps Z + DB 30,'Q' ;; caps Q + DB 39,'M' ;; caps M + DB 44,'W' ;; caps W +COM_AL_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AL_UP_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: G_KB+P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K1_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 21 ;; number of entries + DB 41,"" ;; superscript 2 + DB 2,"&" ;; + DB 3,"" ;; acute - e + DB 4,'"' ;; + DB 5,"'" ;; + DB 6,"(" ;; + DB 7,"-" ;; + DB 8,"" ;; grave - e + DB 9,"_" ;; + DB 10,"" ;; c - cedilla small + DB 11,"" ;; + DB 12,")" ;; + DB 13,"=" ;; + DB 27,"$" ;; + DB 40,"" ;; grave - u + DB 43,"*" ;; + DB 86,'<' ;; + + DB 50,',' ;; < + DB 51,';' ;; - + DB 52,':' ;; + DB 53,'!' ;; + +COM_NA_LO_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: AT_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K2_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_T1_K2_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 20 ;; number of entries + DB 2,"&" ;; + DB 3,"" ;; acute - e + DB 4,'"' ;; + DB 5,"'" ;; + DB 6,"(" ;; + DB 7,"-" ;; + DB 8,"" ;; grave - e + DB 9,"!" ;; + DB 10,"" ;; c - cedilla small + DB 11,"" ;; grave - a small + DB 12,")" ;; + DB 13,"-" ;; + DB 27,"$" ;; + DB 40,"" ;; grave small + DB 43,0E6H ;; mu symbol - + DB 41,'<' ;; + + DB 50,',' ;; < + DB 51,';' ;; - + DB 52,':' ;; + DB 53,'=' ;; + +COM_NA_LO_T1_K2_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: XT_KB+ +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K3_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_T1_K3_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 20 ;; number of entries + DB 2,"&" ;; + DB 3,"" ;; acute - e + DB 4,'"' ;; ' on the AT_KB + DB 5,"'" ;; *** CNS **** 12/18/86 pubs wrong + DB 6,"(" ;; + DB 7,"-" ;; + DB 8,"" ;; grave - e + DB 9,"!" ;; + DB 10,"" ;; c - cedilla small + DB 11,"" ;; + DB 12,")" ;; + DB 13,"-" ;; + DB 27,"$" ;; + DB 40,"" ;; grave small + DB 41,0E6H ;; mu symbol - + DB 43,'<' ;; + + DB 50,',' ;; < + DB 51,';' ;; - + DB 52,':' ;; + DB 53,'=' ;; +COM_NA_LO_T1_K3_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K3_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G_KB+P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 21 ;; number of entries + DB 2,'1' ;; + DB 3,'2' ;; + DB 4,'3' ;; + DB 5,'4' ;; + DB 6,'5' ;; + DB 7,'6' ;; + DB 8,'7' ;; + DB 9,'8' ;; + DB 10,'9' ;; + DB 11,'0' ;; + DB 12,0F8H ;; degree symbol + DB 13,"+" ;; plus sign + DB 27,09CH ;; symbol + DB 40,'%' ;; + DB 41,"" ;; superscript 3 + DB 43,0E6H ;; - mu symbol + DB 86,'>' ;; + DB 50,'?' ;; + DB 51,'.' ;; + DB 52,'/' ;; + DB 53,'+' ;; +COM_NA_UP_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K2_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_T1_K2_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 20 ;; number of entries + DB 2,'1' ;; + DB 3,'2' ;; + DB 4,'3' ;; + DB 5,'4' ;; + DB 6,'5' ;; + DB 7,'6' ;; + DB 8,'7' ;; + DB 9,'8' ;; + DB 10,'9' ;; + DB 11,'0' ;; + DB 12,0F8H ;; degree symbol + DB 13,"_" ;; underscore + DB 43,09CH ;; symbol + DB 40,'%' ;; + DB 27,"*" ;; asterisk + DB 41,'>' ;; + DB 50,'?' ;; + DB 51,'.' ;; + DB 52,'/' ;; + DB 53,'+' ;; +COM_NA_UP_T1_K2_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K2_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: XT_KB+ +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K3_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW XT_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_T1_K3_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 20 ;; number of entries + DB 2,'1' ;; + DB 3,'2' ;; + DB 4,'3' ;; + DB 5,'4' ;; + DB 6,'5' ;; + DB 7,'6' ;; + DB 8,'7' ;; + DB 9,'8' ;; + DB 10,'9' ;; + DB 11,'0' ;; + DB 12,0F8H ;; degree symbol + DB 13,"_" ;; underscore + DB 41,09CH ;; symbol + DB 40,'%' ;; + DB 27,"*" ;; asterisk + DB 43,'>' ;; + DB 50,'?' ;; + DB 51,'.' ;; + DB 52,'/' ;; + DB 53,'+' ;; +COM_NA_UP_T1_K3_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K3_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: G_KB +P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K1_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 11 ;; number of entries + DB 3,'~' ;; + DB 4,'#' ;; + DB 5,'{' ;; + DB 6,'[' ;; + DB 7,'|' ;; + DB 8,'`' ;; grave symbol not a dead key rep + DB 9,'\' ;; + DB 10,'^' ;; circumflex (caret) + DB 11,'@' ;; + DB 12,']' ;; + DB 13,'}' ;; +COM_THIRD_T1_K1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: AT_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K2_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_T1_K2_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 6 ;; number of entries + DB 4,'#' ;; + DB 26,'[' ;; + DB 27,']' ;; + DB 41,'\' ;; + DB 3,'@' ;; + DB 7,'^' ;; circumflex (caret) +COM_THIRD_T1_K2_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: XT_KB+ +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K3_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_T1_K3_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 6 ;; number of entries + DB 4,'#' ;; + DB 26,'[' ;; + DB 27,']' ;; + DB 43,'\' ;; + DB 3,'@' ;; + DB 7,'^' ;; circumflex (caret) +COM_THIRD_T1_K3_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K3_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Acute Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AC_LO_END-$ ;; length of state section + DB ACUTE_LOWER ;; State ID + DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW COM_AC_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 18,'' ;; scan code,ASCII - e +COM_AC_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AC_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Acute Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ;; +;; DW COM_AC_UP_END-$ ;; length of state section +;; DB ACUTE_UPPER ;; State ID +;; DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type +;; DB 39,0 ;; error character = standalone accent +;; ;; +;; DW COM_AC_UP_T1_END-$ ;; Size of xlat table +;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: +;; DB 2 ;; number of scans +;; DB 18,'' ;; scan code,ASCII - e +;;COM_AC_UP_T1_END: ;; +;; ;; +;; DW 0 ;; Size of xlat table - null table +;; ;; +;;COM_AC_UP_END: ;; +;; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Acute Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ;; +;; DW COM_AC_SP_END-$ ;; length of state section +;; DB ACUTE_SPACE ;; State ID +;; DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type +;; DB 39,0 ;; error character = standalone accent +;; ;; +;; DW COM_AC_SP_T1_END-$ ;; Size of xlat table +;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: +;; DB 1 ;; number of scans +;; DB 57,39 ;; scan code,ASCII - SPACE +;;COM_AC_SP_T1_END: ;; +;; ;; +;; DW 0 ;; Size of xlat table - null table +;; ;; +;;COM_AC_SP_END: ;; +;; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Diaresis Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DI_LO_END-$ ;; length of state section + DB DIARESIS_LOWER ;; State ID + DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW COM_DI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 16,'' ;; scan code,ASCII - a + DB 24,'' ;; scan code,ASCII - o + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 21,'' ;; scan code,ASCII - y +COM_DI_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_DI_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Diaresis Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DI_UP_END-$ ;; length of state section + DB DIARESIS_UPPER ;; State ID + DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW COM_DI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 3 ;; number of scans + DB 16,'' ;; scan code,ASCII - a + DB 24,'' ;; scan code,ASCII - o + DB 22,'' ;; scan code,ASCII - u +COM_DI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_DI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Diaresis Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DI_SP_END-$ ;; length of state section + DB DIARESIS_SPACE ;; State ID + DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW COM_DI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,249 ;; error character = standalone accent +COM_DI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table +COM_DI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ;; +;; DW COM_GR_LO_END-$ ;; length of state section +;; DB GRAVE_LOWER ;; State ID +;; DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type +;; DB 96,0 ;; error character = standalone accent +;; ;; +;; DW COM_GR_LO_T1_END-$ ;; Size of xlat table +;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: +;; DB 5 ;; number of scans +;; DB 18,'' ;; scan code,ASCII - e +;; DB 30,'' ;; scan code,ASCII - a +;; DB 24,'' ;; scan code,ASCII - o +;; DB 22,'' ;; scan code,ASCII - u +;; DB 23,'' ;; scan code,ASCII - i +;;COM_GR_LO_T1_END: ;; +;; ;; +;; DW 0 ;; Size of xlat table - null table +;; ;; +;;COM_GR_LO_END: ;; length of state section +;; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ;; +;; DW COM_GR_SP_END-$ ;; length of state section +;; DB GRAVE_SPACE ;; State ID +;; DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type +;; DB 96,0 ;; error character = standalone accent +;; ;; +;; DW COM_GR_SP_T1_END-$ ;; Size of xlat table +;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: +;; DB 1 ;; number of scans +;; DB 57,96 ;; STANDALONE GRAVE +;;COM_GR_SP_T1_END: ;; +;; ;; +;; DW 0 ;; Size of xlat table - null table +;; ;; +;;COM_GR_SP_END: ;; length of state section +;; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_LO_END-$ ;; length of state section + DB CIRCUMFLEX_LOWER ;; State ID + DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW COM_CI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 16,'' ;; scan code,ASCII - a + DB 18,'' ;; scan code,ASCII - e + DB 24,'' ;; scan code,ASCII - o + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i +COM_CI_LO_T1_END: ;; + ;; + DW 0 ;; + ;; +COM_CI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_SP_END-$ ;; length of state section + DB CIRCUMFLEX_SPACE ;; State ID + DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW COM_CI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,94 ;; STANDALONE CIRCUMFLEX +COM_CI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; Last State +COMMON_XLAT_END: ;; + ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; FR Specific Translate Section for 437 +;; 437 IS COMPLETELY COVERED BY THE COMMON TABLE. +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC FR_437_XLAT ;; +FR_437_XLAT: ;; + ;; + DW CP437_XLAT_END-$ ;; length of section + DW 437 ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G_KB+ p12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; default ignore error state + ;; + DW CP437_NA_UP_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: **** CNS 12/18 + DB 1 ;; number of scans + DB 53,015H ;; Section symbol -  +CP437_NA_UP_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_NA_UP_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: AT + XT + +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_NA_LO_K1_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; default ignore error state + ;; + DW CP437_NA_LO_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: **** CNS 12/18 + DB 1 ;; number of scans + DB 7,015H ;; Section symbol -  +CP437_NA_LO_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_NA_LO_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 ???????????????????May need change.... +;; STATE: Third Shift +;; KEYBOARD TYPES: G_KB+P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_THIRD_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; default ignore error state + ;; + DW CP437_THIRD_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: *** CNS 12/18 + DB 1 ;; number of scans + DB 27,'$' ;; dollar currency symbol +CP437_THIRD_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_THIRD_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; LAST STATE + ;; +CP437_XLAT_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; FR Specific Translate Section for 850 +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC FR_850_XLAT ;; +FR_850_XLAT: ;; + ;; + DW CP850_XLAT_END-$ ;; length of section + DW 850 ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G_KB + P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; default ignore error state + ;; + DW CP850_NA_UP_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: ***** CNS 12/18 + DB 1 ;; number of scans + DB 53,0F5H ;; Section symbol -  +CP850_NA_UP_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_NA_UP_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: AT_KB+XT+ +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_NA_LO_K1_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; default ignore error state + ;; + DW CP850_NA_LO_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: ***** CNS **** 12/18 + DB 1 ;; number of scans + DB 7,0F5H ;; Section symbol -  +CP850_NA_LO_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_NA_LO_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Third Shift +;; KEYBOARD TYPES: G_KB+P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_THIRD_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; default ignore error state + ;; + DW CP850_THIRD_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: *** CNS 12/18 + DB 1 ;; number of scans + DB 27,0CFH ;; international currency symbol +CP850_THIRD_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_THIRD_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Acute Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ;; +;; DW CP850_AC_LO_END-$ ;; length of state section +;; DB ACUTE_LOWER ;; State ID +;; DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type +;; DB 39,0 ;; error character = standalone accent +;; ;; +;; DW CP850_AC_LO_T1_END-$ ;; Size of xlat table +;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: +;; DB 1 ;; number of scans +;; DB 21,0ECH ;; y acute +;;CP850_AC_LO_T1_END: ;; +;; ;; +;; DW 0 ;; Size of xlat table - null table +;; ;; +;;CP850_AC_LO_END: ;; +;; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; CODE PAGE: 850 +;;;; STATE: Acute Upper Case +;;;; KEYBOARD TYPES: All +;;;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ;; +;; DW CP850_AC_UP_END-$ ;; length of state section +;; DB ACUTE_UPPER ;; State ID +;; DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type +;; DB 39,0 ;; error character = standalone accent +;; ;; +;; DW CP850_AC_UP_T1_END-$ ;; Size of xlat table +;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: +;; DB 5 ;; number of scans +;; DB 30,0B5H ;; A acute +;; DB 23,0D6H ;; I acute +;; DB 24,0E0H ;; O acute +;; DB 22,0E9H ;; U acute +;; DB 21,0EDH ;; Y acute +;;CP850_AC_UP_T1_END: ;; +;; ;; +;; DW 0 ;; Size of xlat table - null table +;; ;; +;;CP850_AC_UP_END: ;; +;; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; CODE PAGE: 850 +;;;; STATE: Diaresis Upper +;;;; KEYBOARD TYPES: All +;;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_UP_END-$ ;; length of state section + DB DIARESIS_UPPER ;; State ID + DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW CP850_DI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 2 ;; number of scans + DB 18,0D3H ;; E diaeresis + DB 23,0D8H ;; I diaeresis + CP850_DI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; + CP850_DI_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; CODE PAGE: 850 +;; STATE: Grave Upper +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ;; +;; DW CP850_GR_UP_END-$ ;; length of state section +;; DB GRAVE_UPPER ;; State ID +;; DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type +;; DB 96,0 ;; error character = standalone accent +;; ;; +;; DW CP850_GR_UP_T1_END-$ ;; Size of xlat table +;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: +;; DB 5 ;; number of scans +;; DB 30,0B7H ;; A grave +;; DB 18,0D4H ;; E grave +;; DB 23,0DEH ;; I grave +;; DB 24,0E3H ;; O grave +;; DB 22,0EBH ;; U grave +;;CP850_GR_UP_T1_END: ;; +;; ;; +;; DW 0 ;; Size of xlat table - null table +;; ;; +;;CP850_GR_UP_END: ;; length of state section +;; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; CODE PAGE: 850 +;;;; STATE: Circumflex Upper +;;;; KEYBOARD TYPES: All +;;;;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_CI_UP_END-$ ;; length of state section + DB CIRCUMFLEX_UPPER ;; State ID + DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW CP850_CI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 16,0B6H ;; A circumflex + DB 18,0D2H ;; E circumflex + DB 23,0D7H ;; I circumflex + DB 24,0E2H ;; O circumflex + DB 22,0EAH ;; U circumflex + CP850_CI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; + CP850_CI_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW 0 ;; LAST STATE + ;; +CP850_XLAT_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CODE ENDS ;; + END ;; diff --git a/v4.0/src/DEV/KEYBOARD/KDFFR120.ASM b/v4.0/src/DEV/KEYBOARD/KDFFR120.ASM new file mode 100644 index 0000000..3fdb453 --- /dev/null +++ b/v4.0/src/DEV/KEYBOARD/KDFFR120.ASM @@ -0,0 +1,2307 @@ +; ACUTE lc y added +; ****** CNS 12/18 +; ****** CNS 01/21 NUM PAD + PAGE ,132 + TITLE DOS - Keyboard Definition File + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DOS - - NLS Support - Keyboard Defintion File +;; (c) Copyright 1988 Microsoft +;; +;; This file contains the keyboard tables for Belgium. +;; +;; Linkage Instructions: +;; Refer to KDF.ASM. +;; +;; Modded from French - DTF 11-Sep-86 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + INCLUDE KEYBSHAR.INC ;; + INCLUDE POSTEQU.INC ;; + INCLUDE KEYBMAC.INC ;; + ;; + PUBLIC FR1_LOGIC ;; + PUBLIC FR1_437_XLAT ;; + PUBLIC FR1_850_XLAT ;; + ;; +CODE SEGMENT PUBLIC 'CODE' ;; + ASSUME CS:CODE,DS:CODE ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Standard translate table options are a liner search table +;; (TYPE_2_TAB) and ASCII entries ONLY (ASCII_ONLY) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +STANDARD_TABLE EQU TYPE_2_TAB+ASCII_ONLY + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; FR State Logic +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +FR1_LOGIC: + + DW LOGIC_END-$ ;; length + ;; + DW TYPEWRITER_CAPS_LK ;; special features + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; COMMANDS START HERE + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; OPTIONS: If we find a scan match in +;; an XLATT or SET_FLAG operation then +;; exit from INT 9. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + OPTION EXIT_IF_FOUND ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Dead key definitions must come before +;; dead key translations to handle +;; dead key + dead key. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + IFF EITHER_ALT,NOT ;; + ANDF EITHER_CTL,NOT ;; + IFF CAPS_STATE + SET_FLAG DEAD_UPPER + ELSEF + IFF EITHER_SHIFT ;; + SET_FLAG DEAD_UPPER ;; + ELSEF ;; + SET_FLAG DEAD_LOWER ;; + ENDIFF ;; + ENDIFF + ELSEF ;; + IFF EITHER_SHIFT,NOT ;; + IFKBD XT_KB+AT_KB + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + SET_FLAG DEAD_THIRD ;; + ENDIFF ;; + ELSEF + IFF R_ALT_SHIFT ;; + ANDF EITHER_CTL,NOT ;; + ANDF LC_E0,NOT ;; + SET_FLAG DEAD_THIRD ;; + ENDIFF ;; + ENDIFF + ENDIFF + ENDIFF ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ACUTE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +ACUTE_PROC: ;; + ;; + IFF ACUTE,NOT ;; + GOTO TILDE_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT ACUTE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT ACUTE_LOWER ;; + ELSEF ;; + XLATT ACUTE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT ACUTE_UPPER ;; + ELSEF ;; + XLATT ACUTE_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_ACUTE: ;; + PUT_ERROR_CHAR ACUTE_LOWER ;; If we get here then either the XLATT + BEEP ;; failed or we are ina bad shift state. + GOTO NON_DEAD ;; Either is invalid so BEEP and fall + ;; through to generate the second char. + ;; Note that the dead key flag will be + ;; reset before we get here. + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; TILDE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +TILDE_PROC: ;; + ;; + IFF TILDE,NOT ;; + GOTO DIARESIS_PROC ;; + ENDIFF ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT TILDE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT TILDE_LOWER ;; + ELSEF ;; + XLATT TILDE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT TILDE_LOWER ;; + ELSEF ;; + XLATT TILDE_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_TILDE: ;; + PUT_ERROR_CHAR TILDE_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DIARESIS ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +DIARESIS_PROC: ;; + ;; + IFF DIARESIS,NOT ;; + GOTO GRAVE_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT DIARESIS_SPACE ;; exist for 437 so beep for + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_LOWER ;; + ELSEF ;; + XLATT DIARESIS_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_UPPER ;; + ELSEF ;; + XLATT DIARESIS_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_DIARESIS: ;; + PUT_ERROR_CHAR DIARESIS_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; GRAVE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +GRAVE_PROC: ;; + ;; + IFF GRAVE,NOT ;; + GOTO CIRCUMFLEX_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT GRAVE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_GRAVE: ;; + PUT_ERROR_CHAR GRAVE_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CIRCUMFLEX ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CIRCUMFLEX_PROC: ;; + ;; + IFF CIRCUMFLEX,NOT ;; + GOTO NON_DEAD ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT CIRCUMFLEX_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_CIRCUMFLEX: ;; + PUT_ERROR_CHAR CIRCUMFLEX_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Upper, lower and third shifts +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +;*************************** +NON_DEAD: ;; +;ADDED FOR DIVIDE SIGN ;; + IFKBD G_KB+P12_KB ;; Avoid accidentally translating + ANDF LC_E0 ;; the "/" on the numeric pad of the + IFF EITHER_CTL,NOT + ANDF EITHER_ALT,NOT + XLATT DIVIDE_SIGN ;; + ENDIFF + EXIT_STATE_LOGIC ;; + ENDIFF ;; +;BD END OF ADDITION +;**************************** +;NON_DEAD: ;; +; ;; +; IFKBD G_KB+P12_KB ;; Avoid accidentally translating +; ANDF LC_E0 ;; the "/" on the numeric pad of the +; EXIT_STATE_LOGIC ;; G keyboard +; ENDIFF ;; + ;; + IFF EITHER_ALT,NOT ;; + ANDF EITHER_CTL,NOT ;; + IFF EITHER_SHIFT ;; +;****************************************** +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE,NOT ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION +;******************************************* + IFF CAPS_STATE ;; + XLATT ALPHA_LOWER ;; + XLATT NON_ALPHA_LOWER ;; + ELSEF ;; + XLATT ALPHA_UPPER ;; + XLATT NON_ALPHA_UPPER ;; + ENDIFF ;; + ELSEF ;; +;****************************************** +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION +;****************************************** + IFF CAPS_STATE ;; + XLATT ALPHA_UPPER ;; + XLATT NON_ALPHA_UPPER ;; + ELSEF ;; + XLATT ALPHA_LOWER ;; + XLATT NON_ALPHA_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_SHIFT,NOT ;; + IFKBD XT_KB+AT_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_CTL,NOT ;; + ANDF R_ALT_SHIFT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ENDIFF ;; + IFKBD AT_KB+XT_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ENDIFF ;; + IFKBD G_KB+P12_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; +;IFF EITHER_SHIFT,NOT ;; + IFKBD AT_KB+XT_KB ;; + IFF EITHER_CTL,NOT ;; + IFF ALT_SHIFT ;; ALT - case + XLATT ALT_CASE ;; + ENDIFF ;; + ELSEF ;; + XLATT CTRL_CASE ;; + ENDIFF ;; + ENDIFF ;; + ;; + IFKBD G_KB+P12_KB ;; + IFF EITHER_CTL,NOT ;; + IFF ALT_SHIFT ;; ALT - case + ANDF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_ALT,NOT ;; + XLATT CTRL_CASE ;; + ENDIFF ;; + ENDIFF ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + ANDF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ENDIFF ;; + ;; + EXIT_STATE_LOGIC ;; + ;; +LOGIC_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; BE Common Translate Section +;; This section contains translations for the lower 128 characters +;; only since these will never change from code page to code page. +;; In addition the dead key "Set Flag" tables are here since the +;; dead keys are on the same keytops for all code pages. +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC FR1_COMMON_XLAT ;; +FR1_COMMON_XLAT: ;; + ;; + DW COMMON_XLAT_END-$ ;; length of section + DW -1 ;; code page + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alt Case +;; KEYBOARD TYPES: G + P +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_ALT_K1_END-$ ;; length of state section + DB ALT_CASE ;; State ID + DW G_KB ;P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW COM_ALT_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; + DB 6 ;;8 Number of entries +; DB 12,-1,-1 ;; +; DB 13,0,82H ;; + DB 16,0,1EH ;; A + DB 17,0,2CH ;; Z + DB 30,0,10H ;; Q + DB 39,0,32H ;; M + DB 44,0,11H ;; W + DB 50,-1,-1 ;; U.S. 'M' +COM_ALT_K1_T1_END: ;; + ;; + DW 0 ;; + ;; +COM_ALT_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;***************************************** CNS P12 Addition ***************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alt Case +;; KEYBOARD TYPES: P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_ALT_PK1_END-$ ;; length of state section + DB ALT_CASE ;; State ID + DW P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW COM_ALT_PK1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; + DB 6 ;; 10 Number of entries +; DB 12,-1,-1 ;; invalid key U.S. alt - +; DB 13,-1,-1 ;; invalid key U.S. alt = +; DB 07,0,82H ;; alt - (minus sign) +; DB 13,0,83H ;; alt = (equal sign) + DB 16,0,1EH ;; A + DB 17,0,2CH ;; Z + DB 30,0,10H ;; Q + DB 39,0,32H ;; M + DB 44,0,11H ;; W + DB 50,-1,-1 ;; U.S. 'M' +COM_ALT_PK1_T1_END: ;; + ;; + DW 0 ;; + ;; +COM_ALT_PK1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;***************************************** CNS P12 Addition ***************** +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: GKB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K1_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW G_KB ;P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW COM_CTRL_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; + DB 10 ;; Number of entries + DB 12,-1,-1 ;; + DB 13,31,13 ;; + DB 16,01,16 ;; A + DB 17,26,17 ;; Z + DB 30,17,30 ;; Q + DB 39,13,39 ;; M + DB 43,-1,-1 ;; \ + DB 44,23,44 ;; W + DB 50,-1,-1 ;; U.S. 'M' + DB 86,28,86 ;; +COM_CTRL_K1_T1_END: ;; + ;; + DW 0 ;; + ;; +COM_CTRL_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;***************************************** CNS P12 Addition ***************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_PK1_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW COM_CTRL_PK1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; + DB 12 ;; Number of entries + DB 12,-1,-1 ;; + DB 07,30,07 ;; ctl + number six key + DB 12,29,12 ;; ctl + ] + DB 13,31,13 ;; + DB 16,01,16 ;; A + DB 17,26,17 ;; Z + DB 30,17,30 ;; Q + DB 39,13,39 ;; M + DB 43,-1,-1 ;; \ + DB 44,23,44 ;; W + DB 50,-1,-1 ;; U.S. 'M' + DB 9,28,9 ;; \ position (this is also the underscore position) +COM_CTRL_PK1_T1_END: ;; + ;; + DW 0 ;; + ;; +COM_CTRL_PK1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;***************************************** CNS P12 Addition ***************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alt Case +;; KEYBOARD TYPES: AT + XT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_ALT_K2_END-$ ;; length of state section + DB ALT_CASE ;; State ID + DW AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW COM_ALT_K2_T2_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; + DB 6 ;; 9 Number of entries +; DB 12,-1,-1 ;; invalid key U.S. alt - +; DB 13,0,82H ;; alt - (minus sign) +; DB 53,0,83H ;; alt = (equal sign) + DB 16,0,1EH ;; A + DB 17,0,2CH ;; Z + DB 30,0,10H ;; Q + DB 39,0,32H ;; M + DB 44,0,11H ;; W + DB 50,-1,-1 ;; U.S. 'M' +COM_ALT_K2_T2_END: ;; + ;; + DW 0 ;; + ;; +COM_ALT_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K2_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW COM_CTRL_K2_T2_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; + DB 10;11 ;; Number of entries + DB 12,-1,-1 ;; invalid U.S. - + DB 43,-1,-1 ;; invalid U.S. \ + DB 41,28,41 ;; valid ctl + \ + DB 07,30,07 ;; ctl + number six key +; DB 13,31,13 ;; ctl - or _ + DB 16,01,16 ;; A + DB 17,26,17 ;; Z + DB 30,17,30 ;; Q + DB 39,13,39 ;; M + DB 44,23,44 ;; W + DB 50,-1,-1 ;; U.S. 'M' +COM_CTRL_K2_T2_END: ;; + ;; + DW 0 ;; + ;; +COM_CTRL_K2_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: XT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K3_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW COM_CTRL_K3_T3_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; + DB 6 ;; Number of entries + DB 12,-1,-1 ;; + DB 43,-1,-1 ;; + DB 43,28,43 ;; valid ctl + \ + DB 07,30,07 ;; ctl + number six key +; DB 13,31,13 ;; ctl - or _ + DB 16,01,16 ;; A + DB 17,26,17 ;; Z + DB 30,17,30 ;; Q + DB 39,13,39 ;; M + DB 44,23,44 ;; W + DB 50,-1,-1 ;; U.S. 'M' +COM_CTRL_K3_T3_END: ;; + ;; + DW 0 ;; + ;; +COM_CTRL_K3_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Lower Shift Dead Key +;; KEYBOARD TYPES: All +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_LO_END-$ ;; length of state section + DB DEAD_LOWER ;; State ID + DW G_KB+AT_KB+XT_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 1 ;; number of entries + DB 26 ;; scan code + FLAG CIRCUMFLEX ;; flag bit to set + ;; + ;; +COM_DK_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;*************************************** CNS P12 Addition +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Upper Shift Dead Key +;; KEYBOARD TYPES: All +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_UP_END-$ ;; length of state section + DB DEAD_UPPER ;; State ID + DW G_KB+AT_KB+XT_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 1 ;; number of entries + DB 26 ;; scan code + FLAG DIARESIS ;; flag bit to set + ;; +COM_DK_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift Dead Key +;; KEYBOARD TYPES: G, AT +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_TH_END-$ ;; length of state section + DB DEAD_THIRD ;; State ID + DW G_KB+AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 3 ;; number of entries + DB 40 ;; + FLAG ACUTE ;; + DB 43 ;; + FLAG GRAVE ;; + DB 53 ;; + FLAG TILDE ;; + ;; +COM_DK_TH_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;***************************************** CNS P12 Addition ***************** +;NO THRD SHIFT DEAD KEY FOR THE P12 +;***************************************** CNS P12 Addition ***************** +;; CODE PAGE: Common +;; STATE: Third Shift Dead Key +;; KEYBOARD TYPES: XT + +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_TH_K1_END-$ ;; length of state section + DB DEAD_THIRD ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 3 ;; number of entries + DB 40 ;; + FLAG ACUTE ;; + DB 41 ;; + FLAG GRAVE ;; + DB 53 ;; + FLAG TILDE ;; + ;; +COM_DK_TH_K1_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;********************************************** CNS P12 Addition +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Diaresis Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DI_LO_END-$ ;; length of state section + DB DIARESIS_LOWER ;; State ID + DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW COM_DI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 16,'' ;; scan code,ASCII - a + DB 24,'' ;; scan code,ASCII - o + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 21,'' ;; scan code,ASCII - y +COM_DI_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_DI_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;********************************************** CNS P12 Addition +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common ;;change **********CNS ************** +;; STATE: Numeric Key Pad +;; KEYBOARD TYPES: All except the p12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_PAD_K1_END-$ ;; length of state section + DB NUMERIC_PAD ;; State ID + DW G_KB+AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_PAD_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 83,',' ;; decimal seperator = , +COM_PAD_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_PAD_K1_END: ;; + ;; +;**************************************************** CODE eliminated********** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; NUM PAD altered ******** +;; CODE PAGE: 850 CNS engraved "," out +;; STATE: Numeric Pad - Divide Sign +;; KEYBOARD TYPES: G +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ;; +;; DW CP850_DIVID_END-$ ;; length of state section +;; DB DIVIDE_SIGN ;; State ID +;; DW G_KB+P12_KB ;; Keyboard Type +;; DB -1,-1 ;; error character = standalone accent +;; ;; +;; DW CP850_DIVID_T1_END-$ ;; Size of xlat table +;; DB TYPE_2_TAB ;; xlat options: +;; DB 2 ;; number of scans +;; DB 0E0H,',',0E0H ;; DIVIDE SIGN +;; DB 51,',',0E0H ;; +;; CP850_DIVID_T1_END: ;; +;; ;; +;; DW 0 ;; Size of xlat table - null table +;; ;; +;; CP850_DIVID_END: ;; +;; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Numeric Key Pad - Multiplication +;; KEYBOARD TYPES: G, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ;; +;; DW CP850_PAD_K1_END-$ ;; length of state section +;; DB NUMERIC_PAD ;; State ID +;; DW G_KB ;; Keyboard Type +;; DB -1,-1 ;; Buffer entry for error character +;; ;; +;; DW CP850_PAD_K1_T1_END-$ ;; Size of xlat table +;; DB STANDARD_TABLE ;; xlat options: +;; DB 1 ;; number of entries +;; DB 51,',' ; (removed *** CNS ****) ;; MULTIPLICATION SIGN +;; CP850_PAD_K1_T1_END: ;; +;; ;; +;; DW 0 ;; Size of xlat table - null table +;; ;; +;; CP850_PAD_K1_END: ;; +;; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;********************************************************* +;; CODE PAGE: Common +;; STATE: Alpha Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AL_LO_END-$ ;; length of state section + DB ALPHA_LOWER ;; State ID + DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_AL_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 5 ;; number of entries + DB 16,'a' ;; small a + DB 17,'z' ;; small z + DB 30,'q' ;; small q + DB 39,'m' ;; small m + DB 44,'w' ;; small w +COM_AL_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AL_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alpha Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AL_UP_END-$ ;; length of state section + DB ALPHA_UPPER ;; State ID + DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_AL_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 5 ;; number of entries + DB 16,'A' ;; caps A + DB 17,'Z' ;; caps Z + DB 30,'Q' ;; caps Q + DB 39,'M' ;; caps M + DB 44,'W' ;; caps W +COM_AL_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AL_UP_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: G, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW G_KB ;P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 20 ;; number of entries + DB 41,"" ;; superscript 2 + DB 2,"&" ;; + DB 3,"" ;; acute - e + DB 4,'"' ;; + DB 5,"'" ;; + DB 6,"(" ;; + DB 8,"" ;; grave - e + DB 9,"!" ;; + DB 10,"" ;; c - cedilla small + DB 11,"" ;; + DB 12,")" ;; + DB 13,"-" ;; + DB 27,"$" ;; + DB 40,"" ;; grave - u + DB 43,0E6H ;; mu + DB 86,'<' ;; + DB 50,',' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'=' ;; +COM_NA_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;***************************************** CNS P12 Addition ***************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_PK1_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_PT1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 21 ;; number of entries + DB 41,"" ;; superscript 2 + DB 2,"&" ;; + DB 3,"" ;; acute - e + DB 4,'"' ;; + DB 5,"'" ;; + DB 6,"(" ;; + DB 7,"-" ;; + DB 8,"" ;; grave - e + DB 9,"_" ;; + DB 10,"" ;; c - cedilla small + DB 11,"" ;; + DB 12,")" ;; + DB 13,"=" ;; + DB 27,"$" ;; + DB 40,"" ;; grave - u + DB 43,"*" ;; + DB 86,'<' ;; + + DB 50,',' ;; < + DB 51,';' ;; - + DB 52,':' ;; + DB 53,'!' ;; + +COM_NA_LO_PT1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_PK1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;***************************************** CNS P12 Addition ***************** +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES:AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K2_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_T1_K2_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 19 ;; number of entries + DB 41,"<" ;; + DB 2,"&" ;; + DB 3,"" ;; acute - e + DB 4,'"' ;; + DB 5,"'" ;; + DB 6,"(" ;; + DB 8,"" ;; grave - e + DB 9,"!" ;; + DB 10,"" ;; c - cedilla small + DB 11,"" ;; + DB 12,")" ;; + DB 13,"-" ;; + DB 27,"$" ;; + DB 40,"" ;; grave - u + DB 43,0E6H ;; mu + DB 50,',' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'=' ;; +COM_NA_LO_T1_K2_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K2_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: XT, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K1_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 19 ;; number of entries + DB 2,"&" ;; + DB 3,"" ;; acute - e + DB 4,'"' ;; + DB 5,"'" ;; + DB 6,"(" ;; + DB 8,"" ;; + DB 9,"!" ;; + DB 10,"" ;; c - cedilla small + DB 11,"" ;; + DB 12,")" ;; + DB 13,"-" ;; + DB 27,"$" ;; + DB 40,"" ;; grave - u + DB 41,0E6H ;; mu + DB 43,'<' ;; + DB 50,',' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'=' ;; +COM_NA_LO_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB ;+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 20 ;; number of entries + DB 2,'1' ;; + DB 3,'2' ;; + DB 4,'3' ;; + DB 5,'4' ;; + DB 6,'5' ;; + DB 7,'6' ;; + DB 8,'7' ;; + DB 9,'8' ;; + DB 10,'9' ;; + DB 11,'0' ;; + DB 12,0F8H ;; degree symbol + DB 13,"_" ;; + DB 27,"*" ;; + DB 40,'%' ;; + DB 43,'' ;; + DB 86,'>' ;; + DB 50,'?' ;; + DB 51,'.' ;; + DB 52,'/' ;; + DB 53,'+' ;; +COM_NA_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;***************************************** CNS P12 Addition ***************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_PK1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_PT1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 21 ;; number of entries + DB 2,'1' ;; + DB 3,'2' ;; + DB 4,'3' ;; + DB 5,'4' ;; + DB 6,'5' ;; + DB 7,'6' ;; + DB 8,'7' ;; + DB 9,'8' ;; + DB 10,'9' ;; + DB 11,'0' ;; + DB 12,0F8H ;; degree symbol + DB 13,"+" ;; plus sign + DB 27,09CH ;; symbol + DB 40,'%' ;; + DB 41,"" ;; superscript 3 + DB 43,0E6H ;; - mu symbol + DB 86,'>' ;; + DB 50,'?' ;; + DB 51,'.' ;; + DB 52,'/' ;; + DB 53,'+' ;; +COM_NA_UP_PT1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_PK1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;***************************************** CNS P12 Addition ***************** +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: XT + +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 20 ;; number of entries + DB 41,'' ;; + DB 2,'1' ;; + DB 3,'2' ;; + DB 4,'3' ;; + DB 5,'4' ;; + DB 6,'5' ;; + DB 7,'6' ;; + DB 8,'7' ;; + DB 9,'8' ;; + DB 10,'9' ;; + DB 11,'0' ;; + DB 12,0F8H ;; degree symbol + DB 13,"_" ;; + DB 27,"*" ;; + DB 40,'%' ;; + DB 43,'>' ;; + DB 50,'?' ;; + DB 51,'.' ;; + DB 52,'/' ;; + DB 53,'+' ;; +COM_NA_UP_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K1_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K2_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_T1_K2_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 20 ;; number of entries + DB 41,'>' ;; + DB 2,'1' ;; + DB 3,'2' ;; + DB 4,'3' ;; + DB 5,'4' ;; + DB 6,'5' ;; + DB 7,'6' ;; + DB 8,'7' ;; + DB 9,'8' ;; + DB 10,'9' ;; + DB 11,'0' ;; + DB 12,0F8H ;; degree symbol + DB 13,"_" ;; + DB 27,"*" ;; + DB 40,'%' ;; + DB 43,'' ;; + DB 50,'?' ;; + DB 51,'.' ;; + DB 52,'/' ;; + DB 53,'+' ;; +COM_NA_UP_T1_K2_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K2_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: G, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB ;+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 9 ;; number of entries + DB 2,"|" ;; + DB 3,'@' ;; + DB 4,'#' ;; + DB 7,'^' ;; + DB 10,'{' ;; + DB 11,'}' ;; + DB 26,'[' ;; + DB 27,']' ;; + DB 86,'\' ;; +COM_THIRD_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;******************************************* CNS Addition +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Acute Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AC_LO_END-$ ;; length of state section + DB ACUTE_LOWER ;; State ID + DW P12_KB ;; ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW COM_AC_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 18,'' ;; scan code,ASCII - e +COM_AC_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AC_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;******************************************* CNS Addition +;***************************************** CNS P12 Addition ***************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_PK1_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_PT1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 11 ;; number of entries + DB 3,'~' ;; + DB 4,'#' ;; + DB 5,'{' ;; + DB 6,'[' ;; + DB 7,'|' ;; + DB 8,'`' ;; grave symbol not a dead key rep + DB 9,'\' ;; + DB 10,'^' ;; circumflex (caret) + DB 11,'@' ;; + DB 12,']' ;; + DB 13,'}' ;; +COM_THIRD_PT1_K1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_PK1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;***************************************** CNS P12 Addition ***************** +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: XT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K1_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 9 ;; number of entries + DB 2,"|" ;; + DB 3,'@' ;; + DB 4,'#' ;; + DB 7,'^' ;; + DB 10,'{' ;; + DB 11,'}' ;; + DB 26,'[' ;; + DB 27,']' ;; + DB 43,'\' ;; +COM_THIRD_T1_K1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K1_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K2_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_T1_K2_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 9 ;; number of entries + DB 2,"|" ;; + DB 3,'@' ;; + DB 4,'#' ;; + DB 7,'^' ;; + DB 10,'{' ;; + DB 11,'}' ;; + DB 26,'[' ;; + DB 27,']' ;; + DB 41,'\' ;; +COM_THIRD_T1_K2_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K2_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Lower +;; KEYBOARD TYPES: ALL +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_GR_LO_END-$ ;; length of state section + DB GRAVE_LOWER ;; State ID + DW G_KB+AT_KB+XT_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW COM_GR_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 16,'' ;; scan code,ASCII - a + DB 24,'' ;; scan code,ASCII - o + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i +COM_GR_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_GR_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_GR_UP_END-$ ;; length of state section + DB GRAVE_UPPER ;; State ID + DW G_KB+AT_KB+XT_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW COM_GR_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 0 ;; number of scans +COM_GR_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_GR_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_GR_SP_END-$ ;; length of state section + DB GRAVE_SPACE ;; State ID + DW G_KB+AT_KB+XT_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW COM_GR_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,96 ;; STANDALONE GRAVE +COM_GR_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_GR_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_LO_END-$ ;; length of state section + DB CIRCUMFLEX_LOWER ;; State ID + DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW COM_CI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 16,'' ;; scan code,ASCII - a + DB 18,'' ;; scan code,ASCII - e + DB 24,'' ;; scan code,ASCII - o + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i +COM_CI_LO_T1_END: ;; + ;; + DW 0 ;; + ;; +COM_CI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex Upper +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_UP_END-$ ;; length of state section + DB CIRCUMFLEX_UPPER ;; State ID + DW G_KB+AT_KB+XT_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW COM_CI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 0 ;; number of scans +COM_CI_UP_T1_END: ;; + ;; + DW 0 ;; + ;; +COM_CI_UP_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_SP_END-$ ;; length of state section + DB CIRCUMFLEX_SPACE ;; State ID + DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW COM_CI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,94 ;; STANDALONE CIRCUMFLEX +COM_CI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CI_SP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Tilde Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_TI_SP_END-$ ;; length of state section + DB TILDE_SPACE ;; State ID + DW G_KB+AT_KB+XT_KB ;; Keyboard Type + DB 126,0 ;; error character = standalone accent + ;; + DW COM_TI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,126 ;; STANDALONE TIDLE +COM_TI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_TI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; Last State +COMMON_XLAT_END: ;; + ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; BE Specific Translate Section for 437 +;; +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC FR1_437_XLAT ;; +FR1_437_XLAT: ;; + ;; + DW CP437_XLAT_END-$ ;; length of section + DW 437 ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_NA_LO_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW G_KB+AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; default ignore error state + ;; + DW CP437_NA_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of scans + DB 7,15H ;; Section Symbol +CP437_NA_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_NA_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;**************************************** CNS Addition +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: p12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW P12_KB ;; Keyboard Type + DB -1,-1 ;; default ignore error state + ;; + DW CP437_NA_UP_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: **** CNS 12/18 + DB 1 ;; number of scans + DB 53,015H ;; Section symbol -  +CP437_NA_UP_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_NA_UP_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;**************************************** CNS Addition +;; CODE PAGE: 437 +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_NA_UP_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB ;+P12_KB ;; Keyboard Type + DB -1,-1 ;; default ignore error state + ;; + DW CP437_NA_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of scans + DB 41,00H ;; 3 Superscript +CP437_NA_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_NA_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;***************************************** CNS P12 Addition ***************** +;***************************************** CNS P12 Addition ***************** +;; CODE PAGE: CP437 +;; STATE: Acute Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_AC_LO_END-$ ;; length of state section + DB ACUTE_LOWER ;; State ID + DW G_KB+AT_KB+XT_KB ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW CP437_AC_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 16,'' ;; a acute + DB 18,'' ;; e acute + DB 23,'' ;; i acute + DB 24,'' ;; o acute + DB 22,'' ;; u acute +CP437_AC_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_AC_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Acute Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_AC_UP_END-$ ;; length of state section + DB ACUTE_UPPER ;; State ID + DW G_KB+AT_KB+XT_KB ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW CP437_AC_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 18,'' ;; scan code,ASCII - e +CP437_AC_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_AC_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Acute Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_AC_SP_END-$ ;; length of state section + DB ACUTE_SPACE ;; State ID + DW G_KB+AT_KB+XT_KB ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW CP437_AC_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,39 ;; scan code,ASCII - SPACE +CP437_AC_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_AC_SP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Tilde Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_TI_LO_END-$ ;; length of state section + DB TILDE_LOWER ;; State ID + DW G_KB+AT_KB+XT_KB ;; Keyboard Type + DB 126,0 ;; error character = standalone accent + ;; + DW CP437_TI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 49,164 ;; scan code,ASCII - n +CP437_TI_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_TI_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Tilde Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_TI_UP_END-$ ;; length of state section + DB TILDE_UPPER ;; State ID + DW G_KB+AT_KB+XT_KB ;; Keyboard Type + DB 126,0 ;; error character = standalone accent + ;; + DW CP437_TI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 49,165 ;; scan code,ASCII - N +CP437_TI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_TI_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Diaresis Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_DI_LO_END-$ ;; length of state section + DB DIARESIS_LOWER ;; State ID + DW G_KB+AT_KB+XT_KB ;; Keyboard Type + DB 0FEH,0 ;; error character = standalone accent + ;; + DW CP437_DI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 16,'' ;; scan code,ASCII - a + DB 24,'' ;; scan code,ASCII - o + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 21,'' ;; scan code,ASCII - y +CP437_DI_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_DI_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Diaresis Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_DI_UP_END-$ ;; length of state section + DB DIARESIS_UPPER ;; State ID + DW G_KB+AT_KB+XT_KB ;; Keyboard Type + DB 0FEH,0 ;; error character = standalone accent + ;; + DW CP437_DI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 3 ;; number of scans + DB 16,'' ;; scan code,ASCII - a + DB 24,'' ;; scan code,ASCII - o + DB 22,'' ;; scan code,ASCII - u +CP437_DI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_DI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Diaresis Upper Case +;; KEYBOARD TYPES: P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DI_UP_END-$ ;; length of state section + DB DIARESIS_UPPER ;; State ID + DW P12_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW COM_DI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 3 ;; number of scans + DB 16,'' ;; scan code,ASCII - a + DB 24,'' ;; scan code,ASCII - o + DB 22,'' ;; scan code,ASCII - u +COM_DI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_DI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Diaresis Space Bar +;; KEYBOARD TYPES: P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DI_SP_END-$ ;; length of state section + DB DIARESIS_SPACE ;; State ID + DW P12_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW COM_DI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,249 ;; error character = standalone accent +COM_DI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table +COM_DI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;***************************************** CNS P12 Addition ***************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 ???????????????????May need change.... +;; STATE: Third Shift +;; KEYBOARD TYPES: P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_THIRD_PEND-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW P12_KB ;; Keyboard Type + DB -1,-1 ;; default ignore error state + ;; + DW CP437_THIRD_T1_PEND-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: *** CNS 12/18 + DB 1 ;; number of scans + DB 27,'$' ;; dollar currency symbol +CP437_THIRD_T1_PEND: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_THIRD_PEND: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;***************************************** CNS P12 Addition ***************** +;; CODE PAGE: CP437 +;; STATE: Diaresis Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; ;; +; DW CP437_DI_SP_END-$ ;; length of state section +; DB DIARESIS_SPACE ;; State ID +; DW G_KB+AT_KB+XT_KB ;; Keyboard Type +; DB 0FEH,0 ;; error character = standalone accent +; ;; +; DW CP437_DI_SP_T1_END-$ ;; Size of xlat table +; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: +; DB 1 ;; number of scans +; DB 57,0FEH ;; error character = standalone accent +;CP437_DI_SP_T1_END: ;; +; ;; +; DW 0 ;; Size of xlat table - null table +;CP437_DI_SP_END: ;; length of state section +; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; LAST STATE + ;; +CP437_XLAT_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; BE Specific Translate Section for 850 +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC FR1_850_XLAT ;; +FR1_850_XLAT: ;; + ;; + DW CP850_XLAT_END-$ ;; length of section + DW 850 ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_NA_LO_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW G_KB+AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; default ignore error state + ;; + DW CP850_NA_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of scans + DB 7,0F5H ;; Section symbol -  +CP850_NA_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_NA_LO_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;**************************************** CNS Addition +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW P12_KB ;; Keyboard Type + DB -1,-1 ;; default ignore error state + ;; + DW CP850_NA_UP_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: ***** CNS 12/18 + DB 1 ;; number of scans + DB 53,0F5H ;; Section symbol -  +CP850_NA_UP_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_NA_UP_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;**************************************** CNS Addition +;; CODE PAGE: 850 +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_NA_UP_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB ;P12_KB ;; Keyboard Type + DB -1,-1 ;; default ignore error state + ;; + DW CP850_NA_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of scans + DB 41,0FCH ;; 3 Superscript +CP850_NA_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_NA_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Third Shift +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_THIRD_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB+AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; default ignore error state + ;; + DW CP850_THIRD_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 0 ;; number of scans +CP850_THIRD_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_THIRD_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;***************************************** CNS P12 Addition ***************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Third Shift +;; KEYBOARD TYPES: P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_THIRD_PEND-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW P12_KB ;; Keyboard Type + DB -1,-1 ;; default ignore error state + ;; + DW CP850_THIRD_P1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: *** CNS 12/18 + DB 1 ;; number of scans + DB 27,0CFH ;; international currency symbol +CP850_THIRD_P1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_THIRD_PEND: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;***************************************** CNS P12 Addition ***************** +;; CODE PAGE: CP850 +;; STATE: Tilde Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_TI_LO_END-$ ;; length of state section + DB TILDE_LOWER ;; State ID + DW G_KB+AT_KB+XT_KB ;; Keyboard Type + DB 126,0 ;; error character = standalone accent + ;; + DW CP850_TI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 3 ;; number of scans + DB 49,164 ;; scan code,ASCII - n + DB 16,0C6H ;; a + DB 24,0E4H ;; o +CP850_TI_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_TI_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;***************************************** CNS P12 Addition ***************** +;***************************************** CNS P12 Addition ***************** +;; CODE PAGE: CP850 +;; STATE: Tilde Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_TI_UP_END-$ ;; length of state section + DB TILDE_UPPER ;; State ID + DW G_KB+AT_KB+XT_KB ;; Keyboard Type + DB 126,0 ;; error character = standalone accent + ;; + DW CP850_TI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 3 ;; number of scans + DB 49,165 ;; scan code,ASCII - N + DB 16,0C7H ;; A + DB 24,0E5H ;; O +CP850_TI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_TI_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;***************************************** CNS P12 Addition ***************** +;***************************************** CNS P12 Addition ***************** +;; CODE PAGE: CP850 +;; STATE: Acute Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_LO_END-$ ;; length of state section + DB ACUTE_LOWER ;; State ID + DW G_KB+AT_KB+XT_KB ;; Keyboard Type + DB 0EFH,0 ;; error character = standalone accent + DW CP850_AC_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 16,'' ;; a acute + DB 18,'' ;; e acute + DB 23,'' ;; i acute + DB 24,'' ;; o acute + DB 22,'' ;; u acute + DB 21,0ECH ;; y acute ADDED 12/16 CNS ********** +CP850_AC_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;***************************************** CNS P12 Addition ***************** +;***************************************** CNS P12 Addition ***************** +;; CODE PAGE: CP850 +;; STATE: Acute Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_UP_END-$ ;; length of state section + DB ACUTE_UPPER ;; State ID + DW G_KB+AT_KB+XT_KB ;; Keyboard Type + DB 0EFH,0 ;; error character = standalone accent + DW CP850_AC_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 16,0B5H ;; A acute + DB 18,090H ;; E acute + DB 23,0D6H ;; I acute + DB 24,0E0H ;; O acute + DB 22,0E9H ;; U acute + DB 21,0EDH ;; Y acute +CP850_AC_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_UP_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;***************************************** CNS P12 Addition ***************** +;***************************************** CNS P12 Addition ***************** +;; CODE PAGE: CP850 +;; STATE: Acute Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_SP_END-$ ;; length of state section + DB ACUTE_SPACE ;; State ID + DW G_KB+AT_KB+XT_KB ;; Keyboard Type + DB 0EFH,0 ;; error character = standalone accent + ;; + DW CP850_AC_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,0EFH ;; scan code,ASCII - SPACE +CP850_AC_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_SP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;***************************************** CNS P12 Addition ***************** +;***************************************** CNS P12 Addition ***************** +;; CODE PAGE: CP850 +;; STATE: Diaresis Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_LO_END-$ ;; length of state section + DB DIARESIS_LOWER ;; State ID + DW G_KB+AT_KB+XT_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW CP850_DI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 16,'' ;; scan code,ASCII - a + DB 24,'' ;; scan code,ASCII - o + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 21,'' ;; scan code,ASCII - y +CP850_DI_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_DI_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; +;***************************************** CNS P12 Addition ***************** +;***************************************** CNS P12 Addition ***************** +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + ;; + DW CP850_DI_UP_END-$ ;; length of state section + DB DIARESIS_UPPER ;; State ID + DW G_KB+AT_KB+XT_KB+P12_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW CP850_DI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 16,8EH ;; A di + DB 18,0D3H ;; E diaeresis + DB 23,0D8H ;; I diaeresis + DB 24,99H ;; O di + DB 22,9AH ;; U di +CP850_DI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_DI_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;***************************************** CNS P12 Addition ***************** +;***************************************** CNS P12 Addition ***************** +;; CODE PAGE: CP850 +;; STATE: Diaeresis Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_SP_END-$ ;; length of state section + DB DIARESIS_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 0FEH,0 ;; error character = standalone accent + ;; + DW CP850_DI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,0F9H ;; scan code,ASCII - SPACE +CP850_DI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_DI_SP_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;***************************************** CNS P12 Addition ***************** +;***************************************** CNS P12 Addition ***************** +;; CODE PAGE: 850 +;; STATE: Grave Upper +;; KEYBOARD TYPES: ALL +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_GR_UP_END-$ ;; length of state section + DB GRAVE_UPPER ;; State ID + DW G_KB+AT_KB+XT_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW CP850_GR_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 16,0B7H ;; A grave + DB 18,0D4H ;; E grave + DB 23,0DEH ;; I grave + DB 24,0E3H ;; O grave + DB 22,0EBH ;; U grave +CP850_GR_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_GR_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;***************************************** CNS P12 Addition ***************** +;***************************************** CNS P12 Addition ***************** +;; CODE PAGE: 850 +;; STATE: Circumflex Upper +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_CI_UP_END-$ ;; length of state section + DB CIRCUMFLEX_UPPER ;; State ID + DW G_KB+AT_KB+XT_KB ;; + DB 94,0 ;; error character = standalone accent + ;; + DW CP850_CI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 16,0B6H ;; A circumflex + DB 18,0D2H ;; E circumflex + DB 23,0D7H ;; I circumflex + DB 24,0E2H ;; O circumflex + DB 22,0EAH ;; U circumflex +CP850_CI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_CI_UP_END: ;; length of state section + ;; +;***************************************** CNS P12 Addition ***************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; CODE PAGE: 850 +;;;; STATE: Circumflex Upper +;;;; KEYBOARD TYPES: P12 +;;;;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_CI_UP_PEND-$ ;; length of state section + DB CIRCUMFLEX_UPPER ;; State ID + DW P12_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW CP850_CI_UP_T1_PEND-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 16,0B6H ;; A circumflex + DB 18,0D2H ;; E circumflex + DB 23,0D7H ;; I circumflex + DB 24,0E2H ;; O circumflex + DB 22,0EAH ;; U circumflex + CP850_CI_UP_T1_PEND: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; + CP850_CI_UP_PEND: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;***************************************** CNS P12 Addition ***************** + + DW 0 ;; LAST STATE +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CP850_XLAT_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CODE ENDS ;; + END ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/v4.0/src/DEV/KEYBOARD/KDFFR189.ASM b/v4.0/src/DEV/KEYBOARD/KDFFR189.ASM new file mode 100644 index 0000000..7648c5e --- /dev/null +++ b/v4.0/src/DEV/KEYBOARD/KDFFR189.ASM @@ -0,0 +1,1529 @@ +;; LATEST CHANGE ALT & CTL disenabled US invalids +;; Section symbol scan code incorrect +;; zero scan code tag deleted from end of tag field +;; Changed key #5 for the XT "/" instead of "'"..Pubs error +;; ****************** CNS 12/18/86************************* + + PAGE ,132 + TITLE DOS - Keyboard Definition File + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DOS - - NLS Support - Keyboard Defintion File +;; (c) Copyright 1988 Microsoft +;; +;; This file contains the keyboard tables for Spanish. +;; +;; Linkage Instructions: +;; Refer to KDF.ASM. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + INCLUDE KEYBSHAR.INC ;; + INCLUDE POSTEQU.INC ;; + INCLUDE KEYBMAC.INC ;; + ;; + PUBLIC FR2_LOGIC ;; + PUBLIC FR2_437_XLAT ;; + PUBLIC FR2_850_XLAT ;; + ;; +CODE SEGMENT PUBLIC 'CODE' ;; + ASSUME CS:CODE,DS:CODE ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Standard translate table options are a liner search table +;; (TYPE_2_TAB) and ASCII entries ONLY (ASCII_ONLY) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +STANDARD_TABLE EQU TYPE_2_TAB+ASCII_ONLY + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; FR State Logic +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +FR2_LOGIC: + + DW LOGIC_END-$ ;; length + ;; + DW TYPEWRITER_CAPS_LK ;; special features (shift lock state) + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; COMMANDS START HERE + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; OPTIONS: If we find a scan match in +;; an XLATT or SET_FLAG operation then +;; exit from INT 9. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + OPTION EXIT_IF_FOUND ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Dead key definitions must come before +;; dead key translations to handle +;; dead key + dead key. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + IFF EITHER_ALT,NOT ;; + ANDF EITHER_CTL,NOT ;; + IFF CAPS_STATE + SET_FLAG DEAD_UPPER + ELSEF + IFF EITHER_SHIFT ;; + SET_FLAG DEAD_UPPER ;; + ELSEF ;; + SET_FLAG DEAD_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ACUTE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +ACUTE_PROC: ;; + ;; + IFF ACUTE,NOT ;; + GOTO DIARESIS_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT ACUTE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT ACUTE_LOWER ;; + ELSEF ;; + XLATT ACUTE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT ACUTE_UPPER ;; + ELSEF ;; + XLATT ACUTE_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_ACUTE: ;; + PUT_ERROR_CHAR ACUTE_LOWER ;; If we get here then either the XLATT + BEEP ;; failed or we are ina bad shift state. + GOTO NON_DEAD ;; Either is invalid so BEEP and fall + ;; through to generate the second char. + ;; Note that the dead key flag will be + ;; reset before we get here. + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DIARESIS ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +DIARESIS_PROC: ;; + ;; + IFF DIARESIS,NOT ;; + GOTO GRAVE_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT DIARESIS_SPACE ;; exist for 437 so beep for + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_LOWER ;; + ELSEF ;; + XLATT DIARESIS_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_UPPER ;; + ELSEF ;; + XLATT DIARESIS_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_DIARESIS: ;; + PUT_ERROR_CHAR DIARESIS_SPACE ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; GRAVE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +GRAVE_PROC: ;; + ;; + IFF GRAVE,NOT ;; + GOTO CIRCUMFLEX_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT GRAVE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_GRAVE: ;; + PUT_ERROR_CHAR GRAVE_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CIRCUMFLEX ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CIRCUMFLEX_PROC: ;; + ;; + IFF CIRCUMFLEX,NOT ;; + GOTO NON_DEAD ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT CIRCUMFLEX_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_CIRCUMFLEX: ;; + PUT_ERROR_CHAR CIRCUMFLEX_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Upper, lower and third shifts +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +NON_DEAD: ;; + ;; + IFKBD G_KB+P12_KB ;; Avoid accidentally translating + ANDF LC_E0 ;; the "/" on the numeric pad of the + EXIT_STATE_LOGIC ;; G keyboard + ENDIFF ;; +;;***BD ADDED FOR ALT, CTRL CASES ;; + IFF EITHER_CTL,NOT ;; + IFF ALT_SHIFT ;; ALT - case + ANDF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_ALT,NOT ;; CTRL - case + XLATT CTRL_CASE ;; + ENDIFF ;; + ENDIFF ;; +;;***BD END OF ADDITION + ;; + IFF EITHER_ALT,NOT ;; Lower and upper case. Alphabetic + ANDF EITHER_CTL,NOT ;; keys are affected by CAPS LOCK. + IFF EITHER_SHIFT ;; Numeric keys are not. +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE,NOT ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION +; XLATT NON_ALPHA_UPPER ;; + IFF CAPS_STATE ;; + XLATT ALPHA_LOWER ;; + XLATT NON_ALPHA_LOWER ;; + ELSEF ;; + XLATT ALPHA_UPPER ;; + XLATT NON_ALPHA_UPPER ;; + ENDIFF ;; + ELSEF ;; +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION +; XLATT NON_ALPHA_LOWER ;; + IFF CAPS_STATE ;; + XLATT ALPHA_UPPER ;; + XLATT NON_ALPHA_UPPER ;; + ELSEF ;; + XLATT ALPHA_LOWER ;; + XLATT NON_ALPHA_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_SHIFT,NOT ;; + IFKBD XT_KB+AT_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_CTL,NOT ;; + ANDF R_ALT_SHIFT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; + EXIT_STATE_LOGIC ;; + ;; +LOGIC_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; ;; +;NON_DEAD: ;; +; ;; +; IFF EITHER_ALT,NOT ;; Lower and upper case. Alphabetic +; ANDF EITHER_CTL,NOT ;; keys are affected by CAPS LOCK. +; IFF EITHER_SHIFT ;; Numeric keys are not. +; XLATT NON_ALPHA_UPPER ;; +; IFF CAPS_STATE ;; +; XLATT ALPHA_LOWER ;; +; ELSEF ;; +; XLATT ALPHA_UPPER ;; +; ENDIFF ;; +; ELSEF ;; +; XLATT NON_ALPHA_LOWER ;; +; IFF CAPS_STATE ;; +; XLATT ALPHA_UPPER ;; +; ELSEF ;; +; XLATT ALPHA_LOWER ;; +; ENDIFF ;; +; ENDIFF ;; +; ELSEF ;; +; IFF EITHER_SHIFT,NOT ;; +; IFKBD XT_KB+AT_KB ;; +; IFF EITHER_CTL ;; +; ANDF ALT_SHIFT ;; +; XLATT THIRD_SHIFT ;; +; ENDIFF ;; +; ELSEF ;; +; IFF EITHER_CTL,NOT ;; +; ANDF R_ALT_SHIFT ;; +; XLATT THIRD_SHIFT ;; +; ENDIFF ;; +; ENDIFF ;; +; ENDIFF ;; +; ENDIFF ;; +; ;; +; EXIT_STATE_LOGIC ;; +; ;; +;LOGIC_END: ;; +; ;; +; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; FR Common Translate Section +;; This section contains translations for the lower 128 characters +;; only since these will never change from code page to code page. +;; In addition the dead key "Set Flag" tables are here since the +;; dead keys are on the same keytops for all code pages. +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC FR2_COMMON_XLAT ;; +FR2_COMMON_XLAT: ;; + ;; + DW COMMON_XLAT_END-$ ;; length of section + DW -1 ;; code page + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Lower Shift Dead Key +;; KEYBOARD TYPES: All +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_LO_END-$ ;; length of state section + DB DEAD_LOWER ;; State ID + DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 1 ;; number of entries + DB 26 ;; scan code + FLAG CIRCUMFLEX ;; flag bit to set +; DB 40 eliminate ;; +; FLAG ACUTE ;; + ;; + ;; +COM_DK_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Upper Shift Dead Key +;; KEYBOARD TYPES: All +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_UP_END-$ ;; length of state section + DB DEAD_UPPER ;; State ID + DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 1 ;; number of entries + DB 26 ;; scan code + FLAG DIARESIS ;; flag bit to set +; DB 40 eliminate ;; +; FLAG DIARESIS ;; + ;; +COM_DK_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;********************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift Dead Key +;; KEYBOARD TYPES: All +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ;; +;; DW COM_DK_TH_END-$ ;; length of state section +;; DB DEAD_THIRD ;; State ID +;; DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type +;; DB -1,-1 ;; Buffer entry for error character +;; ;; Set Flag Table +;; DW 1 ;; number of entries +;; DB 8 ;; scan code +;; FLAG GRAVE ;; flag bit to set +;; ;; +;;COM_DK_TH_END: ;; +;; ;; +;; ;; +;; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alt Case +;; KEYBOARD TYPES: G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_ALT_K1_END-$ ;; length of state section + DB ALT_CASE ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW COM_ALT_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; + DB 6 ;; 10 Number of entries +; DB 12,-1,-1 ;; invalid key U.S. alt - +; DB 13,-1,-1 ;; invalid key U.S. alt = +; DB 07,0,82H ;; alt - (minus sign) +; DB 13,0,83H ;; alt = (equal sign) + DB 16,0,1EH ;; A + DB 17,0,2CH ;; Z + DB 30,0,10H ;; Q + DB 39,0,32H ;; M + DB 44,0,11H ;; W + DB 50,-1,-1 ;; U.S. 'M' +COM_ALT_K1_T1_END: ;; + ;; + DW 0 ;; + ;; +COM_ALT_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: G_KB+P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K1_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW COM_CTRL_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; + DB 12 ;; Number of entries + DB 12,-1,-1 ;; + DB 07,30,07 ;; ctl + number six key + DB 12,29,12 ;; ctl + ] + DB 13,31,13 ;; + DB 16,01,16 ;; A + DB 17,26,17 ;; Z + DB 30,17,30 ;; Q + DB 39,13,39 ;; M + DB 43,-1,-1 ;; \ + DB 44,23,44 ;; W + DB 50,-1,-1 ;; U.S. 'M' + DB 9,28,9 ;; \ position (this is also the underscore position) +COM_CTRL_K1_T1_END: ;; + ;; + DW 0 ;; + ;; +COM_CTRL_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alt Case +;; KEYBOARD TYPES: AT + XT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_ALT_K2_END-$ ;; length of state section + DB ALT_CASE ;; State ID + DW AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW COM_ALT_K2_T2_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; + DB 6 ;; 9 Number of entries +; DB 12,-1,-1 ;; invalid key U.S. alt - +; DB 13,0,82H ;; alt - (minus sign) +; DB 53,0,83H ;; alt = (equal sign) + DB 16,0,1EH ;; A + DB 17,0,2CH ;; Z + DB 30,0,10H ;; Q + DB 39,0,32H ;; M + DB 44,0,11H ;; W + DB 50,-1,-1 ;; U.S. 'M' +COM_ALT_K2_T2_END: ;; + ;; + DW 0 ;; + ;; +COM_ALT_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K2_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW COM_CTRL_K2_T2_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; + DB 11 ;; Number of entries + DB 12,-1,-1 ;; invalid U.S. - + DB 43,-1,-1 ;; invalid U.S. \ + DB 41,28,41 ;; valid ctl + \ + DB 07,30,07 ;; ctl + number six key + DB 13,31,13 ;; ctl - or _ + DB 16,01,16 ;; A + DB 17,26,17 ;; Z + DB 30,17,30 ;; Q + DB 39,13,39 ;; M + DB 44,23,44 ;; W + DB 50,-1,-1 ;; U.S. 'M' +COM_CTRL_K2_T2_END: ;; + ;; + DW 0 ;; + ;; +COM_CTRL_K2_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: XT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K3_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW COM_CTRL_K3_T3_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; + DB 11 ;; Number of entries + DB 12,-1,-1 ;; + DB 43,-1,-1 ;; + DB 43,28,43 ;; valid ctl + \ + DB 07,30,07 ;; ctl + number six key + DB 13,31,13 ;; ctl - or _ + DB 16,01,16 ;; A + DB 17,26,17 ;; Z + DB 30,17,30 ;; Q + DB 39,13,39 ;; M + DB 44,23,44 ;; W + DB 50,-1,-1 ;; U.S. 'M' +COM_CTRL_K3_T3_END: ;; + ;; + DW 0 ;; + ;; +COM_CTRL_K3_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;****************************************************************************** +;; CODE PAGE: Common +;; STATE: Alpha Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AL_LO_END-$ ;; length of state section + DB ALPHA_LOWER ;; State ID + DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_AL_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 5 ;; number of entries + DB 16,'a' ;; small a + DB 17,'z' ;; small z + DB 30,'q' ;; small q + DB 39,'m' ;; small m + DB 44,'w' ;; small w +COM_AL_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AL_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alpha Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AL_UP_END-$ ;; length of state section + DB ALPHA_UPPER ;; State ID + DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_AL_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 5 ;; number of entries + DB 16,'A' ;; caps A + DB 17,'Z' ;; caps Z + DB 30,'Q' ;; caps Q + DB 39,'M' ;; caps M + DB 44,'W' ;; caps W +COM_AL_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AL_UP_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: G_KB+P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K1_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 21 ;; number of entries + DB 41,"" ;; superscript 2 + DB 2,"&" ;; + DB 3,"" ;; acute - e + DB 4,'"' ;; + DB 5,"'" ;; + DB 6,"(" ;; + DB 7,"-" ;; + DB 8,"" ;; grave - e + DB 9,"_" ;; + DB 10,"" ;; c - cedilla small + DB 11,"" ;; + DB 12,")" ;; + DB 13,"=" ;; + DB 27,"$" ;; + DB 40,"" ;; grave - u + DB 43,"*" ;; + DB 86,'<' ;; + + DB 50,',' ;; < + DB 51,';' ;; - + DB 52,':' ;; + DB 53,'!' ;; + +COM_NA_LO_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: AT_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K2_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_T1_K2_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 20 ;; number of entries + DB 2,"&" ;; + DB 3,"" ;; acute - e + DB 4,'"' ;; + DB 5,"'" ;; + DB 6,"(" ;; + DB 7,"-" ;; + DB 8,"" ;; grave - e + DB 9,"!" ;; + DB 10,"" ;; c - cedilla small + DB 11,"" ;; grave - a small + DB 12,")" ;; + DB 13,"-" ;; + DB 27,"$" ;; + DB 40,"" ;; grave small + DB 43,0E6H ;; mu symbol - + DB 41,'<' ;; + + DB 50,',' ;; < + DB 51,';' ;; - + DB 52,':' ;; + DB 53,'=' ;; + +COM_NA_LO_T1_K2_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: XT_KB+ +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K3_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_T1_K3_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 20 ;; number of entries + DB 2,"&" ;; + DB 3,"" ;; acute - e + DB 4,'"' ;; ' on the AT_KB + DB 5,"'" ;; *** CNS **** 12/18/86 pubs wrong + DB 6,"(" ;; + DB 7,"-" ;; + DB 8,"" ;; grave - e + DB 9,"!" ;; + DB 10,"" ;; c - cedilla small + DB 11,"" ;; + DB 12,")" ;; + DB 13,"-" ;; + DB 27,"$" ;; + DB 40,"" ;; grave small + DB 41,0E6H ;; mu symbol - + DB 43,'<' ;; + + DB 50,',' ;; < + DB 51,';' ;; - + DB 52,':' ;; + DB 53,'=' ;; +COM_NA_LO_T1_K3_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K3_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G_KB+P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 21 ;; number of entries + DB 2,'1' ;; + DB 3,'2' ;; + DB 4,'3' ;; + DB 5,'4' ;; + DB 6,'5' ;; + DB 7,'6' ;; + DB 8,'7' ;; + DB 9,'8' ;; + DB 10,'9' ;; + DB 11,'0' ;; + DB 12,0F8H ;; degree symbol + DB 13,"+" ;; plus sign + DB 27,09CH ;; symbol + DB 40,'%' ;; + DB 41,"" ;; superscript 3 + DB 43,0E6H ;; - mu symbol + DB 86,'>' ;; + DB 50,'?' ;; + DB 51,'.' ;; + DB 52,'/' ;; + DB 53,'+' ;; +COM_NA_UP_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K2_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_T1_K2_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 20 ;; number of entries + DB 2,'1' ;; + DB 3,'2' ;; + DB 4,'3' ;; + DB 5,'4' ;; + DB 6,'5' ;; + DB 7,'6' ;; + DB 8,'7' ;; + DB 9,'8' ;; + DB 10,'9' ;; + DB 11,'0' ;; + DB 12,0F8H ;; degree symbol + DB 13,"_" ;; underscore + DB 43,09CH ;; symbol + DB 40,'%' ;; + DB 27,"*" ;; asterisk + DB 41,'>' ;; + DB 50,'?' ;; + DB 51,'.' ;; + DB 52,'/' ;; + DB 53,'+' ;; +COM_NA_UP_T1_K2_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K2_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: XT_KB+ +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K3_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW XT_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_T1_K3_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 20 ;; number of entries + DB 2,'1' ;; + DB 3,'2' ;; + DB 4,'3' ;; + DB 5,'4' ;; + DB 6,'5' ;; + DB 7,'6' ;; + DB 8,'7' ;; + DB 9,'8' ;; + DB 10,'9' ;; + DB 11,'0' ;; + DB 12,0F8H ;; degree symbol + DB 13,"_" ;; underscore + DB 41,09CH ;; symbol + DB 40,'%' ;; + DB 27,"*" ;; asterisk + DB 43,'>' ;; + DB 50,'?' ;; + DB 51,'.' ;; + DB 52,'/' ;; + DB 53,'+' ;; +COM_NA_UP_T1_K3_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K3_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: G_KB +P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K1_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 11 ;; number of entries + DB 3,'~' ;; + DB 4,'#' ;; + DB 5,'{' ;; + DB 6,'[' ;; + DB 7,'|' ;; + DB 8,'`' ;; grave symbol not a dead key rep + DB 9,'\' ;; + DB 10,'^' ;; circumflex (caret) + DB 11,'@' ;; + DB 12,']' ;; + DB 13,'}' ;; +COM_THIRD_T1_K1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: AT_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K2_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_T1_K2_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 6 ;; number of entries + DB 4,'#' ;; + DB 26,'[' ;; + DB 27,']' ;; + DB 41,'\' ;; + DB 3,'@' ;; + DB 7,'^' ;; circumflex (caret) +COM_THIRD_T1_K2_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: XT_KB+ +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K3_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_T1_K3_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 6 ;; number of entries + DB 4,'#' ;; + DB 26,'[' ;; + DB 27,']' ;; + DB 43,'\' ;; + DB 3,'@' ;; + DB 7,'^' ;; circumflex (caret) +COM_THIRD_T1_K3_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K3_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Acute Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AC_LO_END-$ ;; length of state section + DB ACUTE_LOWER ;; State ID + DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW COM_AC_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 18,'' ;; scan code,ASCII - e +COM_AC_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AC_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Acute Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ;; +;; DW COM_AC_UP_END-$ ;; length of state section +;; DB ACUTE_UPPER ;; State ID +;; DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type +;; DB 39,0 ;; error character = standalone accent +;; ;; +;; DW COM_AC_UP_T1_END-$ ;; Size of xlat table +;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: +;; DB 2 ;; number of scans +;; DB 18,'' ;; scan code,ASCII - e +;;COM_AC_UP_T1_END: ;; +;; ;; +;; DW 0 ;; Size of xlat table - null table +;; ;; +;;COM_AC_UP_END: ;; +;; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Acute Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ;; +;; DW COM_AC_SP_END-$ ;; length of state section +;; DB ACUTE_SPACE ;; State ID +;; DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type +;; DB 39,0 ;; error character = standalone accent +;; ;; +;; DW COM_AC_SP_T1_END-$ ;; Size of xlat table +;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: +;; DB 1 ;; number of scans +;; DB 57,39 ;; scan code,ASCII - SPACE +;;COM_AC_SP_T1_END: ;; +;; ;; +;; DW 0 ;; Size of xlat table - null table +;; ;; +;;COM_AC_SP_END: ;; +;; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Diaresis Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DI_LO_END-$ ;; length of state section + DB DIARESIS_LOWER ;; State ID + DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW COM_DI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 16,'' ;; scan code,ASCII - a + DB 24,'' ;; scan code,ASCII - o + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 21,'' ;; scan code,ASCII - y +COM_DI_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_DI_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Diaresis Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DI_UP_END-$ ;; length of state section + DB DIARESIS_UPPER ;; State ID + DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW COM_DI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 3 ;; number of scans + DB 16,'' ;; scan code,ASCII - a + DB 24,'' ;; scan code,ASCII - o + DB 22,'' ;; scan code,ASCII - u +COM_DI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_DI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Diaresis Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DI_SP_END-$ ;; length of state section + DB DIARESIS_SPACE ;; State ID + DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW COM_DI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,249 ;; error character = standalone accent +COM_DI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table +COM_DI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ;; +;; DW COM_GR_LO_END-$ ;; length of state section +;; DB GRAVE_LOWER ;; State ID +;; DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type +;; DB 96,0 ;; error character = standalone accent +;; ;; +;; DW COM_GR_LO_T1_END-$ ;; Size of xlat table +;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: +;; DB 5 ;; number of scans +;; DB 18,'' ;; scan code,ASCII - e +;; DB 30,'' ;; scan code,ASCII - a +;; DB 24,'' ;; scan code,ASCII - o +;; DB 22,'' ;; scan code,ASCII - u +;; DB 23,'' ;; scan code,ASCII - i +;;COM_GR_LO_T1_END: ;; +;; ;; +;; DW 0 ;; Size of xlat table - null table +;; ;; +;;COM_GR_LO_END: ;; length of state section +;; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ;; +;; DW COM_GR_SP_END-$ ;; length of state section +;; DB GRAVE_SPACE ;; State ID +;; DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type +;; DB 96,0 ;; error character = standalone accent +;; ;; +;; DW COM_GR_SP_T1_END-$ ;; Size of xlat table +;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: +;; DB 1 ;; number of scans +;; DB 57,96 ;; STANDALONE GRAVE +;;COM_GR_SP_T1_END: ;; +;; ;; +;; DW 0 ;; Size of xlat table - null table +;; ;; +;;COM_GR_SP_END: ;; length of state section +;; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_LO_END-$ ;; length of state section + DB CIRCUMFLEX_LOWER ;; State ID + DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW COM_CI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 16,'' ;; scan code,ASCII - a + DB 18,'' ;; scan code,ASCII - e + DB 24,'' ;; scan code,ASCII - o + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i +COM_CI_LO_T1_END: ;; + ;; + DW 0 ;; + ;; +COM_CI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_SP_END-$ ;; length of state section + DB CIRCUMFLEX_SPACE ;; State ID + DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW COM_CI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,94 ;; STANDALONE CIRCUMFLEX +COM_CI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; Last State +COMMON_XLAT_END: ;; + ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; FR Specific Translate Section for 437 +;; 437 IS COMPLETELY COVERED BY THE COMMON TABLE. +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC FR2_437_XLAT ;; +FR2_437_XLAT: ;; + ;; + DW CP437_XLAT_END-$ ;; length of section + DW 437 ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G_KB+ p12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; default ignore error state + ;; + DW CP437_NA_UP_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: **** CNS 12/18 + DB 1 ;; number of scans + DB 53,015H ;; Section symbol -  +CP437_NA_UP_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_NA_UP_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: AT + XT + +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_NA_LO_K1_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; default ignore error state + ;; + DW CP437_NA_LO_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: **** CNS 12/18 + DB 1 ;; number of scans + DB 7,015H ;; Section symbol -  +CP437_NA_LO_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_NA_LO_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 ???????????????????May need change.... +;; STATE: Third Shift +;; KEYBOARD TYPES: G_KB+P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_THIRD_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; default ignore error state + ;; + DW CP437_THIRD_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: *** CNS 12/18 + DB 1 ;; number of scans + DB 27,'$' ;; dollar currency symbol +CP437_THIRD_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_THIRD_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; LAST STATE + ;; +CP437_XLAT_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; FR Specific Translate Section for 850 +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC FR2_850_XLAT ;; +FR2_850_XLAT: ;; + ;; + DW CP850_XLAT_END-$ ;; length of section + DW 850 ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G_KB + P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; default ignore error state + ;; + DW CP850_NA_UP_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: ***** CNS 12/18 + DB 1 ;; number of scans + DB 53,0F5H ;; Section symbol -  +CP850_NA_UP_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_NA_UP_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: AT_KB+XT+ +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_NA_LO_K1_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; default ignore error state + ;; + DW CP850_NA_LO_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: ***** CNS **** 12/18 + DB 1 ;; number of scans + DB 7,0F5H ;; Section symbol -  +CP850_NA_LO_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_NA_LO_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Third Shift +;; KEYBOARD TYPES: G_KB+P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_THIRD_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; default ignore error state + ;; + DW CP850_THIRD_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: *** CNS 12/18 + DB 1 ;; number of scans + DB 27,0CFH ;; international currency symbol +CP850_THIRD_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_THIRD_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Acute Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ;; +;; DW CP850_AC_LO_END-$ ;; length of state section +;; DB ACUTE_LOWER ;; State ID +;; DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type +;; DB 39,0 ;; error character = standalone accent +;; ;; +;; DW CP850_AC_LO_T1_END-$ ;; Size of xlat table +;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: +;; DB 1 ;; number of scans +;; DB 21,0ECH ;; y acute +;;CP850_AC_LO_T1_END: ;; +;; ;; +;; DW 0 ;; Size of xlat table - null table +;; ;; +;;CP850_AC_LO_END: ;; +;; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; CODE PAGE: 850 +;;;; STATE: Acute Upper Case +;;;; KEYBOARD TYPES: All +;;;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ;; +;; DW CP850_AC_UP_END-$ ;; length of state section +;; DB ACUTE_UPPER ;; State ID +;; DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type +;; DB 39,0 ;; error character = standalone accent +;; ;; +;; DW CP850_AC_UP_T1_END-$ ;; Size of xlat table +;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: +;; DB 5 ;; number of scans +;; DB 30,0B5H ;; A acute +;; DB 23,0D6H ;; I acute +;; DB 24,0E0H ;; O acute +;; DB 22,0E9H ;; U acute +;; DB 21,0EDH ;; Y acute +;;CP850_AC_UP_T1_END: ;; +;; ;; +;; DW 0 ;; Size of xlat table - null table +;; ;; +;;CP850_AC_UP_END: ;; +;; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; CODE PAGE: 850 +;;;; STATE: Diaresis Upper +;;;; KEYBOARD TYPES: All +;;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_UP_END-$ ;; length of state section + DB DIARESIS_UPPER ;; State ID + DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW CP850_DI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 2 ;; number of scans + DB 18,0D3H ;; E diaeresis + DB 23,0D8H ;; I diaeresis + CP850_DI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; + CP850_DI_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; CODE PAGE: 850 +;; STATE: Grave Upper +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ;; +;; DW CP850_GR_UP_END-$ ;; length of state section +;; DB GRAVE_UPPER ;; State ID +;; DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type +;; DB 96,0 ;; error character = standalone accent +;; ;; +;; DW CP850_GR_UP_T1_END-$ ;; Size of xlat table +;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: +;; DB 5 ;; number of scans +;; DB 30,0B7H ;; A grave +;; DB 18,0D4H ;; E grave +;; DB 23,0DEH ;; I grave +;; DB 24,0E3H ;; O grave +;; DB 22,0EBH ;; U grave +;;CP850_GR_UP_T1_END: ;; +;; ;; +;; DW 0 ;; Size of xlat table - null table +;; ;; +;;CP850_GR_UP_END: ;; length of state section +;; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; CODE PAGE: 850 +;;;; STATE: Circumflex Upper +;;;; KEYBOARD TYPES: All +;;;;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_CI_UP_END-$ ;; length of state section + DB CIRCUMFLEX_UPPER ;; State ID + DW G_KB+P12_KB+AT_KB+XT_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW CP850_CI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 16,0B6H ;; A circumflex + DB 18,0D2H ;; E circumflex + DB 23,0D7H ;; I circumflex + DB 24,0E2H ;; O circumflex + DB 22,0EAH ;; U circumflex + CP850_CI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; + CP850_CI_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW 0 ;; LAST STATE + ;; +CP850_XLAT_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CODE ENDS ;; + END ;; diff --git a/v4.0/src/DEV/KEYBOARD/KDFGE.ASM b/v4.0/src/DEV/KEYBOARD/KDFGE.ASM new file mode 100644 index 0000000..a244c28 --- /dev/null +++ b/v4.0/src/DEV/KEYBOARD/KDFGE.ASM @@ -0,0 +1,1333 @@ +;; LATEST CHANGE ALT & CTL "Z & Y", "-" symbol (AT) +;; Eliminated zero scan tag from alpha upper CP section +;; SECTION SYMBOL +;; SCAN CODE OUTPUT CHANGES MADE 12/18/86 +;; **************** CNS ************************ + PAGE ,132 + TITLE DOS - Keyboard Definition File + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DOS - - NLS Support - Keyboard Defintion File +;; (c) Copyright 1988 Microsoft +;; +;; This file contains the keyboard tables for Spanish. +;; +;; Linkage Instructions: +;; Refer to KDF.ASM. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + INCLUDE KEYBSHAR.INC ;; + INCLUDE POSTEQU.INC ;; + INCLUDE KEYBMAC.INC ;; + ;; + PUBLIC GE_LOGIC ;; + PUBLIC GE_437_XLAT ;; + PUBLIC GE_850_XLAT ;; + ;; +CODE SEGMENT PUBLIC 'CODE' ;; + ASSUME CS:CODE,DS:CODE ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Standard translate table options are a liner search table +;; (TYPE_2_TAB) and ASCII entries ONLY (ASCII_ONLY) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +STANDARD_TABLE EQU TYPE_2_TAB+ASCII_ONLY + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; GE State Logic +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +GE_LOGIC: + + DW LOGIC_END-$ ;; length + ;; + DW TYPEWRITER_CAPS_LK ;; special features (shift lock state) + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; COMMANDS START HERE + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; OPTIONS: If we find a scan match in +;; an XLATT or SET_FLAG operation then +;; exit from INT 9. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + OPTION EXIT_IF_FOUND ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Dead key definitions must come before +;; dead key translations to handle +;; dead key + dead key. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + IFF EITHER_ALT,NOT ;; + ANDF EITHER_CTL,NOT ;; + IFKBD G_KB+P12_KB ;; FUNCTIONS AS A SHIFT LOCK + IFF CAPS_STATE ;; + ANDF EITHER_SHIFT ;; + SET_FLAG DEAD_LOWER ;; + ELSEF + IFF CAPS_STATE ;; + SET_FLAG DEAD_UPPER ;; + ELSEF + IFF EITHER_SHIFT ;; + SET_FLAG DEAD_UPPER ;; + ELSEF + SET_FLAG DEAD_LOWER ;; NORMAL STATE LC + ENDIFF ;; SHIFT OR NORMAL CHECK END + ENDIFF ;; CAPS OR SHIFT CHECK END + ENDIFF ;; BOTH SHIFT LOCK AND CAPS END + ELSEF ;; + IFF CAPS_STATE ;; THIS MEANS IT IS A at OR xt + ANDF EITHER_SHIFT + SET_FLAG DEAD_UPPER + ELSEF + IFF CAPS_STATE ;; + SET_FLAG DEAD_LOWER ;; + ELSEF + IFF EITHER_SHIFT ;; + SET_FLAG DEAD_UPPER ;; + ELSEF + SET_FLAG DEAD_LOWER ;; NORMAL STATE LC + ENDIFF ;; SHIFT OR NORMAL CHECK END + ENDIFF ;; CAPS OR SHIFT CHECK END + ENDIFF ;; BOTH SHIFT LOCK AND CAPS END ;; + ENDIFF ;; IS IT ENHANCED OR NOT END + ENDIFF ;; NO CONTROL OR ALT END + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ACUTE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +ACUTE_PROC: ;; + ;; + IFF ACUTE,NOT ;; + GOTO DIARESIS_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT ACUTE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT ACUTE_LOWER ;; + ELSEF ;; + XLATT ACUTE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT ACUTE_UPPER ;; + ELSEF ;; + XLATT ACUTE_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_ACUTE: ;; + PUT_ERROR_CHAR ACUTE_LOWER ;; If we get here then either the XLATT + BEEP ;; failed or we are ina bad shift state. + GOTO NON_DEAD ;; Either is invalid so BEEP and fall + ;; through to generate the second char. + ;; Note that the dead key flag will be + ;; reset before we get here. + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DIARESIS ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +DIARESIS_PROC: ;; + ;; + IFF DIARESIS,NOT ;; + GOTO GRAVE_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT DIARESIS_SPACE ;; exist for 437 so beep for + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_LOWER ;; + ELSEF ;; + XLATT DIARESIS_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_UPPER ;; + ELSEF ;; + XLATT DIARESIS_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_DIARESIS: ;; + PUT_ERROR_CHAR DIARESIS_SPACE ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; GRAVE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +GRAVE_PROC: ;; + ;; + IFF GRAVE,NOT ;; + GOTO CIRCUMFLEX_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT GRAVE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_GRAVE: ;; + PUT_ERROR_CHAR GRAVE_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CIRCUMFLEX ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CIRCUMFLEX_PROC: ;; + ;; + IFF CIRCUMFLEX,NOT ;; + GOTO NON_DEAD ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT CIRCUMFLEX_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_CIRCUMFLEX: ;; + PUT_ERROR_CHAR CIRCUMFLEX_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Upper, lower and third shifts +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +NON_DEAD: ;; + ;; + IFKBD G_KB+P12_KB ;; Avoid accidentally translating + ANDF LC_E0 ;; the "/" on the numeric pad of the + EXIT_STATE_LOGIC ;; G keyboard + ENDIFF ;; +;;***BD ADDED FOR ALT, CTRL CASES ;; + IFF EITHER_CTL,NOT ;; + IFF ALT_SHIFT ;; ALT - case + ANDF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_ALT,NOT ;; CTRL - case + XLATT CTRL_CASE ;; + ENDIFF ;; + ENDIFF ;; +;;***BD END OF ADDITION + ;; + IFF EITHER_ALT,NOT ;; Lower and upper case. Alphabetic + ANDF EITHER_CTL,NOT ;; keys are affected by CAPS LOCK. + IFF EITHER_SHIFT ;; Numeric keys are not. +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE,NOT ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION +; XLATT NON_ALPHA_UPPER ;; add in keyboard logic + IFKBD G_KB+P12_KB ;; SHIFT STATE ONLY FOR P12 & G + IFF CAPS_STATE ;; for AT and XT + XLATT ALPHA_LOWER ;; + XLATT NON_ALPHA_LOWER ;; + ELSEF ;; + XLATT ALPHA_UPPER ;;THIS MEANS normal SHIFT STATE + XLATT NON_ALPHA_UPPER ;;FOR G AND P12 + ENDIFF ;; + ELSEF + IFF CAPS_STATE ;; for AT and XT + XLATT ALPHA_LOWER ;; shift state & caps + XLATT NON_ALPHA_UPPER ;; + ELSEF ;; + XLATT ALPHA_UPPER ;; shift state & no caps + XLATT NON_ALPHA_UPPER ;; + ENDIFF ;; + ENDIFF + ELSEF ;; SHIFT STATE DOES NOT EXIST +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION +;; XLATT NON_ALPHA_LOWER ;; + IFKBD G_KB+P12_KB ;; G & p12 NO shift state + IFF CAPS_STATE ;; + XLATT ALPHA_UPPER ;; + XLATT NON_ALPHA_UPPER ;; + ELSEF ;; + XLATT ALPHA_LOWER ;; + XLATT NON_ALPHA_LOWER ;; + ENDIFF ;; + ELSEF ;;AT & XT WITH NO SHIFT + IFF CAPS_STATE ;; + XLATT ALPHA_UPPER ;; + XLATT NON_ALPHA_LOWER ;; + ELSEF ;; + XLATT ALPHA_LOWER ;; + XLATT NON_ALPHA_LOWER ;; + ENDIFF ;; + ENDIFF + ENDIFF ;; + ELSEF ;; + IFF EITHER_SHIFT,NOT ;; + IFKBD XT_KB+AT_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_CTL,NOT ;; + ANDF R_ALT_SHIFT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; + EXIT_STATE_LOGIC ;; + ;; +LOGIC_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; GE Common Translate Section +;; This section contains translations for the lower 128 characters +;; only since these will never change from code page to code page. +;; In addition the dead key "Set Flag" tables are here since the +;; dead keys are on the same keytops for all code pages. +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC GE_COMMON_XLAT ;; +GE_COMMON_XLAT: ;; + ;; + DW COMMON_XLAT_END-$ ;; length of section + DW -1 ;; code page + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Lower Shift Dead Key +;; KEYBOARD TYPES: All +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_LO_END-$ ;; length of state section + DB DEAD_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 1 ;; number of entries + DB 13 ;; scan code + FLAG ACUTE ;; flag bit to set + ;; + ;; +COM_DK_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Upper Shift Dead Key +;; KEYBOARD TYPES: All +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_UP_END-$ ;; length of state section + DB DEAD_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 1 ;; number of entries + DB 13 ;; scan code + FLAG GRAVE ;; flag bit to set +COM_DK_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alt Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_ALT_K1_END-$ ;; length of state section + DB ALT_CASE ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_ALT_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 2 ;; 5 number of entries +;;***BD THIS ENTRY IS A TEST ENTRY +;; DB 53,225,0 ;; TEST ENTRY - switch two keys +; DB 12,-1,-1 ;; invalid key U.S. - +; DB 13,-1,-1 ;; invalid key U.S. = + DB 21,0,44 ;; alt z function + DB 44,0,21 ;; alt y function +; DB 53,0,82H ;; alt - (minus sign) +COM_ALT_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_ALT_K1_END: ;; + ;; +;;****************************** +;;***BD - ADDED FOR CTRL CASE +;;****************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K1_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_CTRL_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 5 ;; number of entries +;;***BD THIS ENTRY IS A TEST ENTRY +;; DB 53,226,0 ;; TEST ENTRY + DB 43,-1,-1 ;; no backslash + DB 53,31,53 ;; ctl + - or _ + DB 21,1AH,21 ;; ctl z function + DB 44,19h,44 ;; ctl y function + DB 12,28,12 ;; \ position +COM_CTRL_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CTRL_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K2_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_CTRL_K2_T2_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 6 ;; number of entries +;;***BD THIS ENTRY IS A TEST ENTRY +;; DB 53,226,0 ;; TEST ENTRY + DB 12,-1,-1 ;; invalid key U.S. - + DB 43,-1,-1 ;; no backslash + DB 53,31,53 ;; ctl + - or _ + DB 21,1AH,21 ;; ctl z function + DB 44,19h,44 ;; ctl y function + DB 41,28,41 ;; \ position +COM_CTRL_K2_T2_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CTRL_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: XT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K3_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_CTRL_K3_T3_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 6 ;; number of entries +;;***BD THIS ENTRY IS A TEST ENTRY +;; DB 53,226,0 ;; TEST ENTRY + DB 43,-1,-1 ;; no backslash + DB 12,-1,-1 ;; invalid key U.S. - + DB 53,31,53 ;; ctl + - or _ + DB 21,1AH,21 ;; ctl z function + DB 44,19h,44 ;; ctl y function + DB 43,28,43 ;; \ position +COM_CTRL_K3_T3_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CTRL_K3_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alpha Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AL_LO_END-$ ;; length of state section + DB ALPHA_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_AL_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 5 ;; number of entries + DB 26,081h ;; diaresis - + DB 39,094h ;; diaresis - + DB 40,084h ;; diaresis - + DB 44,'y' ;; + DB 21,'z' ;; ;; +COM_AL_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AL_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alpha Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AL_UP_END-$ ;; length of state section + DB ALPHA_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_AL_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 5 ;; number of entries + DB 26,09AH ;; Diaresis - + DB 39,099H ;; Diaresis - + DB 40,08EH ;; Diaresis - + DB 44,'Y' ;; + DB 21,'Z' ;; +COM_AL_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AL_UP_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;****************************** +;;***BD - ADDED FOR NUMERIC PAD (DECIMAL SEPERATOR) +;;****************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Numeric Key Pad ;;**********CNS****************** +;; KEYBOARD TYPES: G_KB ;;change does not apply to P12 +;; TABLE TYPE: Translate ;;P12 Key #54 has a comma available +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_PAD_K1_END-$ ;; length of state section + DB NUMERIC_PAD ;; State ID + DW G_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_PAD_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 83,44 ;; decimal seperator = , +COM_PAD_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_PAD_K1_END: ;; + ;; +;;****************************** +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: G_KB + P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K1_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 18 ;; number of entries + DB 41,'^' ;; + DB 2,'1' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 3,'2' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 4,'3' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 5,'4' ;; + DB 6,'5' ;; + DB 7,'6' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 8,'7' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 9,'8' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 10,'9' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 11,'0' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 12,0E1H ;; + DB 27,'+' ;; + DB 43,'#' ;; pound sign + DB 86,'<' ;; + DB 51,',' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 52,'.' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 53,'-' ;; +COM_NA_LO_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: AT_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K2_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K2_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 17 ;; number of entries + DB 41,'<' ;; different than enhanced + DB 2,'1' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 3,'2' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 4,'3' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 5,'4' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 6,'5' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 7,'6' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 8,'7' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 9,'8' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 10,'9' ;; + DB 11,'0' ;; + DB 12,0E1H ;; + DB 27,'+' ;; + DB 43,'#' ;; pound sign + DB 51,',' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 52,'.' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 53,'-' ;; +COM_NA_LO_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: XT_KB+ +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K3_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K3_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 17 ;; number of entries + DB 2,'1' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 3,'2' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 4,'3' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 5,'4' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 6,'5' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 7,'6' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 8,'7' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 9,'8' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 10,'9' ;; + DB 11,'0' ;; + DB 12,0E1H ;; + DB 27,'+' ;; + DB 41,'#' ;; pound sign + DB 43,'<' ;; + DB 51,',' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 52,'.' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 53,'-' ;; +COM_NA_LO_K3_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K3_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G_KB+P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 17 ;; number of entries + DB 41,0F8H ;; + DB 3,'"' ;; + DB 2,'!' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 5,'$' ;; + DB 6,'%' ;; + DB 7,'&' ;; + DB 8,'/' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,'=' ;; + DB 12,'?' ;; + DB 27,'*' ;; + DB 43,"'" ;; + DB 86,'>' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'_' ;; + +COM_NA_UP_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: AT_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K2_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_K2_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 16 ;; number of entries + DB 41,'>' ;; + DB 3,'"' ;; + DB 2,'!' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 5,'$' ;; + DB 6,'%' ;; + DB 7,'&' ;; + DB 8,'/' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,'=' ;; + DB 12,'?' ;; + DB 27,'*' ;; + DB 43,"^" ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'_' ;; + +COM_NA_UP_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K2_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: XT_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K3_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_K3_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 16 ;; number of entries + DB 3,'"' ;; + DB 2,'!' ;;IMPLEMENTED FOR SHIFT STATE STATUS + DB 5,'$' ;; + DB 6,'%' ;; + DB 7,'&' ;; + DB 8,'/' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,'=' ;; + DB 12,'?' ;; + DB 27,'*' ;; + DB 41,"^" ;; + DB 43,'>' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'_' ;; + +COM_NA_UP_K3_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K3_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: G_KB+P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K1_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 11 ;; number of entries + DB 3,0FDH ;; + DB 4,0FCH ;; - converted to script 3 in Germany + DB 8,'{' ;; + DB 9,'[' ;; + DB 10,']' ;; + DB 11,'}' ;; + DB 12,'\' ;; + DB 16,'@' ;; + DB 27,07EH ;; Tilde - ~ + DB 86,07CH ;; Solid vertical bar + DB 50,0E6H ;; - mu symbol +COM_THIRD_K1_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: AT_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K2_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_K2_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 4 ;; number of entries + DB 26,'[' ;; + DB 27,']' ;; + DB 41,'\' ;; + DB 3,'@' ;; +COM_THIRD_K2_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: XT_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K3_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_K3_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 4 ;; number of entries + DB 26,'[' ;; + DB 27,']' ;; + DB 43,'\' ;; + DB 3,'@' ;; +COM_THIRD_K3_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K3_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Acute Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; ;; +; DW COM_AC_LO_END-$ ;; length of state section +; DB ACUTE_LOWER ;; State ID +; DW ANY_KB ;; Keyboard Type +; DB 39,0 ;; error character = standalone accent +; ;; +; DW COM_AC_LO_T1_END-$ ;; Size of xlat table +; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: +; DB 5 ;; number of scans +; DB 18,'' ;; scan code,ASCII - e +; DB 30,'' ;; scan code,ASCII - a +; DB 24,'' ;; scan code,ASCII - o +; DB 22,'' ;; scan code,ASCII - u +; DB 23,'' ;; scan code,ASCII - i +;COM_AC_LO_T1_END: ;; +; ;; +; DW 0 ;; Size of xlat table - null table +; ;; +;COM_AC_LO_END: ;; +; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; CODE PAGE: Common +;;; STATE: Acute Upper Case +;;; KEYBOARD TYPES: All +;;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; ;; +; DW COM_AC_UP_END-$ ;; length of state section +; DB ACUTE_UPPER ;; State ID +; DW ANY_KB ;; Keyboard Type +; DB 39,0 ;; error character = standalone accent +; ;; +; DW COM_AC_UP_T1_END-$ ;; Size of xlat table +; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: +; DB 1 ;; number of scans +; DB 18,'' ;; scan code,ASCII - e +;COM_AC_UP_T1_END: ;; +; ;; +; DW 0 ;; Size of xlat table - null table +; ;; +;COM_AC_UP_END: ;; +; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; CODE PAGE: Common +;;; STATE: Acute Space Bar +;;; KEYBOARD TYPES: All +;;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; ;; +; DW COM_AC_SP_END-$ ;; length of state section +; DB ACUTE_SPACE ;; State ID +; DW ANY_KB ;; Keyboard Type +; DB 39,0 ;; error character = standalone accent +; ;; +; DW COM_AC_SP_T1_END-$ ;; Size of xlat table +; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: +; DB 1 ;; number of scans +; DB 57,39 ;; scan code,ASCII - SPACE +;COM_AC_SP_T1_END: ;; +; ;; +; DW 0 ;; Size of xlat table - null table +; ;; +;COM_AC_SP_END: ;; +;; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_GR_LO_END-$ ;; length of state section + DB GRAVE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW COM_GR_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 30,'' ;; scan code,ASCII - a + DB 24,'' ;; scan code,ASCII - o + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i +COM_GR_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_GR_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_GR_SP_END-$ ;; length of state section + DB GRAVE_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW COM_GR_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,96 ;; STANDALONE GRAVE +COM_GR_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_GR_SP_END: ;; length of state section +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; Last State +COMMON_XLAT_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; GE Specific Translate Section for 437 +;; 437 IS COMPLETELY COVERED BY THE COMMON TABLE. +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC GE_437_XLAT ;; +GE_437_XLAT: ;; + ;; + DW CP437_XLAT_END-$ ;; length of section + DW 437 ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; eliminated !!!! + DW CP437_NA_LO_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; error character = standalone accent + ;; + DW CP437_NA_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 0 ;; number of scans +CP437_NA_LO_T1_END: ;; + ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_NA_LO_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_NA_UP_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; error character = standalone accent + ;; + DW CP437_NA_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: ***** CNS 12/18 + DB 1 ;; number of scans + DB 4,015H ;;  - Section symbol +CP437_NA_UP_T1_END: ;; + ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_NA_UP_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Acute Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_AC_LO_END-$ ;; length of state section + DB ACUTE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW CP437_AC_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 30,'' ;; scan code,ASCII - a + DB 24,'' ;; scan code,ASCII - o + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + CP437_AC_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_AC_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Acute Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_AC_UP_END-$ ;; length of state section + DB ACUTE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW CP437_AC_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 18,'' ;; scan code,ASCII - e +CP437_AC_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_AC_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Acute Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_AC_SP_END-$ ;; length of state section + DB ACUTE_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW CP437_AC_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,39 ;; scan code,ASCII - SPACE +CP437_AC_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_AC_SP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW 0 ;; LAST STATE + ;; +CP437_XLAT_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; GE Specific Translate Section for 850 +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC GE_850_XLAT ;; +GE_850_XLAT: ;; + ;; + DW CP850_XLAT_END-$ ;; length of section + DW 850 ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_NA_LO_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; error character = standalone accent + ;; + DW CP850_NA_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 0 ;; number of scans +CP850_NA_LO_T1_END: ;; + ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_NA_LO_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_NA_UP_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; error character = standalone accent + ;; + DW CP850_NA_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: **** CNS 12/18 + DB 1 ;; number of scans + DB 4,0F5H ;;  - Section symbol + ;; +CP850_NA_UP_T1_END: ;; + ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_NA_UP_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Acute Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_LO_END-$ ;; length of state section + DB ACUTE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 0eFh,0 ;; error character = standalone accent + ;; + DW CP850_AC_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 30,'' ;; scan code,ASCII - a + DB 24,'' ;; scan code,ASCII - o + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + CP850_AC_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Acute Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_UP_END-$ ;; length of state section + DB ACUTE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 0efh,0 ;; error character = standalone accent + ;; + DW CP850_AC_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 30,0B5H ;; Caps acute A + DB 23,0D6H ;; Caps acute I + DB 24,0E0H ;; Caps acute O + DB 22,0E9H ;; Caps acute U + DB 18,'' ;; scan code,ASCII - e +CP850_AC_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Acute Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_SP_END-$ ;; length of state section + DB ACUTE_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 0efh,0 ;; error character = standalone accent + ;; + DW CP850_AC_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,0efh ;; scan code,ASCII - SPACE +CP850_AC_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_SP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Grave Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_GR_UP_END-$ ;; length of state section + DB GRAVE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; error character = standalone accent + ;; + DW CP850_GR_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 30,0B7H ;; Caps grave A + DB 18,0D4H ;; Caps grave E + DB 23,0DEH ;; Caps grave I + DB 24,0E3H ;; Caps grave O + DB 22,0EBH ;; Caps grave U + ;; +CP850_GR_UP_T1_END: ;; + ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_GR_UP_END: ;; + ;; + DW 0 ;; LAST STATE + ;; +CP850_XLAT_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +CODE ENDS ;; + END ;; diff --git a/v4.0/src/DEV/KEYBOARD/KDFIT.ASM b/v4.0/src/DEV/KEYBOARD/KDFIT.ASM new file mode 100644 index 0000000..c29b453 --- /dev/null +++ b/v4.0/src/DEV/KEYBOARD/KDFIT.ASM @@ -0,0 +1,794 @@ +;; LATEST CHANGE ALT & CTL + + + + PAGE ,132 + TITLE DOS - Keyboard Definition File + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DOS - - NLS Support - Keyboard Defintion File +;; (c) Copyright 1988 Microsoft +;; +;; This file contains the keyboard tables for Spanish. +;; +;; Linkage Instructions: +;; Refer to KDF.ASM. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + INCLUDE KEYBSHAR.INC ;; + INCLUDE POSTEQU.INC ;; + INCLUDE KEYBMAC.INC ;; + ;; + PUBLIC IT_LOGIC ;; + PUBLIC IT_437_XLAT ;; + PUBLIC IT_850_XLAT ;; + ;; +CODE SEGMENT PUBLIC 'CODE' ;; + ASSUME CS:CODE,DS:CODE ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Standard translate table options are a liner search table +;; (TYPE_2_TAB) and ASCII entries ONLY (ASCII_ONLY) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +STANDARD_TABLE EQU TYPE_2_TAB+ASCII_ONLY + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; IT State Logic +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +IT_LOGIC: + + DW LOGIC_END-$ ;; length + ;; + DW 0 ;; special features + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; COMMANDS START HERE + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; OPTIONS: If we find a scan match in +;; an XLATT or SET_FLAG operation then +;; exit from INT 9. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + OPTION EXIT_IF_FOUND ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Dead key definitions must come before +;; dead key translations to handle +;; dead key + dead key. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + IFF EITHER_ALT,NOT ;; + ANDF EITHER_CTL,NOT ;; + IFF EITHER_SHIFT ;; + SET_FLAG DEAD_UPPER ;; + ELSEF ;; + SET_FLAG DEAD_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ACUTE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +ACUTE_PROC: ;; + ;; + IFF ACUTE,NOT ;; + GOTO DIARESIS_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT ACUTE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT ACUTE_LOWER ;; + ELSEF ;; + XLATT ACUTE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT ACUTE_UPPER ;; + ELSEF ;; + XLATT ACUTE_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_ACUTE: ;; + PUT_ERROR_CHAR ACUTE_LOWER ;; If we get here then either the XLATT + BEEP ;; failed or we are ina bad shift state. + GOTO NON_DEAD ;; Either is invalid so BEEP and fall + ;; through to generate the second char. + ;; Note that the dead key flag will be + ;; reset before we get here. + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DIARESIS ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +DIARESIS_PROC: ;; + ;; + IFF DIARESIS,NOT ;; + GOTO GRAVE_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT DIARESIS_SPACE ;; exist for 437 so beep for + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_LOWER ;; + ELSEF ;; + XLATT DIARESIS_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_UPPER ;; + ELSEF ;; + XLATT DIARESIS_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_DIARESIS: ;; + PUT_ERROR_CHAR DIARESIS_SPACE ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; GRAVE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +GRAVE_PROC: ;; + ;; + IFF GRAVE,NOT ;; + GOTO CIRCUMFLEX_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT GRAVE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_GRAVE: ;; + PUT_ERROR_CHAR GRAVE_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CIRCUMFLEX ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CIRCUMFLEX_PROC: ;; + ;; + IFF CIRCUMFLEX,NOT ;; + GOTO NON_DEAD ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT CIRCUMFLEX_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_CIRCUMFLEX: ;; + PUT_ERROR_CHAR CIRCUMFLEX_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Upper, lower and third shifts +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +NON_DEAD: ;; + ;; + IFKBD G_KB+P12_KB ;; Avoid accidentally translating + ANDF LC_E0 ;; the "/" on the numeric pad of the + EXIT_STATE_LOGIC ;; G keyboard + ENDIFF ;; +;;***BD ADDED FOR ALT, CTRL CASES ;; + IFF EITHER_CTL,NOT ;; + IFF ALT_SHIFT ;; ALT - case + ANDF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_ALT,NOT ;; CTRL - case + XLATT CTRL_CASE ;; + ENDIFF ;; + ENDIFF ;; +;;***BD END OF ADDITION + ;; + IFF EITHER_ALT,NOT ;; Lower and upper case. Alphabetic + ANDF EITHER_CTL,NOT ;; keys are affected by CAPS LOCK. + IFF EITHER_SHIFT ;; Numeric keys are not. +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE,NOT ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION + XLATT NON_ALPHA_UPPER ;; + IFF CAPS_STATE ;; + XLATT ALPHA_LOWER ;; + ELSEF ;; + XLATT ALPHA_UPPER ;; + ENDIFF ;; + ELSEF ;; +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION + XLATT NON_ALPHA_LOWER ;; + IFF CAPS_STATE ;; + XLATT ALPHA_UPPER ;; + ELSEF ;; + XLATT ALPHA_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_SHIFT,NOT ;; + IFKBD XT_KB+AT_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_CTL,NOT ;; + ANDF R_ALT_SHIFT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; + EXIT_STATE_LOGIC ;; + ;; +LOGIC_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;*************************************** +;; IT Common Translate Section +;; This section contains translations for the lower 128 characters +;; only since these will never change from code page to code page. +;; In addition the dead key "Set Flag" tables are here since the +;; dead keys are on the same keytops for all code pages. +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC IT_COMMON_XLAT ;; +IT_COMMON_XLAT: ;; + ;; + DW COMMON_XLAT_END-$ ;; length of section + DW -1 ;; code page + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;;***BD - ADDED FOR ALT CASE +;;****************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alt Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_ALT_K1_END-$ ;; length of state section + DB ALT_CASE ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_ALT_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 3 ;; number of entries +;;***BD THIS ENTRY IS A TEST ENTRY +;; DB 53,225,0 ;; TEST ENTRY + DB 53,0,82H ;; valid alt - + DB 12,-1,-1 ;; invalid alt - + DB 13,-1,-1 ;; invalid alt = +COM_ALT_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_ALT_K1_END: ;; + ;; +;;****************************** +;;***BD - ADDED FOR CTRL CASE +;;****************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: G_KB+P12_KB+AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K1_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW G_KB+P12_KB+AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_CTRL_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 2 ;; number of entries +;;***BD THIS ENTRY IS A TEST ENTRY +;; DB 53,226,0 ;; TEST ENTRY + DB 43,-1,-1 ;; invalid slash + DB 41,28,41 ;; valid slash +COM_CTRL_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CTRL_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: G_KB+P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K1_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 10 ;; number of entries + DB 41,"\" ;; \ + DB 12,"'" ;; ' + DB 13,141 ;; grave i - ; + DB 27,'+' ;; + + DB 86,'<' ;; < + DB 53,'-' ;; - + DB 39,149 ;; grave o - + DB 40,133 ;; grave a - ; + DB 43,151 ;; grave u - ; + DB 26,138 ;; grave e - ; +COM_NA_LO_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K2_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K2_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 9 ;; number of entries + DB 41,"<" ;; < + DB 12,"'" ;; ' + DB 13,141 ;; grave i - ; + DB 27,'+' ;; + + DB 53,'-' ;; - + DB 39,149 ;; grave o - + DB 40,133 ;; grave a - ; + DB 43,151 ;; grave u - ; + DB 26,138 ;; grave e - ; +COM_NA_LO_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: XT + +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K3_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K3_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 9 ;; number of entries + DB 12,"'" ;; ' + DB 13,141 ;; grave i - ; + DB 27,'+' ;; + + DB 43,'<' ;; < + DB 53,'-' ;; - + DB 39,149 ;; grave o - + DB 40,133 ;; grave a - ; + DB 41,151 ;; grave u - ; + DB 26,138 ;; grave e - ; +COM_NA_LO_K3_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K3_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G_KB+P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 18 ;; number of entries + DB 41,07CH ;; Solid vertical bar - | + DB 3,'"' ;; + DB 4,'' ;; + DB 7,'&' ;; + DB 8,'/' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,'=' ;; + DB 12,'?' ;; + DB 13,'^' ;; + DB 26,130 ;; acute e - ; + DB 39,135 ;; c - cedilla - + DB 27,'*' ;; + DB 40,0F8H ;; - degree symbol + DB 86,'>' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'_' ;; + ;; +COM_NA_UP_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K2_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_K2_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 18 ;; number of entries + DB 41,'>' ;; > + DB 3,'"' ;; + DB 4,'' ;; + DB 7,'&' ;; + DB 8,'/' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,'=' ;; + DB 12,'?' ;; + DB 13,'^' ;; + DB 26,130 ;; acute e - ; + DB 39,'@' ;; @ AT sign replaces c - cedilla - + DB 27,'*' ;; + DB 40,'#' ;; # sign replaces - degree symbol + DB 86,'>' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'_' ;; + ;; +COM_NA_UP_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K2_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: XT + +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K3_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_K3_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 17 ;; number of entries + DB 3,'"' ;; + DB 4,'' ;; + DB 7,'&' ;; + DB 8,'/' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,'=' ;; + DB 12,'?' ;; + DB 13,'^' ;; + DB 26,130 ;; acute e - ; + DB 39,'@' ;; @ AT sign replaces c - cedilla - + DB 27,'*' ;; + DB 40,'#' ;; # sign replaces - degree symbol + DB 43,'>' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'_' ;; + ;; +COM_NA_UP_K3_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K3_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: G_KB+P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K1_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 4 ;; number of entries + DB 26,'[' ;; + DB 27,']' ;; + DB 39,'@' ;; + DB 40,'#' ;; +COM_THIRD_K1_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K2_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_K2_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 3 ;; number of entries + DB 41,'\' ;; + DB 26,'[' ;; + DB 27,']' ;; +COM_THIRD_K2_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: XT + +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K3_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_K3_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 3 ;; number of entries + DB 43,'\' ;; + DB 26,'[' ;; + DB 27,']' ;; +COM_THIRD_K3_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K3_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; Last State +COMMON_XLAT_END: ;; + ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; IT Specific Translate Section for 437 +;; 437 IS COMPLETELY COVERED BY THE COMMON TABLE. +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC IT_437_XLAT ;; +IT_437_XLAT: ;; + ;; + DW CP437_XLAT_END-$ ;; length of section + DW 437 ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Non-Alpha Upper case +;; KEYBOARD TYPES: G_KB+P12+AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB+AT_KB ;; Keyboard Type + DB -1,-1 ;; error character = standalone accent + ;; + DW CP437_NA_UP_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 43,015H ;; Section symbol -  + CP437_NA_UP_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; + CP437_NA_UP_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Non-Alpha Upper case +;; KEYBOARD TYPES: XT + +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_NA_UP_K2_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; error character = standalone accent + ;; + DW CP437_NA_UP_T1_K2_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 41,015H ;; Section symbol -  + CP437_NA_UP_T1_K2_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; + CP437_NA_UP_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; LAST STATE + ;; +CP437_XLAT_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; IT Specific Translate Section for 850 +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC IT_850_XLAT ;; +IT_850_XLAT: ;; + ;; + DW CP850_XLAT_END-$ ;; length of section + DW 850 ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Non-Alpha Upper case +;; KEYBOARD TYPES: G_KB+P12+AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB+AT_KB ;; Keyboard Type + DB -1,-1 ;; error character = standalone accent + ;; + DW CP850_NA_UP_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 43,0F5H ;; Section symbol -  + CP850_NA_UP_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; + CP850_NA_UP_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Non-Alpha Upper case +;; KEYBOARD TYPES: XT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_NA_UP_K2_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; error character = standalone accent + ;; + DW CP850_NA_UP_T1_K2_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 41,0F5H ;; Section symbol -  + CP850_NA_UP_T1_K2_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; + CP850_NA_UP_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; LAST STATE + ;; +CP850_XLAT_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CODE ENDS ;; + END ;; diff --git a/v4.0/src/DEV/KEYBOARD/KDFIT141.ASM b/v4.0/src/DEV/KEYBOARD/KDFIT141.ASM new file mode 100644 index 0000000..a01b8c9 --- /dev/null +++ b/v4.0/src/DEV/KEYBOARD/KDFIT141.ASM @@ -0,0 +1,794 @@ + + + + + PAGE ,132 + TITLE DOS - Keyboard Definition File + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DOS - - NLS Support - Keyboard Defintion File +;; (c) Copyright 1988 Microsoft +;; +;; This file contains the keyboard tables for Spanish. +;; +;; Linkage Instructions: +;; Refer to KDF.ASM. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + INCLUDE KEYBSHAR.INC ;; + INCLUDE POSTEQU.INC ;; + INCLUDE KEYBMAC.INC ;; + ;; + PUBLIC IT2_LOGIC ;; + PUBLIC IT2_437_XLAT ;; + PUBLIC IT2_850_XLAT ;; + ;; +CODE SEGMENT PUBLIC 'CODE' ;; + ASSUME CS:CODE,DS:CODE ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Standard translate table options are a liner search table +;; (TYPE_2_TAB) and ASCII entries ONLY (ASCII_ONLY) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +STANDARD_TABLE EQU TYPE_2_TAB+ASCII_ONLY + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; IT State Logic +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +IT2_LOGIC: + + DW LOGIC_END-$ ;; length + ;; + DW 0 ;; special features + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; COMMANDS START HERE + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; OPTIONS: If we find a scan match in +;; an XLATT or SET_FLAG operation then +;; exit from INT 9. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + OPTION EXIT_IF_FOUND ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Dead key definitions must come before +;; dead key translations to handle +;; dead key + dead key. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + IFF EITHER_ALT,NOT ;; + ANDF EITHER_CTL,NOT ;; + IFF EITHER_SHIFT ;; + SET_FLAG DEAD_UPPER ;; + ELSEF ;; + SET_FLAG DEAD_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ACUTE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +ACUTE_PROC: ;; + ;; + IFF ACUTE,NOT ;; + GOTO DIARESIS_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT ACUTE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT ACUTE_LOWER ;; + ELSEF ;; + XLATT ACUTE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT ACUTE_UPPER ;; + ELSEF ;; + XLATT ACUTE_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_ACUTE: ;; + PUT_ERROR_CHAR ACUTE_LOWER ;; If we get here then either the XLATT + BEEP ;; failed or we are ina bad shift state. + GOTO NON_DEAD ;; Either is invalid so BEEP and fall + ;; through to generate the second char. + ;; Note that the dead key flag will be + ;; reset before we get here. + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DIARESIS ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +DIARESIS_PROC: ;; + ;; + IFF DIARESIS,NOT ;; + GOTO GRAVE_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT DIARESIS_SPACE ;; exist for 437 so beep for + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_LOWER ;; + ELSEF ;; + XLATT DIARESIS_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_UPPER ;; + ELSEF ;; + XLATT DIARESIS_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_DIARESIS: ;; + PUT_ERROR_CHAR DIARESIS_SPACE ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; GRAVE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +GRAVE_PROC: ;; + ;; + IFF GRAVE,NOT ;; + GOTO CIRCUMFLEX_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT GRAVE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_GRAVE: ;; + PUT_ERROR_CHAR GRAVE_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CIRCUMFLEX ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CIRCUMFLEX_PROC: ;; + ;; + IFF CIRCUMFLEX,NOT ;; + GOTO NON_DEAD ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT CIRCUMFLEX_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_CIRCUMFLEX: ;; + PUT_ERROR_CHAR CIRCUMFLEX_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Upper, lower and third shifts +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +NON_DEAD: ;; + ;; + IFKBD G_KB+P12_KB ;; Avoid accidentally translating + ANDF LC_E0 ;; the "/" on the numeric pad of the + EXIT_STATE_LOGIC ;; G keyboard + ENDIFF ;; +;;***BD ADDED FOR ALT, CTRL CASES ;; + IFF EITHER_CTL,NOT ;; + IFF ALT_SHIFT ;; ALT - case + ANDF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_ALT,NOT ;; CTRL - case + XLATT CTRL_CASE ;; + ENDIFF ;; + ENDIFF ;; +;;***BD END OF ADDITION + ;; + IFF EITHER_ALT,NOT ;; Lower and upper case. Alphabetic + ANDF EITHER_CTL,NOT ;; keys are affected by CAPS LOCK. + IFF EITHER_SHIFT ;; Numeric keys are not. +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE,NOT ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION + XLATT NON_ALPHA_UPPER ;; + IFF CAPS_STATE ;; + XLATT ALPHA_LOWER ;; + ELSEF ;; + XLATT ALPHA_UPPER ;; + ENDIFF ;; + ELSEF ;; +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION + XLATT NON_ALPHA_LOWER ;; + IFF CAPS_STATE ;; + XLATT ALPHA_UPPER ;; + ELSEF ;; + XLATT ALPHA_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_SHIFT,NOT ;; + IFKBD XT_KB+AT_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_CTL,NOT ;; + ANDF R_ALT_SHIFT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; + EXIT_STATE_LOGIC ;; + ;; +LOGIC_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;*************************************** +;; IT Common Translate Section +;; This section contains translations for the lower 128 characters +;; only since these will never change from code page to code page. +;; In addition the dead key "Set Flag" tables are here since the +;; dead keys are on the same keytops for all code pages. +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC IT2_COMMON_XLAT ;; +IT2_COMMON_XLAT: ;; + ;; + DW COMMON_XLAT_END-$ ;; length of section + DW -1 ;; code page + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;;***BD - ADDED FOR ALT CASE +;;****************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alt Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_ALT_K1_END-$ ;; length of state section + DB ALT_CASE ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_ALT_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 0 ;; 3 number of entries +;;***BD THIS ENTRY IS A TEST ENTRY +;; DB 53,225,0 ;; TEST ENTRY +;; DB 53,0,82H ;; valid alt - +;; DB 12,-1,-1 ;; invalid alt - +;; DB 13,-1,-1 ;; invalid alt = +COM_ALT_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_ALT_K1_END: ;; + ;; +;;****************************** +;;***BD - ADDED FOR CTRL CASE +;;****************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: G_KB+P12_KB+AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K1_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW G_KB+P12_KB+AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_CTRL_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 2 ;; number of entries +;;***BD THIS ENTRY IS A TEST ENTRY +;; DB 53,226,0 ;; TEST ENTRY + DB 43,-1,-1 ;; invalid slash + DB 41,28,41 ;; valid slash +COM_CTRL_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CTRL_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: G_KB+P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K1_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 10 ;; number of entries + DB 41,"\" ;; \ + DB 12,"'" ;; ' + DB 13,141 ;; grave i - ; + DB 27,'+' ;; + + DB 86,'<' ;; < + DB 53,'-' ;; - + DB 39,149 ;; grave o - + DB 40,133 ;; grave a - ; + DB 43,151 ;; grave u - ; + DB 26,138 ;; grave e - ; +COM_NA_LO_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K2_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K2_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 9 ;; number of entries + DB 41,"<" ;; < + DB 12,"'" ;; ' + DB 13,141 ;; grave i - ; + DB 27,'+' ;; + + DB 53,'-' ;; - + DB 39,149 ;; grave o - + DB 40,133 ;; grave a - ; + DB 43,151 ;; grave u - ; + DB 26,138 ;; grave e - ; +COM_NA_LO_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: XT + +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K3_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K3_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 9 ;; number of entries + DB 12,"'" ;; ' + DB 13,141 ;; grave i - ; + DB 27,'+' ;; + + DB 43,'<' ;; < + DB 53,'-' ;; - + DB 39,149 ;; grave o - + DB 40,133 ;; grave a - ; + DB 41,151 ;; grave u - ; + DB 26,138 ;; grave e - ; +COM_NA_LO_K3_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K3_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G_KB+P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 18 ;; number of entries + DB 41,07CH ;; Solid vertical bar - | + DB 3,'"' ;; + DB 4,'' ;; + DB 7,'&' ;; + DB 8,'/' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,'=' ;; + DB 12,'?' ;; + DB 13,'^' ;; + DB 26,130 ;; acute e - ; + DB 39,135 ;; c - cedilla - + DB 27,'*' ;; + DB 40,0F8H ;; - degree symbol + DB 86,'>' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'_' ;; + ;; +COM_NA_UP_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K2_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_K2_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 18 ;; number of entries + DB 41,'>' ;; > + DB 3,'"' ;; + DB 4,'' ;; + DB 7,'&' ;; + DB 8,'/' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,'=' ;; + DB 12,'?' ;; + DB 13,'^' ;; + DB 26,130 ;; acute e - ; + DB 39,'@' ;; @ AT sign replaces c - cedilla - + DB 27,'*' ;; + DB 40,'#' ;; # sign replaces - degree symbol + DB 86,'>' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'_' ;; + ;; +COM_NA_UP_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K2_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: XT + +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K3_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_K3_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 17 ;; number of entries + DB 3,'"' ;; + DB 4,'' ;; + DB 7,'&' ;; + DB 8,'/' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,'=' ;; + DB 12,'?' ;; + DB 13,'^' ;; + DB 26,130 ;; acute e - ; + DB 39,'@' ;; @ AT sign replaces c - cedilla - + DB 27,'*' ;; + DB 40,'#' ;; # sign replaces - degree symbol + DB 43,'>' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'_' ;; + ;; +COM_NA_UP_K3_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K3_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: G_KB+P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K1_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 4 ;; number of entries + DB 26,'[' ;; + DB 27,']' ;; + DB 39,'@' ;; + DB 40,'#' ;; +COM_THIRD_K1_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K2_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_K2_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 3 ;; number of entries + DB 41,'\' ;; + DB 26,'[' ;; + DB 27,']' ;; +COM_THIRD_K2_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: XT + +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K3_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_K3_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 3 ;; number of entries + DB 43,'\' ;; + DB 26,'[' ;; + DB 27,']' ;; +COM_THIRD_K3_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K3_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; Last State +COMMON_XLAT_END: ;; + ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; IT Specific Translate Section for 437 +;; 437 IS COMPLETELY COVERED BY THE COMMON TABLE. +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC IT2_437_XLAT ;; +IT2_437_XLAT: ;; + ;; + DW CP437_XLAT_END-$ ;; length of section + DW 437 ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Non-Alpha Upper case +;; KEYBOARD TYPES: G_KB+P12+AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB+AT_KB ;; Keyboard Type + DB -1,-1 ;; error character = standalone accent + ;; + DW CP437_NA_UP_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 43,015H ;; Section symbol -  + CP437_NA_UP_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; + CP437_NA_UP_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Non-Alpha Upper case +;; KEYBOARD TYPES: XT + +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_NA_UP_K2_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; error character = standalone accent + ;; + DW CP437_NA_UP_T1_K2_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 41,015H ;; Section symbol -  + CP437_NA_UP_T1_K2_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; + CP437_NA_UP_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; LAST STATE + ;; +CP437_XLAT_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; IT Specific Translate Section for 850 +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC IT2_850_XLAT ;; +IT2_850_XLAT: ;; + ;; + DW CP850_XLAT_END-$ ;; length of section + DW 850 ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Non-Alpha Upper case +;; KEYBOARD TYPES: G_KB+P12+AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB+AT_KB ;; Keyboard Type + DB -1,-1 ;; error character = standalone accent + ;; + DW CP850_NA_UP_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 43,0F5H ;; Section symbol -  + CP850_NA_UP_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; + CP850_NA_UP_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Non-Alpha Upper case +;; KEYBOARD TYPES: XT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_NA_UP_K2_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; error character = standalone accent + ;; + DW CP850_NA_UP_T1_K2_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 41,0F5H ;; Section symbol -  + CP850_NA_UP_T1_K2_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; + CP850_NA_UP_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; LAST STATE + ;; +CP850_XLAT_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CODE ENDS ;; + END ;; diff --git a/v4.0/src/DEV/KEYBOARD/KDFIT142.ASM b/v4.0/src/DEV/KEYBOARD/KDFIT142.ASM new file mode 100644 index 0000000..7b07247 --- /dev/null +++ b/v4.0/src/DEV/KEYBOARD/KDFIT142.ASM @@ -0,0 +1,864 @@ + + + + + PAGE ,132 + TITLE DOS - Keyboard Definition File + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DOS - - NLS Support - Keyboard Defintion File +;; (c) Copyright 1988 Microsoft +;; +;; This file contains the keyboard tables for Spanish. +;; +;; Linkage Instructions: +;; Refer to KDF.ASM. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + INCLUDE KEYBSHAR.INC ;; ;AN000; + INCLUDE POSTEQU.INC ;; ;AN000; + INCLUDE KEYBMAC.INC ;; ;AN000; + ;; ;AN000; + PUBLIC IT1_LOGIC ;; ;AN000; + PUBLIC IT1_437_XLAT ;; ;AN000; + PUBLIC IT1_850_XLAT ;; ;AN000; + ;; ;AN000; +CODE SEGMENT PUBLIC 'CODE' ;; ;AN000; + ASSUME CS:CODE,DS:CODE ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; Standard translate table options are a liner search table ;AN000; +;; (TYPE_2_TAB) and ASCII entries ONLY (ASCII_ONLY) ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; +STANDARD_TABLE EQU TYPE_2_TAB+ASCII_ONLY ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;*************************************** ;AN000; +;; IT State Logic ;AN000; +;;*************************************** ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + ;; ;AN000; +IT1_LOGIC: ;AN000; + ;AN000; + DW LOGIC_END-$ ;; length ;AN000; + ;; ;AN000; + DW 0 ;; special features ;AN000; + ;; ;AN000; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; COMMANDS START HERE ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; OPTIONS: If we find a scan match in ;AN000; +;; an XLATT or SET_FLAG operation then ;AN000; +;; exit from INT 9. ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + OPTION EXIT_IF_FOUND ;; ;AN000; + ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; Dead key definitions must come before ;AN000; +;; dead key translations to handle ;AN000; +;; dead key + dead key. ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + IFF EITHER_ALT,NOT ;; ;AN000; + ANDF EITHER_CTL,NOT ;; ;AN000; + IFF EITHER_SHIFT ;; ;AN000; + SET_FLAG DEAD_UPPER ;; ;AN000; + ELSEF ;; ;AN000; + SET_FLAG DEAD_LOWER ;; ;AN000; + ENDIFF ;; ;AN000; + ENDIFF ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; ACUTE ACCENT TRANSLATIONS ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; +ACUTE_PROC: ;; ;AN000; + ;; ;AN000; + IFF ACUTE,NOT ;; ;AN000; + GOTO DIARESIS_PROC ;; ;AN000; + ENDIFF ;; ;AN000; + ;; ;AN000; + RESET_NLS ;; ;AN000; + IFF R_ALT_SHIFT,NOT ;; ;AN000; + XLATT ACUTE_SPACE ;; ;AN000; + ENDIFF ;; ;AN000; + IFF EITHER_CTL,NOT ;; ;AN000; + ANDF EITHER_ALT,NOT ;; ;AN000; + IFF EITHER_SHIFT ;; ;AN000; + IFF CAPS_STATE ;; ;AN000; + XLATT ACUTE_LOWER ;; ;AN000; + ELSEF ;; ;AN000; + XLATT ACUTE_UPPER ;; ;AN000; + ENDIFF ;; ;AN000; + ELSEF ;; ;AN000; + IFF CAPS_STATE ;; ;AN000; + XLATT ACUTE_UPPER ;; ;AN000; + ELSEF ;; ;AN000; + XLATT ACUTE_LOWER ;; ;AN000; + ENDIFF ;; ;AN000; + ENDIFF ;; ;AN000; + ENDIFF ;; ;AN000; + ;; ;AN000; +INVALID_ACUTE: ;; ;AN000; + PUT_ERROR_CHAR ACUTE_LOWER ;; If we get here then either the XLATT ;AN000; + BEEP ;; failed or we are ina bad shift state. ;AN000; + GOTO NON_DEAD ;; Either is invalid so BEEP and fall ;AN000; + ;; through to generate the second char. ;AN000; + ;; Note that the dead key flag will be ;AN000; + ;; reset before we get here. ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; DIARESIS ACCENT TRANSLATIONS ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; +DIARESIS_PROC: ;; ;AN000; + ;; ;AN000; + IFF DIARESIS,NOT ;; ;AN000; + GOTO GRAVE_PROC ;; ;AN000; + ENDIFF ;; ;AN000; + ;; ;AN000; + RESET_NLS ;; ;AN000; + IFF R_ALT_SHIFT,NOT ;; ;AN000; + XLATT DIARESIS_SPACE ;; exist for 437 so beep for ;AN000; + ENDIFF ;; ;AN000; + IFF EITHER_CTL,NOT ;; ;AN000; + ANDF EITHER_ALT,NOT ;; ;AN000; + IFF EITHER_SHIFT ;; ;AN000; + IFF CAPS_STATE ;; ;AN000; + XLATT DIARESIS_LOWER ;; ;AN000; + ELSEF ;; ;AN000; + XLATT DIARESIS_UPPER ;; ;AN000; + ENDIFF ;; ;AN000; + ELSEF ;; ;AN000; + IFF CAPS_STATE ;; ;AN000; + XLATT DIARESIS_UPPER ;; ;AN000; + ELSEF ;; ;AN000; + XLATT DIARESIS_LOWER ;; ;AN000; + ENDIFF ;; ;AN000; + ENDIFF ;; ;AN000; + ENDIFF ;; ;AN000; + ;; ;AN000; +INVALID_DIARESIS: ;; ;AN000; + PUT_ERROR_CHAR DIARESIS_SPACE ;; standalone accent ;AN000; + BEEP ;; Invalid dead key combo. ;AN000; + GOTO NON_DEAD ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; GRAVE ACCENT TRANSLATIONS ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; +GRAVE_PROC: ;; ;AN000; + ;; ;AN000; + IFF GRAVE,NOT ;; ;AN000; + GOTO CIRCUMFLEX_PROC ;; ;AN000; + ENDIFF ;; ;AN000; + ;; ;AN000; + RESET_NLS ;; ;AN000; + IFF R_ALT_SHIFT,NOT ;; ;AN000; + XLATT GRAVE_SPACE ;; ;AN000; + ENDIFF ;; ;AN000; + IFF EITHER_CTL,NOT ;; ;AN000; + ANDF EITHER_ALT,NOT ;; ;AN000; + IFF EITHER_SHIFT ;; ;AN000; + IFF CAPS_STATE ;; ;AN000; + XLATT GRAVE_LOWER ;; ;AN000; + ELSEF ;; ;AN000; + XLATT GRAVE_UPPER ;; ;AN000; + ENDIFF ;; ;AN000; + ELSEF ;; ;AN000; + IFF CAPS_STATE,NOT ;; ;AN000; + XLATT GRAVE_LOWER ;; ;AN000; + ELSEF ;; ;AN000; + XLATT GRAVE_UPPER ;; ;AN000; + ENDIFF ;; ;AN000; + ENDIFF ;; ;AN000; + ENDIFF ;; ;AN000; + ;; ;AN000; +INVALID_GRAVE: ;; ;AN000; + PUT_ERROR_CHAR GRAVE_LOWER ;; standalone accent ;AN000; + BEEP ;; Invalid dead key combo. ;AN000; + GOTO NON_DEAD ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CIRCUMFLEX ACCENT TRANSLATIONS ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; +CIRCUMFLEX_PROC: ;; ;AN000; + ;; ;AN000; + IFF CIRCUMFLEX,NOT ;; ;AN000; + GOTO NON_DEAD ;; ;AN000; + ENDIFF ;; ;AN000; + ;; ;AN000; + RESET_NLS ;; ;AN000; + IFF R_ALT_SHIFT,NOT ;; ;AN000; + XLATT CIRCUMFLEX_SPACE ;; ;AN000; + ENDIFF ;; ;AN000; + IFF EITHER_CTL,NOT ;; ;AN000; + ANDF EITHER_ALT,NOT ;; ;AN000; + IFF EITHER_SHIFT ;; ;AN000; + IFF CAPS_STATE ;; ;AN000; + XLATT CIRCUMFLEX_LOWER ;; ;AN000; + ELSEF ;; ;AN000; + XLATT CIRCUMFLEX_UPPER ;; ;AN000; + ENDIFF ;; ;AN000; + ELSEF ;; ;AN000; + IFF CAPS_STATE,NOT ;; ;AN000; + XLATT CIRCUMFLEX_LOWER ;; ;AN000; + ELSEF ;; ;AN000; + XLATT CIRCUMFLEX_UPPER ;; ;AN000; + ENDIFF ;; ;AN000; + ENDIFF ;; ;AN000; + ENDIFF ;; ;AN000; + ;; ;AN000; +INVALID_CIRCUMFLEX: ;; ;AN000; + PUT_ERROR_CHAR CIRCUMFLEX_LOWER ;; standalone accent ;AN000; + BEEP ;; Invalid dead key combo. ;AN000; + GOTO NON_DEAD ;; ;AN000; + ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; Upper, lower and third shifts ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; +NON_DEAD: ;; ;AN000; + ;; ;AN000; + IFKBD G_KB+P12_KB ;; Avoid accidentally translating ;AN000; + ANDF LC_E0 ;; the "/" on the numeric pad of the ;AN000; + EXIT_STATE_LOGIC ;; G keyboard ;AN000; + ENDIFF ;; ;AN000; +;;***BD ADDED FOR ALT, CTRL CASES ;; ;AN000; + IFF EITHER_CTL,NOT ;; ;AN000; + IFF ALT_SHIFT ;; ALT - case ;AN000; + ANDF R_ALT_SHIFT,NOT ;; ;AN000; + XLATT ALT_CASE ;; ;AN000; + ENDIFF ;; ;AN000; + ELSEF ;; ;AN000; + IFF EITHER_ALT,NOT ;; CTRL - case ;AN000; + XLATT CTRL_CASE ;; ;AN000; + ENDIFF ;; ;AN000; + ENDIFF ;; ;AN000; +;;***BD END OF ADDITION ;AN000; + ;; ;AN000; + IFF EITHER_ALT,NOT ;; Lower and upper case. Alphabetic ;AN000; + ANDF EITHER_CTL,NOT ;; keys are affected by CAPS LOCK. ;AN000; + IFF EITHER_SHIFT ;; Numeric keys are not. ;AN000; +;;***BD ADDED FOR NUMERIC PAD ;AN000; + IFF NUM_STATE,NOT ;; ;AN000; + XLATT NUMERIC_PAD ;; ;AN000; + ENDIFF ;; ;AN000; +;;***BD END OF ADDITION ;AN000; + XLATT NON_ALPHA_UPPER ;; ;AN000; + IFF CAPS_STATE ;; ;AN000; + XLATT ALPHA_LOWER ;; ;AN000; + ELSEF ;; ;AN000; + XLATT ALPHA_UPPER ;; ;AN000; + ENDIFF ;; ;AN000; + ELSEF ;; ;AN000; +;;***BD ADDED FOR NUMERIC PAD ;AN000; + IFF NUM_STATE ;; ;AN000; + XLATT NUMERIC_PAD ;; ;AN000; + ENDIFF ;; ;AN000; +;;***BD END OF ADDITION ;AN000; + XLATT NON_ALPHA_LOWER ;; ;AN000; + IFF CAPS_STATE ;; ;AN000; + XLATT ALPHA_UPPER ;; ;AN000; + ELSEF ;; ;AN000; + XLATT ALPHA_LOWER ;; ;AN000; + ENDIFF ;; ;AN000; + ENDIFF ;; ;AN000; + ELSEF ;; ;AN000; + IFF EITHER_SHIFT,NOT ;; ;AN000; + IFKBD XT_KB+AT_KB ;; ;AN000; + IFF EITHER_CTL ;; ;AN000; + ANDF ALT_SHIFT ;; ;AN000; + XLATT THIRD_SHIFT ;; ;AN000; + ENDIFF ;; ;AN000; + ELSEF ;; ;AN000; + IFF EITHER_CTL,NOT ;; ;AN000; + ANDF R_ALT_SHIFT ;; ;AN000; + XLATT THIRD_SHIFT ;; ;AN000; + ENDIFF ;; ;AN000; + ENDIFF ;; ;AN000; + ENDIFF ;; ;AN000; + ENDIFF ;; ;AN000; + ;; ;AN000; + EXIT_STATE_LOGIC ;; ;AN000; + ;; ;AN000; +LOGIC_END: ;; ;AN000; + ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;;*************************************** ;AN000; +;; IT Common Translate Section ;AN000; +;; This section contains translations for the lower 128 characters ;AN000; +;; only since these will never change from code page to code page. ;AN000; +;; In addition the dead key "Set Flag" tables are here since the ;AN000; +;; dead keys are on the same keytops for all code pages. ;AN000; +;;*************************************** ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + PUBLIC IT1_COMMON_XLAT ;; ;AN000; +IT1_COMMON_XLAT: ;; ;AN000; + ;; ;AN000; + DW COMMON_XLAT_END-$ ;; length of section ;AN000; + DW -1 ;; code page ;AN000; + ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: Common ;AN000; +;; STATE: Upper Shift Dead Key ;AN000; +;; KEYBOARD TYPES: G + P12 ;AN000; +;; TABLE TYPE: Flag Table ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; ;; ;AN000; +;; DW COM_DK_UP_K1_END-$ ;; length of state section ;AN000; +;; DB DEAD_UPPER ;; State ID ;AN000; +;; DW G_KB+P12_KB ;; Keyboard Type ;AN000; +;; DB -1,-1 ;; Buffer entry for error character ;AN000; +;; ;; Set Flag Table ;AN000; +;; DW 1 ;; number of entries ;AN000; +;; DB 13 ;; scan code ;AN000; +;; FLAG CIRCUMFLEX ;; flag bit to set ;AN000; +;; ;; ;AN000; +;;COM_DK_UP_K1_END: ;; ;AN000; +;; ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;*************************************** ;AN000; +;;***BD - ADDED FOR ALT CASE ;AN000; +;;****************************** ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: Common ;AN000; +;; STATE: Alt Case ;AN000; +;; KEYBOARD TYPES: All ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW COM_ALT_K1_END-$ ;; length of state section ;AN000; + DB ALT_CASE ;; State ID ;AN000; + DW ANY_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW COM_ALT_K1_T1_END-$ ;; Size of xlat table ;AN000; + DB TYPE_2_TAB ;; xlat options: ;AN000; + DB 0 ;; 3 number of entries ;AN000; +;;***BD THIS ENTRY IS A TEST ENTRY ;AN000; +;; DB 53,225,0 ;; TEST ENTRY ;AN000; +; DB 53,0,82H ;; valid alt - ;AN000; +; DB 12,-1,-1 ;; invalid alt - ;AN000; +; DB 13,-1,-1 ;; invalid alt = ;AN000; +COM_ALT_K1_T1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Size of xlat table - null table ;AN000; + ;; ;AN000; +COM_ALT_K1_END: ;; ;AN000; + ;; ;AN000; +;;****************************** ;AN000; +;;***BD - ADDED FOR CTRL CASE ;AN000; +;;****************************** ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: Common ;AN000; +;; STATE: Ctrl Case ;AN000; +;; KEYBOARD TYPES: G_KB+P12_KB+AT ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW COM_CTRL_K1_END-$ ;; length of state section ;AN000; + DB CTRL_CASE ;; State ID ;AN000; + DW G_KB+P12_KB+AT_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW COM_CTRL_K1_T1_END-$ ;; Size of xlat table ;AN000; + DB TYPE_2_TAB ;; xlat options: ;AN000; + DB 2 ;; number of entries ;AN000; +;;***BD THIS ENTRY IS A TEST ENTRY ;AN000; +;; DB 53,226,0 ;; TEST ENTRY ;AN000; + DB 43,-1,-1 ;; invalid slash ;AN000; + DB 41,28,41 ;; valid slash ;AN000; +COM_CTRL_K1_T1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Size of xlat table - null table ;AN000; + ;; ;AN000; +COM_CTRL_K1_END: ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: Common ;;change **********CNS ************** ;AN000; +;; STATE: Numeric Key Pad ;AN000; +;; KEYBOARD TYPES: All except the p12 ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW COM_PAD_K1_END-$ ;; length of state section ;AN000; + DB NUMERIC_PAD ;; State ID ;AN000; + DW G_KB+AT_KB+XT_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW COM_PAD_K1_T1_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE ;; xlat options: ;AN000; + DB 1 ;; number of entries ;AN000; + DB 83,',' ;; decimal seperator = , ;AN000; +COM_PAD_K1_T1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Size of xlat table - null table ;AN000; + ;; ;AN000; +COM_PAD_K1_END: ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: Common ;AN000; +;; STATE: Non-Alpha Lower Case ;AN000; +;; KEYBOARD TYPES: G_KB+P12_KB ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW COM_NA_LO_K1_END-$ ;; length of state section ;AN000; + DB NON_ALPHA_LOWER ;; State ID ;AN000; + DW G_KB+P12_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW COM_NA_LO_K1_T1_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE ;; xlat options: ;AN000; + DB 10 ;; number of entries ;AN000; + DB 41,"\" ;; \ ;AN000; + DB 12,"'" ;; ' ;AN000; + DB 13,141 ;; grave i - ; ;AN000; + DB 27,'+' ;; + ;AN000; + DB 86,'<' ;; < ;AN000; + DB 53,'-' ;; - ;AN000; + DB 39,149 ;; grave o - ;AN000; + DB 40,133 ;; grave a - ; ;AN000; + DB 43,151 ;; grave u - ; ;AN000; + DB 26,138 ;; grave e - ; ;AN000; +COM_NA_LO_K1_T1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Size of xlat table - null table ;AN000; + ;; ;AN000; +COM_NA_LO_K1_END: ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: Common ;AN000; +;; STATE: Non-Alpha Lower Case ;AN000; +;; KEYBOARD TYPES: AT ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW COM_NA_LO_K2_END-$ ;; length of state section ;AN000; + DB NON_ALPHA_LOWER ;; State ID ;AN000; + DW AT_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW COM_NA_LO_K2_T1_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE ;; xlat options: ;AN000; + DB 9 ;; number of entries ;AN000; + DB 41,"<" ;; < ;AN000; + DB 12,"'" ;; ' ;AN000; + DB 13,141 ;; grave i - ; ;AN000; + DB 27,'+' ;; + ;AN000; + DB 53,'-' ;; - ;AN000; + DB 39,149 ;; grave o - ;AN000; + DB 40,133 ;; grave a - ; ;AN000; + DB 43,151 ;; grave u - ; ;AN000; + DB 26,138 ;; grave e - ; ;AN000; +COM_NA_LO_K2_T1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Size of xlat table - null table ;AN000; + ;; ;AN000; +COM_NA_LO_K2_END: ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: Common ;AN000; +;; STATE: Non-Alpha Lower Case ;AN000; +;; KEYBOARD TYPES: XT + ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW COM_NA_LO_K3_END-$ ;; length of state section ;AN000; + DB NON_ALPHA_LOWER ;; State ID ;AN000; + DW XT_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW COM_NA_LO_K3_T1_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE ;; xlat options: ;AN000; + DB 9 ;; number of entries ;AN000; + DB 12,"'" ;; ' ;AN000; + DB 13,141 ;; grave i - ; ;AN000; + DB 27,'+' ;; + ;AN000; + DB 43,'<' ;; < ;AN000; + DB 53,'-' ;; - ;AN000; + DB 39,149 ;; grave o - ;AN000; + DB 40,133 ;; grave a - ; ;AN000; + DB 41,151 ;; grave u - ; ;AN000; + DB 26,138 ;; grave e - ; ;AN000; +COM_NA_LO_K3_T1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Size of xlat table - null table ;AN000; + ;; ;AN000; +COM_NA_LO_K3_END: ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: Common ;AN000; +;; STATE: Non-Alpha Upper Case ;AN000; +;; KEYBOARD TYPES: G_KB+P12 ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW COM_NA_UP_K1_END-$ ;; length of state section ;AN000; + DB NON_ALPHA_UPPER ;; State ID ;AN000; + DW G_KB+P12_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW COM_NA_UP_K1_T1_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE ;; xlat options: ;AN000; + DB 18 ;; number of entries ;AN000; + DB 41,07CH ;; Solid vertical bar - | ;AN000; + DB 3,'"' ;; ;AN000; + DB 4,'' ;; ;AN000; + DB 7,'&' ;; ;AN000; + DB 8,'/' ;; ;AN000; + DB 9,'(' ;; ;AN000; + DB 10,')' ;; ;AN000; + DB 11,'=' ;; ;AN000; + DB 12,'?' ;; ;AN000; + DB 13,'^' ;; ;AN000; + DB 26,130 ;; acute e - ; ;AN000; + DB 39,135 ;; c - cedilla - ;AN000; + DB 27,'*' ;; ;AN000; + DB 40,0F8H ;; - degree symbol ;AN000; + DB 86,'>' ;; ;AN000; + DB 51,';' ;; ;AN000; + DB 52,':' ;; ;AN000; + DB 53,'_' ;; ;AN000; + ;; ;AN000; +COM_NA_UP_K1_T1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Size of xlat table - null table ;AN000; + ;; ;AN000; +COM_NA_UP_K1_END: ;; ;AN000; + ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: Common ;AN000; +;; STATE: Non-Alpha Upper Case ;AN000; +;; KEYBOARD TYPES: AT ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW COM_NA_UP_K2_END-$ ;; length of state section ;AN000; + DB NON_ALPHA_UPPER ;; State ID ;AN000; + DW AT_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW COM_NA_UP_K2_T1_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE ;; xlat options: ;AN000; + DB 18 ;; number of entries ;AN000; + DB 41,'>' ;; > ;AN000; + DB 3,'"' ;; ;AN000; + DB 4,'' ;; ;AN000; + DB 7,'&' ;; ;AN000; + DB 8,'/' ;; ;AN000; + DB 9,'(' ;; ;AN000; + DB 10,')' ;; ;AN000; + DB 11,'=' ;; ;AN000; + DB 12,'?' ;; ;AN000; + DB 13,'^' ;; ;AN000; + DB 26,130 ;; acute e - ; ;AN000; + DB 39,'@' ;; @ AT sign replaces c - cedilla - ;AN000; + DB 27,'*' ;; ;AN000; + DB 40,'#' ;; # sign replaces - degree symbol ;AN000; + DB 86,'>' ;; ;AN000; + DB 51,';' ;; ;AN000; + DB 52,':' ;; ;AN000; + DB 53,'_' ;; ;AN000; + ;; ;AN000; +COM_NA_UP_K2_T1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Size of xlat table - null table ;AN000; + ;; ;AN000; +COM_NA_UP_K2_END: ;; ;AN000; + ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: Common ;AN000; +;; STATE: Non-Alpha Upper Case ;AN000; +;; KEYBOARD TYPES: XT + ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW COM_NA_UP_K3_END-$ ;; length of state section ;AN000; + DB NON_ALPHA_UPPER ;; State ID ;AN000; + DW XT_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW COM_NA_UP_K3_T1_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE ;; xlat options: ;AN000; + DB 17 ;; number of entries ;AN000; + DB 3,'"' ;; ;AN000; + DB 4,'' ;; ;AN000; + DB 7,'&' ;; ;AN000; + DB 8,'/' ;; ;AN000; + DB 9,'(' ;; ;AN000; + DB 10,')' ;; ;AN000; + DB 11,'=' ;; ;AN000; + DB 12,'?' ;; ;AN000; + DB 13,'^' ;; ;AN000; + DB 26,130 ;; acute e - ; ;AN000; + DB 39,'@' ;; @ AT sign replaces c - cedilla - ;AN000; + DB 27,'*' ;; ;AN000; + DB 40,'#' ;; # sign replaces - degree symbol ;AN000; + DB 43,'>' ;; ;AN000; + DB 51,';' ;; ;AN000; + DB 52,':' ;; ;AN000; + DB 53,'_' ;; ;AN000; + ;; ;AN000; +COM_NA_UP_K3_T1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Size of xlat table - null table ;AN000; + ;; ;AN000; +COM_NA_UP_K3_END: ;; ;AN000; + ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: Common ;AN000; +;; STATE: Third Shift ;AN000; +;; KEYBOARD TYPES: G_KB ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW COM_THIRD_K1_END-$ ;; length of state section ;AN000; + DB THIRD_SHIFT ;; State ID ;AN000; + DW G_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW COM_THIRD_K1_T1_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE ;; xlat options: ;AN000; + DB 8 ;; number of entries ;AN000; + DB 4,'#' ;; ;AN000; + DB 8,'{' ;; ;AN000; + DB 9,'[' ;; ;AN000; + DB 10,']' ;; ;AN000; + DB 11,'}' ;; ;AN000; + DB 16,'@' ;; ;AN000; + DB 27,'~' ;; ;AN000; + DB 43,"`" ;; grave symbol or closing single quote ;AN000; +COM_THIRD_K1_T1_END: ;; codepoint 60h ;AN000; + ;; ;AN000; + DW 0 ;; Last xlat table ;AN000; +COM_THIRD_K1_END: ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: Common ;AN000; +;; STATE: Third Shift ;AN000; +;; KEYBOARD TYPES: P12_KB ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW COM_THIRD_PK1_END-$ ;; length of state section ;AN000; + DB THIRD_SHIFT ;; State ID ;AN000; + DW P12_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW COM_THIRD_PK1_T1_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE ;; xlat options: ;AN000; + DB 4 ;; number of entries ;AN000; + DB 26,'[' ;; ;AN000; + DB 27,']' ;; ;AN000; + DB 39,'@' ;; ;AN000; + DB 40,'#' ;; ;AN000; +COM_THIRD_PK1_T1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Last xlat table ;AN000; +COM_THIRD_PK1_END: ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: Common ;AN000; +;; STATE: Third Shift ;AN000; +;; KEYBOARD TYPES: AT ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW COM_THIRD_K2_END-$ ;; length of state section ;AN000; + DB THIRD_SHIFT ;; State ID ;AN000; + DW AT_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW COM_THIRD_K2_T1_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE ;; xlat options: ;AN000; + DB 3 ;; number of entries ;AN000; + DB 41,'\' ;; ;AN000; + DB 26,'[' ;; ;AN000; + DB 27,']' ;; ;AN000; +COM_THIRD_K2_T1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Last xlat table ;AN000; +COM_THIRD_K2_END: ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: Common ;AN000; +;; STATE: Third Shift ;AN000; +;; KEYBOARD TYPES: XT + ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW COM_THIRD_K3_END-$ ;; length of state section ;AN000; + DB THIRD_SHIFT ;; State ID ;AN000; + DW XT_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW COM_THIRD_K3_T1_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE ;; xlat options: ;AN000; + DB 3 ;; number of entries ;AN000; + DB 43,'\' ;; ;AN000; + DB 26,'[' ;; ;AN000; + DB 27,']' ;; ;AN000; +COM_THIRD_K3_T1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Last xlat table ;AN000; +COM_THIRD_K3_END: ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + DW 0 ;; Last State ;AN000; +COMMON_XLAT_END: ;; ;AN000; + ;; ;AN000; + ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;*************************************** ;AN000; +;; IT Specific Translate Section for 437 ;AN000; +;; 437 IS COMPLETELY COVERED BY THE COMMON TABLE. ;AN000; +;;*************************************** ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + PUBLIC IT1_437_XLAT ;; ;AN000; +IT1_437_XLAT: ;; ;AN000; + ;; ;AN000; + DW CP437_XLAT_END-$ ;; length of section ;AN000; + DW 437 ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: 437 ;AN000; +;; STATE: Non-Alpha Upper case ;AN000; +;; KEYBOARD TYPES: G_KB+P12+AT ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW CP437_NA_UP_K1_END-$ ;; length of state section ;AN000; + DB NON_ALPHA_UPPER ;; State ID ;AN000; + DW G_KB+P12_KB+AT_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; error character = standalone accent ;AN000; + ;; ;AN000; + DW CP437_NA_UP_T1_K1_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: ;AN000; + DB 1 ;; number of scans ;AN000; + DB 43,015H ;; Section symbol -  ;AN000; + CP437_NA_UP_T1_K1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Size of xlat table - null table ;AN000; + ;; ;AN000; + CP437_NA_UP_K1_END: ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: 437 ;AN000; +;; STATE: Non-Alpha Upper case ;AN000; +;; KEYBOARD TYPES: XT + ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW CP437_NA_UP_K2_END-$ ;; length of state section ;AN000; + DB NON_ALPHA_UPPER ;; State ID ;AN000; + DW XT_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; error character = standalone accent ;AN000; + ;; ;AN000; + DW CP437_NA_UP_T1_K2_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: ;AN000; + DB 1 ;; number of scans ;AN000; + DB 41,015H ;; Section symbol -  ;AN000; + CP437_NA_UP_T1_K2_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Size of xlat table - null table ;AN000; + ;; ;AN000; + CP437_NA_UP_K2_END: ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + DW 0 ;; LAST STATE ;AN000; + ;; ;AN000; +CP437_XLAT_END: ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;*************************************** ;AN000; +;; IT Specific Translate Section for 850 ;AN000; +;;*************************************** ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + PUBLIC IT1_850_XLAT ;; ;AN000; +IT1_850_XLAT: ;; ;AN000; + ;; ;AN000; + DW CP850_XLAT_END-$ ;; length of section ;AN000; + DW 850 ;; ;AN000; + ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: 850 ;AN000; +;; STATE: Non-Alpha Upper case ;AN000; +;; KEYBOARD TYPES: G_KB+P12+AT ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW CP850_NA_UP_K1_END-$ ;; length of state section ;AN000; + DB NON_ALPHA_UPPER ;; State ID ;AN000; + DW G_KB+P12_KB+AT_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; error character = standalone accent ;AN000; + ;; ;AN000; + DW CP850_NA_UP_T1_K1_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: ;AN000; + DB 1 ;; number of scans ;AN000; + DB 43,0F5H ;; Section symbol -  ;AN000; + CP850_NA_UP_T1_K1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Size of xlat table - null table ;AN000; + ;; ;AN000; + CP850_NA_UP_K1_END: ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: 850 ;AN000; +;; STATE: Non-Alpha Upper case ;AN000; +;; KEYBOARD TYPES: XT ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW CP850_NA_UP_K2_END-$ ;; length of state section ;AN000; + DB NON_ALPHA_UPPER ;; State ID ;AN000; + DW XT_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; error character = standalone accent ;AN000; + ;; ;AN000; + DW CP850_NA_UP_T1_K2_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: ;AN000; + DB 1 ;; number of scans ;AN000; + DB 41,0F5H ;; Section symbol -  ;AN000; + CP850_NA_UP_T1_K2_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Size of xlat table - null table ;AN000; + ;; ;AN000; + CP850_NA_UP_K2_END: ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + DW 0 ;; LAST STATE ;AN000; + ;; ;AN000; +CP850_XLAT_END: ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; +CODE ENDS ;; ;AN000; + END ;; ;AN000; diff --git a/v4.0/src/DEV/KEYBOARD/KDFLA.ASM b/v4.0/src/DEV/KEYBOARD/KDFLA.ASM new file mode 100644 index 0000000..0d7a692 --- /dev/null +++ b/v4.0/src/DEV/KEYBOARD/KDFLA.ASM @@ -0,0 +1,1322 @@ +PAGE ,132 +TITLE DOS - LAD Keyboard Definition File +;; LATEST CHANGE ALT & CTL +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; DOS - - LAD Keyboard Support - Keyboard Defintion File +; (C) Copyright 1988 Microsoft +; +; This file contains the keyboard tables for Latin American. +; +; The LAD keyboard support is based on the following: +; PC - 246 (Spanish) +; PC/AT - 246 (Spanish) +; PC, PC/XT - 246 (Spanish) +; Ferrari G - 171 +; Ferrari P (?) - 171 +; +; DATE: September 15, 1986 +; +; +; To update KEYBOARD.SYS....enter the following info into KDF.ASM +; +; FILE HEADER +; =========== +; DB 'LA' ; language code +; DW OFFSET LA_LANG_ENT,0 ; language ptr +; +; LANGUAGE ENTRY +; ============== +; EXTRN LA_LOGIC:NEAR +; EXTRN LA_437_XLAT:NEAR +; EXTRN LA_850_XLAT:NEAR +; +; LA_LANG_ENT: DB 'LA' ; +; DW 0 ; reserved +; DW OFFSET LA_LOGIC,0 ; pointer to LANG kb table +; DW 2 ; number of code pages +; DW 437 ; code page +; DW OFFSET LA_437_XLAT,0 ; table pointer +; DW 850 ; code page +; DW OFFSET LA_850_XLAT,0 ; table pointer +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + INCLUDE KEYBSHAR.INC ; + INCLUDE POSTEQU.INC ; + INCLUDE KEYBMAC.INC ; + ; + PUBLIC LA_LOGIC ; + PUBLIC LA_437_XLAT ; + PUBLIC LA_850_XLAT ; + ; +CODE SEGMENT PUBLIC 'CODE' ; + ASSUME CS:CODE,DS:CODE ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Standard translate table options are a liner search table +; (TYPE_2_TAB) and ASCII entries ONLY (ASCII_ONLY) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; +STANDARD_TABLE EQU TYPE_2_TAB+ASCII_ONLY + ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; SP State Logic +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +LA_LOGIC: ; + DW LOGIC_END-$ ; length + DW 0 ; special features +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; OPTIONS: If we find a scan match in +; an XLATT or SET_FLAG operation then +; exit from INT 9. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + OPTION EXIT_IF_FOUND ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Dead key definitions must come before +; dead key translations to handle +; dead key + dead key. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +IFF EITHER_ALT,NOT ;; +ANDF EITHER_CTL,NOT ;; + IFF EITHER_SHIFT ;; + SET_FLAG DEAD_UPPER ;; + ELSEF ;; + SET_FLAG DEAD_LOWER ;; + ENDIFF ;; +ENDIFF ;; +IFF EITHER_SHIFT,NOT ;; + IFKBD XT_KB+AT_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + SET_FLAG DEAD_THIRD ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_CTL,NOT ;; + ANDF R_ALT_SHIFT ;; + SET_FLAG DEAD_THIRD ;; + ENDIFF ;; + ENDIFF ;; +ENDIFF ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; ACUTE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; +ACUTE_PROC: ; + ; + IFF ACUTE,NOT ; + GOTO DIARESIS_PROC ; + ENDIFF ; + ; + RESET_NLS ; + IFF R_ALT_SHIFT,NOT ; + XLATT ACUTE_SPACE ; + ENDIFF ; + IFF EITHER_CTL,NOT ; + ANDF EITHER_ALT,NOT ; + IFF EITHER_SHIFT ; + IFF CAPS_STATE ; + XLATT ACUTE_LOWER ; + ELSEF ; + XLATT ACUTE_UPPER ; + ENDIFF ; + ELSEF ; + IFF CAPS_STATE ; + XLATT ACUTE_UPPER ; + ELSEF ; + XLATT ACUTE_LOWER ; + ENDIFF ; + ENDIFF ; + ENDIFF ; + ; +INVALID_ACUTE: ; + PUT_ERROR_CHAR ACUTE_LOWER ; If we get here then either the XLATT + BEEP ; failed or we are ina bad shift state. + GOTO NON_DEAD ; Either is invalid so BEEP and fall + ; through to generate the second char. + ; Note that the dead key flag will be + ; reset before we get here. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; DIARESIS ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +DIARESIS_PROC: ; + IFF DIARESIS,NOT ; + GOTO GRAVE_PROC ; + ENDIFF ; + ; + RESET_NLS ; + IFF R_ALT_SHIFT,NOT ; + XLATT DIARESIS_SPACE ; exist for 437 so beep for + ENDIFF ; + IFF EITHER_CTL,NOT ; + ANDF EITHER_ALT,NOT ; + IFF EITHER_SHIFT ; + IFF CAPS_STATE ; + XLATT DIARESIS_LOWER ; + ELSEF ; + XLATT DIARESIS_UPPER ; + ENDIFF ; + ELSEF ; + IFF CAPS_STATE ; + XLATT DIARESIS_UPPER ; + ELSEF ; + XLATT DIARESIS_LOWER ; + ENDIFF ; + ENDIFF ; + ENDIFF ; + ; +INVALID_DIARESIS: ; + PUT_ERROR_CHAR DIARESIS_LOWER ; standalone accent + BEEP ; Invalid dead key combo. + GOTO NON_DEAD ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; GRAVE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +GRAVE_PROC: ; + ; + IFF GRAVE,NOT ; + GOTO CIRCUMFLEX_PROC ; + ENDIFF ; + ; + RESET_NLS ; + IFF R_ALT_SHIFT,NOT ; + XLATT GRAVE_SPACE ; + ENDIFF ; + IFF EITHER_CTL,NOT ; + ANDF EITHER_ALT,NOT ; + IFF EITHER_SHIFT ; + IFF CAPS_STATE ; + XLATT GRAVE_LOWER ; + ELSEF ; + XLATT GRAVE_UPPER ; + ENDIFF ; + ELSEF ; + IFF CAPS_STATE,NOT ; + XLATT GRAVE_LOWER ; + ELSEF ; + XLATT GRAVE_UPPER ; + ENDIFF ; + ENDIFF ; + ENDIFF ; + ; +INVALID_GRAVE: ; + PUT_ERROR_CHAR GRAVE_LOWER ; standalone accent + BEEP ; Invalid dead key combo. + GOTO NON_DEAD ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CIRCUMFLEX ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +CIRCUMFLEX_PROC: ; + ; + IFF CIRCUMFLEX,NOT ; + GOTO NON_DEAD ; + ENDIFF ; + ; + RESET_NLS ; + IFF R_ALT_SHIFT,NOT ; + XLATT CIRCUMFLEX_SPACE ; + ENDIFF ; + IFF EITHER_CTL,NOT ; + ANDF EITHER_ALT,NOT ; + IFF EITHER_SHIFT ; + IFF CAPS_STATE ; + XLATT CIRCUMFLEX_LOWER ; + ELSEF ; + XLATT CIRCUMFLEX_UPPER ; + ENDIFF ; + ELSEF ; + IFF CAPS_STATE,NOT ; + XLATT CIRCUMFLEX_LOWER ; + ELSEF ; + XLATT CIRCUMFLEX_UPPER ; + ENDIFF ; + ENDIFF ; + ENDIFF ; + ; +INVALID_CIRCUMFLEX: ; + PUT_ERROR_CHAR CIRCUMFLEX_LOWER ; standalone accent + BEEP ; Invalid dead key combo. + GOTO NON_DEAD ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Upper, lower and third shifts +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +NON_DEAD: ; + ; + IFKBD G_KB+P12_KB ; Avoid accidentally translating + ANDF LC_E0 ; the "/" on the numeric pad of the + EXIT_STATE_LOGIC ; G keyboard + ENDIFF ; +;;***BD ADDED FOR ALT, CTRL CASES ; + IFF EITHER_CTL,NOT ; + IFF ALT_SHIFT ; ALT - case + ANDF R_ALT_SHIFT,NOT ; + XLATT ALT_CASE ; + ENDIFF ; + ELSEF ; + IFF EITHER_ALT,NOT ; CTRL - case + XLATT CTRL_CASE ; + ENDIFF ; + ENDIFF ; +;;***BD END OF ADDITION + ; + IFF EITHER_ALT,NOT ; Lower and upper case. Alphabetic + ANDF EITHER_CTL,NOT ; keys are affected by CAPS LOCK. + IFF EITHER_SHIFT ; Numeric keys are not. +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE,NOT ; + XLATT NUMERIC_PAD ; + ENDIFF ; +;;***BD END OF ADDITION + XLATT NON_ALPHA_UPPER ; + IFF CAPS_STATE ; + XLATT ALPHA_LOWER ; + ELSEF ; + XLATT ALPHA_UPPER ; + ENDIFF ; + ELSEF ; +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE ; + XLATT NUMERIC_PAD ; + ENDIFF ; +;;***BD END OF ADDITION + XLATT NON_ALPHA_LOWER ; + IFF CAPS_STATE ; + XLATT ALPHA_UPPER ; + ELSEF ; + XLATT ALPHA_LOWER ; + ENDIFF ; + ENDIFF ; + ELSEF ; + IFF EITHER_SHIFT,NOT ; + IFKBD XT_KB+AT_KB ; + IFF EITHER_CTL ; + ANDF ALT_SHIFT ; + XLATT THIRD_SHIFT ; + ENDIFF ; + ELSEF ; + IFF EITHER_CTL,NOT ; + ANDF R_ALT_SHIFT ; + XLATT THIRD_SHIFT ; + ENDIFF ; + ENDIFF ; + ENDIFF ; + ENDIFF ; + ; + EXIT_STATE_LOGIC ; + ; +LOGIC_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; SP Common Translate Section +; This section contains translations for the lower 128 characters +; only since these will never change from code page to code page. +; In addition the dead key "Set Flag" tables are here since the +; dead keys are on the same keytops for all code pages. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + PUBLIC LA_COMMON_XLAT ; +LA_COMMON_XLAT: ; + ; + DW COMMON_XLAT_END-$ ; length of section + DW -1 ; code page +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: Common +; STATE: Lower Shift Dead Key +; KEYBOARD TYPES: G + P12 +; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW COM_DK_LO_K1_END-$ ; length of state section + DB DEAD_LOWER ; State ID + DW G_KB+P12_KB ; Keyboard Type + DB -1,-1 ; Buffer entry for error character + ; Set Flag Table + DW 1 ; number of entries + DB 26 ; scan code + FLAG ACUTE ; + ; +COM_DK_LO_K1_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: Common +; STATE: Lower Shift Dead Key +; KEYBOARD TYPES: AT + XT + +; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; + DW COM_DK_LO_K2_END-$ ; length of state section + DB DEAD_LOWER ; State ID + DW AT_KB+XT_KB ; Keyboard Type + DB -1,-1 ; Buffer entry for error character + ; Set Flag Table + DW 2 ; number of entries + DB 26 ; scan code + FLAG ACUTE ; flag bit to set + DB 27 ; + FLAG GRAVE ; + ; + ; +COM_DK_LO_K2_END: ; + ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: Common +; STATE: Upper Shift Dead Key +; KEYBOARD TYPES: G + P12 +; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW COM_DK_UP_K1_END-$ ; length of state section + DB DEAD_UPPER ; State ID + DW G_KB+P12_KB ; Keyboard Type + DB -1,-1 ; Buffer entry for error character + ; Set Flag Table + DW 1 ; number of entries + DB 26 ; scan code + FLAG DIARESIS ; + ; +COM_DK_UP_K1_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: Common +; STATE: Third Shift Dead Key +; KEYBOARD TYPES: G + P12 +; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW COM_TH_DK_UP_K1_END-$ ; length of state section + DB DEAD_THIRD ; State ID + DW G_KB+P12_KB ; Keyboard Type + DB -1,-1 ; Buffer entry for error character + ; Set Flag Table + DW 2 ; number of entries + DB 40 ; scan code + FLAG CIRCUMFLEX ; + DB 43 ; scan code + FLAG GRAVE ; + ; +COM_TH_DK_UP_K1_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: Common +; STATE: Upper Shift Dead Key +; KEYBOARD TYPES: AT + XT + +; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; + DW COM_DK_UP_END-$ ; length of state section + DB DEAD_UPPER ; State ID + DW AT_KB+XT_KB ; Keyboard Type + DB -1,-1 ; Buffer entry for error character + ; Set Flag Table + DW 2 ; number of entries + DB 26 ; scan code + FLAG DIARESIS ; flag bit to set + DB 27 ; + FLAG CIRCUMFLEX ; + ; +COM_DK_UP_END: ; + ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: Common +; STATE: Alpha Lower Case +; KEYBOARD TYPES: G + P12 +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW COM_AL_LO_GP_K1_END-$ ; length of state section + DB ALPHA_LOWER ; State ID + DW G_KB+P12_KB ; Keyboard Type + DB -1,-1 ; Buffer entry for error character + ; + DW COM_AL_LO_GP_K1_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE ; xlat options: + DB 1 ; number of entries + DB 39,164 ; n-tilde +COM_AL_LO_GP_K1_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +COM_AL_LO_GP_K1_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: Common +; STATE: Alpha Lower Case +; KEYBOARD TYPES: AT +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW COM_AL_LO_K1_END-$ ; length of state section + DB ALPHA_LOWER ; State ID + DW AT_KB ; Keyboard Type + DB -1,-1 ; Buffer entry for error character + ; + DW COM_AL_LO_K1_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE ; xlat options: + DB 2 ; number of entries + DB 39,164 ; n-tilde + DB 43,135 ; c-cedilla +COM_AL_LO_K1_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +COM_AL_LO_K1_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: Common +; STATE: Numeric Key Pad +; KEYBOARD TYPES: All +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW COM_PAD_K1_END-$ ; length of state section + DB NUMERIC_PAD ; State ID + DW ANY_KB ; Keyboard Type + DB -1,-1 ; Buffer entry for error character + ; + DW COM_PAD_K1_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE ; xlat options: + DB 1 ; number of entries + DB 83,'.' ; decimal seperator = . +COM_PAD_K1_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +COM_PAD_K1_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; BD - ADDED FOR ALT CASE +; +; CODE PAGE: Common +; STATE: Alt Case +; KEYBOARD TYPES: All +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW COM_ALT_K1_END-$ ; length of state section + DB ALT_CASE ; State ID + DW ANY_KB ; Keyboard Type + DB -1,-1 ; Buffer entry for error character + ; + DW COM_ALT_K1_T1_END-$ ; Size of xlat table + DB TYPE_2_TAB ; xlat options: + DB 0 ; number of entries +;;***BD THIS ENTRY IS A TEST ENTRY +;; DB 53,225,0 ; TEST ENTRY +COM_ALT_K1_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +COM_ALT_K1_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; BD - ADDED FOR CTRL CASE +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K1_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_CTRL_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 2 ;; number of entries +;;***BD THIS ENTRY IS A TEST ENTRY +;; DB 53,226,0 ;; TEST ENTRY + DB 43,-1,-1 ;; invalid slash + DB 41,28,41 ;; valid slash +COM_CTRL_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CTRL_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: XT_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K2_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_CTRL_K2_T2_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 1 ;; number of entries +;;***BD THIS ENTRY IS A TEST ENTRY +;; DB 53,226,0 ;; TEST ENTRY + DB 43,-1,-1 ;; invalid slash +COM_CTRL_K2_T2_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CTRL_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: Common +; STATE: Alpha Lower Case +; KEYBOARD TYPES: XT + +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW COM_AL_LO_K2_END-$ ; length of state section + DB ALPHA_LOWER ; State ID + DW XT_KB ; Keyboard Type + DB -1,-1 ; Buffer entry for error character + ; + DW COM_AL_LO_K2_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE ; xlat options: + DB 2 ; number of entries + DB 39,164 ; n-tilde + DB 41,135 ; c-cedilla +COM_AL_LO_K2_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +COM_AL_LO_K2_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: Common +; STATE: Alpha Upper Case +; KEYBOARD TYPES: G + P12 +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW COM_AL_UP_GP_K1_END-$ ; length of state section + DB ALPHA_UPPER ; State ID + DW G_KB+P12_KB ; Keyboard Type + DB -1,-1 ; Buffer entry for error character + ; + DW COM_AL_UP_GP_K1_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE ; xlat options: + DB 1 ; number of entries + DB 39,165 ; N-tilde +COM_AL_UP_GP_K1_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +COM_AL_UP_GP_K1_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: Common +; STATE: Alpha Upper Case +; KEYBOARD TYPES: AT +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW COM_AL_UP_K1_END-$ ; length of state section + DB ALPHA_UPPER ; State ID + DW AT_KB ; Keyboard Type + DB -1,-1 ; Buffer entry for error character + ; + DW COM_AL_UP_K1_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE ; xlat options: + DB 2 ; number of entries + DB 39,165 ; N-tilde + DB 43,128 ; C-cedilla +COM_AL_UP_K1_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +COM_AL_UP_K1_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: Common +; STATE: Alpha Upper Case +; KEYBOARD TYPES: XT + +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW COM_AL_UP_K2_END-$ ; length of state section + DB ALPHA_UPPER ; State ID + DW XT_KB ; Keyboard Type + DB -1,-1 ; Buffer entry for error character + ; + DW COM_AL_UP_K2_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE ; xlat options: + DB 2 ; number of entries + DB 39,165 ; N-tilde + DB 41,128 ; C-cedilla +COM_AL_UP_K2_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +COM_AL_UP_K2_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: Common +; STATE: Non-Alpha Lower Case +; KEYBOARD TYPES: G + P12 +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW COM_NA_LO_GP_K1_END-$ ; length of state section + DB NON_ALPHA_LOWER ; State ID + DW G_KB+P12_KB ; Keyboard Type + DB -1,-1 ; Buffer entry for error character + ; + DW COM_NA_LO_GP_K1_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE ; xlat options: + DB 8 ; number of entries + DB 12,"'" ; ' + DB 13,'' ; + DB 27,'+' ; + + DB 40,'{' ; | + DB 41,'|' ; | + DB 43,'}' ; | + DB 53,'-' ; - + DB 86,'<' ; < +COM_NA_LO_GP_K1_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +COM_NA_LO_GP_K1_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: Common +; STATE: Non-Alpha Lower Case +; KEYBOARD TYPES: AT +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW COM_NA_LO_K2_END-$ ; length of state section + DB NON_ALPHA_LOWER ; State ID + DW AT_KB ; Keyboard Type + DB -1,-1 ; Buffer entry for error character + ; + DW COM_NA_LO_K2_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE ; xlat options: + DB 3 ; number of entries + DB 40,';' ; ; + DB 41,'<' ; < + DB 53,"'" ; quote +COM_NA_LO_K2_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +COM_NA_LO_K2_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: Common +; STATE: Non-Alpha Lower Case +; KEYBOARD TYPES: XT + +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW COM_NA_LO_K3_END-$ ; length of state section + DB NON_ALPHA_LOWER ; State ID + DW XT_KB ; Keyboard Type + DB -1,-1 ; Buffer entry for error character + ; + DW COM_NA_LO_K3_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE ; xlat options: + DB 3 ; number of entries + DB 40,';' ; ; + DB 43,'<' ; < + DB 53,"'" ; quote +COM_NA_LO_K3_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +COM_NA_LO_K3_END: ; + ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: Common +; STATE: Non-Alpha Upper Case +; KEYBOARD TYPES: G + P12 +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW COM_NA_UP_GP_K1_END-$ ; length of state section + DB NON_ALPHA_UPPER ; State ID + DW G_KB+P12_KB ; Keyboard Type + DB -1,-1 ; Buffer entry for error character + ; + DW COM_NA_UP_GP_K1_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE ; xlat options: + DB 16 ; number of entries + DB 3,'"' ; " + DB 7,'&' ; & + DB 8,'/' ; / + DB 9,'(' ; ( + DB 10,')' ; ) + DB 11,'=' ; = + DB 12,'?' ; ? + DB 13,'' ; + DB 27,'*' ; * + DB 40,'[' ; [ + DB 41,'' ; + DB 43,']' ; ] + DB 51,';' ; ; + DB 52,':' ; : + DB 53,'_' ; _ + DB 86,'>' ; > +COM_NA_UP_GP_K1_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +COM_NA_UP_GP_K1_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: Common +; STATE: Non-Alpha Upper Case +; KEYBOARD TYPES: AT +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW COM_NA_UP_K2_END-$ ; length of state section + DB NON_ALPHA_UPPER ; State ID + DW AT_KB ; Keyboard Type + DB -1,-1 ; Buffer entry for error character + ; + DW COM_NA_UP_K2_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE ; xlat options: + DB 8 ; number of entries + DB 41,'>' ; + DB 2,0ADH ; UPSIDE DOWN + DB 3,168 ; UPSIDE DOWN ? + DB 7,'/' ; + DB 40,':' ; + DB 51,'?' ; + DB 52,'!' ; + DB 53,'"' ; +COM_NA_UP_K2_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +COM_NA_UP_K2_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: Common +; STATE: Non-Alpha Upper Case +; KEYBOARD TYPES: XT + +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; + DW COM_NA_UP_K3_END-$ ; length of state section + DB NON_ALPHA_UPPER ; State ID + DW XT_KB ; Keyboard Type + DB -1,-1 ; Buffer entry for error character + ; + DW COM_NA_UP_K3_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE ; xlat options: + DB 8 ; number of entries + DB 43,'>' ; + DB 2,0ADH ; UPSIDE DOWN + DB 3,168 ; UPSIDE DOWN ? + DB 7,'/' ; + DB 40,':' ; + DB 51,'?' ; + DB 52,'!' ; + DB 53,'"' ; +COM_NA_UP_K3_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +COM_NA_UP_K3_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: Common +; STATE: Third Shift +; KEYBOARD TYPES: G + P12 +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW COM_THIRD_K1_END-$ ; length of state section + DB THIRD_SHIFT ; State ID + DW G_KB+P12_KB ; Keyboard Type + DB -1,-1 ; Buffer entry for error character + ; + DW COM_THIRD_K1_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE ; xlat options: + DB 4 ; number of entries + DB 12,'\' ; \ + DB 16,'@' ; @ + DB 27,'~' ; ~ + DB 41,'' ; +COM_THIRD_K1_T1_END: ; + ; + DW 0 ; Last xlat table +COM_THIRD_K1_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: Common +; STATE: Third Shift +; KEYBOARD TYPES: AT +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW COM_THIRD_K2_END-$ ; length of state section + DB THIRD_SHIFT ; State ID + DW AT_KB ; Keyboard Type + DB -1,-1 ; Buffer entry for error character + ; + DW COM_THIRD_K2_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE ; xlat options: + DB 4 ; number of entries + DB 41,'\' ; + DB 3,'@' ; + DB 26,'[' ; + DB 27,']' ; +COM_THIRD_K2_T1_END: ; + ; + DW 0 ; Last xlat table +COM_THIRD_K2_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: Common +; STATE: Third Shift +; KEYBOARD TYPES: XT + +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW COM_THIRD_K3_END-$ ; length of state section + DB THIRD_SHIFT ; State ID + DW XT_KB ; Keyboard Type + DB -1,-1 ; Buffer entry for error character + ; + DW COM_THIRD_K3_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE ; xlat options: + DB 3 ; number of entries + DB 3,'@' ; + DB 26,'[' ; + DB 27,']' ; +COM_THIRD_K3_T1_END: ; + ; + DW 0 ; Last xlat table +COM_THIRD_K3_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: Common +; STATE: Acute Lower Case +; KEYBOARD TYPES: All +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; DW COM_AC_LO_END-$ ; length of state section +; DB ACUTE_LOWER ; State ID +; DW ANY_KB ; Keyboard Type +; DB 39,0 ; error character = standalone accent +; ; +; DW COM_AC_LO_T1_END-$ ; Size of xlat table +; DB STANDARD_TABLE+ZERO_SCAN ; xlat options: +; DB 5 ; number of scans +; DB 18,'' ; scan code,ASCII - e +; DB 30,'' ; scan code,ASCII - a +; DB 24,'' ; scan code,ASCII - o +; DB 22,'' ; scan code,ASCII - u +; DB 23,'' ; scan code,ASCII - i +;COM_AC_LO_T1_END: ; +; ; +; DW 0 ; Size of xlat table - null table +; ; +;COM_AC_LO_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Acute Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; DW COM_AC_UP_END-$ ; length of state section +; DB ACUTE_UPPER ; State ID +; DW ANY_KB ; Keyboard Type +; DB 39,0 ; error character = standalone accent +; ; +; DW COM_AC_UP_T1_END-$ ; Size of xlat table +; DB STANDARD_TABLE+ZERO_SCAN ; xlat options: +; DB 2 ; number of scans +; DB 18,'' ; scan code,ASCII - e +;COM_AC_UP_T1_END: ; +; ; +; DW 0 ; Size of xlat table - null table +; ; +;COM_AC_UP_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Acute Space Bar +;;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; DW COM_AC_LA_END-$ ; length of state section +; DB ACUTE_SPACE ; State ID +;; DW ANY_KB ; Keyboard Type +; DB 39,0 ; error character = standalone accent +; ; +; DW COM_AC_LA_T1_END-$ ; Size of xlat table +; DB STANDARD_TABLE+ZERO_SCAN ; xlat options: +; DB 1 ; number of scans +; DB 57,39 ; scan code,ASCII - SPACE +;COM_AC_LA_T1_END: ; +; ; +; DW 0 ; Size of xlat table - null table +; ; +;COM_AC_LA_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Diaresis Lower Case +; KEYBOARD TYPES: All +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW COM_DI_LO_END-$ ; length of state section + DB DIARESIS_LOWER ; State ID + DW ANY_KB ; Keyboard Type + DB 249,0 ; error character = standalone accent + ; + DW COM_DI_LO_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ; xlat options: + DB 6 ; number of scans + DB 18,'' ; scan code,ASCII - e + DB 30,'' ; scan code,ASCII - a + DB 24,'' ; scan code,ASCII - o + DB 22,'' ; scan code,ASCII - u + DB 23,'' ; scan code,ASCII - i + DB 21,'' ; scan code,ASCII - y +COM_DI_LO_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +COM_DI_LO_END: ; length of state section +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: Common +; STATE: Diaresis Upper Case +; KEYBOARD TYPES: All +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW COM_DI_UP_END-$ ; length of state section + DB DIARESIS_UPPER ; State ID + DW ANY_KB ; Keyboard Type + DB 249,0 ; error character = standalone accent + ; + DW COM_DI_UP_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ; xlat options: + DB 3 ; number of scans + DB 30,'' ; scan code,ASCII - a + DB 24,'' ; scan code,ASCII - o + DB 22,'' ; scan code,ASCII - u +COM_DI_UP_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +COM_DI_UP_END: ; length of state section +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: Common +; STATE: Grave Lower +; KEYBOARD TYPES: All +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW COM_GR_LO_END-$ ; length of state section + DB GRAVE_LOWER ; State ID + DW ANY_KB ; Keyboard Type + DB 96,0 ; error character = standalone accent + ; + DW COM_GR_LO_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ; xlat options: + DB 5 ; number of scans + DB 18,'' ; scan code,ASCII - e + DB 30,'' ; scan code,ASCII - a + DB 24,'' ; scan code,ASCII - o + DB 22,'' ; scan code,ASCII - u + DB 23,'' ; scan code,ASCII - i +COM_GR_LO_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +COM_GR_LO_END: ; length of state section +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: Common +; STATE: Grave Space Bar +; KEYBOARD TYPES: All +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW COM_GR_LA_END-$ ; length of state section + DB GRAVE_SPACE ; State ID + DW ANY_KB ; Keyboard Type + DB 96,0 ; error character = standalone accent + ; + DW COM_GR_LA_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ; xlat options: + DB 1 ; number of scans + DB 57,96 ; STANDALONE GRAVE +COM_GR_LA_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +COM_GR_LA_END: ; length of state section +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: Common +; STATE: Circumflex Lower +; KEYBOARD TYPES: All +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW COM_CI_LO_END-$ ; length of state section + DB CIRCUMFLEX_LOWER ; State ID + DW ANY_KB ; Keyboard Type + DB 94,0 ; error character = standalone accent + ; + DW COM_CI_LO_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ; xlat options: + DB 5 ; number of scans + DB 18,'' ; scan code,ASCII - e + DB 30,'' ; scan code,ASCII - a + DB 24,'' ; scan code,ASCII - o + DB 22,'' ; scan code,ASCII - u + DB 23,'' ; scan code,ASCII - i +COM_CI_LO_T1_END: ; + ; + DW 0 ; + ; +COM_CI_LO_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: Common +; STATE: Circumflex Space Bar +; KEYBOARD TYPES: All +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW COM_CI_LA_END-$ ; length of state section + DB CIRCUMFLEX_SPACE ; State ID + DW ANY_KB ; Keyboard Type + DB 94,0 ; error character = standalone accent + ; + DW COM_CI_LA_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ; xlat options: + DB 1 ; number of scans + DB 57,94 ; STANDALONE CIRCUMFLEX +COM_CI_LA_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +COM_CI_LA_END: ; length of state section + ; + DW 0 ; Last State +COMMON_XLAT_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; SP Specific Translate Section for 437 +; 437 IS COMPLETELY COVERED BY THE COMMON TABLE. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + PUBLIC LA_437_XLAT ; +LA_437_XLAT: ; + ; + DW CP437_XLAT_END-$ ; length of section + DW 437 ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: Specific 437 +; STATE: Acute Lower Case +; KEYBOARD TYPES: All +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW CP437_AC_LO_END-$ ; length of state section + DB ACUTE_LOWER ; State ID + DW ANY_KB ; Keyboard Type + DB 39,0 ; error character = standalone accent + ; + DW CP437_AC_LO_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ; xlat options: + DB 5 ; number of scans + DB 18,'' ; scan code,ASCII - e + DB 30,'' ; scan code,ASCII - a + DB 24,'' ; scan code,ASCII - o + DB 22,'' ; scan code,ASCII - u + DB 23,'' ; scan code,ASCII - i +CP437_AC_LO_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +CP437_AC_LO_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: 437 +; STATE: Acute Upper Case +; KEYBOARD TYPES: All +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW CP437_AC_UP_END-$ ; length of state section + DB ACUTE_UPPER ; State ID + DW ANY_KB ; Keyboard Type + DB 39,0 ; error character = standalone accent + ; + DW CP437_AC_UP_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ; xlat options: + DB 1 ; number of scans + DB 18,'' ; scan code,ASCII - e +CP437_AC_UP_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +CP437_AC_UP_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: 437 +; STATE: Acute Space Bar +; KEYBOARD TYPES: All +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW CP437_AC_LA_END-$ ; length of state section + DB ACUTE_SPACE ; State ID + DW ANY_KB ; Keyboard Type + DB 39,0 ; error character = standalone accent + ; + DW CP437_AC_LA_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ; xlat options: + DB 1 ; number of scans + DB 57,39 ; scan code,ASCII - SPACE +CP437_AC_LA_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +CP437_AC_LA_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ; LAST STATE + ; +CP437_XLAT_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; SP Specific Translate Section for 850 +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + PUBLIC LA_850_XLAT ; +LA_850_XLAT: ; + ; + DW CP850_XLAT_END-$ ; length of section + DW 850 ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: Specific 850 +; STATE: Acute Lower Case +; KEYBOARD TYPES: All +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW CP850_AC_LO_END-$ ; length of state section + DB ACUTE_LOWER ; State ID + DW ANY_KB ; Keyboard Type + DB 0EFH,0 ; error character = standalone accent + ; + DW CP850_AC_LO_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ; xlat options: + DB 5 ; number of scans + DB 18,'' ; scan code,ASCII - e + DB 30,'' ; scan code,ASCII - a + DB 24,'' ; scan code,ASCII - o + DB 22,'' ; scan code,ASCII - u + DB 23,'' ; scan code,ASCII - i +; DB 21,0ECH add in later date ; y acute +CP850_AC_LO_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +CP850_AC_LO_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: 850 +; STATE: Acute Upper Case +; KEYBOARD TYPES: All +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW CP850_AC_UP_END-$ ; length of state section + DB ACUTE_UPPER ; State ID + DW ANY_KB ; Keyboard Type + DB 0EFH,0 ; error character = standalone accent + ; + DW CP850_AC_UP_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ; xlat options: + DB 5 ; number of scans + DB 18,'' ; scan code,ASCII - e + DB 30,0B5H ; A acute + DB 23,0D6H ; I acute + DB 24,0E0H ; O acute + DB 22,0E9H ; U acute +; DB 21,0EDH add in later date ; Y acute +CP850_AC_UP_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +CP850_AC_UP_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: 850 +; STATE: Acute Space Bar +; KEYBOARD TYPES: All +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW CP850_AC_LA_END-$ ; length of state section + DB ACUTE_SPACE ; State ID + DW ANY_KB ; Keyboard Type + DB 0EFH,0 ; error character = standalone accent + ; + DW CP850_AC_LA_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ; xlat options: + DB 1 ; number of scans + DB 57,0EFH ; scan code,ASCII - SPACE +CP850_AC_LA_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +CP850_AC_LA_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: 850 +; STATE: Diaresis Upper +; KEYBOARD TYPES: All +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW CP850_DI_UP_END-$ ; length of state section + DB DIARESIS_UPPER ; State ID + DW ANY_KB ; Keyboard Type + DB 249,0 ; error character = standalone accent + ; + DW CP850_DI_UP_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ; xlat options: + DB 2 ; number of scans + DB 18,0D3H ; E diaeresis + DB 23,0D8H ; I diaeresis +CP850_DI_UP_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +CP850_DI_UP_END: ; length of state section +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: 850 +; STATE: Diaresis Space Bar +; KEYBOARD TYPES: All +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW CP850_DI_LA_END-$ ; length of state section + DB DIARESIS_SPACE ; State ID + DW ANY_KB ; Keyboard Type + DB 249,0 ; error character = standalone accent + ; + DW CP850_DI_LA_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ; xlat options: + DB 1 ; number of scans + DB 57,249 ; error character = standalone accent +CP850_DI_LA_T1_END: ; + ; + DW 0 ; Size of xlat table - null table +CP850_DI_LA_END: ; length of state section +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: 850 +; STATE: Grave Upper +; KEYBOARD TYPES: All +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW CP850_GR_UP_END-$ ; length of state section + DB GRAVE_UPPER ; State ID + DW ANY_KB ; Keyboard Type + DB 96,0 ; error character = standalone accent + ; + DW CP850_GR_UP_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ; xlat options: + DB 5 ; number of scans + DB 30,0B7H ; A grave + DB 18,0D4H ; E grave + DB 23,0DEH ; I grave + DB 24,0E3H ; O grave + DB 22,0EBH ; U grave +CP850_GR_UP_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +CP850_GR_UP_END: ; length of state section +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: 850 +; STATE: Circumflex Upper +; KEYBOARD TYPES: All +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW CP850_CI_UP_END-$ ; length of state section + DB CIRCUMFLEX_UPPER ; State ID + DW ANY_KB ; Keyboard Type + DB 94,0 ; error character = standalone accent + ; + DW CP850_CI_UP_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ; xlat options: + DB 5 ; number of scans + DB 30,0B6H ; A circumflex + DB 18,0D2H ; E circumflex + DB 23,0D7H ; I circumflex + DB 24,0E2H ; O circumflex + DB 22,0EAH ; U circumflex +CP850_CI_UP_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +CP850_CI_UP_END: ; length of state section + ; + DW 0 ; LAST STATE +CP850_XLAT_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +CODE ENDS ; + END ; diff --git a/v4.0/src/DEV/KEYBOARD/KDFNL.ASM b/v4.0/src/DEV/KEYBOARD/KDFNL.ASM new file mode 100644 index 0000000..24ca7b0 --- /dev/null +++ b/v4.0/src/DEV/KEYBOARD/KDFNL.ASM @@ -0,0 +1,1515 @@ +;; LATEST CHANGE ALT & CTL + PAGE ,132 + TITLE DOS - Keyboard Definition File + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DOS - - NLS Support - Keyboard Defintion File +;; (c) Copyright 1988 Microsoft +;; +;; This file contains the keyboard tables for Netherlands +;; +;; Linkage Instructions: +;; Refer to KDF.ASM. +;; +;; Modded from Belgian - DTF 20-Aug-86; 08-Sep-86 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + INCLUDE KEYBSHAR.INC ;; + INCLUDE POSTEQU.INC ;; + INCLUDE KEYBMAC.INC ;; + ;; + PUBLIC NL_LOGIC ;; + PUBLIC NL_437_XLAT ;; + PUBLIC NL_850_XLAT ;; + ;; +CODE SEGMENT PUBLIC 'CODE' ;; + ASSUME CS:CODE,DS:CODE ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Standard translate table options are a liner search table +;; (TYPE_2_TAB) and ASCII entries ONLY (ASCII_ONLY) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +STANDARD_TABLE EQU TYPE_2_TAB+ASCII_ONLY + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; NL State Logic +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +NL_LOGIC: + + DW LOGIC_END-$ ;; length + ;; + DW 0 ;; special features + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; COMMANDS START HERE + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; OPTIONS: If we find a scan match in +;; an XLATT or SET_FLAG operation then +;; exit from INT 9. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + OPTION EXIT_IF_FOUND ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Dead key definitions must come before +;; dead key translations to handle +;; dead key + dead key. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + IFF EITHER_CTL,NOT ;; + IFF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + SET_FLAG DEAD_UPPER ;; + ELSEF ;; + SET_FLAG DEAD_LOWER ;; + ENDIFF ;; + ELSEF ;; + IFKBD G_KB+P12_KB ;; For ENHANCED keyboard some + ANDF R_ALT_SHIFT ;; dead keys are on third shift + ANDF EITHER_SHIFT,NOT ;; which is accessed via the altgr key + SET_FLAG DEAD_THIRD ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ACUTE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +ACUTE_PROC: ;; + ;; + IFF ACUTE,NOT ;; + GOTO CEDILLA_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT ACUTE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT ACUTE_LOWER ;; + ELSEF ;; + XLATT ACUTE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT ACUTE_UPPER ;; + ELSEF ;; + XLATT ACUTE_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_ACUTE: ;; + PUT_ERROR_CHAR ACUTE_SPACE ;; If we get here then either the XLATT + BEEP ;; failed or we are ina bad shift state. + GOTO NON_DEAD ;; Either is invalid so BEEP and fall + ;; through to generate the second char. + ;; Note that the dead key flag will be + ;; reset before we get here. + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CEDILLA ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CEDILLA_PROC: ;; + ;; + IFF CEDILLA,NOT ;; + GOTO TILDE_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT CEDILLA_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT CEDILLA_LOWER ;; + ELSEF ;; + XLATT CEDILLA_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT CEDILLA_UPPER ;; + ELSEF ;; + XLATT CEDILLA_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_CEDILLA: ;; + PUT_ERROR_CHAR CEDILLA_SPACE ;; If we get here then either the XLATT + BEEP ;; failed or we are ina bad shift state. + GOTO NON_DEAD ;; Either is invalid so BEEP and fall + ;; through to generate the second char. + ;; Note that the dead key flag will be + ;; reset before we get here. + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; TILDE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +TILDE_PROC: ;; + ;; + IFF TILDE,NOT ;; + GOTO DIARESIS_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT TILDE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT TILDE_LOWER ;; + ELSEF ;; + XLATT TILDE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT TILDE_LOWER ;; + ELSEF ;; + XLATT TILDE_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_TILDE: ;; + PUT_ERROR_CHAR TILDE_SPACE ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DIARESIS ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +DIARESIS_PROC: ;; + ;; + IFF DIARESIS,NOT ;; + GOTO GRAVE_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT DIARESIS_SPACE ;; exist for 437 so beep for + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_LOWER ;; + ELSEF ;; + XLATT DIARESIS_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_UPPER ;; + ELSEF ;; + XLATT DIARESIS_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_DIARESIS: ;; + PUT_ERROR_CHAR DIARESIS_SPACE ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; GRAVE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +GRAVE_PROC: ;; + ;; + IFF GRAVE,NOT ;; + GOTO CIRCUMFLEX_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT GRAVE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_GRAVE: ;; + PUT_ERROR_CHAR GRAVE_SPACE ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CIRCUMFLEX ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CIRCUMFLEX_PROC: ;; + ;; + IFF CIRCUMFLEX,NOT ;; + GOTO NON_DEAD ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT CIRCUMFLEX_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_CIRCUMFLEX: ;; + PUT_ERROR_CHAR CIRCUMFLEX_SPACE ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Upper, lower and third shifts +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +NON_DEAD: ;; + ;; + IFKBD G_KB+P12_KB ;; Avoid accidentally translating + ANDF LC_E0 ;; the "/" on the numeric pad of the + EXIT_STATE_LOGIC ;; G keyboard + ENDIFF ;; + ;; +;;***BD ADDED FOR ALT, CTRL CASES ;; +;;***MJS Added because of diferences ;; +;;between KYB Types ;; + ;; + IFKBD AT_KB+XT_KB ;; + IFF EITHER_CTL,NOT ;; + IFF ALT_SHIFT ;; ALT - case + XLATT ALT_CASE ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_ALT,NOT ;; CTRL - case + XLATT CTRL_CASE ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +;;***MJS repeated for G, P12 ;; + IFKBD G_KB+P12_KB ;; + IFF EITHER_CTL,NOT ;; + ANDF ALT_SHIFT ;; + ANDF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; ALT - case + ANDF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + IFF EITHER_CTL ;; + ANDF EITHER_ALT,NOT ;; CTRL - case + XLATT CTRL_CASE ;; + ENDIFF ;; + ENDIFF ;; +;;***BD END OF ADDITION + IFF EITHER_CTL,NOT ;; Lower and upper case. Alphabetic + IFF EITHER_ALT,NOT ;; keys are affected by CAPS LOCK. + IFF EITHER_SHIFT ;; Numeric keys are not. +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE,NOT ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION + XLATT NON_ALPHA_UPPER ;; + IFF CAPS_STATE ;; + XLATT ALPHA_LOWER ;; + ELSEF ;; + XLATT ALPHA_UPPER ;; + ENDIFF ;; + ELSEF ;; +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION + XLATT NON_ALPHA_LOWER ;; + IFF CAPS_STATE ;; + XLATT ALPHA_UPPER ;; + ELSEF ;; + XLATT ALPHA_LOWER ;; + ENDIFF ;; + ENDIFF ;; Third and Fourth shifts + ELSEF ;; ctl off, alt on at this point + IFKBD XT_KB+AT_KB ;; XT, AT, keyboards. Nordics + IFF EITHER_SHIFT ;; only. + XLATT FOURTH_SHIFT ;; ALT + shift + ELSEF ;; + XLATT THIRD_SHIFT ;; ALT + ENDIFF ;; + ELSEF ;; ENHANCED keyboard + IFF R_ALT_SHIFT ;; ALTGr + ANDF EITHER_SHIFT,NOT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; + EXIT_STATE_LOGIC ;; + ;; +LOGIC_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; NL Common Translate Section +;; This section contains translations for the lower 128 characters +;; only since these will never change from code page to code page. +;; In addition the dead key "Set Flag" tables are here since the +;; dead keys are on the same keytops for all code pages. +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC NL_COMMON_XLAT ;; +NL_COMMON_XLAT: ;; + ;; + DW COMMON_XLAT_END-$ ;; length of section + DW -1 ;; code page + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Lower Shift Dead Key +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_LO_END-$ ;; length of state section + DB DEAD_LOWER ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 2 ;; number of entries + DB 26 ;; scan code + FLAG DIARESIS ;; flag bit to set + DB 40 ;; + FLAG ACUTE ;; + ;; + ;; +COM_DK_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Upper Shift Dead Key +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_UP_END-$ ;; length of state section + DB DEAD_UPPER ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 3 ;; number of entries + DB 26 ;; scan code + FLAG CIRCUMFLEX ;; flag bit to set + DB 40 ;; + FLAG GRAVE ;; + DB 13 ;; + FLAG TILDE ;; + ;; +COM_DK_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift Dead Key +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_TH_END-$ ;; length of state section + DB DEAD_THIRD ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 1 ;; number of entries + DB 13 ;; + FLAG CEDILLA ;; + ;; +COM_DK_TH_END: ;; + ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alpha Lower Case +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +; DW COM_AL_LO_END-$ ;; length of state section +; DB ALPHA_LOWER ;; State ID +; DW G_KB + P12_KB ;; Keyboard Type +; DB -1,-1 ;; Buffer entry for error character + ;; +; DW COM_AL_LO_T1_END-$ ;; Size of xlat table +; DB STANDARD_TABLE ;; xlat options: +; DB 0 ;; number of entries +;COM_AL_LO_T1_END: ;; + ;; +; DW 0 ;; Size of xlat table - null table + ;; +;COM_AL_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alpha Upper Case +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; ;; +; DW COM_AL_UP_END-$ ;; length of state section +; DB ALPHA_UPPER ;; State ID +; DW G_KB + P12_KB ;; Keyboard Type +; DB -1,-1 ;; Buffer entry for error character + ;; +; DW COM_AL_UP_T1_END-$ ;; Size of xlat table +; DB STANDARD_TABLE ;; xlat options: +; DB 0 ;; number of entries +;COM_AL_UP_T1_END: ;; +; ;; +; DW 0 ;; Size of xlat table - null table + ;; +;COM_AL_UP_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 10 ;; number of entries + DB 41,"@" ;; at sign + DB 12,"/" ;; + DB 13,0F8H ;; + DB 27,"*" ;; + DB 39,'+' ;; + DB 43,'<' ;; + DB 51,',' ;; + DB 52,'.' ;; + DB 53,'-' ;; + DB 86,']' +COM_NA_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 17 ;; number of entries + DB 2,'!' ;; + DB 3,'"' ;; + DB 4,'#' ;; + DB 5,'$' ;; + DB 6,'%' ;; + DB 7,'&' ;; + DB 8,'_' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,"'" ;; + DB 12,'?' ;; + DB 39,0F1H ;; + DB 43,'>' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'=' ;; + DB 86,'[' +COM_NA_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 16 ;; number of entries + DB 41,0AAH ;; + DB 2,0FBH ;; + DB 3,0FDH ;; + DB 4,0FCH ;; + DB 5,0ACH ;; + DB 6,0ABH ;; + DB 7,0F3H ;; + DB 8,9CH ;; + DB 9,'{' ;; + DB 10,'}' ;; + DB 12,5CH ;; + DB 31,0E1H ;; + DB 44,0AEH ;; + DB 45,0AFH ;; +; DB 46,9BH ;; special case + DB 50,0E6H ;; mu character + DB 52,0FAH ;; +COM_THIRD_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_END: ;; + ;; +;;****************************** +;;***BD - ADDED FOR NUMERIC PAD (DECIMAL SEPERATOR) +;;****************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Numeric Key Pad +;; KEYBOARD TYPES : G_KB (P12 change does not apply) +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_PAD_K1_END-$ ;; length of state section + DB NUMERIC_PAD ;; State ID + DW G_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_PAD_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 83,',' ;; decimal seperator = , +COM_PAD_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_PAD_K1_END: ;; + ;; +;;****************************** +;;***BD - ADDED FOR ALT CASE +;;****************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alt Case +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_ALT_K1_END-$ ;; length of state section + DB ALT_CASE ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_ALT_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 0 ;; 2 number of entries +; DB 12,-1,-1 ;; +; DB 53,0,82H ;; +COM_ALT_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_ALT_K1_END: ;; + ;; +;;****************************** +;;***BD - ADDED FOR CTRL CASE +;;****************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K1_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_CTRL_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 5 ;; number of entries + DB 12,-1,-1 ;; + DB 26,-1,-1 ;; + DB 27,-1,-1 ;; + DB 43,-1,-1 ;; + DB 53,01FH,35h ;; +COM_CTRL_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CTRL_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Lower +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_GR_LO_END-$ ;; length of state section + DB GRAVE_LOWER ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB 60H,0 ;; error character = standalone accent + ;; + DW COM_GR_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 30,'' ;; scan code,ASCII - a + DB 24,'' ;; scan code,ASCII - o + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i +COM_GR_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_GR_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Upper Case +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_GR_UP_END-$ ;; length of state section + DB GRAVE_UPPER ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB 60H,0 ;; error character = standalone accent + ;; + DW COM_GR_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 0 ;; number of scans +COM_GR_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_GR_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Space Bar +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_GR_SP_END-$ ;; length of state section + DB GRAVE_SPACE ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB 60H,0 ;; error character = standalone accent + ;; + DW COM_GR_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,60H ;; STANDALONE GRAVE +COM_GR_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_GR_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex Lower +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_LO_END-$ ;; length of state section + DB CIRCUMFLEX_LOWER ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB 5EH,0 ;; error character = standalone accent + ;; + DW COM_CI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 30,'' ;; scan code,ASCII - a + DB 18,'' ;; scan code,ASCII - e + DB 24,'' ;; scan code,ASCII - o + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i +COM_CI_LO_T1_END: ;; + ;; + DW 0 ;; + ;; +COM_CI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex Upper +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_UP_END-$ ;; length of state section + DB CIRCUMFLEX_UPPER ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB 5EH,0 ;; error character = standalone accent + ;; + DW COM_CI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 0 ;; number of scans +COM_CI_UP_T1_END: ;; + ;; + DW 0 ;; + ;; +COM_CI_UP_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex Space Bar +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_SP_END-$ ;; length of state section + DB CIRCUMFLEX_SPACE ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB 5EH,0 ;; error character = standalone accent + ;; + DW COM_CI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,5EH ;; STANDALONE CIRCUMFLEX +COM_CI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Tilde Space Bar +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_TI_SP_END-$ ;; length of state section + DB TILDE_SPACE ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB 7EH,0 ;; error character = standalone accent + ;; + DW COM_TI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,7EH ;; STANDALONE TIDLE +COM_TI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_TI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Cedilla lower +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CE_LO_END-$ ;; length of state section + DB CEDILLA_LOWER ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB 0F7H,0 ;; error character = standalone accent + ;; CHNAGED MJS 31/10/86 + DW COM_CE_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 46,135 ;; scan code,ASCII - c +COM_CE_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CE_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: CedilIa Upper Case +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CE_UP_END-$ ;; length of state section + DB CEDILLA_UPPER ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB 0F7H,0 ;; error character = standalone accent + ;; CHANGED MJS 31/10/86 + DW COM_CE_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 46,128 ;; scan code,ASCII - C +COM_CE_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CE_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Cedilla Space Bar +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CE_SP_END-$ ;; length of state section + DB CEDILLA_SPACE ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB 0F7H,0 ;; error character = standalone accent + ;; CHANGED MJS 31/10/86 + DW COM_CE_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,0F7H ;; STANDALONE CEDILLA +COM_CE_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CE_SP_END: ;; length of state section +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Diaresis Lower Case +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DI_LO_END-$ ;; length of state section + DB DIARESIS_LOWER ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB 0F9H,0 ;; error character = standalone accent + ;; CHANGED MJS 31/10/86 + DW COM_DI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 30,'' ;; scan code,ASCII - a + DB 24,'' ;; scan code,ASCII - o + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 21,'' ;; scan code,ASCII - y +COM_DI_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_DI_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Diaresis Space Bar +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DI_SP_END-$ ;; length of state section + DB DIARESIS_SPACE ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB 0F9H,0 ;; error character = standalone accent + ;; CHANGED MJS 31/10/86 + DW COM_DI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,0F9H ;; error character = standalone accent +COM_DI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table +COM_DI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; Last State +COMMON_XLAT_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; NL Specific Translate Section for 437 +;; +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC NL_437_XLAT ;; +NL_437_XLAT: ;; + ;; + DW CP437_XLAT_END-$ ;; length of section + DW 437 ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Third Shift +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_THIRD_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB -1,-1 ;; default ignore error state + ;; + DW CP437_THIRD_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 3 ;; number of scans +;; DB 2,7 ;; NO CHAR - JUST BELL should be super 1 +;; ;; NOW COMM. MJS 31/10/86 +;; DB 7,0FCH ;; NOW COMM. MJS 31/10/86 + DB 19,14H ;; NO CHAR - JUST BELL +;; ;; SHOULD O/P MJS 31/10/86 + DB 46,9BH ;; cent sign - + DB 86,7CH ;; vertical bar + ;; +CP437_THIRD_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_THIRD_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +; DW CP437_NA_LO_END-$ ;; length of state section +; DB NON_ALPHA_LOWER ;; State ID +; DW G_KB + P12_KB ;; Keyboard Type +; DB -1,-1 ;; default ignore error state + ;; +; DW CP437_NA_LO_T1_END-$ ;; Size of xlat table +; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: +; DB 0 ;; number of scans +;CP437_NA_LO_T1_END: ;; + ;; +; DW 0 ;; Size of xlat table - null table + ;; +;CP437_NA_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_NA_UP_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB -1,-1 ;; default ignore error state + ;; + DW CP437_NA_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 2 ;; number of scans + DB 27,0B3H ;; vert. line graphics + DB 41,15H ;; Section symbol +CP437_NA_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_NA_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Tilde Lower +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_TI_LO_END-$ ;; length of state section + DB TILDE_LOWER ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB 7EH,0 ;; error character = standalone accent + ;; + DW CP437_TI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 49,164 ;; scan code,ASCII - n +CP437_TI_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_TI_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Tilde Upper Case +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_TI_UP_END-$ ;; length of state section + DB TILDE_UPPER ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB 7EH,0 ;; error character = standalone accent + ;; + DW CP437_TI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 49,165 ;; scan code,ASCII - N +CP437_TI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_TI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Acute Lower Case +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_AC_LO_END-$ ;; length of state section + DB ACUTE_LOWER ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB 027H,0 ;; error character = standalone accent + ;; CHANGED MJS 31/10/86 + DW CP437_AC_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 30,'' ;; a acute + DB 18,'' ;; e acute + DB 23,'' ;; i acute + DB 24,'' ;; o acute + DB 22,'' ;; u acute +CP437_AC_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_AC_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Acute Upper Case +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_AC_UP_END-$ ;; length of state section + DB ACUTE_UPPER ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB 027H,0 ;; error character = standalone accent + ;; CHANGED MJS 31/10/86 + DW CP437_AC_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 18,'' ;; scan code,ASCII - e +CP437_AC_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_AC_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Acute Space Bar +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_AC_SP_END-$ ;; length of state section + DB ACUTE_SPACE ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB 027H,0 ;; error character = standalone accent + ;; CHANGED MJS 34/10/86 + DW CP437_AC_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,027H ;; scan code,ASCII - SPACE +CP437_AC_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_AC_SP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Diaresis Upper Case +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_DI_UP_END-$ ;; length of state section + DB DIARESIS_UPPER ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB 0F9H,0 ;; error character = standalone accent + ;; + DW CP437_DI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 3 ;; number of scans + DB 30,'' ;; scan code,ASCII - a + DB 24,'' ;; scan code,ASCII - o + DB 22,'' ;; scan code,ASCII - u +CP437_DI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_DI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; LAST STATE + ;; +CP437_XLAT_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; NL Specific Translate Section for 850 +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC NL_850_XLAT ;; +NL_850_XLAT: ;; + ;; + DW CP850_XLAT_END-$ ;; length of section + DW 850 ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_NA_UP_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB -1,-1 ;; default ignore error state + ;; + DW CP850_NA_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 2 ;; number of scans + DB 27,07CH ;; vert line + DB 41,0F5H ;; section symbol +CP850_NA_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_NA_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Third Shift +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_THIRD_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB -1,-1 ;; default ignore error state + ;; + DW CP850_THIRD_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 3 ;; number of scans +;; DB 2,0FBH ;; NOW COMM. MJS 31/10/86 +;; DB 7,0F3H ;; NOW COMM. MJS 31/10/86 + DB 19,0F4H ;; + DB 46,0BDH ;; cent sign - + DB 86,0DDH ;; true broken vertical +CP850_THIRD_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_THIRD_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP850 +;; STATE: Tilde Lower +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_TI_LO_END-$ ;; length of state section + DB TILDE_LOWER ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB 7EH,0 ;; error character = standalone accent + ;; + DW CP850_TI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 3 ;; number of scans + DB 30,0C6H ;; scan code,ASCII - a + DB 24,0E4H ;; scan code,ASCII - o + DB 49,164 ;; scan code,ASCII - n +CP850_TI_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_TI_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP850 +;; STATE: Tilde Upper Case +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_TI_UP_END-$ ;; length of state section + DB TILDE_UPPER ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB 7EH,0 ;; error character = standalone accent + ;; + DW CP850_TI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 3 ;; number of scans + DB 30,0C7H ;; scan code,ASCII - A + DB 24,0E5H ;; scan code,ASCII - O + DB 49,165 ;; scan code,ASCII - N +CP850_TI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_TI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP850 - NOW IN COMMON MJS 31/10/86 +;; STATE: Cedilla lower +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP850 - NOW IN COMMON MJS 31/10/86 +;; STATE: CedilIa Upper Case +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP850 - NOW IN COMMON MJS 31/10/86 +;; STATE: Cedilla Space Bar +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP850 +;; STATE: Acute Lower Case +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_LO_END-$ ;; length of state section + DB ACUTE_LOWER ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB 0EFH,0 ;; error character = standalone accent + DW CP850_AC_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 30,'' ;; a acute + DB 18,'' ;; e acute + DB 23,'' ;; i acute + DB 24,'' ;; o acute + DB 22,'' ;; u acute + DB 21,0ECH ;; y acute +CP850_AC_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP850 +;; STATE: Acute Upper Case +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_UP_END-$ ;; length of state section + DB ACUTE_UPPER ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB 0EFH,0 ;; error character = standalone accent + DW CP850_AC_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,090H ;; E acute + DB 30,0B5H ;; A acute + DB 23,0D6H ;; I acute + DB 24,0E0H ;; O acute + DB 22,0E9H ;; U acute + DB 21,0EDH ;; Y acute +CP850_AC_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_UP_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP850 +;; STATE: Acute Space Bar +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_SP_END-$ ;; length of state section + DB ACUTE_SPACE ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB 0EFH,0 ;; error character = standalone accent + ;; + DW CP850_AC_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,0EFH ;; scan code,ASCII - SPACE +CP850_AC_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_SP_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP850 - NOW IN COMMON MJS 31/10/86 +;; STATE: Diaresis Lower Case +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; +;; CODE PAGE: 850 +;; STATE: Diaresis Upper +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_UP_END-$ ;; length of state section + DB DIARESIS_UPPER ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB 0F9H,0 ;; error character = standalone accent + ;; + DW CP850_DI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 30,'' ;; scan code,ASCII - A + DB 18,0D3H ;; scan code,ASCII - E + DB 23,0D8H ;; scan code,ASCII - I + DB 24,'' ;; scan code,ASCII - O + DB 22,'' ;; scan code,ASCII - U +CP850_DI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_DI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP850 - NOW IN COMMON MJS 31/10/86 +;; STATE: Diaeresis Space Bar +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Grave Upper +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_GR_UP_END-$ ;; length of state section + DB GRAVE_UPPER ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB 60H,0 ;; error character = standalone accent + ;; + DW CP850_GR_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 30,0B7H ;; A grave + DB 18,0D4H ;; E grave + DB 23,0DEH ;; I grave + DB 24,0E3H ;; O grave + DB 22,0EBH ;; U grave +CP850_GR_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_GR_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Circumflex Upper +;; KEYBOARD TYPES : G_KB + P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_CI_UP_END-$ ;; length of state section + DB CIRCUMFLEX_UPPER ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB 5EH,0 ;; error character = standalone accent + ;; + DW CP850_CI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 30,0B6H ;; A circumflex + DB 18,0D2H ;; E circumflex + DB 23,0D7H ;; I circumflex + DB 24,0E2H ;; O circumflex + DB 22,0EAH ;; U circumflex +CP850_CI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_CI_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW 0 ;; LAST STATE + ;; +CP850_XLAT_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CODE ENDS ;; + END ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/v4.0/src/DEV/KEYBOARD/KDFNO.ASM b/v4.0/src/DEV/KEYBOARD/KDFNO.ASM new file mode 100644 index 0000000..b1d846a --- /dev/null +++ b/v4.0/src/DEV/KEYBOARD/KDFNO.ASM @@ -0,0 +1,1607 @@ + PAGE ,132 + TITLE DOS - Keyboard Definition File + +;; LATEST CHANGE P12 NUMERIC +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DOS - - NLS Support - Keyboard Definition File +;; (c) Copyright 1988 Microsoft +;; +;; This file contains the keyboard tables for Norwegian +;; +;; Linkage Instructions: +;; Refer to KDF.ASM. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + INCLUDE KEYBSHAR.INC ;; + INCLUDE POSTEQU.INC ;; + INCLUDE KEYBMAC.INC ;; + ;; + PUBLIC NO_LOGIC ;; + PUBLIC NO_865_XLAT ;; + PUBLIC NO_850_XLAT ;; + ;; +CODE SEGMENT PUBLIC 'CODE' ;; + ASSUME CS:CODE,DS:CODE ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Standard translate table options are a linear search table +;; (TYPE_2_TAB) and ASCII entries ONLY (ASCII_ONLY) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +STANDARD_TABLE EQU TYPE_2_TAB+ASCII_ONLY + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; NO State Logic +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +NO_LOGIC: + + DW LOGIC_END-$ ;; length + ;; + DW 0 ;; special features + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; COMMANDS START HERE + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; OPTIONS: If we find a scan match in +;; an XLATT or SET_FLAG operation then +;; exit from INT 9. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + OPTION EXIT_IF_FOUND ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Dead key definitions must come before +;; dead key translations to handle +;; dead key + dead key. +;; ***BD - THIS SECTION HAS BEEN UPDATED +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + IFF EITHER_CTL,NOT ;; + IFF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + SET_FLAG DEAD_UPPER ;; + ELSEF ;; + SET_FLAG DEAD_LOWER ;; + ENDIFF ;; + ELSEF ;; + IFKBD G_KB+P12_KB ;; For ENHANCED keyboard some + ANDF R_ALT_SHIFT ;; dead keys are on third shift + ANDF EITHER_SHIFT,NOT ;; which is accessed via the altgr key + SET_FLAG DEAD_THIRD ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ACUTE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +ACUTE_PROC: ;; + ;; + IFF ACUTE,NOT ;; + GOTO DIARESIS_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT ACUTE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT ACUTE_LOWER ;; + ELSEF ;; + XLATT ACUTE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT ACUTE_UPPER ;; + ELSEF ;; + XLATT ACUTE_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_ACUTE: ;; + PUT_ERROR_CHAR ACUTE_LOWER ;; If we get here then either the XLATT + BEEP ;; failed or we are ina bad shift state. + GOTO NON_DEAD ;; Either is invalid so BEEP and fall + ;; through to generate the second char. + ;; Note that the dead key flag will be + ;; reset before we get here. + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DIARESIS ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +DIARESIS_PROC: ;; + ;; + IFF DIARESIS,NOT ;; + GOTO GRAVE_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT DIARESIS_SPACE ;; exist for 437 so beep for + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_LOWER ;; + ELSEF ;; + XLATT DIARESIS_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_UPPER ;; + ELSEF ;; + XLATT DIARESIS_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_DIARESIS: ;; + PUT_ERROR_CHAR DIARESIS_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; GRAVE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +GRAVE_PROC: ;; + ;; + IFF GRAVE,NOT ;; + GOTO TILDE_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT GRAVE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_GRAVE: ;; + PUT_ERROR_CHAR GRAVE_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; TILDE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +TILDE_PROC: ;; + ;; + IFF TILDE,NOT ;; + GOTO CIRCUMFLEX_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT TILDE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT TILDE_LOWER ;; + ELSEF ;; + XLATT TILDE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT TILDE_UPPER ;; + ELSEF ;; + XLATT TILDE_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_TILDE: ;; + PUT_ERROR_CHAR TILDE_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CIRCUMFLEX ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CIRCUMFLEX_PROC: ;; + ;; + IFF CIRCUMFLEX,NOT ;; + GOTO NON_DEAD ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT CIRCUMFLEX_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_CIRCUMFLEX: ;; + PUT_ERROR_CHAR CIRCUMFLEX_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Upper, lower and third shifts +;; ***BD - NON_DEAD THRU LOGIC_END IS UPDATED +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +NON_DEAD: ;; + ;; + IFKBD G_KB+P12_KB ;; Avoid accidentally translating + ANDF LC_E0 ;; the "/" on the numeric pad of the + EXIT_STATE_LOGIC ;; G keyboard + ENDIFF ;; + ;; + IFF EITHER_CTL,NOT ;; Lower and upper case. Alphabetic + IFF EITHER_ALT,NOT ;; keys are affected by CAPS LOCK. + IFF EITHER_SHIFT ;; Numeric keys are not. +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE,NOT ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION + XLATT NON_ALPHA_UPPER ;; + IFF CAPS_STATE ;; + XLATT ALPHA_LOWER ;; + ELSEF ;; + XLATT ALPHA_UPPER ;; + ENDIFF ;; + ELSEF ;; +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION + XLATT NON_ALPHA_LOWER ;; + IFF CAPS_STATE ;; + XLATT ALPHA_UPPER ;; + ELSEF ;; + XLATT ALPHA_LOWER ;; + ENDIFF ;; + ENDIFF ;; Third and Fourth shifts + ELSEF ;; ctl off, alt on at this point + IFKBD XT_KB+AT_KB ;; XT, AT, keyboards. Nordics + IFF EITHER_SHIFT ;; only. + XLATT FOURTH_SHIFT ;; ALT + shift + ELSEF ;; + XLATT THIRD_SHIFT ;; ALT + ENDIFF ;; + ELSEF ;; ENHANCED keyboard + IFF R_ALT_SHIFT ;; ALTGr + ANDF EITHER_SHIFT,NOT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +;**************************************;; + IFF EITHER_SHIFT,NOT ;; + IFKBD XT_KB+AT_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ENDIFF ;; + IFKBD G_KB+P12_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; +;**************************************;; + IFKBD AT_KB+XT_KB ;; + IFF EITHER_CTL,NOT ;; + IFF ALT_SHIFT ;; ALT - case + XLATT ALT_CASE ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_ALT,NOT ;; CTRL - case + XLATT CTRL_CASE ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; + IFKBD G_KB+P12_KB ;; + IFF EITHER_CTL,NOT ;; + IFF ALT_SHIFT ;; ALT - case + ANDF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_ALT,NOT ;; CTRL - case + XLATT CTRL_CASE ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; + EXIT_STATE_LOGIC ;; + ;; +LOGIC_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;********************************************************************** +;; NO Common Translate Section +;; This section contains translations for the lower 128 characters +;; only since these will never change from code page to code page. +;; Some common Characters are included from 128 - 165 where appropriate. +;; In addition the dead key "Set Flag" tables are here since the +;; dead keys are on the same keytops for all code pages. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC NO_COMMON_XLAT ;; +NO_COMMON_XLAT: ;; + ;; + DW COMMON_XLAT_END-$ ;; length of section + DW -1 ;; code page + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Lower Shift Dead Key +;; KEYBOARD TYPES: XT, , AT +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_LO_END-$ ;; length of state section + DB DEAD_LOWER ;; State ID + DW XT_KB+AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 2 ;; number of entries + DB 13 ;; scan code + FLAG ACUTE ;; flag bit to set + DB 27 ;; + FLAG DIARESIS ;; + ;; + ;; +COM_DK_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Lower Shift Dead Key +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_LO_K1_END-$ ;; length of state section + DB DEAD_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 1 ;; number of entries + DB 27 ;; + FLAG DIARESIS ;; + ;; + ;; +COM_DK_LO_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Upper Shift Dead Key +;; KEYBOARD TYPES: All +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_UP_END-$ ;; length of state section + DB DEAD_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 2 ;; number of entries + DB 13 ;; scan code + FLAG GRAVE ;; flag bit to set + DB 27 ;; + FLAG CIRCUMFLEX ;; + ;; +COM_DK_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift Dead Key +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_TH_END-$ ;; length of state section + DB DEAD_THIRD ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 2 ;; number of entries + DB 13 ;; scan code + FLAG ACUTE ;; flag bit to set + DB 27 ;; scan code + FLAG TILDE ;; flag bit to set + ;; +COM_DK_TH_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;****************************** +;;***BD - ADDED FOR NUMERIC PAD (DECIMAL SEPERATOR) +;;****************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common ;;************CNS **************** +;; STATE: Numeric Key Pad ;;change +;; KEYBOARD TYPES: All except the p12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_PAD_K1_END-$ ;; length of state section + DB NUMERIC_PAD ;; State ID + DW G_KB+AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_PAD_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 83,',' ;; decimal seperator = , +COM_PAD_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_PAD_K1_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;****************************** +;;***BD - ADDED FOR ALT CASE +;;****************************** +;; +;; CODE PAGE: Common +;; STATE: Alt Case +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_ALT_K1_END-$ ;; length of state section + DB ALT_CASE ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_ALT_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 0 ;; 2 number of entries +; DB 12,-1,-1 ;; +; DB 53,0,082H ;; CHANGE OF HYPHEN +COM_ALT_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_ALT_K1_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;****************************** +;;***BD - ADDED FOR CTRL CASE +;;****************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: XT, , AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K1_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW XT_KB+AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_CTRL_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 2 ;; number of entries + DB 12,-1,-1 ;; + DB 53,01FH,35h ;; +COM_CTRL_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CTRL_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K2_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_CTRL_K2_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 8 ;; number of entries + DB 9,01BH,09H ;; + DB 10,01DH,0AH ;; + DB 12,-1,-1 ;; + DB 13,01CH,0DH ;; + DB 26,-1,-1 ;; + DB 27,-1,-1 ;; + DB 43,-1,-1 ;; + DB 53,01FH,35H ;; +COM_CTRL_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CTRL_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alpha Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AL_LO_END-$ ;; length of state section + DB ALPHA_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_AL_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 3 ;; number of entries + DB 26,086H ;; a-overcircle + DB 39,09BH ;; o-slash + DB 40,091H ;; ae-dipthong +COM_AL_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AL_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alpha Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AL_UP_END-$ ;; length of state section + DB ALPHA_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_AL_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 3 ;; number of entries + DB 26,08FH ;; A-OVERCIRCLE + DB 39,09DH ;; O-SLASH + DB 40,092H ;; AE-DIPTHONG +COM_AL_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AL_UP_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: G + P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K1_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 6 ;; number of entries + DB 41,07CH ;; | + DB 12,"+" ;; + INCLUDED FOR SIMPLIC. + DB 13,"\" ;; \ + DB 43,"'" ;; ' + DB 53,"-" ;; - + DB 86,"<" ;; < +COM_NA_LO_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: XT + +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K2_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K2_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 4 ;; number of entries + DB 41,"'" ;; ' + DB 12,"+" ;; + + DB 43,"<" ;; < + DB 53,"-" ;; - +COM_NA_LO_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K3_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K3_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 4 ;; number of entries + DB 12,"+" ;; + + DB 41,"<" ;; < + DB 43,"'" ;; ' + DB 53,"-" ;; - +COM_NA_LO_K3_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K3_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G + P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 12 ;; number of entries + DB 3,'"' ;; + DB 7,'&' ;; + DB 8,'/' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,'=' ;; + DB 12,'?' ;; + DB 43,'*' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'_' ;; + DB 86,'>' ;; +COM_NA_UP_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: XT + +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K2_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_K2_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 13 ;; number of entries + DB 3,'"' ;; + DB 4,'' ;; + DB 7,'&' ;; + DB 8,'/' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,'=' ;; + DB 12,'?' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'_' ;; + DB 41,'*' ;; + DB 43,'>' ;; +COM_NA_UP_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K2_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K3_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_K3_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 13 ;; number of entries + DB 3,'"' ;; + DB 4,'' ;; + DB 7,'&' ;; + DB 8,'/' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,'=' ;; + DB 12,'?' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'_' ;; + DB 41,'>' ;; + DB 43,'*' ;; +COM_NA_UP_K3_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K3_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB+P12_KB ;; Keyboard Type FERRARI + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 7 ;; number of entries + DB 3,'@' ;; + DB 4,09CH ;; + DB 5,'$' ;; + DB 8,'{' ;; + DB 9,'[' ;; + DB 10,']' ;; + DB 11,'}' ;; +COM_THIRD_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift (ALTERNATE) +;; KEYBOARD TYPES: XT, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K1_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 9 ;; number of entries + DB 12,'-','-' ;; + DB 13,'=','=' ;; + DB 26,'[','[' ;; + DB 27,']',']' ;; + DB 39,';',';' ;; + DB 40,027H,027H ;; + DB 41,060H,060H ;; + DB 43,'\','\' ;; + DB 53,'/','/' ;; +COM_THIRD_K1_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift (ALTERNATE) +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K2_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_K2_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 9 ;; number of entries + DB 12,'-','-' ;; + DB 13,'=','=' ;; + DB 26,'[','[' ;; + DB 27,']',']' ;; + DB 39,';',';' ;; + DB 40,027H,027H ;; + DB 41,'\','\' ;; + DB 43,060H,060H ;; + DB 53,'/','/' ;; +COM_THIRD_K2_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Fourth Shift (ALTERNATE+SHIFT) +;; KEYBOARD TYPES: XT, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_FOURTH_END-$ ;; length of state section + DB FOURTH_SHIFT ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_FOURTH_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 18 ;; number of entries + DB 3,'@','@' ;; + DB 4,'#','#' ;; + DB 7,'^','^' ;; + DB 8,'&','&' ;; + DB 9,'*','*' ;; + DB 10,'(','(' ;; + DB 11,')',')' ;; + DB 12,'_','_' ;; + DB 13,'+','+' ;; + DB 26,'{','{' ;; + DB 27,'}','}' ;; + DB 39,':',':' ;; + DB 40,'"','"' ;; + DB 41,'~','~' ;; + DB 43,'|','|' ;; + DB 51,'<','<' ;; + DB 52,'>','>' ;; + DB 53,'?','?' ;; +COM_FOURTH_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_FOURTH_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Fourth Shift (ALTERNATE+SHIFT) +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_FOURTH_K1_END-$ ;; length of state section + DB FOURTH_SHIFT ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_FOURTH_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 18 ;; number of entries + DB 3,'@','@' ;; + DB 4,'#','#' ;; + DB 7,'^','^' ;; + DB 8,'&','&' ;; + DB 9,'*','*' ;; + DB 10,'(','(' ;; + DB 11,')',')' ;; + DB 12,'_','_' ;; + DB 13,'+','+' ;; + DB 26,'{','{' ;; + DB 27,'}','}' ;; + DB 39,':',':' ;; + DB 40,'"','"' ;; + DB 41,'|','|' ;; + DB 43,'~','~' ;; + DB 51,'<','<' ;; + DB 52,'>','>' ;; + DB 53,'?','?' ;; +COM_FOURTH_K1_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_FOURTH_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_GR_LO_END-$ ;; length of state section + DB GRAVE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW COM_GR_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +COM_GR_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_GR_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_GR_SP_END-$ ;; length of state section + DB GRAVE_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW COM_GR_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,96 ;; STANDALONE GRAVE +COM_GR_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_GR_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_LO_END-$ ;; length of state section + DB CIRCUMFLEX_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW COM_CI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +COM_CI_LO_T1_END: ;; + ;; + DW 0 ;; + ;; +COM_CI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_SP_END-$ ;; length of state section + DB CIRCUMFLEX_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW COM_CI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,94 ;; STANDALONE CIRCUMFLEX +COM_CI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Tilde Lower +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_TI_LO_END-$ ;; length of state section + DB TILDE_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW COM_TI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 49,0A4H ;; scan code,ASCII - + COM_TI_LO_T1_END: ;; + ;; + DW 0 ;; + ;; + COM_TI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; CODE PAGE: Common +;;; STATE: Tilde Upper Case +;;; KEYBOARD TYPES: G, P12 +;;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_TI_UP_END-$ ;; length of state section + DB TILDE_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW COM_TI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 49,0A5H ;; scan code,ASCII - + COM_TI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; + COM_TI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Tilde Space Bar +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_TI_SP_END-$ ;; length of state section + DB TILDE_SPACE ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW COM_TI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,07EH ;; STANDALONE TILDE +COM_TI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_TI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; Last State +COMMON_XLAT_END: ;; + ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; NO Specific Translate Section for 865 +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC NO_865_XLAT ;; +NO_865_XLAT: ;; + ;; + DW CP865_XLAT_END-$ ;; length of section + DW 865 ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 865 +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP865_NA_K1_UP_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP865_NA_UP_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 2 ;; number of entries + DB 5,0AFH ;; INTERNATIONAL MONEY SYMB + DB 41,015H ;; SECTION Symb +CP865_NA_UP_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP865_NA_K1_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 865 +;; STATE: Acute Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP865_AC_LO_END-$ ;; length of state section + DB ACUTE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW CP865_AC_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +CP865_AC_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP865_AC_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 865 +;; STATE: Acute Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP865_AC_UP_END-$ ;; length of state section + DB ACUTE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW CP865_AC_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of entries + DB 18,'' ;; scan code,ASCII - +CP865_AC_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP865_AC_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 865 +;; STATE: Acute Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP865_AC_SP_END-$ ;; length of state section + DB ACUTE_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW CP865_AC_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,39 ;; scan code,ASCII - SPACE +CP865_AC_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP865_AC_SP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP865 +;; STATE: Diaresis Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP865_DI_LO_END-$ ;; length of state section + DB DIARESIS_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 254,0 ;; error character = standalone accent + ;; + DW CP865_DI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 21,'' ;; scan code,ASCII - y + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +CP865_DI_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP865_DI_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP865 +;; STATE: Diaresis Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP865_DI_UP_END-$ ;; length of state section + DB DIARESIS_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 254,0 ;; error character = standalone accent + ;; + DW CP865_DI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 3 ;; number of scans + DB 22,'' ;; scan code,ASCII - U + DB 24,'' ;; scan code,ASCII - O + DB 30,'' ;; scan code,ASCII - A +CP865_DI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP865_DI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 865 +;; STATE: Diaresis Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; ;; +; DW CP865_DI_SP_END-$ ;; length of state section +; DB DIARESIS_SPACE ;; State ID +; DW ANY_KB ;; Keyboard Type +; DB 254,0 ;; error character = standalone accent +; ;; +; DW CP865_DI_SP_T1_END-$ ;; Size of xlat table +; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: +; DB 1 ;; number of scans +; DB 57,254 ;; error character = standalone accent +;CP865_DI_SP_T1_END: ;; +; ;; +; DW 0 ;; Size of xlat table - null table +;CP865_DI_SP_END: ;; length of state section +; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW 0 ;; LAST STATE + ;; +CP865_XLAT_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; NO Specific Translate Section for 850 +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC NO_850_XLAT ;; +NO_850_XLAT: ;; + ;; + DW CP850_XLAT_END-$ ;; length of section + DW 850 ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_NA_K1_UP_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP850_NA_UP_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 2 ;; number of entries + DB 5,0CFH ;; INT MONEY SYMB + DB 41,0F5H ;; SECTION Symb +CP850_NA_UP_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_NA_K1_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Acute Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_LO_END-$ ;; length of state section + DB ACUTE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 239,0 ;; error character = standalone accent + ;; + DW CP850_AC_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 21,0ECH ;; y acute + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +CP850_AC_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Acute Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_UP_END-$ ;; length of state section + DB ACUTE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 239,0 ;; error character = standalone accent + ;; + DW CP850_AC_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of entries + DB 18,090H ;; E acute + DB 21,0EDH ;; Y acute + DB 22,0E9H ;; U acute + DB 23,0D6H ;; I acute + DB 24,0E0H ;; O acute + DB 30,0B5H ;; A acute +CP850_AC_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Acute Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_SP_END-$ ;; length of state section + DB ACUTE_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 239,0 ;; error character = standalone accent + ;; + DW CP850_AC_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,239 ;; scan code,ASCII - SPACE +CP850_AC_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_SP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Diaresis Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_LO_END-$ ;; length of state section + DB DIARESIS_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW CP850_DI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 21,'' ;; scan code,ASCII - y + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +CP850_DI_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_DI_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Diaresis Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_UP_END-$ ;; length of state section + DB DIARESIS_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW CP850_DI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,0D3H ;; E Diaeresis + DB 22,'' ;; U Diaeresis + DB 23,0D8H ;; I Diaeresis + DB 24,'' ;; O Diaeresis + DB 30,'' ;; A Diaeresis +CP850_DI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_DI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Diaresis Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_SP_END-$ ;; length of state section + DB DIARESIS_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW CP850_DI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,249 ;; error character = standalone accent +CP850_DI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table +CP850_DI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Grave Upper +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_GR_UP_END-$ ;; length of state section + DB GRAVE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW CP850_GR_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,0D4H ;; E grave + DB 22,0EBH ;; U grave + DB 23,0DEH ;; I grave + DB 24,0E3H ;; O grave + DB 30,0B7H ;; A grave +CP850_GR_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_GR_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Tilde Lower +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_TI_LO_END-$ ;; length of state section + DB TILDE_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW CP850_TI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 2 ;; number of scans + DB 24,0E4H ;; scan code,ASCII - o tilde + DB 30,0C6H ;; scan code,ASCII - a tilde + CP850_TI_LO_T1_END: ;; + ;; + DW 0 ;; + ;; + CP850_TI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; CODE PAGE: 850 +;;; STATE: Tilde Upper Case +;; KEYBOARD TYPES: G, P12 +;;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_TI_UP_END-$ ;; length of state section + DB TILDE_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW CP850_TI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 2 ;; number of scans + DB 24,0E5H ;; scan code,ASCII - O tilde + DB 30,0C7H ;; scan code,ASCII - A tilde + CP850_TI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; + CP850_TI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Circumflex Upper +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_CI_UP_END-$ ;; length of state section + DB CIRCUMFLEX_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW CP850_CI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,0D2H ;; E circumflex + DB 22,0EAH ;; U circumflex + DB 23,0D7H ;; I circumflex + DB 24,0E2H ;; O circumflex + DB 30,0B6H ;; A circumflex +CP850_CI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_CI_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW 0 ;; LAST STATE + ;; +CP850_XLAT_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CODE ENDS ;; + END ;; diff --git a/v4.0/src/DEV/KEYBOARD/KDFNOW.ASM b/v4.0/src/DEV/KEYBOARD/KDFNOW.ASM new file mode 100644 index 0000000..ac2ea78 --- /dev/null +++ b/v4.0/src/DEV/KEYBOARD/KDFNOW.ASM @@ -0,0 +1,507 @@ + + + PAGE ,132 + TITLE DOS - Keyboard Definition File + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DOS - - NLS Support - Keyboard Definition File +;; (c) Copyright 1988 Microsoft +;; +;; This the file header and table pointers ONLY. +;; The actual tables are contained in seperate source files. +;; These are: +;; KDFSP.ASM - Spanish +;; KDFPO.ASM - Portuguese +;; KDFGR.ASM - German +;; KDFIT142.ASM - Italian +;; KDFIT.ASM - Italian +;; KDFFR189.ASM - French +;; KDFFR.ASM - French +;; KDFSG.ASM - Swiss German +;; KDFSF.ASM - Swiss French +;; KDFDK.ASM - Danish +;; KDFUK168.ASM - English +;; KDFUK.ASM - English +;; KDFBE.ASM - Belgium +;; KDFNL.ASM - Netherlands +;; KDFNO.ASM - Norway +;; KDFLA.ASM - Latin American +;; KDFSV.ASM - SWEDEN -----> This moddule is used for both Sweden +;; and Finland - exact same template +;; KDFSU.ASM - Finland -----> Same module as Sweden eliminated +;; Dummy US - US +;; Linkage Instructions: +;; The following instructions are contained in KDFLINK.BAT: +;; +;; LINK KDF+KDFSP+KDFGE+KDFFR+KDFIT+KDFPO+KDFUK+KDFSG+KDFDK+KDFEOF; +;; EXE2BIN KDF.EXE KEYBOARD.SYS +;; +;; DCL, March 8, 1988 - swapped 437/850 to 850/437 for SG & SF +;; DCL, March 8, 1988 - uncommented SU(finland)& swapped 437/850 to 850/437 +;; as the Finnish want 850/437 vs. 437/850 for Sweden +;; did not alter the pointer to kbid 153 to Sweden +;; CNS April 14 1988 - swapped 437/850 to 850/437 for SP & LA +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +CODE SEGMENT PUBLIC 'CODE' ;; + ASSUME CS:CODE,DS:CODE ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; File Header +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +DB 0FFh,'KEYB ' ;; signature +DB 8 DUP(0) ;; reserved +DW 650 ;; maximum size of Common Xlat Sect +DW 350 ;; max size of Specific Xlat Sect +DW 400 ;; max size of State Logic +DW 0 ;;AC000;reserved +DW 19 ;;AC000 number of IDs +DW 17 ;;AC000 number of languages +DB 'GR' ;; LANGUAGE CODE TABLE +DW OFFSET GE_LANG_ENT,0 ;; +DB 'SP' ;; +DW OFFSET SP_LANG_ENT,0 ;; +DB 'PO' ;; +DW OFFSET PO_LANG_ENT,0 ;; +DB 'FR' ;; +DW OFFSET FR2_LANG_ENT,0 ;; +DB 'DK' ;; +DW OFFSET DK_LANG_ENT,0 ;; +DB 'SG' ;; +DW OFFSET SG_LANG_ENT,0 ;; +DB 'IT' ;; +DW OFFSET IT2_LANG_ENT,0 ;; +DB 'UK' ;; +DW OFFSET UK2_LANG_ENT,0 ;; +DB 'SF' ;; +DW OFFSET SF_LANG_ENT,0 ;; +DB 'BE' ;; +DW OFFSET BE_LANG_ENT,0 ;; +DB 'NL' ;; +DW OFFSET NL_LANG_ENT,0 ;; +DB 'NO' ;; +DW OFFSET NO_LANG_ENT,0 ;; +DB 'CF' ;; +DW OFFSET CF_LANG_ENT,0 ;; +DB 'SV' ;; +DW OFFSET SV_LANG_ENT,0 ;; +DB 'SU' ;; +DW OFFSET Su_LANG_ENT,0 ;; +DB 'LA' ;; +DW OFFSET LA_LANG_ENT,0 ;; +DB 'US' ;; +DW OFFSET DUMMY_ENT,0 ;; +DW 172 ;;AN000;ID CODE TABLE *************************** +DW OFFSET SP_LANG_ENT,0 ;;AN000; +DW 163 ;;AN000; +DW OFFSET PO_LANG_ENT,0 ;;AN000; +DW 120 ;;AN000; +DW OFFSET FR1_LANG_ENT,0 ;;AN000; +DW 189 ;;AN000; +DW OFFSET FR2_LANG_ENT,0 ;;AN000; +DW 159 ;;AN000; +DW OFFSET DK_LANG_ENT,0 ;;AN000; +DW 000 ;;AN000; +DW OFFSET SG_LANG_ENT,0 ;;AN000; +DW 129 ;;AN000; +DW OFFSET GE_LANG_ENT,0 ;;AN000; +DW 142 ;;AN000; +DW OFFSET IT1_LANG_ENT,0 ;;AN000; +DW 141 ;;AN000; +DW OFFSET IT2_LANG_ENT,0 ;;AN000; +DW 168 ;;AN000; +DW OFFSET UK1_LANG_ENT,0 ;;AN000; +DW 166 ;;AN000; +DW OFFSET UK2_LANG_ENT,0 ;;AN000; +DW 150 ;;AN000; +DW OFFSET SF_LANG_ENT,0 ;;AN000; +DW 120 ;;AN000; +DW OFFSET BE_LANG_ENT,0 ;;AN000; +DW 143 ;;AN000; +DW OFFSET NL_LANG_ENT,0 ;;AN000; +DW 155 ;;AN000; +DW OFFSET NO_LANG_ENT,0 ;;AN000; +DW 058 ;;AN000; +DW OFFSET CF_LANG_ENT,0 ;;AN000; +DW 153 ;;AN000; +DW OFFSET SV_LANG_ENT,0 ;;AN000; +DW 171 ;;AN000; +DW OFFSET LA_LANG_ENT,0 ;;AN000; +DW 103 ;;AN000; +DW OFFSET DUMMY_ENT,0 ;;AN000; +; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; Language Entries +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + EXTRN SP_LOGIC:NEAR ;; + EXTRN SP_437_XLAT:NEAR ;; + EXTRN SP_850_XLAT:NEAR ;; + ;; +SP_LANG_ENT: ;; language entry for SPANISH + DB 'SP' ;; + DW 172 ;; AN000;ID entry (ID CODE) + DW OFFSET SP_LOGIC,0 ;; pointer to LANG kb table + DB 1 ;; AN000;number of IDs + DB 2 ;; number of code pages + DW 850 ;; code page + DW OFFSET SP_850_XLAT,0 ;; table pointer + DW 437 ;; code page + DW OFFSET SP_437_XLAT,0 ;; table pointer + ;; +;***************************************************************************** + EXTRN FR1_LOGIC:NEAR ;;AN000; + EXTRN FR1_437_XLAT:NEAR ;;AN000; + EXTRN FR1_850_XLAT:NEAR ;;AN000; + ;; + FR1_LANG_ENT: ;;AN000; language entry for FRANCE + DB 'FR' ;;AN000; SECONDARY KEYBOARD ID VALUE + DW 120 ;;AN000; ID entry + DW OFFSET FR1_LOGIC,0 ;;AN000; pointer to LANG kb table + DB 2 ;;AN000; number of code pages + DB 2 ;;AN000; number of ids + DW 437 ;;AN000; code page + DW OFFSET FR1_437_XLAT,0 ;;AN000; table pointer + DW 850 ;;AN000; code page + DW OFFSET FR1_850_XLAT,0 ;;AN000; table pointer + ;;AN000; +;***************************************************************************** + EXTRN FR2_LOGIC:NEAR ;;AC000; + EXTRN FR2_437_XLAT:NEAR ;;AC000; + EXTRN FR2_850_XLAT:NEAR ;;AC000; + ;; + FR2_LANG_ENT: ;; language entry for FRANCE + DB 'FR' ;; PRIMARY KEYBOARD ID VALUE + DW 189 ;;AC000; ID entry + DW OFFSET FR2_LOGIC,0 ;;AC000; pointer to LANG kb table + DB 1 ;;AC000; number of ids + DB 2 ;;AC000; number of code pages + DW 437 ;;AC000; code page + DW OFFSET FR2_437_XLAT,0 ;;AC000; table pointer + DW 850 ;;AC000; code page + DW OFFSET FR2_850_XLAT,0 ;;AC000; table pointer + ;; +;**************************************************************************** + EXTRN PO_LOGIC:NEAR ;;AC000; + EXTRN PO_850_XLAT:NEAR ;;AC000; + EXTRN PO_860_XLAT:NEAR ;;AC000; + ;; +PO_LANG_ENT: ;; language entry for PORTUGAL + DB 'PO' ;; + DW 163 ;;AN000; ID entry + DW OFFSET PO_LOGIC,0 ;; pointer to LANG kb table + DB 1 ;;AC000; number of ids + DB 2 ;;AC000; number of code pages + DW 850 ;;AC000; code page + DW OFFSET PO_850_XLAT,0 ;;AC000; table pointer + DW 860 ;;AC000; code page + DW OFFSET PO_860_XLAT,0 ;;AC000; table pointer + ;; +;***************************************************************************** + EXTRN DK_LOGIC:NEAR ;; + EXTRN DK_850_XLAT:NEAR ;;AC000; + EXTRN DK_865_XLAT:NEAR ;;AC000; + ;; + DK_LANG_ENT: ;; language entry for DENMARK + DB 'DK' ;; + DW 159 ;;AN000; ID entry + DW OFFSET DK_LOGIC,0 ;; pointer to LANG kb table + DB 1 ;;AN000;number of ids + DB 2 ;;AC000; number of code pages + DW 850 ;;AC000; code page + DW OFFSET DK_850_XLAT,0 ;;AC000; table pointer + DW 865 ;;AC000; code page + DW OFFSET DK_865_XLAT,0 ;;AC000; table pointer + ;; +;***************************************************************************** + EXTRN SG_LOGIC:NEAR ;; + EXTRN SG_850_XLAT:NEAR ;; + EXTRN SG_437_XLAT:NEAR ;; + ;; +SG_LANG_ENT: ;; language entry for SWISS GERMAN + DB 'SG' ;; + DW 000 ;;AN001; ID entry + DW OFFSET SG_LOGIC,0 ;; pointer to LANG kb table + DB 1 ;;AN000; number of ids + DB 2 ;;AC000; number of code pages + DW 850 ;; code page ;;;dcl 850 now default March 8, 1988 + DW OFFSET SG_850_XLAT,0 ;; table pointer + DW 437 ;; code page + DW OFFSET SG_437_XLAT,0 ;; table pointer + ;; +;***************************************************************************** + EXTRN SF_LOGIC:NEAR ;; + EXTRN SF_850_XLAT:NEAR ;; + EXTRN SF_437_XLAT:NEAR ;; + ;; +SF_LANG_ENT: ;; language entry for SWISS FRENCH + DB 'SF' ;; + DW 150 ;;AN000; ID entry + DW OFFSET SF_LOGIC,0 ;; pointer to LANG kb table + DB 1 ;;AN000; number of ids + DB 2 ;;AC000; number of code pages + DW 850 ;; code page ;;;dcl 850 now default March 8, 1988 + DW OFFSET SF_850_XLAT,0 ;; table pointer + DW 437 ;; code page + DW OFFSET SF_437_XLAT,0 ;; table pointer + ;; +;***************************************************************************** + EXTRN GE_LOGIC:NEAR ;; + EXTRN GE_437_XLAT:NEAR ;; + EXTRN GE_850_XLAT:NEAR ;; + ;; +GE_LANG_ENT: ;; language entry for GERMANY + DB 'GR' ;; + DW 129 ;;AN000; ID entry + DW OFFSET GE_LOGIC,0 ;; pointer to LANG kb table + DB 1 ;;AN000; number of ids + DB 2 ;;AC000; number of code pages + DW 437 ;; code page + DW OFFSET GE_437_XLAT,0 ;; table pointer + DW 850 ;; code page + DW OFFSET GE_850_XLAT,0 ;; table pointer + ;; +;***************************************************************************** + EXTRN IT1_LOGIC:NEAR ;;AN000; + EXTRN IT1_437_XLAT:NEAR ;;AN000; + EXTRN IT1_850_XLAT:NEAR ;;AN000; + ;; + IT1_LANG_ENT: ;;AN000; language entry for ITALY + DB 'IT' ;;AN000; SECONDARY KEYBOARD ID VALUE + DW 142 ;;AN000; ID entry + DW OFFSET IT1_LOGIC,0 ;;AN000; pointer to LANG kb table + DB 2 ;;AN000;number of ids + DB 2 ;;AN000; number of code pages + DW 437 ;;AN000; code page + DW OFFSET IT1_437_XLAT,0 ;;AN000; table pointer + DW 850 ;;AN000; code page + DW OFFSET IT1_850_XLAT,0 ;;AN000; table pointer + ;; +;***************************************************************************** + EXTRN IT2_LOGIC:NEAR ;; + EXTRN IT2_437_XLAT:NEAR ;; + EXTRN IT2_850_XLAT:NEAR ;; + ;; + IT2_LANG_ENT: ;;AC000; language entry for ITALY + DB 'IT' ;;AC000; PRIMARY KEYBOARD ID VALUE + DW 141 ;;AN000; ID entry + DW OFFSET IT2_LOGIC,0 ;;AN000; pointer to LANG kb table + DB 1 ;;AC000; number of ids + DB 2 ;;AC000; number of code pages + DW 437 ;;AC000; code page + DW OFFSET IT2_437_XLAT,0 ;;AC000; table pointer + DW 850 ;;AC000; code page + DW OFFSET IT2_850_XLAT,0 ;;AC000; table pointer + ;; +;***************************************************************************** + EXTRN UK1_LOGIC:FAR ;;AN000; + EXTRN UK1_437_XLAT:FAR ;;AN000; + EXTRN UK1_850_XLAT:FAR ;;AN000; + ;; + UK1_LANG_ENT: ;;AN000; language entry for UNITED KINGDOM + DB 'UK' ;;AN000; SECONDARY KEYBOARD ID VALUE + DW 168 ;;AN000; ID entry + DW OFFSET UK1_LOGIC,0 ;;AN000; pointer to LANG kb table + DB 2 ;;AN000; number of ids + DB 2 ;;AN000; number of code pages + DW 437 ;;AN000; code page + DW OFFSET UK1_437_XLAT,0 ;;AN000; table pointer + DW 850 ;;AN000; code page + DW OFFSET UK1_850_XLAT,0 ;;AN000; table pointer + ;; +;***************************************************************************** + EXTRN UK2_LOGIC:FAR ;;AC000; + EXTRN UK2_437_XLAT:FAR ;;AC000; + EXTRN UK2_850_XLAT:FAR ;;AC000; + ;; + UK2_LANG_ENT: ;;AN000; language entry for UNITED KINGDOM + DB 'UK' ;;AC000; PRIMARY KEYBOARD ID VALUE + DW 166 ;;AC000; ID entry + DW OFFSET UK2_LOGIC,0 ;;AC000; pointer to LANG kb table + DB 1 ;; AN000;number of ids + DB 2 ;;AN000; number of code pages + DW 437 ;;AC000; code page + DW OFFSET UK2_437_XLAT,0 ;;AC000; table pointer + DW 850 ;;AC000; code page + DW OFFSET UK2_850_XLAT,0 ;;AC000; table pointer + ;; +;***************************************************************************** + EXTRN BE_LOGIC:NEAR ;; + EXTRN BE_437_XLAT:NEAR ;; + EXTRN BE_850_XLAT:NEAR ;; + ;; +BE_LANG_ENT: ;; language entry for BELGIUM + DB 'BE' ;; + DW 120 ;;AN000; ID entry + DW OFFSET BE_LOGIC,0 ;; pointer to LANG kb table + DB 1 ;;AN000; number of ids + DB 2 ;;AN000; number of code pages + DW 850 ;; code page ;; default to 850 - same as country.sys + DW OFFSET BE_850_XLAT,0 ;; table pointer + DW 437 ;; code page + DW OFFSET BE_437_XLAT,0 ;; table pointer + ;; +;***************************************************************************** +;***************************************************************************** + EXTRN NL_LOGIC:NEAR ;; + EXTRN NL_437_XLAT:NEAR ;; + EXTRN NL_850_XLAT:NEAR ;; + ;; + NL_LANG_ENT: ;; language entry for NETHERLANDS + DB 'NL' ;; + DW 143 ;;AN000; ID entry + DW OFFSET NL_LOGIC,0 ;; pointer to LANG kb table + DB 1 ;;AN000; number of ids + DB 2 ;;AN000; number of code pages + DW 437 ;; code page + DW OFFSET NL_437_XLAT,0 ;; table pointer + DW 850 ;; code page + DW OFFSET NL_850_XLAT,0 ;; table pointer + ;; +;***************************************************************************** +;***************************************************************************** + EXTRN NO_LOGIC:NEAR ;; + EXTRN NO_850_XLAT:NEAR ;;AC000; + EXTRN NO_865_XLAT:NEAR ;;AC000; + ;; + NO_LANG_ENT: ;; language entry for NORWAY + DB 'NO' ;; + DW 155 ;;AN000; ID entry + DW OFFSET NO_LOGIC,0 ;; pointer to LANG kb table + DB 1 ;;AN000; number of ids + DB 2 ;;AN000; number of code pages + DW 850 ;;AC000; code page + DW OFFSET NO_850_XLAT,0 ;;AC000; table pointer + DW 865 ;;AC000; code page + DW OFFSET NO_865_XLAT,0 ;;AC000; table pointer + ;; +;***************************************************************************** +;***************************************************************************** + EXTRN SV_LOGIC:NEAR ;; + EXTRN SV_437_XLAT:NEAR ;; + EXTRN SV_850_XLAT:NEAR ;; + ;; + SV_LANG_ENT: ;; language entry for SWEDEN + DB 'SV' ;; + DW 153 ;;AN000; ID entry + DW OFFSET SV_LOGIC,0 ;; pointer to LANG kb table + DB 1 ;;AN000; number of ids + DB 2 ;;AN000; number of code pages + DW 437 ;; code page + DW OFFSET SV_437_XLAT,0 ;; table pointer + DW 850 ;; code page + DW OFFSET SV_850_XLAT,0 ;; table pointer + ;; +;***************************************************************************** +;***************************************************************************** +;; Already declared external above +;; EXTRN Sv_LOGIC:NEAR ;; Finland & Sweden have same layout, +;; EXTRN Sv_437_XLAT:NEAR ;; but different code page defaults, +;; EXTRN Sv_850_XLAT:NEAR ;; use Sweden data for Finland + ;; + SU_LANG_ENT: ;; language entry for FINLAND + DB 'SU' ;; + DW 153 ;; ID entry + DW OFFSET Sv_LOGIC,0 ;; pointer to LANG kb table + DB 1 ;; number of ids + DB 2 ;; number of code pages + DW 850 ;; code page ;;;dcl 850 now default, March 8, 1988 + DW OFFSET Sv_850_XLAT,0 ;; table pointer + DW 437 ;; code page + DW OFFSET Sv_437_XLAT,0 ;; table pointer + ;; +;***************************************************************************** +;***************************************************************************** + EXTRN CF_LOGIC:NEAR ;; + EXTRN CF_863_XLAT:NEAR ;; + EXTRN CF_850_XLAT:NEAR ;; + ;; + CF_LANG_ENT: ;; language entry for Canadian-French + DB 'CF' ;; + DW 058 ;; ID entry + DW OFFSET CF_LOGIC,0 ;; pointer to LANG kb table + DB 1 ;; number of ids + DB 2 ;; number of code pages + DW 863 ;; code page + DW OFFSET CF_863_XLAT,0 ;; table pointer + DW 850 ;; code page + DW OFFSET CF_850_XLAT,0 ;; table pointer + ;; +;***************************************************************************** + EXTRN LA_LOGIC:NEAR ;; + EXTRN LA_850_XLAT:NEAR ;; + EXTRN LA_437_XLAT:NEAR ;; + ;; + LA_LANG_ENT: ;; language entry for LATIN AMERICAN + DB 'LA' ;; + DW 171 ;;AN000; ID entry + DW OFFSET LA_LOGIC,0 ;; pointer to LANG kb table + DB 1 ;;AN000; number of ids + DB 2 ;;AN000; number of code pages + DW 850 ;; code page + DW OFFSET LA_850_XLAT,0 ;; table pointer + DW 437 ;; code page ; default to 437 -same as country.sys + DW OFFSET LA_437_XLAT,0 ;; table pointer + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +DUMMY_ENT: ;; language entry + DB 'XX' ;; + DW 103 ;;AC000; ID entry + DW OFFSET DUMMY_LOGIC,0 ;; pointer to LANG kb table + DB 1 ;;AC000; number of ids + DB 5 ;;AC000; number of code pages + DW 437 ;; code page + DW OFFSET DUMMY_XLAT_437,0 ;; table pointer + DW 850 ;; code page + DW OFFSET DUMMY_XLAT_850,0 ;; table pointer + DW 860 ;; code page + DW OFFSET DUMMY_XLAT_860,0 ;; table pointer + DW 863 ;; code page + DW OFFSET DUMMY_XLAT_863,0 ;; table pointer + DW 865 ;; code page + DW OFFSET DUMMY_XLAT_865,0 ;; table pointer + ;; +DUMMY_LOGIC: ;; + DW LOGIC_END-$ ;; length + DW 0 ;; special features + DB 92H,0,0 ;; EXIT_STATE_LOGIC_COMMAND +LOGIC_END: ;; + ;; +DUMMY_XLAT_437: ;; + DW 6 ;; length of section + DW 437 ;; code page + DW 0 ;; LAST STATE + ;; +DUMMY_XLAT_850: ;; + DW 6 ;; length of section + DW 850 ;; code page + DW 0 ;; LAST STATE + ;; +DUMMY_XLAT_860: ;; + DW 6 ;; length of section + DW 860 ;; code page + DW 0 ;; LAST STATE + ;; +DUMMY_XLAT_865: ;; + DW 6 ;; length of section + DW 865 ;; code page + DW 0 ;; LAST STATE + ;; +DUMMY_XLAT_863: ;; + DW 6 ;; length of section + DW 863 ;; code page + DW 0 ;; LAST STATE + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;***************************************************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CODE ENDS ;; + END ;; diff --git a/v4.0/src/DEV/KEYBOARD/KDFPO.ASM b/v4.0/src/DEV/KEYBOARD/KDFPO.ASM new file mode 100644 index 0000000..8247187 --- /dev/null +++ b/v4.0/src/DEV/KEYBOARD/KDFPO.ASM @@ -0,0 +1,1607 @@ +;; LATEST CHANGE TO CTL [ and ] on XT moved to key 26 & 27 +;; XT section enabled +;; ************* CNS 12/18/86 + + + PAGE ,132 + TITLE DOS - Keyboard Definition File + +;; LATEST CHANGE P12 NUMERIC +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DOS - - NLS Support - Keyboard Defintion File +;; (c) Copyright 1988 Microsoft +;; +;; This file contains the keyboard tables for Portugeuse +;; +;; Linkage Instructions: +;; Refer to KDF.ASM. +;; +;; modded : DTF 18-Sep-86 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + INCLUDE KEYBSHAR.INC ;; + INCLUDE POSTEQU.INC ;; + INCLUDE KEYBMAC.INC ;; + ;; + PUBLIC PO_LOGIC ;; + PUBLIC PO_860_XLAT ;; + PUBLIC PO_850_XLAT ;; + ;; +CODE SEGMENT PUBLIC 'CODE' ;; + ASSUME CS:CODE,DS:CODE ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Standard translate table options are a linear search table +;; (TYPE_2_TAB) and ASCII entries ONLY (ASCII_ONLY) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +STANDARD_TABLE EQU TYPE_2_TAB+ASCII_ONLY + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; PO State Logic +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +PO_LOGIC: + + DW LOGIC_END-$ ;; length + ;; + DW 0 ;; special features + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; COMMANDS START HERE +;; OPTIONS: If we find a scan match in +;; an XLATT or SET_FLAG operation then +;; exit from INT 9. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + OPTION EXIT_IF_FOUND ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Dead key definitions must come before +;; dead key translations to handle +;; dead key + dead key. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + IFF EITHER_ALT,NOT ;; + ANDF EITHER_CTL,NOT ;; + IFF EITHER_SHIFT ;; + SET_FLAG DEAD_UPPER ;; + ELSEF ;; + SET_FLAG DEAD_LOWER ;; + ENDIFF ;; + ENDIFF ;; +IFF EITHER_SHIFT,NOT ;; + IFKBD XT_KB+AT_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + SET_FLAG DEAD_THIRD ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_CTL,NOT ;; + ANDF R_ALT_SHIFT ;; + SET_FLAG DEAD_THIRD ;; + ENDIFF ;; + ENDIFF ;; +ENDIFF ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ACUTE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +ACUTE_PROC: ;; + ;; + IFF ACUTE,NOT ;; + GOTO DIARESIS_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT ACUTE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT ACUTE_LOWER ;; + ELSEF ;; + XLATT ACUTE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT ACUTE_UPPER ;; + ELSEF ;; + XLATT ACUTE_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_ACUTE: ;; + PUT_ERROR_CHAR ACUTE_LOWER ;; If we get here then either the XLATT + BEEP ;; failed or we are ina bad shift state. + GOTO NON_DEAD ;; Either is invalid so BEEP and fall + ;; through to generate the second char. + ;; Note that the dead key flag will be + ;; reset before we get here. + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DIARESIS ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +DIARESIS_PROC: ;; + ;; + IFF DIARESIS,NOT ;; + GOTO GRAVE_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT DIARESIS_SPACE ;; exist for 437 so beep for + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_LOWER ;; + ELSEF ;; + XLATT DIARESIS_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_UPPER ;; + ELSEF ;; + XLATT DIARESIS_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_DIARESIS: ;; + PUT_ERROR_CHAR DIARESIS_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; GRAVE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +GRAVE_PROC: ;; + ;; + IFF GRAVE,NOT ;; + GOTO TILDE_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT GRAVE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_GRAVE: ;; + PUT_ERROR_CHAR GRAVE_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; TILDE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +TILDE_PROC: ;; + ;; + IFF TILDE,NOT ;; + GOTO CIRCUMFLEX_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT TILDE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT TILDE_LOWER ;; + ELSEF ;; + XLATT TILDE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT TILDE_UPPER ;; + ELSEF ;; + XLATT TILDE_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_TILDE: ;; + PUT_ERROR_CHAR TILDE_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CIRCUMFLEX ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CIRCUMFLEX_PROC: ;; + ;; + IFF CIRCUMFLEX,NOT ;; + GOTO NON_DEAD ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT CIRCUMFLEX_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_CIRCUMFLEX: ;; + PUT_ERROR_CHAR CIRCUMFLEX_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Upper, lower and third shifts +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +NON_DEAD: ;; + ;; + IFKBD G_KB+P12_KB ;; Avoid accidentally translating + ANDF LC_E0 ;; the "/" on the numeric pad of the + EXIT_STATE_LOGIC ;; G keyboard + ENDIFF ;; + ;; + IFF EITHER_ALT,NOT ;; Lower and upper case. Alphabetic + ANDF EITHER_CTL,NOT ;; keys are affected by CAPS LOCK. + IFF EITHER_SHIFT ;; Numeric keys are not. +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE,NOT ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION + XLATT NON_ALPHA_UPPER ;; + IFF CAPS_STATE ;; + XLATT ALPHA_LOWER ;; + ELSEF ;; + XLATT ALPHA_UPPER ;; + ENDIFF ;; + ELSEF ;; +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION + XLATT NON_ALPHA_LOWER ;; + IFF CAPS_STATE ;; + XLATT ALPHA_UPPER ;; + ELSEF ;; + XLATT ALPHA_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_SHIFT,NOT ;; + IFKBD XT_KB+AT_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_CTL,NOT ;; + ANDF R_ALT_SHIFT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; +;**************************************;; + IFF EITHER_SHIFT,NOT ;; + IFKBD XT_KB+AT_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ENDIFF ;; + IFKBD G_KB+P12_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; +;**************************************;; + IFKBD AT_KB+XT_KB ;; + IFF EITHER_CTL,NOT ;; + IFF ALT_SHIFT ;; ALT - case + XLATT ALT_CASE ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_ALT,NOT ;; CTRL - case + XLATT CTRL_CASE ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; + IFKBD G_KB+P12_KB ;; + IFF EITHER_CTL,NOT ;; + IFF ALT_SHIFT ;; ALT - case + ANDF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_ALT,NOT ;; CTRL - case + XLATT CTRL_CASE ;; + ENDIFF ;; + ENDIFF ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + ANDF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ENDIFF ;; + ;; + EXIT_STATE_LOGIC ;; + ;; +LOGIC_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; PO Common Translate Section +;; This section contains translations for the lower 128 characters +;; only since these will never change from code page to code page. +;; In addition the dead key "Set Flag" tables are here since the +;; dead keys are on the same keytops for all code pages. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC PO_COMMON_XLAT ;; +PO_COMMON_XLAT: ;; + ;; + DW COMMON_XLAT_END-$ ;; length of section + DW -1 ;; code page + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Lower Shift Dead Key +;; KEYBOARD TYPES: XT +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_LO_END-$ ;; length of state section + DB DEAD_LOWER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 2 ;; number of entries + DB 27 ;; scan code + FLAG ACUTE ;; flag bit to set + DB 41 ;; + FLAG TILDE ;; + ;; + ;; +COM_DK_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Lower Shift Dead Key +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_LO_K1_END-$ ;; length of state section + DB DEAD_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 2 ;; number of entries + DB 27 ;; scan code + FLAG ACUTE ;; flag bit to set + DB 43 ;; + FLAG TILDE ;; + ;; + ;; +COM_DK_LO_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Upper Shift Dead Key +;; KEYBOARD TYPES: XT +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_UP_END-$ ;; length of state section + DB DEAD_UPPER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 2 ;; number of entries + DB 27 ;; scan code + FLAG GRAVE ;; flag bit to set + DB 41 ;; + FLAG CIRCUMFLEX ;; + ;; +COM_DK_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Upper Shift Dead Key +;; KEYBOARD TYPES: G, P12, +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_UP_K1_END-$ ;; length of state section + DB DEAD_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 2 ;; number of entries + DB 27 ;; scan code + FLAG GRAVE ;; flag bit to set + DB 43 ;; + FLAG CIRCUMFLEX ;; + ;; +COM_DK_UP_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift Dead Key +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_TH_END-$ ;; length of state section + DB DEAD_THIRD ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 1 ;; number of entries + DB 26 ;; scan code + FLAG DIARESIS ;; flag bit to set + ;; +COM_DK_TH_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alt Case +;; KEYBOARD TYPES: XT, G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_ALT_K1_END-$ ;; length of state section + DB ALT_CASE ;; State ID + DW XT_KB+G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_ALT_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 0 ;; 2 number of entries +; DB 12,-1,-1 ;; BLOT OUT HYPHEN +; DB 53,0,82H ;; MOVE HYPHEN +COM_ALT_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_ALT_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K1_END-$ ;; length of state section + DB CTRL_CASE ;; State ID **** CNS 12/18 + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_CTRL_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 7 ;; number of entries + DB 09,1BH,09 ;; [ + DB 10,1DH,10 ;; ] + DB 12,-1,-1 ;; BLOT OUT HYPHEN + DB 1AH,-1,-1 ;; " " [ + DB 1BH,-1,-1 ;; " " ] + DB 29H,1CH,29H ;; backslash + DB 53,01FH,35H ;; MOVE HYPHEN +COM_CTRL_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CTRL_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: XT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; *** CNS 12/18/86 + ;; + DW COM_CTRL_K2_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_CTRL_K2_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 5 ;; number of entries + DB 12,-1,-1 ;; BLOT OUT HYPHEN + DB 1AH,1BH,1AH ;; " " [ + DB 1BH,1DH,1BH ;; " " ] + DB 43,1CH,43 ;; backslash + DB 53,01FH,35H ;; MOVE HYPHEN +COM_CTRL_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CTRL_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alpha Lower Case +;; KEYBOARD TYPES: XT, G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AL_LO_END-$ ;; length of state section + DB ALPHA_LOWER ;; State ID + DW XT_KB+G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_AL_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 39,087H ;; c-cedilla +COM_AL_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AL_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alpha Upper Case +;; KEYBOARD TYPES: XT, G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AL_UP_END-$ ;; length of state section + DB ALPHA_UPPER ;; State ID + DW XT_KB+G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_AL_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 39,080H ;; c-cedilla +COM_AL_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AL_UP_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: XT, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 6 ;; number of entries + DB 12,"'" ;; + DB 13,0AEH ;; + DB 26,"+" ;; + DB 40,0A7H ;; + DB 43,"<" ;; + DB 53,"-" ;; +COM_NA_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: XT, , G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K1_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 7 ;; number of entries + DB 12,"'" ;; + DB 13,0AEH ;; + DB 26,"+" ;; + DB 40,0A7H ;; + DB 41,"\" ;; + DB 53,"-" ;; + DB 86,"<" ;; +COM_NA_LO_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: XT, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 14 ;; + DB 3,'"' ;; + DB 7,'&' ;; + DB 8,'/' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,'=' ;; + DB 12,'?' ;; + DB 13,0AFH ;; right double arrow + DB 26,'*' ;; + DB 40,0A6H ;; a underscore + DB 43,'>' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'_' ;; + ;; +COM_NA_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 15 ;; + DB 3,'"' ;; + DB 7,'&' ;; + DB 8,'/' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,'=' ;; + DB 12,'?' ;; + DB 13,0AFH ;; right double arrow + DB 26,'*' ;; + DB 40,0A6H ;; a underscore + DB 41,07CH ;;| + DB 51,';' ;; + DB 52,':' ;; + DB 53,'_' ;; + DB 86,'>' ;; + ;; +COM_NA_UP_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: XT, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 8 ;; number of entries + DB 2,'|' ;; + DB 3,'@' ;; + DB 5,09CH ;; + DB 9,'{' ;; + DB 10,'}' ;; + DB 26,'[' ;; + DB 27,']' ;; + DB 43,'\' ;; +COM_THIRD_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K1_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 6 ;; number of entries + DB 3,'@' ;; + DB 4,09CH ;; + DB 8,'{' ;; + DB 9,'[' ;; + DB 10,']' ;; + DB 11,'}' ;; +COM_THIRD_K1_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Lower +;; KEYBOARD TYPES: XT, , G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_GR_LO_END-$ ;; length of state section + DB GRAVE_LOWER ;; State ID + DW XT_KB+G_KB+P12_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW COM_GR_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +COM_GR_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_GR_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Space Bar +;; KEYBOARD TYPES: XT, , G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_GR_SP_END-$ ;; length of state section + DB GRAVE_SPACE ;; State ID + DW XT_KB+G_KB+P12_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW COM_GR_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,96 ;; STANDALONE GRAVE +COM_GR_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_GR_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex Lower +;; KEYBOARD TYPES: XT, , G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_LO_END-$ ;; length of state section + DB CIRCUMFLEX_LOWER ;; State ID + DW XT_KB+G_KB+P12_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW COM_CI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 3 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +COM_CI_LO_T1_END: ;; + ;; + DW 0 ;; + ;; +COM_CI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex Space Bar +;; KEYBOARD TYPES: XT, , G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_SP_END-$ ;; length of state section + DB CIRCUMFLEX_SPACE ;; State ID + DW XT_KB+G_KB+P12_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW COM_CI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,94 ;; STANDALONE CIRCUMFLEX +COM_CI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Tilde Lower +;; KEYBOARD TYPES: XT, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_TI_LO_END-$ ;; length of state section + DB TILDE_LOWER ;; State ID + DW XT_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW COM_TI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 4 ;; number of scans + DB 30,0C6H ;; scan code,ASCII - tilde a + DB 24,0E4H ;; scan code,ASCII - tilde o + DB 49,0A4H ;; scan code,ASCII - + DB 22,081h ;; scan code,ASCII - u diaresis + COM_TI_LO_T1_END: ;; because the diaresis is not + ;; available on the XT + DW 0 ;; + ;; + COM_TI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; CODE PAGE: Common +;;; STATE: Tilde Upper Case +;;; KEYBOARD TYPES: XT, +;;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_TI_UP_END-$ ;; length of state section + DB TILDE_UPPER ;; State ID + DW XT_KB ;; Keyboard Type + DB 07eH,0 ;; error character = standalone accent + ;; + DW COM_TI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 4 ;; number of scans + DB 30,0C7H ;; scan code,ASCII - tilde A + DB 24,0E5H ;; scan code,ASCII - tilde O + DB 49,0A5H ;; scan code,ASCII - + DB 22,09AH ;; scan code,ASCII - U diaresis + COM_TI_UP_T1_END: ;; because the diaresis is not + ;; available on the XT + DW 0 ;; Size of xlat table - null table + ;; + COM_TI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Tilde Lower +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_TI_LO_K1_END-$ ;; length of state section + DB TILDE_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW COM_TI_LO_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 3 ;; number of scans + DB 30,0C6H ;; scan code,ASCII - tilde a + DB 24,0E4H ;; scan code,ASCII - tilde o + DB 49,0A4H ;; scan code,ASCII - + COM_TI_LO_K1_T1_END: ;; + ;; + DW 0 ;; + ;; + COM_TI_LO_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; CODE PAGE: Common +;;; STATE: Tilde Upper Case +;;; KEYBOARD TYPES: G, P12 +;;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_TI_UP_K1_END-$ ;; length of state section + DB TILDE_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW COM_TI_UP_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 3 ;; number of scans + DB 30,0C7H ;; scan code,ASCII - tilde A + DB 24,0E5H ;; scan code,ASCII - tilde O + DB 49,0A5H ;; scan code,ASCII - + COM_TI_UP_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; + COM_TI_UP_K1_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Tilde Space Bar +;; KEYBOARD TYPES: XT, , G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_TI_SP_END-$ ;; length of state section + DB TILDE_SPACE ;; State ID + DW XT_KB+G_KB+P12_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW COM_TI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,07EH ;; STANDALONE TILDE +COM_TI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_TI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; Last State +COMMON_XLAT_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; PO Specific Translate Section for 860 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC PO_860_XLAT ;; +PO_860_XLAT: ;; + ;; + DW CP860_XLAT_END-$ ;; length of section + DW 860 ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 860 +;; STATE: Third Shift +;; KEYBOARD TYPES: G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP860_THIRD_K1_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP860_THIRD_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 5,015H ;; section symbol +CP860_THIRD_K1_T1_END: ;; + ;; + DW 0 ;; Last xlat table +CP860_THIRD_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 860 +;; STATE: Acute Lower Case +;; KEYBOARD TYPES: XT, , G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP860_AC_LO_END-$ ;; length of state section + DB ACUTE_LOWER ;; State ID + DW XT_KB+G_KB+P12_KB ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW CP860_AC_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +CP860_AC_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP860_AC_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 860 +;; STATE: Acute Upper Case +;; KEYBOARD TYPES: XT, , G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP860_AC_UP_END-$ ;; length of state section + DB ACUTE_UPPER ;; State ID + DW XT_KB+G_KB+P12_KB ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW CP860_AC_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,090H ;; E acute + DB 22,096H ;; U acute + DB 23,08BH ;; I acute + DB 24,09FH ;; O acute + DB 30,086H ;; A acute +CP860_AC_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP860_AC_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 860 +;; STATE: Acute Space Bar +;; KEYBOARD TYPES: XT, , G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP860_AC_SP_END-$ ;; length of state section + DB ACUTE_SPACE ;; State ID + DW XT_KB+G_KB+P12_KB ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW CP860_AC_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,39 ;; scan code,ASCII - SPACE +CP860_AC_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP860_AC_SP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 860 +;; STATE: Grave Upper +;; KEYBOARD TYPES: XT, , G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP860_GR_UP_END-$ ;; length of state section + DB GRAVE_UPPER ;; State ID + DW XT_KB+G_KB+P12_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW CP860_GR_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,092H ;; E grave + DB 22,09DH ;; U grave + DB 23,098H ;; I grave + DB 24,0A9H ;; O grave + DB 30,091H ;; A grave +CP860_GR_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP860_GR_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 860 +;; STATE: Circumflex Upper +;; KEYBOARD TYPES: XT, , G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP860_CI_UP_END-$ ;; length of state section + DB CIRCUMFLEX_UPPER ;; State ID + DW XT_KB+G_KB+P12_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW CP860_CI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 3 ;; number of scans + DB 30,08FH ;; A circumflex + DB 18,089H ;; E circumflex + DB 24,08CH ;; O circumflex +CP860_CI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP860_CI_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 860 +;; STATE: Tilde Lower +;; KEYBOARD TYPES: XT, , G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP860_TI_LO_END-$ ;; length of state section + DB TILDE_LOWER ;; State ID + DW XT_KB+G_KB+P12_KB ;; Keyboard Type + DB 07eH,0 ;; error character = standalone accent + ;; + DW CP860_TI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 2 ;; number of scans + DB 24,094H ;; scan code,ASCII - o tilde + DB 30,084H ;; scan code,ASCII - a tilde + CP860_TI_LO_T1_END: ;; + ;; + DW 0 ;; + ;; + CP860_TI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; CODE PAGE: 860 +;;; STATE: Tilde Upper Case +;;; KEYBOARD TYPES: XT, , G, P12, +;;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP860_TI_UP_END-$ ;; length of state section + DB TILDE_UPPER ;; State ID + DW XT_KB+G_KB+P12_KB ;; Keyboard Type + DB 07eH,0 ;; error character = standalone accent + ;; + DW CP860_TI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 2 ;; number of scans + DB 24,099H ;; scan code,ASCII - O tilde + DB 30,08EH ;; scan code,ASCII - A tilde + CP860_TI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; + CP860_TI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 860 +;; STATE: Diaresis Lower +;; KEYBOARD TYPES: G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP860_DI_LO_END-$ ;; length of state section + DB DIARESIS_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB 0FEH,0 ;; error character = standalone accent + ;; + DW CP860_DI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 22,081H ;; u diaeresis +CP860_DI_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP860_DI_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 860 +;; STATE: Diaresis Upper +;; KEYBOARD TYPES: G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP860_DI_UP_END-$ ;; length of state section + DB DIARESIS_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB 0FEH,0 ;; error character = standalone accent + ;; + DW CP860_DI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 22,09AH ;; U diaeresis +CP860_DI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP860_DI_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 860 +;; STATE: Diaresis Space Bar +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP860_DI_SP_END-$ ;; length of state section + DB DIARESIS_SPACE ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB 0FEH,0 ;; error character = standalone accent + ;; + DW CP860_DI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,0FEH ;; scan code,ASCII - SPACE +CP860_DI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP860_DI_SP_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; LAST STATE + ;; +CP860_XLAT_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; PO Specific Translate Section for 850 +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC PO_850_XLAT ;; +PO_850_XLAT: ;; + ;; + DW CP850_XLAT_END-$ ;; length of section + DW 850 ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Third Shift +;; KEYBOARD TYPES: G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_THIRD_K1_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP850_THIRD_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 5,0F5H ;; section symbol +CP850_THIRD_K1_T1_END: ;; + ;; + DW 0 ;; Last xlat table +CP850_THIRD_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Acute Lower Case +;; KEYBOARD TYPES: XT, , G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_LO_END-$ ;; length of state section + DB ACUTE_LOWER ;; State ID + DW XT_KB+G_KB+P12_KB ;; Keyboard Type + DB 239,0 ;; error character = standalone accent + ;; + DW CP850_AC_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 21,0ECH ;; y acute + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +CP850_AC_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Acute Upper Case +;; KEYBOARD TYPES: XT, , G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_UP_END-$ ;; length of state section + DB ACUTE_UPPER ;; State ID + DW XT_KB+G_KB+P12_KB ;; Keyboard Type + DB 239,0 ;; error character = standalone accent + ;; + DW CP850_AC_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,090H ;; E acute + DB 21,0EDH ;; Y acute + DB 22,0E9H ;; U acute + DB 23,0D6H ;; I acute + DB 24,0E0H ;; O acute + DB 30,0B5H ;; A acute +CP850_AC_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Acute Space Bar +;; KEYBOARD TYPES: XT, , G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_SP_END-$ ;; length of state section + DB ACUTE_SPACE ;; State ID + DW XT_KB+G_KB+P12_KB ;; Keyboard Type + DB 239,0 ;; error character = standalone accent + ;; + DW CP850_AC_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,239 ;; scan code,ASCII - SPACE +CP850_AC_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_SP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Diaresis Lower +;; KEYBOARD TYPES: G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_LO_END-$ ;; length of state section + DB DIARESIS_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW CP850_DI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,089H ;; e diaeresis + DB 21,098H ;; y diaeresis + DB 22,081H ;; u diaeresis + DB 23,08BH ;; i diaeresis + DB 24,094H ;; o diaeresis + DB 30,084H ;; a diaeresis +CP850_DI_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_DI_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Diaresis Upper +;; KEYBOARD TYPES: G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_UP_END-$ ;; length of state section + DB DIARESIS_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW CP850_DI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,0D3H ;; E diaeresis + DB 22,09AH ;; U diaeresis + DB 23,0D8H ;; I diaeresis + DB 24,099H ;; O diaeresis + DB 30,08EH ;; A diaeresis +CP850_DI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_DI_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Diaresis Space Bar +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_SP_END-$ ;; length of state section + DB DIARESIS_SPACE ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW CP850_DI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,249 ;; scan code,ASCII - SPACE +CP850_DI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_DI_SP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Grave Upper +;; KEYBOARD TYPES: XT, , G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_GR_UP_END-$ ;; length of state section + DB GRAVE_UPPER ;; State ID + DW XT_KB+G_KB+P12_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW CP850_GR_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 30,0B7H ;; A grave + DB 18,0D4H ;; E grave + DB 23,0DEH ;; I grave + DB 24,0E3H ;; O grave + DB 22,0EBH ;; U grave +CP850_GR_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_GR_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Tilde Lower +;; KEYBOARD TYPES: XT, , G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_TI_LO_END-$ ;; length of state section + DB TILDE_LOWER ;; State ID + DW XT_KB+G_KB+P12_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW CP850_TI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 2 ;; number of scans + DB 30,0C6H ;; scan code,ASCII - a tilde + DB 24,0E4H ;; scan code,ASCII - o tilde + CP850_TI_LO_T1_END: ;; + ;; + DW 0 ;; + ;; + CP850_TI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; CODE PAGE: 850 +;;; STATE: Tilde Upper Case +;;; KEYBOARD TYPES: XT, , G, P12, +;;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_TI_UP_END-$ ;; length of state section + DB TILDE_UPPER ;; State ID + DW XT_KB+G_KB+P12_KB ;; Keyboard Type + DB 07eH,0 ;; error character = standalone accent + ;; + DW CP850_TI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 2 ;; number of scans + DB 30,0C7H ;; scan code,ASCII - A tilde + DB 24,0E5H ;; scan code,ASCII - O tilde + CP850_TI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; + CP850_TI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Circumflex Lower +;; KEYBOARD TYPES: XT, , G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_CI_LO_END-$ ;; length of state section + DB CIRCUMFLEX_LOWER ;; State ID + DW XT_KB+G_KB+P12_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW CP850_CI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 2 ;; number of scans + DB 23,08CH ;; i circumflex + DB 22,096H ;; u circumflex +CP850_CI_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_CI_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Circumflex Upper +;; KEYBOARD TYPES: XT, , G, P12, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_CI_UP_END-$ ;; length of state section + DB CIRCUMFLEX_UPPER ;; State ID + DW XT_KB+G_KB+P12_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW CP850_CI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 30,0B6H ;; A circumflex + DB 18,0D2H ;; E circumflex + DB 23,0D7H ;; I circumflex + DB 24,0E2H ;; O circumflex + DB 22,0EAH ;; U circumflex +CP850_CI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_CI_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW 0 ;; LAST STATE + ;; +CP850_XLAT_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CODE ENDS ;; + END ;; + diff --git a/v4.0/src/DEV/KEYBOARD/KDFSF.ASM b/v4.0/src/DEV/KEYBOARD/KDFSF.ASM new file mode 100644 index 0000000..6165b0d --- /dev/null +++ b/v4.0/src/DEV/KEYBOARD/KDFSF.ASM @@ -0,0 +1,1627 @@ + PAGE ,132 + TITLE DOS - Keyboard Definition File + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DOS - - NLS Support - Keyboard Defintion File +;; (c) Copyright 1988 Microsoft +;; +;; This file contains the keyboard tables for Swiss French +;; +;; Linkage Instructions: +;; Refer to KDF.ASM. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + INCLUDE KEYBSHAR.INC ;; + INCLUDE POSTEQU.INC ;; + INCLUDE KEYBMAC.INC ;; + ;; + PUBLIC SF_LOGIC ;; + PUBLIC SF_437_XLAT ;; + PUBLIC SF_850_XLAT ;; + ;; +CODE SEGMENT PUBLIC 'CODE' ;; + ASSUME CS:CODE,DS:CODE ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Standard translate table options are a liner search table +;; (TYPE_2_TAB) and ASCII entries ONLY (ASCII_ONLY) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +STANDARD_TABLE EQU TYPE_2_TAB+ASCII_ONLY + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; SG State Logic +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +SF_LOGIC: + + DW LOGIC_END-$ ;; length + ;; + DW 0 ;; special features + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; COMMANDS START HERE + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; OPTIONS: If we find a scan match in +;; an XLATT or SET_FLAG operation then +;; exit from INT 9. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + OPTION EXIT_IF_FOUND ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Dead key definitions must come before +;; dead key translations to handle +;; dead key + dead key. +;; ***BD - THIS SECTION HAS BEEN UPDATED +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +IFF EITHER_ALT,NOT ;; +ANDF EITHER_CTL,NOT ;; + IFF EITHER_SHIFT ;; + SET_FLAG DEAD_UPPER ;; + ELSEF ;; + SET_FLAG DEAD_LOWER ;; + ENDIFF ;; +ENDIFF ;; +IFF EITHER_SHIFT,NOT ;; + IFKBD XT_KB+AT_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + SET_FLAG DEAD_THIRD ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_CTL,NOT ;; + ANDF R_ALT_SHIFT ;; + SET_FLAG DEAD_THIRD ;; + ENDIFF ;; + ENDIFF ;; +ENDIFF ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ACUTE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +ACUTE_PROC: ;; + ;; + IFF ACUTE,NOT ;; + GOTO DIARESIS_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT ACUTE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT ACUTE_LOWER ;; + ELSEF ;; + XLATT ACUTE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT ACUTE_UPPER ;; + ELSEF ;; + XLATT ACUTE_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_ACUTE: ;; + PUT_ERROR_CHAR ACUTE_LOWER ;; If we get here then either the XLATT + BEEP ;; failed or we are ina bad shift state. + GOTO NON_DEAD ;; Either is invalid so BEEP and fall + ;; through to generate the second char. + ;; Note that the dead key flag will be + ;; reset before we get here. + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DIARESIS ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +DIARESIS_PROC: ;; + ;; + IFF DIARESIS,NOT ;; + GOTO GRAVE_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT DIARESIS_SPACE ;; exist for 437 so beep for + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_LOWER ;; + ELSEF ;; + XLATT DIARESIS_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_UPPER ;; + ELSEF ;; + XLATT DIARESIS_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_DIARESIS: ;; + PUT_ERROR_CHAR DIARESIS_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; GRAVE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +GRAVE_PROC: ;; + ;; + IFF GRAVE,NOT ;; + GOTO TILDE_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT GRAVE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_GRAVE: ;; + PUT_ERROR_CHAR GRAVE_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; TILDE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +TILDE_PROC: ;; + ;; + IFF TILDE,NOT ;; + GOTO CIRCUMFLEX_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT TILDE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT TILDE_LOWER ;; + ELSEF ;; + XLATT TILDE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT TILDE_UPPER ;; + ELSEF ;; + XLATT TILDE_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_TILDE: ;; + PUT_ERROR_CHAR TILDE_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CIRCUMFLEX ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CIRCUMFLEX_PROC: ;; + ;; + IFF CIRCUMFLEX,NOT ;; + GOTO NON_DEAD ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT CIRCUMFLEX_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_CIRCUMFLEX: ;; + PUT_ERROR_CHAR CIRCUMFLEX_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Upper, lower and third shifts +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +NON_DEAD: ;; + ;; + IFKBD G_KB+P12_KB ;; Avoid accidentally translating + ANDF LC_E0 ;; the "/" on the numeric pad of the + EXIT_STATE_LOGIC ;; G keyboard + ENDIFF ;; + ;; + IFF EITHER_ALT,NOT ;; Lower and upper case. Alphabetic + ANDF EITHER_CTL,NOT ;; keys are affected by CAPS LOCK. + IFF EITHER_SHIFT ;; Numeric keys are not. + IFF CAPS_STATE ;; + XLATT BOTRH_F_CAPS ;; + XLATT ALPHA_LOWER ;; + ELSEF ;; + XLATT ALPHA_UPPER ;; + ENDIFF ;; + XLATT NON_ALPHA_UPPER ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT BOTRH_CAPS ;; + XLATT ALPHA_UPPER ;; + ELSEF ;; + XLATT ALPHA_LOWER ;; + ENDIFF ;; + XLATT NON_ALPHA_LOWER ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_SHIFT,NOT ;; + IFKBD XT_KB+AT_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_CTL,NOT ;; + ANDF R_ALT_SHIFT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ENDIFF ;; + IFKBD AT_KB+XT_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ENDIFF ;; + IFKBD G_KB+P12_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; +;IFF EITHER_SHIFT,NOT ;; + IFKBD AT_KB+XT_KB ;; + IFF EITHER_CTL,NOT ;; + IFF ALT_SHIFT ;; ALT - case + XLATT ALT_CASE ;; + ENDIFF ;; + ELSEF ;; + XLATT CTRL_CASE ;; + ENDIFF ;; + ENDIFF ;; + ;; + IFKBD G_KB+P12_KB ;; + IFF EITHER_CTL,NOT ;; + IFF ALT_SHIFT ;; ALT - case + ANDF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ELSEF ;; + XLATT CTRL_CASE ;; + ENDIFF ;; +; ENDIFF ;; + ENDIFF ;; + ;; + EXIT_STATE_LOGIC ;; + ;; +LOGIC_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; SF Common Translate Section +;; This section contains translations for the lower 128 characters +;; only since these will never change from code page to code page. +;; In addition the dead key "Set Flag" tables are here since the +;; dead keys are on the same keytops for all code pages. +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC SF_COMMON_XLAT ;; +SF_COMMON_XLAT: ;; + ;; + DW COMMON_XLAT_END-$ ;; length of section + DW -1 ;; code page + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Lower Shift Dead Key +;; KEYBOARD TYPES: All +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_SF_LO_END-$ ;; length of state section + DB DEAD_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 2 ;; number of entries + DB 13 ;; scan code + FLAG CIRCUMFLEX ;; flag bit to set + DB 27 ;; scan code + FLAG DIARESIS ;; flag bit to set + ;; + ;; +COM_SF_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Upper Shift Dead Key +;; KEYBOARD TYPES: All +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_SF_UP_END-$ ;; length of state section + DB DEAD_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 1 ;; number of entries + DB 13 ;; scan code + FLAG GRAVE ;; flag bit to set +COM_SF_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift Dead Key +;; KEYBOARD TYPES: All +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_TH_END-$ ;; length of state section + DB DEAD_THIRD ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 2 ;; number of entries + DB 13 ;; scan code + FLAG TILDE ;; flag bit to set + DB 12 ;; scan code + FLAG ACUTE ;; flag bit to set +COM_DK_TH_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alt Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_ALT_K1_END-$ ;; length of state section + DB ALT_CASE ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW COM_ALT_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; + DB 2 ;; 5 Number of entries +; DB 12,-1,-1 ;; +; DB 13,-1,-1 ;; + DB 21,0,2CH ;; + DB 44,0,15H ;; +; DB 53,0,82H ;; +COM_ALT_K1_T1_END: ;; + ;; + DW 0 ;; + ;; +COM_ALT_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K1_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW COM_CTRL_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; + DB 6 ;; Number of entries + DB 12,-1,-1 ;; + DB 21,01AH,15H ;; + DB 43,-1,-1 ;; + DB 44,019H,2CH ;; + DB 53,01FH,35H ;; + DB 86,01CH,56H ;; +COM_CTRL_K1_T1_END: ;; + ;; + DW 0 ;; + ;; +COM_CTRL_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alpha Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AL_LO_END-$ ;; length of state section + DB ALPHA_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_AL_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 2 ;; number of entries + DB 21,'z' ;; small z + DB 44,'y' ;; small y + ;; +COM_AL_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AL_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alpha Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AL_UP_END-$ ;; length of state section + DB ALPHA_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_AL_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 2 ;; number of entries + DB 21,'Z' ;; caps Z + DB 44,'Y' ;; caps Y +COM_AL_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AL_UP_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: G_KB+P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K1_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 7 ;; number of entries + DB 12,"'" ;; + DB 26,8AH ;; e Grave + DB 39,82H ;; e Acute + DB 40,85H ;; a Grave + DB 43,'$' ;; + DB 86,'<' ;; + DB 53,'-' ;; +COM_NA_LO_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: AT_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K2_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K2_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 7 ;; number of entries + DB 12,"'" ;; + DB 26,8AH ;; e Grave + DB 39,82H ;; e Acute + DB 40,85H ;; a Grave + DB 41,'<' ;; + DB 43,'$' ;; + DB 53,'-' ;; +COM_NA_LO_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: XT_KB+ +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K3_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K3_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 7 ;; number of entries + DB 12,"'" ;; + DB 26,8AH ;; e Grave + DB 39,82H ;; e Acute + DB 40,85H ;; a Grave + DB 41,'$' ;; + DB 43,'<' ;; + DB 53,'-' ;; +COM_NA_LO_K3_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K3_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G_KB+P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 20 ;; number of entries + DB 41,0F8H ;; degree symbol + DB 2,'+' ;; + DB 3,'"' ;; + DB 4,'*' ;; + DB 5,087H ;; + DB 7,'&' ;; + DB 8,'/' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,'=' ;; + DB 12,'?' ;; + DB 43,09CH ;; + DB 27,'!' ;; + DB 86,'>' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'_' ;; + DB 26,81H ;; u diaeresis + DB 39,94H ;; o diaeresis + DB 40,84H ;; a diaeresis +COM_NA_UP_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K2_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_T1_K2_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 19 ;; number of entries + DB 41,'>' ;; degree symbol + DB 2,'+' ;; + DB 3,'"' ;; + DB 4,'*' ;; + DB 5,087H ;; + DB 7,'&' ;; + DB 8,'/' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,'=' ;; + DB 12,'?' ;; + DB 43,09CH ;; + DB 27,'!' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'_' ;; + DB 26,81H ;; u diaeresis + DB 39,94H ;; o diaeresis + DB 40,84H ;; a diaeresis +COM_NA_UP_T1_K2_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K2_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: XT+ +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K3_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_T1_K3_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 19 ;; number of entries + DB 43,'>' ;; degree symbol + DB 2,'+' ;; + DB 3,'"' ;; + DB 4,'*' ;; + DB 5,087H ;; + DB 7,'&' ;; + DB 8,'/' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,'=' ;; + DB 12,'?' ;; + DB 41,09CH ;; + DB 27,'!' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'_' ;; + DB 26,81H ;; u diaeresis + DB 39,94H ;; o diaeresis + DB 40,84H ;; a diaeresis +COM_NA_UP_T1_K3_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K3_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: G_KB+P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K1_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 8 ;; number of entries + DB 3,"@" ;; + DB 4,'#' ;; + DB 7,0AAH ;; + DB 43,'}' ;; + DB 26,'[' ;; + DB 27,']' ;; + DB 40,'{' ;; + DB 86,'\' ;; +COM_THIRD_T1_K1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K2_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_T1_K2_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 9 ;; number of entries + DB 3,"@" ;; + DB 4,'#' ;; + DB 5,0F8H ;; degree symbol + DB 8,07CH ;; broken vertical - | + DB 40,'}' ;; + DB 26,'[' ;; + DB 27,']' ;; + DB 39,'{' ;; + DB 41,'\' ;; +COM_THIRD_T1_K2_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K2_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: XT+ +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K3_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_T1_K3_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 9 ;; number of entries + DB 3,"@" ;; + DB 4,'#' ;; + DB 5,0F8H ;; degree symbol + DB 6,0E8H ;; symbol + DB 41,'}' ;; + DB 26,'[' ;; + DB 27,']' ;; + DB 40,'{' ;; + DB 43,'\' ;; +COM_THIRD_T1_K3_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K3_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_GR_LO_END-$ ;; length of state section + DB GRAVE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW COM_GR_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,08AH ;; scan code,ASCII - e + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +COM_GR_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_GR_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_GR_SP_END-$ ;; length of state section + DB GRAVE_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW COM_GR_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,96 ;; STANDALONE GRAVE +COM_GR_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_GR_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_LO_END-$ ;; length of state section + DB CIRCUMFLEX_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW COM_CI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +COM_CI_LO_T1_END: ;; + ;; + DW 0 ;; + ;; +COM_CI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_SP_END-$ ;; length of state section + DB CIRCUMFLEX_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW COM_CI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,94 ;; STANDALONE CIRCUMFLEX +COM_CI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Tilde Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_TI_LO_END-$ ;; length of state section + DB TILDE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW COM_TI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 49,0A4H ;; scan code,ASCII - + COM_TI_LO_T1_END: ;; + ;; + DW 0 ;; + ;; + COM_TI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; CODE PAGE: Common +;;; STATE: Tilde Upper Case +;;; KEYBOARD TYPES: All +;;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_TI_UP_END-$ ;; length of state section + DB TILDE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW COM_TI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 49,0A5H ;; scan code,ASCII - + COM_TI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; + COM_TI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Tilde Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_TI_SP_END-$ ;; length of state section + DB TILDE_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW COM_TI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,07EH ;; STANDALONE TILDE +COM_TI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_TI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; Last State +COMMON_XLAT_END: ;; + ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; SF Specific Translate Section for 437 +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC SF_437_XLAT ;; +SF_437_XLAT: ;; + ;; + DW CP437_XLAT_END-$ ;; length of section + DW 437 ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: G_KB+P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_NA_LO_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP437_NA_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 41,015H ;; Section Symbol +CP437_NA_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_NA_LO_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Third Shift +;; KEYBOARD TYPES: G_KB+P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_THIRD_K1_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP437_THIRD_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 3 ;; number of entries + DB 2,0B3H ;; Solid vertical + DB 8,07CH ;; Broken vertical + DB 9,09BH ;; cent sign +CP437_THIRD_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_THIRD_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Third Shift +;; KEYBOARD TYPES: AT+XT+ +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_THIRD_K2_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP437_THIRD_T1_K2_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 2 ;; number of entries + DB 8,07CH ;; Broken vertical + DB 6,015H ;; Section Symbol +CP437_THIRD_T1_K2_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_THIRD_K2_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Acute Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_AC_LO_END-$ ;; length of state section + DB ACUTE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW CP437_AC_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +CP437_AC_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_AC_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Acute Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_AC_UP_END-$ ;; length of state section + DB ACUTE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW CP437_AC_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of entries + DB 18,'' ;; scan code,ASCII - +CP437_AC_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_AC_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Diaresis Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_DI_LO_END-$ ;; length of state section + DB DIARESIS_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 34,0 ;; error character = standalone accent + ;; + DW CP437_DI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 44,'' ;; scan code,ASCII - y + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +CP437_DI_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_DI_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Diaresis Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_DI_UP_END-$ ;; length of state section + DB DIARESIS_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 34,0 ;; error character = standalone accent + ;; + DW CP437_DI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 3 ;; number of scans + DB 22,'' ;; scan code,ASCII - U + DB 24,'' ;; scan code,ASCII - O + DB 30,'' ;; scan code,ASCII - A +CP437_DI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_DI_UP_END: ;; length of state section +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: CapsLock +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_BOTRH_END-$ ;; length of state section + DB BOTRH_CAPS ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP437_BOTRH_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 3 ;; number of entries + DB 39,082H ;; e ACUTE + DB 26,08AH ;; e GRAVE + DB 40,085H ;; a GRAVE +CP437_BOTRH_T1_END: ;; + ;; + DW 0 ;; Last xlat table +CP437_BOTRH_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: CapsLock + Shift +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_BOTRH_K1_END-$ ;; length of state section + DB BOTRH_F_CAPS ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP437_BOTRH_T2_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 3 ;; number of entries + DB 39,094H ;; o di + DB 26,081H ;; u di + DB 40,084H ;; a di +CP437_BOTRH_T2_END: ;; + ;; + DW 0 ;; Last xlat table +CP437_BOTRH_K1_END: ;; + ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW 0 ;; LAST STATE + ;; +CP437_XLAT_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; SF Specific Translate Section for 850 +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC SF_850_XLAT ;; +SF_850_XLAT: ;; + ;; + DW CP850_XLAT_END-$ ;; length of section + DW 850 ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP850 +;; STATE: CapsLock +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_BOTRH_END-$ ;; length of state section + DB BOTRH_CAPS ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP850_BOTRH_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 3 ;; number of entries + DB 39,090H ;; CAP E ACUTE + DB 26,0D4H ;; CAP E GRAVE + DB 40,0B7H ;; CAP A GRAVE +CP850_BOTRH_T1_END: ;; + ;; + DW 0 ;; Last xlat table +CP850_BOTRH_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP850 +;; STATE: CapsLock + Shift +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_BOTRH_K1_END-$ ;; length of state section + DB BOTRH_F_CAPS ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP850_BOTRH_T2_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 3 ;; number of entries + DB 26,09AH ;; CAP U di + DB 39,099H ;; CAP O di + DB 40,08EH ;; CAP A di +CP850_BOTRH_T2_END: ;; + ;; + DW 0 ;; Last xlat table +CP850_BOTRH_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: G_KB+P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_NA_LO_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP850_NA_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 41,0F5H ;; Section Symbol +CP850_NA_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_NA_LO_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Third Shift +;; KEYBOARD TYPES: G_KB+P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_THIRD_K1_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP850_THIRD_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 3 ;; number of entries + DB 2,07CH ;; Solid vertical + DB 8,0DDH ;; Broken vertical + DB 9,0BDH ;; cent sign +CP850_THIRD_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_THIRD_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Third Shift +;; KEYBOARD TYPES: AT+XT+ +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_THIRD_K2_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP850_THIRD_T1_K2_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 2 ;; number of entries + DB 8,0DDH ;; Broken vertical + DB 6,0F5H ;; Section Symbol +CP850_THIRD_T1_K2_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_THIRD_K2_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Acute Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_LO_END-$ ;; length of state section + DB ACUTE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 239,0 ;; error character = standalone accent + ;; + DW CP850_AC_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 44,0ECH ;; y acute + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +CP850_AC_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Acute Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_UP_END-$ ;; length of state section + DB ACUTE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 239,0 ;; error character = standalone accent + ;; + DW CP850_AC_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of entries + DB 18,090H ;; E acute + DB 44,0EDH ;; Y acute + DB 22,0E9H ;; U acute + DB 23,0D6H ;; I acute + DB 24,0E0H ;; O acute + DB 30,0B5H ;; A acute +CP850_AC_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Acute Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_SP_END-$ ;; length of state section + DB ACUTE_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 239,0 ;; error character = standalone accent + ;; + DW CP850_AC_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,239 ;; scan code,ASCII - SPACE +CP850_AC_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_SP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Diaresis Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_LO_END-$ ;; length of state section + DB DIARESIS_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW CP850_DI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 44,'' ;; scan code,ASCII - y + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +CP850_DI_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_DI_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Diaresis Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_UP_END-$ ;; length of state section + DB DIARESIS_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW CP850_DI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,0D3H ;; E Diaeresis + DB 22,'' ;; U Diaeresis + DB 23,0D8H ;; I Diaeresis + DB 24,'' ;; O Diaeresis + DB 30,'' ;; A Diaeresis +CP850_DI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_DI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Diaresis Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_SP_END-$ ;; length of state section + DB DIARESIS_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW CP850_DI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,249 ;; error character = standalone accent +CP850_DI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table +CP850_DI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Grave Upper +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_GR_UP_END-$ ;; length of state section + DB GRAVE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW CP850_GR_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,0D4H ;; E grave + DB 22,0EBH ;; U grave + DB 23,0DEH ;; I grave + DB 24,0E3H ;; O grave + DB 30,0B7H ;; A grave +CP850_GR_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_GR_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Tilde Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_TI_LO_END-$ ;; length of state section + DB TILDE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW CP850_TI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 2 ;; number of scans + DB 24,0E4H ;; scan code,ASCII - o tilde + DB 30,0C6H ;; scan code,ASCII - a tilde + CP850_TI_LO_T1_END: ;; + ;; + DW 0 ;; + ;; + CP850_TI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; CODE PAGE: 850 +;;; STATE: Tilde Upper Case +;;; KEYBOARD TYPES: All +;;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_TI_UP_END-$ ;; length of state section + DB TILDE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW CP850_TI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 2 ;; number of scans + DB 24,0E5H ;; scan code,ASCII - O tilde + DB 30,0C7H ;; scan code,ASCII - A tilde + CP850_TI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; + CP850_TI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Circumflex Upper +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_CI_UP_END-$ ;; length of state section + DB CIRCUMFLEX_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW CP850_CI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,0D2H ;; E circumflex + DB 22,0EAH ;; U circumflex + DB 23,0D7H ;; I circumflex + DB 24,0E2H ;; O circumflex + DB 30,0B6H ;; A circumflex +CP850_CI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_CI_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; + DW 0 ;; LAST STATE + ;; +CP850_XLAT_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CODE ENDS ;; + END ;; diff --git a/v4.0/src/DEV/KEYBOARD/KDFSG.ASM b/v4.0/src/DEV/KEYBOARD/KDFSG.ASM new file mode 100644 index 0000000..233da93 --- /dev/null +++ b/v4.0/src/DEV/KEYBOARD/KDFSG.ASM @@ -0,0 +1,1629 @@ + PAGE ,132 + TITLE DOS - Keyboard Definition File + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DOS - - NLS Support - Keyboard Defintion File +;; (c) Copyright 1988 Microsoft +;; +;; This file contains the keyboard tables for Swiss German +;; +;; Linkage Instructions: +;; Refer to KDF.ASM. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + INCLUDE KEYBSHAR.INC ;; + INCLUDE POSTEQU.INC ;; + INCLUDE KEYBMAC.INC ;; + ;; + PUBLIC SG_LOGIC ;; + PUBLIC SG_437_XLAT ;; + PUBLIC SG_850_XLAT ;; + ;; +CODE SEGMENT PUBLIC 'CODE' ;; + ASSUME CS:CODE,DS:CODE ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Standard translate table options are a liner search table +;; (TYPE_2_TAB) and ASCII entries ONLY (ASCII_ONLY) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +STANDARD_TABLE EQU TYPE_2_TAB+ASCII_ONLY + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; SG State Logic +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +SG_LOGIC: + + DW LOGIC_END-$ ;; length + ;; + DW 0 ;; special features + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; COMMANDS START HERE + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; OPTIONS: If we find a scan match in +;; an XLATT or SET_FLAG operation then +;; exit from INT 9. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + OPTION EXIT_IF_FOUND ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Dead key definitions must come before +;; dead key translations to handle +;; dead key + dead key. +;; ***BD - THIS SECTION HAS BEEN UPDATED +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +IFF EITHER_ALT,NOT ;; +ANDF EITHER_CTL,NOT ;; + IFF EITHER_SHIFT ;; + SET_FLAG DEAD_UPPER ;; + ELSEF ;; + SET_FLAG DEAD_LOWER ;; + ENDIFF ;; +ENDIFF ;; +IFF EITHER_SHIFT,NOT ;; + IFKBD XT_KB+AT_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + SET_FLAG DEAD_THIRD ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_CTL,NOT ;; + ANDF R_ALT_SHIFT ;; + SET_FLAG DEAD_THIRD ;; + ENDIFF ;; + ENDIFF ;; +ENDIFF ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ACUTE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +ACUTE_PROC: ;; + ;; + IFF ACUTE,NOT ;; + GOTO DIARESIS_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT ACUTE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT ACUTE_LOWER ;; + ELSEF ;; + XLATT ACUTE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT ACUTE_UPPER ;; + ELSEF ;; + XLATT ACUTE_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_ACUTE: ;; + PUT_ERROR_CHAR ACUTE_LOWER ;; If we get here then either the XLATT + BEEP ;; failed or we are ina bad shift state. + GOTO NON_DEAD ;; Either is invalid so BEEP and fall + ;; through to generate the second char. + ;; Note that the dead key flag will be + ;; reset before we get here. + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DIARESIS ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +DIARESIS_PROC: ;; + ;; + IFF DIARESIS,NOT ;; + GOTO GRAVE_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT DIARESIS_SPACE ;; exist for 437 so beep for + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_LOWER ;; + ELSEF ;; + XLATT DIARESIS_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_UPPER ;; + ELSEF ;; + XLATT DIARESIS_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_DIARESIS: ;; + PUT_ERROR_CHAR DIARESIS_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; GRAVE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +GRAVE_PROC: ;; + ;; + IFF GRAVE,NOT ;; + GOTO TILDE_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT GRAVE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_GRAVE: ;; + PUT_ERROR_CHAR GRAVE_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; TILDE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +TILDE_PROC: ;; + ;; + IFF TILDE,NOT ;; + GOTO CIRCUMFLEX_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT TILDE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT TILDE_LOWER ;; + ELSEF ;; + XLATT TILDE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT TILDE_UPPER ;; + ELSEF ;; + XLATT TILDE_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_TILDE: ;; + PUT_ERROR_CHAR TILDE_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CIRCUMFLEX ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CIRCUMFLEX_PROC: ;; + ;; + IFF CIRCUMFLEX,NOT ;; + GOTO NON_DEAD ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT CIRCUMFLEX_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_CIRCUMFLEX: ;; + PUT_ERROR_CHAR CIRCUMFLEX_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Upper, lower and third shifts +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +NON_DEAD: ;; + ;; + IFKBD G_KB+P12_KB ;; Avoid accidentally translating + ANDF LC_E0 ;; the "/" on the numeric pad of the + EXIT_STATE_LOGIC ;; G keyboard + ENDIFF ;; + ;; + IFF EITHER_ALT,NOT ;; Lower and upper case. Alphabetic + ANDF EITHER_CTL,NOT ;; keys are affected by CAPS LOCK. + IFF EITHER_SHIFT ;; Numeric keys are not. + IFF CAPS_STATE ;; + XLATT BOTLH_F_CAPS ;; + XLATT ALPHA_LOWER ;; + ELSEF ;; + XLATT ALPHA_UPPER ;; + ENDIFF ;; + XLATT NON_ALPHA_UPPER ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT BOTLH_CAPS ;; + XLATT ALPHA_UPPER ;; + ELSEF ;; + XLATT ALPHA_LOWER ;; + ENDIFF ;; + XLATT NON_ALPHA_LOWER ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_SHIFT,NOT ;; + IFKBD XT_KB+AT_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_CTL,NOT ;; + ANDF R_ALT_SHIFT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ENDIFF ;; + IFKBD AT_KB+XT_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ENDIFF ;; + IFKBD G_KB+P12_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; +;IFF EITHER_SHIFT,NOT ;; + IFKBD AT_KB+XT_KB ;; + IFF EITHER_CTL,NOT ;; + IFF ALT_SHIFT ;; ALT - case + XLATT ALT_CASE ;; + ENDIFF ;; + ELSEF ;; + XLATT CTRL_CASE ;; + ENDIFF ;; + ENDIFF ;; + ;; + IFKBD G_KB+P12_KB ;; + IFF EITHER_CTL,NOT ;; + IFF ALT_SHIFT ;; ALT - case + ANDF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ELSEF ;; + XLATT CTRL_CASE ;; + ENDIFF ;; +; ENDIFF ;; + ENDIFF ;; + ;; + EXIT_STATE_LOGIC ;; + ;; +LOGIC_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; SG Common Translate Section +;; This section contains translations for the lower 128 characters +;; only since these will never change from code page to code page. +;; In addition the dead key "Set Flag" tables are here since the +;; dead keys are on the same keytops for all code pages. +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC SG_COMMON_XLAT ;; +SG_COMMON_XLAT: ;; + ;; + DW COMMON_XLAT_END-$ ;; length of section + DW -1 ;; code page + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Lower Shift Dead Key +;; KEYBOARD TYPES: All +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_SG_LO_END-$ ;; length of state section + DB DEAD_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 2 ;; number of entries + DB 13 ;; scan code + FLAG CIRCUMFLEX ;; flag bit to set + DB 27 ;; scan code + FLAG DIARESIS ;; flag bit to set + ;; + ;; +COM_SG_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Upper Shift Dead Key +;; KEYBOARD TYPES: All +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_SG_UP_END-$ ;; length of state section + DB DEAD_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 1 ;; number of entries + DB 13 ;; scan code + FLAG GRAVE ;; flag bit to set +COM_SG_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift Dead Key +;; KEYBOARD TYPES: All +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_TH_END-$ ;; length of state section + DB DEAD_THIRD ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 2 ;; number of entries + DB 13 ;; scan code + FLAG TILDE ;; flag bit to set + DB 12 ;; scan code + FLAG ACUTE ;; flag bit to set +COM_DK_TH_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alt Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_ALT_K1_END-$ ;; length of state section + DB ALT_CASE ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW COM_ALT_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; + DB 2 ;; 5 Number of entries +; DB 12,-1,-1 ;; +; DB 13,-1,-1 ;; + DB 21,0,2CH ;; + DB 44,0,15H ;; +; DB 53,0,82H ;; +COM_ALT_K1_T1_END: ;; + ;; + DW 0 ;; + ;; +COM_ALT_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K1_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW COM_CTRL_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; + DB 6 ;; Number of entries + DB 12,-1,-1 ;; + DB 21,01AH,15H ;; + DB 43,-1,-1 ;; + DB 44,019H,2CH ;; + DB 53,01FH,35H ;; + DB 86,01CH,56H ;; +COM_CTRL_K1_T1_END: ;; + ;; + DW 0 ;; + ;; +COM_CTRL_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alpha Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AL_LO_END-$ ;; length of state section + DB ALPHA_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_AL_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 2 ;; number of entries + DB 21,'z' ;; small z + DB 44,'y' ;; small y + ;; +COM_AL_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AL_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alpha Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AL_UP_END-$ ;; length of state section + DB ALPHA_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_AL_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 2 ;; number of entries + DB 21,'Z' ;; caps Z + DB 44,'Y' ;; caps Y +COM_AL_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AL_UP_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: G_KB+P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K1_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 7 ;; number of entries + DB 12,"'" ;; + DB 39,'' ;; diaresis - o + DB 26,'' ;; diaresis - u + DB 40,'' ;; diaresis - a + DB 43,'$' ;; + DB 86,'<' ;; + DB 53,'-' ;; +COM_NA_LO_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: AT_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K2_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K2_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 7 ;; number of entries + DB 12,"'" ;; + DB 39,'' ;; diaresis - o + DB 26,'' ;; diaresis - u + DB 40,'' ;; diaresis - a + DB 41,'<' ;; + DB 43,'$' ;; + DB 53,'-' ;; +COM_NA_LO_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: XT_KB+ +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K3_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K3_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 7 ;; number of entries + DB 12,"'" ;; + DB 39,'' ;; diaresis - o + DB 26,'' ;; diaresis - u + DB 40,'' ;; diaresis - a + DB 41,'$' ;; + DB 43,'<' ;; + DB 53,'-' ;; +COM_NA_LO_K3_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K3_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G_KB+P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 20 ;; number of entries + DB 41,0F8H ;; degree symbol + DB 2,'+' ;; + DB 3,'"' ;; + DB 4,'*' ;; + DB 5,087H ;; + DB 7,'&' ;; + DB 8,'/' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,'=' ;; + DB 12,'?' ;; + DB 43,09CH ;; + DB 27,'!' ;; + DB 86,'>' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'_' ;; + DB 39,'' ;; acute e + DB 26,'' ;; grave e + DB 40,'' ;; grave a +COM_NA_UP_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K2_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_T1_K2_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 19 ;; number of entries + DB 41,'>' ;; degree symbol + DB 2,'+' ;; + DB 3,'"' ;; + DB 4,'*' ;; + DB 5,087H ;; + DB 7,'&' ;; + DB 8,'/' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,'=' ;; + DB 12,'?' ;; + DB 43,09CH ;; + DB 27,'!' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'_' ;; + DB 39,'' ;; acute e + DB 26,'' ;; grave e + DB 40,'' ;; grave a +COM_NA_UP_T1_K2_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K2_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: XT+ +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K3_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_T1_K3_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 19 ;; number of entries + DB 43,'>' ;; degree symbol + DB 2,'+' ;; + DB 3,'"' ;; + DB 4,'*' ;; + DB 5,087H ;; + DB 7,'&' ;; + DB 8,'/' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,'=' ;; + DB 12,'?' ;; + DB 41,09CH ;; + DB 27,'!' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'_' ;; + DB 39,'' ;; acute e - Shift stae for SWISS GR + DB 26,'' ;; grave e + DB 40,'' ;; grave a +COM_NA_UP_T1_K3_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K3_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: G_KB+P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K1_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 8 ;; number of entries + DB 3,"@" ;; + DB 4,'#' ;; + DB 7,0AAH ;; + DB 43,'}' ;; + DB 26,'[' ;; + DB 27,']' ;; + DB 40,'{' ;; + DB 86,'\' ;; +COM_THIRD_T1_K1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K2_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_T1_K2_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 9 ;; number of entries + DB 3,"@" ;; + DB 4,'#' ;; + DB 5,0F8H ;; degree symbol + DB 8,07CH ;; broken vertical - | + DB 40,'}' ;; + DB 26,'[' ;; + DB 27,']' ;; + DB 39,'{' ;; + DB 41,'\' ;; +COM_THIRD_T1_K2_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K2_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: XT+ +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K3_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_T1_K3_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 9 ;; number of entries + DB 3,"@" ;; + DB 4,'#' ;; + DB 5,0F8H ;; degree symbol + DB 6,0E8H ;; symbol + DB 41,'}' ;; + DB 26,'[' ;; + DB 27,']' ;; + DB 40,'{' ;; + DB 43,'\' ;; +COM_THIRD_T1_K3_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K3_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_GR_LO_END-$ ;; length of state section + DB GRAVE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW COM_GR_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,08AH ;; scan code,ASCII - e + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +COM_GR_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_GR_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_GR_SP_END-$ ;; length of state section + DB GRAVE_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW COM_GR_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,96 ;; STANDALONE GRAVE +COM_GR_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_GR_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_LO_END-$ ;; length of state section + DB CIRCUMFLEX_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW COM_CI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +COM_CI_LO_T1_END: ;; + ;; + DW 0 ;; + ;; +COM_CI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_SP_END-$ ;; length of state section + DB CIRCUMFLEX_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW COM_CI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,94 ;; STANDALONE CIRCUMFLEX +COM_CI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Tilde Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_TI_LO_END-$ ;; length of state section + DB TILDE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW COM_TI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 49,0A4H ;; scan code,ASCII - + COM_TI_LO_T1_END: ;; + ;; + DW 0 ;; + ;; + COM_TI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; CODE PAGE: Common +;;; STATE: Tilde Upper Case +;;; KEYBOARD TYPES: All +;;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_TI_UP_END-$ ;; length of state section + DB TILDE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW COM_TI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 49,0A5H ;; scan code,ASCII - + COM_TI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; + COM_TI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Tilde Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_TI_SP_END-$ ;; length of state section + DB TILDE_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW COM_TI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,07EH ;; STANDALONE TILDE +COM_TI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_TI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; Last State +COMMON_XLAT_END: ;; + ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; SG Specific Translate Section for 437 +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC SG_437_XLAT ;; +SG_437_XLAT: ;; + ;; + DW CP437_XLAT_END-$ ;; length of section + DW 437 ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: G_KB+P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_NA_LO_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP437_NA_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 41,015H ;; Section Symbol +CP437_NA_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_NA_LO_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Third Shift +;; KEYBOARD TYPES: G_KB+P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_THIRD_K1_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP437_THIRD_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 3 ;; number of entries + DB 2,0B3H ;; Solid vertical + DB 8,07CH ;; Broken vertical + DB 9,09BH ;; cent sign +CP437_THIRD_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_THIRD_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Third Shift +;; KEYBOARD TYPES: AT+XT+ +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_THIRD_K2_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP437_THIRD_T1_K2_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 2 ;; number of entries + DB 8,07CH ;; Broken vertical + DB 6,015H ;; Section Symbol +CP437_THIRD_T1_K2_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_THIRD_K2_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Acute Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_AC_LO_END-$ ;; length of state section + DB ACUTE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW CP437_AC_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +CP437_AC_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_AC_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Acute Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_AC_UP_END-$ ;; length of state section + DB ACUTE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW CP437_AC_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of entries + DB 18,'' ;; scan code,ASCII - +CP437_AC_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_AC_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Diaresis Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_DI_LO_END-$ ;; length of state section + DB DIARESIS_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 34,0 ;; error character = standalone accent + ;; + DW CP437_DI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 44,'' ;; scan code,ASCII - y + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +CP437_DI_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_DI_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Diaresis Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_DI_UP_END-$ ;; length of state section + DB DIARESIS_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 34,0 ;; error character = standalone accent + ;; + DW CP437_DI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 3 ;; number of scans + DB 22,'' ;; scan code,ASCII - U + DB 24,'' ;; scan code,ASCII - O + DB 30,'' ;; scan code,ASCII - A +CP437_DI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_DI_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: CapsLock +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_BOTLH_K1_END-$ ;; length of state section + DB BOTLH_CAPS ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP437_BOTLH_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 3 ;; number of entries + DB 39,099H ;; CAP O Umlaut + DB 26,09AH ;; CAP U Umlaut + DB 40,08EH ;; CAP A Umlaut +CP437_BOTLH_K1_T1_END: ;; + ;; + DW 0 ;; Last xlat table +CP437_BOTLH_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: CapsLock + Shift +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_BOTLH_T1_END-$ ;; length of state section + DB BOTLH_F_CAPS ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP437_BOTLH_T1_K2_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 3 ;; number of entries + DB 39,082H ;; e Acute + DB 26,08AH ;; e Grave + DB 40,085H ;; a Grave +CP437_BOTLH_T1_K2_END: ;; + ;; + DW 0 ;; Last xlat table +CP437_BOTLH_T1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW 0 ;; LAST STATE + ;; +CP437_XLAT_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; SG Specific Translate Section for 850 +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC SG_850_XLAT ;; +SG_850_XLAT: ;; + ;; + DW CP850_XLAT_END-$ ;; length of section + DW 850 ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP850 +;; STATE: CapsLock +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_BOTLH_END-$ ;; length of state section + DB BOTLH_CAPS ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP850_BOTLH_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 3 ;; number of entries + DB 26,09AH ;; CAP U Umlaut + DB 39,099H ;; CAP O Umlaut + DB 40,08EH ;; CAP A Umlaut +CP850_BOTLH_T1_END: ;; + ;; + DW 0 ;; Last xlat table +CP850_BOTLH_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP850 +;; STATE: CapsLock + Shift +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_BOTLH_K1_END-$ ;; length of state section + DB BOTLH_F_CAPS ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP850_BOTLH_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 3 ;; number of entries + DB 26,0D4H ;; CAP E Grave + DB 39,090H ;; CAP E Acute + DB 40,0B7H ;; CAP A Grave +CP850_BOTLH_T1_K1_END: ;; + ;; + DW 0 ;; Last xlat table +CP850_BOTLH_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: G_KB+P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_NA_LO_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP850_NA_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 41,0F5H ;; Section Symbol +CP850_NA_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_NA_LO_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Third Shift +;; KEYBOARD TYPES: G_KB+P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_THIRD_K1_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP850_THIRD_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 3 ;; number of entries + DB 2,07CH ;; Solid vertical + DB 8,0DDH ;; Broken vertical + DB 9,0BDH ;; cent sign +CP850_THIRD_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_THIRD_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Third Shift +;; KEYBOARD TYPES: AT+XT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_THIRD_K2_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP850_THIRD_T1_K2_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 2 ;; number of entries + DB 8,0DDH ;; Broken vertical + DB 6,0F5H ;; Section Symbol +CP850_THIRD_T1_K2_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_THIRD_K2_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Acute Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_LO_END-$ ;; length of state section + DB ACUTE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 239,0 ;; error character = standalone accent + ;; + DW CP850_AC_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 44,0ECH ;; y acute + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +CP850_AC_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Acute Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_UP_END-$ ;; length of state section + DB ACUTE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 239,0 ;; error character = standalone accent + ;; + DW CP850_AC_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of entries + DB 18,090H ;; E acute + DB 44,0EDH ;; Y acute + DB 22,0E9H ;; U acute + DB 23,0D6H ;; I acute + DB 24,0E0H ;; O acute + DB 30,0B5H ;; A acute +CP850_AC_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Acute Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_SP_END-$ ;; length of state section + DB ACUTE_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 239,0 ;; error character = standalone accent + ;; + DW CP850_AC_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,239 ;; scan code,ASCII - SPACE +CP850_AC_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_SP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Diaresis Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_LO_END-$ ;; length of state section + DB DIARESIS_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW CP850_DI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 44,'' ;; scan code,ASCII - y + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +CP850_DI_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_DI_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Diaresis Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_UP_END-$ ;; length of state section + DB DIARESIS_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW CP850_DI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,0D3H ;; E Diaeresis + DB 22,'' ;; U Diaeresis + DB 23,0D8H ;; I Diaeresis + DB 24,'' ;; O Diaeresis + DB 30,'' ;; A Diaeresis +CP850_DI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_DI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Diaresis Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_SP_END-$ ;; length of state section + DB DIARESIS_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW CP850_DI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,249 ;; error character = standalone accent +CP850_DI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table +CP850_DI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Grave Upper +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_GR_UP_END-$ ;; length of state section + DB GRAVE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW CP850_GR_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,0D4H ;; E grave + DB 22,0EBH ;; U grave + DB 23,0DEH ;; I grave + DB 24,0E3H ;; O grave + DB 30,0B7H ;; A grave +CP850_GR_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_GR_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Tilde Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_TI_LO_END-$ ;; length of state section + DB TILDE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW CP850_TI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 2 ;; number of scans + DB 24,0E4H ;; scan code,ASCII - o tilde + DB 30,0C6H ;; scan code,ASCII - a tilde + CP850_TI_LO_T1_END: ;; + ;; + DW 0 ;; + ;; + CP850_TI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; CODE PAGE: 850 +;;; STATE: Tilde Upper Case +;;; KEYBOARD TYPES: All +;;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_TI_UP_END-$ ;; length of state section + DB TILDE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW CP850_TI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 2 ;; number of scans + DB 24,0E5H ;; scan code,ASCII - O tilde + DB 30,0C7H ;; scan code,ASCII - A tilde + CP850_TI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; + CP850_TI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Circumflex Upper +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_CI_UP_END-$ ;; length of state section + DB CIRCUMFLEX_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW CP850_CI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,0D2H ;; E circumflex + DB 22,0EAH ;; U circumflex + DB 23,0D7H ;; I circumflex + DB 24,0E2H ;; O circumflex + DB 30,0B6H ;; A circumflex +CP850_CI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_CI_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; + DW 0 ;; LAST STATE + ;; +CP850_XLAT_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CODE ENDS ;; + END ;; diff --git a/v4.0/src/DEV/KEYBOARD/KDFSP.ASM b/v4.0/src/DEV/KEYBOARD/KDFSP.ASM new file mode 100644 index 0000000..30955e3 --- /dev/null +++ b/v4.0/src/DEV/KEYBOARD/KDFSP.ASM @@ -0,0 +1,1373 @@ +;; LATEST CHANGE ALT & CTL (November) +;LATEST CHANGE XT "\" third shift (December) +;;;;******************************************** +;;;;******************************************** +;;;;CONTAINS UPDATES FOR +;;;; 1) ALT, CTRL CASES +;;;; 2) DECIMAL SEPERATOR ON NUMERIC PAD +;;;; 3) STANDALONE DIARESIS VALID ONLY FOR 850 +;;;;CHANGES ARE MARKED ***BD +;;;;******************************************** +;;;;******************************************** + + PAGE ,132 + TITLE DOS - Keyboard Definition File + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DOS - - NLS Support - Keyboard Defintion File +;; (c) Copyright 1988 Microsoft +;; +;; This file contains the keyboard tables for Spanish. +;; +;; Linkage Instructions: +;; Refer to KDF.ASM. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + INCLUDE KEYBSHAR.INC ;; + INCLUDE POSTEQU.INC ;; + INCLUDE KEYBMAC.INC ;; + ;; + PUBLIC SP_LOGIC ;; + PUBLIC SP_437_XLAT ;; + PUBLIC SP_850_XLAT ;; + ;; +CODE SEGMENT PUBLIC 'CODE' ;; + ASSUME CS:CODE,DS:CODE ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Standard translate table options are a liner search table +;; (TYPE_2_TAB) and ASCII entries ONLY (ASCII_ONLY) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +STANDARD_TABLE EQU TYPE_2_TAB+ASCII_ONLY + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; SP State Logic +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +SP_LOGIC: + + DW LOGIC_END-$ ;; length + ;; + DW 0 ;; special features + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; COMMANDS START HERE + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; OPTIONS: If we find a scan match in +;; an XLATT or SET_FLAG operation then +;; exit from INT 9. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + OPTION EXIT_IF_FOUND ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Dead key definitions must come before +;; dead key translations to handle +;; dead key + dead key. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + IFF EITHER_ALT,NOT ;; + ANDF EITHER_CTL,NOT ;; + IFF EITHER_SHIFT ;; + SET_FLAG DEAD_UPPER ;; + ELSEF ;; + SET_FLAG DEAD_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ACUTE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +ACUTE_PROC: ;; + ;; + IFF ACUTE,NOT ;; + GOTO DIARESIS_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT ACUTE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT ACUTE_LOWER ;; + ELSEF ;; + XLATT ACUTE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT ACUTE_UPPER ;; + ELSEF ;; + XLATT ACUTE_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_ACUTE: ;; + PUT_ERROR_CHAR ACUTE_LOWER ;; If we get here then either the XLATT + BEEP ;; failed or we are ina bad shift state. + GOTO NON_DEAD ;; Either is invalid so BEEP and fall + ;; through to generate the second char. + ;; Note that the dead key flag will be + ;; reset before we get here. + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DIARESIS ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +DIARESIS_PROC: ;; + ;; + IFF DIARESIS,NOT ;; + GOTO GRAVE_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT DIARESIS_SPACE ;; exist for 437 so beep for + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_LOWER ;; + ELSEF ;; + XLATT DIARESIS_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_UPPER ;; + ELSEF ;; + XLATT DIARESIS_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_DIARESIS: ;; + PUT_ERROR_CHAR DIARESIS_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; GRAVE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +GRAVE_PROC: ;; + ;; + IFF GRAVE,NOT ;; + GOTO CIRCUMFLEX_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT GRAVE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_GRAVE: ;; + PUT_ERROR_CHAR GRAVE_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CIRCUMFLEX ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CIRCUMFLEX_PROC: ;; + ;; + IFF CIRCUMFLEX,NOT ;; + GOTO NON_DEAD ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT CIRCUMFLEX_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_CIRCUMFLEX: ;; + PUT_ERROR_CHAR CIRCUMFLEX_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Upper, lower and third shifts +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +NON_DEAD: ;; + ;; + IFKBD G_KB+P12_KB ;; Avoid accidentally translating + ANDF LC_E0 ;; the "/" on the numeric pad of the + EXIT_STATE_LOGIC ;; G keyboard + ENDIFF ;; +;;***BD ADDED FOR ALT, CTRL CASES ;; + IFF EITHER_CTL,NOT ;; + IFF ALT_SHIFT ;; ALT - case + ANDF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_ALT,NOT ;; CTRL - case + XLATT CTRL_CASE ;; + ENDIFF ;; + ENDIFF ;; +;;***BD END OF ADDITION + ;; + IFF EITHER_ALT,NOT ;; Lower and upper case. Alphabetic + ANDF EITHER_CTL,NOT ;; keys are affected by CAPS LOCK. + IFF EITHER_SHIFT ;; Numeric keys are not. +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE,NOT ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION + XLATT NON_ALPHA_UPPER ;; + IFF CAPS_STATE ;; + XLATT ALPHA_LOWER ;; + ELSEF ;; + XLATT ALPHA_UPPER ;; + ENDIFF ;; + ELSEF ;; +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION + XLATT NON_ALPHA_LOWER ;; + IFF CAPS_STATE ;; + XLATT ALPHA_UPPER ;; + ELSEF ;; + XLATT ALPHA_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_SHIFT,NOT ;; + IFKBD XT_KB+AT_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_CTL,NOT ;; + ANDF R_ALT_SHIFT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; + EXIT_STATE_LOGIC ;; + ;; +LOGIC_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; SP Common Translate Section +;; This section contains translations for the lower 128 characters +;; only since these will never change from code page to code page. +;; In addition the dead key "Set Flag" tables are here since the +;; dead keys are on the same keytops for all code pages. +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC SP_COMMON_XLAT ;; +SP_COMMON_XLAT: ;; + ;; + DW COMMON_XLAT_END-$ ;; length of section + DW -1 ;; code page + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Lower Shift Dead Key +;; KEYBOARD TYPES: G + P12 +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_LO_K1_END-$ ;; length of state section + DB DEAD_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 2 ;; number of entries + DB 26 ;; scan code + FLAG GRAVE ;; flag bit to set + DB 40 ;; + FLAG ACUTE ;; + ;; + ;; +COM_DK_LO_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Lower Shift Dead Key +;; KEYBOARD TYPES: AT + XT + +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_LO_K2_END-$ ;; length of state section + DB DEAD_LOWER ;; State ID + DW AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 2 ;; number of entries + DB 26 ;; scan code + FLAG ACUTE ;; flag bit to set + DB 27 ;; + FLAG GRAVE ;; + ;; + ;; +COM_DK_LO_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Upper Shift Dead Key +;; KEYBOARD TYPES: G + P12 +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_UP_K1_END-$ ;; length of state section + DB DEAD_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 2 ;; number of entries + DB 26 ;; scan code + FLAG CIRCUMFLEX ;; flag bit to set + DB 40 ;; + FLAG DIARESIS ;; + ;; +COM_DK_UP_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Upper Shift Dead Key +;; KEYBOARD TYPES: AT + XT + +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_UP_END-$ ;; length of state section + DB DEAD_UPPER ;; State ID + DW AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 2 ;; number of entries + DB 26 ;; scan code + FLAG DIARESIS ;; flag bit to set + DB 27 ;; + FLAG CIRCUMFLEX ;; + ;; +COM_DK_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alpha Lower Case +;; KEYBOARD TYPES: G + AT + P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AL_LO_K1_END-$ ;; length of state section + DB ALPHA_LOWER ;; State ID + DW G_KB+AT_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_AL_LO_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 2 ;; number of entries + DB 39,164 ;; n-tilde + DB 43,135 ;; c-cedilla +COM_AL_LO_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AL_LO_K1_END: ;; + +;;****************************** +;;***BD - ADDED FOR NUMERIC PAD (DECIMAL SEPERATOR) +;;****************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Numeric Key Pad +;; KEYBOARD TYPES: p12 + G +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_PAD_K1_END-$ ;; length of state section + DB NUMERIC_PAD ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_PAD_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 0 ;; number of entries +; THIS IS A TEST ENTRY TO SHOW AN EXAMPLE +; DB 83,44 ;; decimal seperator = , +COM_PAD_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_PAD_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Numeric Key Pad +;; KEYBOARD TYPES: AT+ XT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ;; +;; DW COM_PAD_K2_END-$ ;; length of state section +;; DB NUMERIC_PAD ;; State ID +;; DW AT_KB+XT_KB ;; Keyboard Type +;; DB -1,-1 ;; Buffer entry for error character +;; ;; +;; DW COM_PAD_K2_T2_END-$ ;; Size of xlat table +;; DB STANDARD_TABLE ;; xlat options: +;; DB 1 ;; number of entries +;; DB 74,05eh ;; circumflex carat under the Prtscr key +;;COM_PAD_K2_T2_END: ;; +;; ;; +;; DW 0 ;; Size of xlat table - null table +;; ;; +;;COM_PAD_K2_END: ;; +;; ;; +;;;;****************************** +;;***BD - ADDED FOR ALT CASE +;;****************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alt Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_ALT_K1_END-$ ;; length of state section + DB ALT_CASE ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_ALT_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 0 ;; number of entries +;;***BD THIS ENTRY IS A TEST ENTRY +;; DB 53,225,0 ;; TEST ENTRY +COM_ALT_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_ALT_K1_END: ;; + ;; +;;****************************** +;;***BD - ADDED FOR CTRL CASE +;;****************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: G_KB+P12_KB+AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K1_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW G_KB+P12_KB+AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_CTRL_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 2 ;; number of entries +;;***BD THIS ENTRY IS A TEST ENTRY +;; DB 53,226,0 ;; TEST ENTRY + DB 43,-1,-1 ;; invalid slash + DB 41,28,41 ;; valid slash +COM_CTRL_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CTRL_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: XT_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K2_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_CTRL_K2_T2_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 1 ;; number of entries +;;***BD THIS ENTRY IS A TEST ENTRY +;; DB 53,226,0 ;; TEST ENTRY + DB 43,-1,-1 ;; invalid slash +COM_CTRL_K2_T2_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CTRL_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alpha Lower Case +;; KEYBOARD TYPES: XT + +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AL_LO_K2_END-$ ;; length of state section + DB ALPHA_LOWER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_AL_LO_K2_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 2 ;; number of entries + DB 39,164 ;; n-tilde + DB 41,135 ;; c-cedilla +COM_AL_LO_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AL_LO_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alpha Upper Case +;; KEYBOARD TYPES: G + AT + P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AL_UP_K1_END-$ ;; length of state section + DB ALPHA_UPPER ;; State ID + DW G_KB+AT_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_AL_UP_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 2 ;; number of entries + DB 39,165 ;; N-tilde + DB 43,128 ;; C-cedilla +COM_AL_UP_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AL_UP_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alpha Upper Case +;; KEYBOARD TYPES: XT + +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AL_UP_K2_END-$ ;; length of state section + DB ALPHA_UPPER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_AL_UP_K2_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 2 ;; number of entries + DB 39,165 ;; N-tilde + DB 41,128 ;; C-cedilla +COM_AL_UP_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AL_UP_K2_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: G + P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K1_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 6 ;; number of entries + DB 12,"'" ;; ' + DB 27,'+' ;; + + DB 86,'<' ;; < + DB 53,'-' ;; - + DB 41,167 ;; o-underline + DB 13,173 ;; upside-dowm ! +COM_NA_LO_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K2_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K2_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 4 ;; number of entries + DB 40,';' ;; ; + DB 41,'<' ;; < + DB 53,"'" ;; quote + DB 55,05eh ;; circumflex carat under the Prtscr key +COM_NA_LO_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K2_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: XT + +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K3_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K3_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 4 ;; number of entries + DB 40,';' ;; ; + DB 43,'<' ;; < + DB 53,"'" ;; quote + DB 55,05eh ;; circumflex carat under the Prtscr key +COM_NA_LO_K3_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K3_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G + P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 16 ;; number of entries + DB 3,'"' ;; + DB 4,250 ;; diacritic + DB 7,'&' ;; + DB 8,'/' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,'=' ;; + DB 12,'?' ;; + DB 13,168 ;; upside-dowm ? + DB 27,'*' ;; + DB 41,166 ;; a-underline + DB 86,'>' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'_' ;; +COM_NA_UP_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K2_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_K2_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 8 ;; number of entries + DB 41,'>' ;; + DB 2,0ADH ;; UPSIDE DOWN + DB 3,168 ;; UPSIDE DOWN ? + DB 7,'/' ;; + DB 40,':' ;; + DB 51,'?' ;; + DB 52,'!' ;; + DB 53,'"' ;; +COM_NA_UP_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K2_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: XT + +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K3_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_K3_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 8 ;; number of entries + DB 43,'>' ;; + DB 2,0ADH ;; UPSIDE DOWN + DB 3,168 ;; UPSIDE DOWN ? + DB 7,'/' ;; + DB 40,':' ;; + DB 51,'?' ;; + DB 52,'!' ;; + DB 53,'"' ;; +COM_NA_UP_K3_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K3_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: G + P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K1_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 9 ;; number of entries + DB 41,'\' ;; + DB 2,'|' ;; + DB 3,'@' ;; + DB 4,'#' ;; + DB 7,170 ;; + DB 26,'[' ;; + DB 27,']' ;; + DB 40,'{' ;; + DB 43,'}' ;; +COM_THIRD_K1_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K2_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_K2_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 4 ;; number of entries + DB 41,'\' ;; + DB 3,'@' ;; + DB 26,'[' ;; + DB 27,']' ;; +COM_THIRD_K2_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: XT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K3_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_K3_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 4 ;; number of entries + DB 3,'@' ;; + DB 26,'[' ;; + DB 27,']' ;; + DB 43,'\' ;; +COM_THIRD_K3_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K3_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Acute Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; ;; +; DW COM_AC_LO_END-$ ;; length of state section +; DB ACUTE_LOWER ;; State ID +; DW ANY_KB ;; Keyboard Type +; DB 39,0 ;; error character = standalone accent +; ;; +; DW COM_AC_LO_T1_END-$ ;; Size of xlat table +; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: +; DB 5 ;; number of scans +; DB 18,'' ;; scan code,ASCII - e +; DB 30,'' ;; scan code,ASCII - a +; DB 24,'' ;; scan code,ASCII - o +; DB 22,'' ;; scan code,ASCII - u +; DB 23,'' ;; scan code,ASCII - i +;COM_AC_LO_T1_END: ;; +; ;; +; DW 0 ;; Size of xlat table - null table +; ;; +;COM_AC_LO_END: ;; +; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; CODE PAGE: Common +;;; STATE: Acute Upper Case +;;; KEYBOARD TYPES: All +;;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; ;; +; DW COM_AC_UP_END-$ ;; length of state section +; DB ACUTE_UPPER ;; State ID +; DW ANY_KB ;; Keyboard Type +; DB 39,0 ;; error character = standalone accent +; ;; +; DW COM_AC_UP_T1_END-$ ;; Size of xlat table +; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: +; DB 2 ;; number of scans +; DB 18,'' ;; scan code,ASCII - e +;COM_AC_UP_T1_END: ;; +; ;; +; DW 0 ;; Size of xlat table - null table +; ;; +;COM_AC_UP_END: ;; +; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; CODE PAGE: Common +;;; STATE: Acute Space Bar +;;; KEYBOARD TYPES: All +;;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; ;; +; DW COM_AC_SP_END-$ ;; length of state section +; DB ACUTE_SPACE ;; State ID +; DW ANY_KB ;; Keyboard Type +; DB 39,0 ;; error character = standalone accent +; ;; +; DW COM_AC_SP_T1_END-$ ;; Size of xlat table +; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: +; DB 1 ;; number of scans +; DB 57,39 ;; scan code,ASCII - SPACE +;COM_AC_SP_T1_END: ;; +; ;; +; DW 0 ;; Size of xlat table - null table +; ;; +;COM_AC_SP_END: ;; +; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Diaresis Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DI_LO_END-$ ;; length of state section + DB DIARESIS_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW COM_DI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 30,'' ;; scan code,ASCII - a + DB 24,'' ;; scan code,ASCII - o + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 21,'' ;; scan code,ASCII - y +COM_DI_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_DI_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Diaresis Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DI_UP_END-$ ;; length of state section + DB DIARESIS_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW COM_DI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 3 ;; number of scans + DB 30,'' ;; scan code,ASCII - a + DB 24,'' ;; scan code,ASCII - o + DB 22,'' ;; scan code,ASCII - u +COM_DI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_DI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_GR_LO_END-$ ;; length of state section + DB GRAVE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW COM_GR_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 30,'' ;; scan code,ASCII - a + DB 24,'' ;; scan code,ASCII - o + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i +COM_GR_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_GR_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_GR_SP_END-$ ;; length of state section + DB GRAVE_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW COM_GR_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,96 ;; STANDALONE GRAVE +COM_GR_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_GR_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_LO_END-$ ;; length of state section + DB CIRCUMFLEX_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW COM_CI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 30,'' ;; scan code,ASCII - a + DB 24,'' ;; scan code,ASCII - o + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i +COM_CI_LO_T1_END: ;; + ;; + DW 0 ;; + ;; +COM_CI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_SP_END-$ ;; length of state section + DB CIRCUMFLEX_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW COM_CI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,94 ;; STANDALONE CIRCUMFLEX +COM_CI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; Last State +COMMON_XLAT_END: ;; + ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; SP Specific Translate Section for 437 +;; 437 IS COMPLETELY COVERED BY THE COMMON TABLE. +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC SP_437_XLAT ;; +SP_437_XLAT: ;; + ;; + DW CP437_XLAT_END-$ ;; length of section + DW 437 ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: Specific 437 +; STATE: Acute Lower Case +; KEYBOARD TYPES: All +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW CP437_AC_LO_END-$ ; length of state section + DB ACUTE_LOWER ; State ID + DW ANY_KB ; Keyboard Type + DB 39,0 ; error character = standalone accent + ; + DW CP437_AC_LO_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ; xlat options: + DB 5 ; number of scans + DB 18,'' ; scan code,ASCII - e + DB 30,'' ; scan code,ASCII - a + DB 24,'' ; scan code,ASCII - o + DB 22,'' ; scan code,ASCII - u + DB 23,'' ; scan code,ASCII - i +CP437_AC_LO_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +CP437_AC_LO_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: 437 +; STATE: Acute Upper Case +; KEYBOARD TYPES: All +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW CP437_AC_UP_END-$ ; length of state section + DB ACUTE_UPPER ; State ID + DW ANY_KB ; Keyboard Type + DB 39,0 ; error character = standalone accent + ; + DW CP437_AC_UP_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ; xlat options: + DB 1 ; number of scans + DB 18,'' ; scan code,ASCII - e +CP437_AC_UP_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +CP437_AC_UP_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; CODE PAGE: 437 +; STATE: Acute Space Bar +; KEYBOARD TYPES: All +; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW CP437_AC_SP_END-$ ; length of state section + DB ACUTE_SPACE ; State ID + DW ANY_KB ; Keyboard Type + DB 39,0 ; error character = standalone accent + ; + DW CP437_AC_SP_T1_END-$ ; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ; xlat options: + DB 1 ; number of scans + DB 57,39 ; scan code,ASCII - SPACE +CP437_AC_SP_T1_END: ; + ; + DW 0 ; Size of xlat table - null table + ; +CP437_AC_SP_END: ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; LAST STATE + ;; +CP437_XLAT_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; SP Specific Translate Section for 850 +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC SP_850_XLAT ;; +SP_850_XLAT: ;; + ;; + DW CP850_XLAT_END-$ ;; length of section + DW 850 ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Acute Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_LO_END-$ ;; length of state section + DB ACUTE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 0EFH,0 ;; error character = standalone accent + ;; + DW CP850_AC_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ; number of scans + DB 18,'' ; scan code,ASCII - e + DB 30,'' ; scan code,ASCII - a + DB 24,'' ; scan code,ASCII - o + DB 22,'' ; scan code,ASCII - u + DB 23,'' ; scan code,ASCII - i +; DB 21,0ECH Delete until 4.00 ;; y acute +CP850_AC_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Acute Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_UP_END-$ ;; length of state section + DB ACUTE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 0EFH,0 ;; error character = standalone accent + ;; + DW CP850_AC_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,'' ; scan code,ASCII - e + DB 30,0B5H ;; A acute + DB 23,0D6H ;; I acute + DB 24,0E0H ;; O acute + DB 22,0E9H ;; U acute +; DB 21,0EDH Delete until 4.00 ;; Y acute +CP850_AC_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Acute Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_SP_END-$ ;; length of state section + DB ACUTE_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 0EFH,0 ;; error character = standalone accent + ;; + DW CP850_AC_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,0EFH ;; scan code,ASCII - SPACE +CP850_AC_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_SP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Diaresis Upper +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_UP_END-$ ;; length of state section + DB DIARESIS_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW CP850_DI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 2 ;; number of scans + DB 18,0D3H ;; E diaeresis + DB 23,0D8H ;; I diaeresis +CP850_DI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_DI_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Diaresis Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_SP_END-$ ;; length of state section + DB DIARESIS_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW CP850_DI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,249 ;; error character = standalone accent +CP850_DI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table +CP850_DI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Grave Upper +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_GR_UP_END-$ ;; length of state section + DB GRAVE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW CP850_GR_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 30,0B7H ;; A grave + DB 18,0D4H ;; E grave + DB 23,0DEH ;; I grave + DB 24,0E3H ;; O grave + DB 22,0EBH ;; U grave +CP850_GR_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_GR_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Circumflex Upper +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_CI_UP_END-$ ;; length of state section + DB CIRCUMFLEX_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW CP850_CI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 30,0B6H ;; A circumflex + DB 18,0D2H ;; E circumflex + DB 23,0D7H ;; I circumflex + DB 24,0E2H ;; O circumflex + DB 22,0EAH ;; U circumflex +CP850_CI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_CI_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW 0 ;; LAST STATE + ;; +CP850_XLAT_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CODE ENDS ;; + END ;; diff --git a/v4.0/src/DEV/KEYBOARD/KDFSU.ASM b/v4.0/src/DEV/KEYBOARD/KDFSU.ASM new file mode 100644 index 0000000..9710310 --- /dev/null +++ b/v4.0/src/DEV/KEYBOARD/KDFSU.ASM @@ -0,0 +1,1680 @@ + PAGE ,132 + TITLE DOS - Keyboard Definition File + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DOS - - NLS Support - Keyboard Definition File +;; (c) Copyright 1988 Microsoft +;; +;; This file contains the keyboard tables for Finnish +;; +;; Linkage Instructions: +;; Refer to KDF.ASM. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + INCLUDE KEYBSHAR.INC ;; + INCLUDE POSTEQU.INC ;; + INCLUDE KEYBMAC.INC ;; + ;; + PUBLIC SU_LOGIC ;; + PUBLIC SU_437_XLAT ;; + PUBLIC SU_850_XLAT ;; + ;; +CODE SEGMENT PUBLIC 'CODE' ;; + ASSUME CS:CODE,DS:CODE ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Standard translate table options are a linear search table +;; (TYPE_2_TAB) and ASCII entries ONLY (ASCII_ONLY) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +STANDARD_TABLE EQU TYPE_2_TAB+ASCII_ONLY + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; SU State Logic +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +SU_LOGIC: + + DW LOGIC_END-$ ;; length + ;; + DW 0 ;; special features + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; COMMANDS START HERE + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; OPTIONS: If we find a scan match in +;; an XLATT or SET_FLAG operation then +;; exit from INT 9. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + OPTION EXIT_IF_FOUND ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Dead key definitions must come before +;; dead key translations to handle +;; dead key + dead key. +;; ***BD - THIS SECTION HAS BEEN UPDATED +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + IFF EITHER_CTL,NOT ;; + IFF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + SET_FLAG DEAD_UPPER ;; + ELSEF ;; + SET_FLAG DEAD_LOWER ;; + ENDIFF ;; + ELSEF ;; + IFKBD G_KB+P12_KB ;; For ENHANCED keyboard some + ANDF R_ALT_SHIFT ;; dead keys are on third shift + ANDF EITHER_SHIFT,NOT ;; which is accessed via the altgr key + SET_FLAG DEAD_THIRD ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ACUTE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +ACUTE_PROC: ;; + ;; + IFF ACUTE,NOT ;; + GOTO DIARESIS_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT ACUTE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT ACUTE_LOWER ;; + ELSEF ;; + XLATT ACUTE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT ACUTE_UPPER ;; + ELSEF ;; + XLATT ACUTE_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_ACUTE: ;; + PUT_ERROR_CHAR ACUTE_LOWER ;; If we get here then either the XLATT + BEEP ;; failed or we are ina bad shift state. + GOTO NON_DEAD ;; Either is invalid so BEEP and fall + ;; through to generate the second char. + ;; Note that the dead key flag will be + ;; reset before we get here. + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DIARESIS ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +DIARESIS_PROC: ;; + ;; + IFF DIARESIS,NOT ;; + GOTO GRAVE_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT DIARESIS_SPACE ;; exist for 437 so beep for + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_LOWER ;; + ELSEF ;; + XLATT DIARESIS_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_UPPER ;; + ELSEF ;; + XLATT DIARESIS_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_DIARESIS: ;; + PUT_ERROR_CHAR DIARESIS_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; GRAVE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +GRAVE_PROC: ;; + ;; + IFF GRAVE,NOT ;; + GOTO TILDE_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT GRAVE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_GRAVE: ;; + PUT_ERROR_CHAR GRAVE_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; TILDE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +TILDE_PROC: ;; + ;; + IFF TILDE,NOT ;; + GOTO CIRCUMFLEX_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT TILDE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT TILDE_LOWER ;; + ELSEF ;; + XLATT TILDE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT TILDE_UPPER ;; + ELSEF ;; + XLATT TILDE_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_TILDE: ;; + PUT_ERROR_CHAR TILDE_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CIRCUMFLEX ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CIRCUMFLEX_PROC: ;; + ;; + IFF CIRCUMFLEX,NOT ;; + GOTO NON_DEAD ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT CIRCUMFLEX_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_CIRCUMFLEX: ;; + PUT_ERROR_CHAR CIRCUMFLEX_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Upper, lower and third shifts +;; ***BD - NON_DEAD THRU LOGIC_END IS UPDATED +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +NON_DEAD: ;; +;;ADDED FOR DIVIDE SIGN ;; + IFKBD G_KB ;; Avoid accidentally translating + ANDF LC_E0 ;; the "/" on the numeric pad of the + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + XLATT DIVIDE_SIGN ;; + ENDIFF ;; + EXIT_STATE_LOGIC ;; + ENDIFF ;; + ;; + IFF EITHER_CTL,NOT ;; Lower and upper case. Alphabetic + IFF EITHER_ALT,NOT ;; keys are affected by CAPS LOCK. + IFF EITHER_SHIFT ;; Numeric keys are not. +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE,NOT ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION + XLATT NON_ALPHA_UPPER ;; + IFF CAPS_STATE ;; + XLATT ALPHA_LOWER ;; + ELSEF ;; + XLATT ALPHA_UPPER ;; + ENDIFF ;; + ELSEF ;; +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION + XLATT NON_ALPHA_LOWER ;; + IFF CAPS_STATE ;; + XLATT ALPHA_UPPER ;; + ELSEF ;; + XLATT ALPHA_LOWER ;; + ENDIFF ;; + ENDIFF ;; Third and Fourth shifts + ELSEF ;; ctl off, alt on at this point + IFKBD XT_KB+AT_KB ;; XT, AT, keyboards. Nordics + IFF EITHER_SHIFT ;; only. + XLATT FOURTH_SHIFT ;; ALT + shift + ELSEF ;; + XLATT THIRD_SHIFT ;; ALT + ENDIFF ;; + ELSEF ;; ENHANCED keyboard + IFF R_ALT_SHIFT ;; ALTGr + ANDF EITHER_SHIFT,NOT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; +;**************************************;; + IFF EITHER_SHIFT,NOT ;; + IFKBD XT_KB+AT_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ENDIFF ;; + IFKBD G_KB+P12_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; +;**************************************;; + IFKBD AT_KB+XT_KB ;; + IFF EITHER_CTL,NOT ;; + IFF ALT_SHIFT ;; ALT - case + XLATT ALT_CASE ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_ALT,NOT ;; CTRL - case + XLATT CTRL_CASE ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; + IFKBD G_KB+P12_KB ;; + IFF EITHER_CTL,NOT ;; + IFF ALT_SHIFT ;; ALT - case + ANDF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_ALT,NOT ;; CTRL - case + XLATT CTRL_CASE ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; + EXIT_STATE_LOGIC ;; + ;; +LOGIC_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;********************************************************************** +;; SU Common Translate Section +;; This section contains translations for the lower 128 characters +;; only since these will never change from code page to code page. +;; Some common Characters are included from 128 - 165 where appropriate. +;; In addition the dead key "Set Flag" tables are here since the +;; dead keys are on the same keytops for all code pages. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC SU_COMMON_XLAT ;; +SU_COMMON_XLAT: ;; + ;; + DW COMMON_XLAT_END-$ ;; length of section + DW -1 ;; code page + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Lower Shift Dead Key +;; KEYBOARD TYPES: All +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_LO_END-$ ;; length of state section + DB DEAD_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 2 ;; number of entries + DB 13 ;; scan code + FLAG ACUTE ;; flag bit to set + DB 27 ;; + FLAG DIARESIS ;; + ;; + ;; +COM_DK_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Upper Shift Dead Key +;; KEYBOARD TYPES: All +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_UP_END-$ ;; length of state section + DB DEAD_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 2 ;; number of entries + DB 13 ;; scan code + FLAG GRAVE ;; flag bit to set + DB 27 ;; + FLAG CIRCUMFLEX ;; + ;; +COM_DK_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift Dead Key +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_TH_END-$ ;; length of state section + DB DEAD_THIRD ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 1 ;; number of entries + DB 27 ;; scan code + FLAG TILDE ;; flag bit to set + ;; +COM_DK_TH_END: ;; + ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;****************************** +;;***BD - ADDED FOR NUMERIC PAD (DECIMAL SEPERATOR) +;;****************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Numeric Key Pad +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_PAD_K1_END-$ ;; length of state section + DB NUMERIC_PAD ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_PAD_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 83,',' ;; decimal seperator = , +COM_PAD_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_PAD_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;****************************** +;;***BD - ADDED FOR ALT CASE +;;****************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alt Case +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_ALT_K1_END-$ ;; length of state section + DB ALT_CASE ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_ALT_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 2 ;; number of entries + DB 12,-1,-1 ;; + DB 53,0,82H ;; +COM_ALT_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_ALT_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;****************************** +;;***BD - ADDED FOR CTRL CASE +;;****************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: XT, , AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K1_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW XT_KB+AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_CTRL_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 2 ;; number of entries + DB 12,-1,-1 ;; + DB 53,01FH,35h ;; +COM_CTRL_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CTRL_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K2_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_CTRL_K2_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 8 ;; number of entries + DB 9,01BH,09H ;; + DB 10,01DH,0AH ;; + DB 12,-1,-1 ;; + DB 26,-1,-1 ;; + DB 27,-1,-1 ;; + DB 43,-1,-1 ;; + DB 53,01FH,35H ;; + DB 86,01CH,56H ;; +COM_CTRL_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CTRL_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alpha Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AL_LO_END-$ ;; length of state section + DB ALPHA_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_AL_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 3 ;; number of entries + DB 26,086H ;; a-overcircle + DB 39,094H ;; o-diaeresis + DB 40,084H ;; a-diaeresis +COM_AL_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AL_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alpha Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AL_UP_END-$ ;; length of state section + DB ALPHA_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_AL_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 3 ;; number of entries + DB 26,08FH ;; A-OVERCIRCLE + DB 39,099H ;; A-DIAERESIS + DB 40,08EH ;; O-DIAERESIS +COM_AL_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AL_UP_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: G + P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K1_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 4 ;; number of entries + DB 12,"+" ;; + INCLUDED FOR SIMPLIC. + DB 43,"'" ;; ' + DB 86,"<" ;; < + DB 53,"-" ;; - +COM_NA_LO_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: XT + +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K2_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K2_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 4 ;; number of entries + DB 12,"+" ;; + + DB 41,"'" ;; ' + DB 43,"<" ;; < + DB 53,"-" ;; - +COM_NA_LO_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K3_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K3_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 4 ;; number of entries + DB 12,"+" ;; + + DB 41,"<" ;; < + DB 43,"'" ;; ' + DB 53,"-" ;; - +COM_NA_LO_K3_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K3_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G + P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 13 ;; number of entries + DB 3,'"' ;; + DB 7,'&' ;; + DB 8,'/' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,'=' ;; + DB 12,'?' ;; + DB 41,'' ;; + DB 43,'*' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'_' ;; + DB 86,'>' ;; +COM_NA_UP_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: XT + +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K2_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW XT_KB + _KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_K2_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 13 ;; number of entries + DB 3,'"' ;; + DB 4,09CH ;; POUND STERLING + DB 7,'&' ;; + DB 8,'/' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,'=' ;; + DB 12,'?' ;; + DB 41,'*' ;; + DB 43,'>' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'_' ;; +COM_NA_UP_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K2_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K3_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_K3_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 13 ;; number of entries + DB 3,'"' ;; + DB 4,09CH ;; POUND STERLING + DB 7,'&' ;; + DB 8,'/' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,'=' ;; + DB 12,'?' ;; + DB 41,'>' ;; + DB 43,'*' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'_' ;; +COM_NA_UP_K3_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K3_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB+P12_KB ;; Keyboard Type FERRARI + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 9 ;; number of entries + DB 3,'@' ;; + DB 4,09CH ;; + DB 5,'$' ;; + DB 8,'{' ;; + DB 9,'[' ;; + DB 10,']' ;; + DB 11,'}' ;; + DB 12,'\' ;; Broken Vertical Line + DB 86,'|' ;; +COM_THIRD_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift (ALTERNATE) +;; KEYBOARD TYPES: XT, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K1_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 9 ;; number of entries + DB 12,'-','-' ;; + DB 13,'=','=' ;; + DB 26,'[','[' ;; + DB 27,']',']' ;; + DB 39,';',';' ;; + DB 40,027H,027H ;; + DB 41,060H,060H ;; + DB 43,'\','\' ;; + DB 53,'/','/' ;; +COM_THIRD_K1_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift (ALTERNATE) +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K2_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_K2_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 9 ;; number of entries + DB 12,'-','-' ;; + DB 13,'=','=' ;; + DB 26,'[','[' ;; + DB 27,']',']' ;; + DB 39,';',';' ;; + DB 40,027H,027H ;; + DB 41,'\','\' ;; + DB 43,060H,060H ;; + DB 53,'/','/' ;; +COM_THIRD_K2_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Fourth Shift (ALTERNATE+SHIFT) +;; KEYBOARD TYPES: XT, +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_FOURTH_END-$ ;; length of state section + DB FOURTH_SHIFT ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_FOURTH_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 18 ;; number of entries + DB 3,'@','@' ;; + DB 4,'#','#' ;; + DB 7,'^','^' ;; + DB 8,'&','&' ;; + DB 9,'*','*' ;; + DB 10,'(','(' ;; + DB 11,')',')' ;; + DB 12,'_','_' ;; + DB 13,'+','+' ;; + DB 26,'{','{' ;; + DB 27,'}','}' ;; + DB 39,':',':' ;; + DB 40,'"','"' ;; + DB 41,'~','~' ;; + DB 43,'|','|' ;; + DB 51,'<','<' ;; + DB 52,'>','>' ;; + DB 53,'?','?' ;; +COM_FOURTH_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_FOURTH_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Fourth Shift (ALTERNATE+SHIFT) +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_FOURTH_K1_END-$ ;; length of state section + DB FOURTH_SHIFT ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_FOURTH_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 18 ;; number of entries + DB 3,'@','@' ;; + DB 4,'#','#' ;; + DB 7,'^','^' ;; + DB 8,'&','&' ;; + DB 9,'*','*' ;; + DB 10,'(','(' ;; + DB 11,')',')' ;; + DB 12,'_','_' ;; + DB 13,'+','+' ;; + DB 26,'{','{' ;; + DB 27,'}','}' ;; + DB 39,':',':' ;; + DB 40,'"','"' ;; + DB 41,'|','|' ;; + DB 43,'~','~' ;; + DB 51,'<','<' ;; + DB 52,'>','>' ;; + DB 53,'?','?' ;; +COM_FOURTH_K1_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_FOURTH_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_GR_LO_END-$ ;; length of state section + DB GRAVE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW COM_GR_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +COM_GR_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_GR_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_GR_SP_END-$ ;; length of state section + DB GRAVE_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW COM_GR_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,96 ;; STANDALONE GRAVE +COM_GR_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_GR_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_LO_END-$ ;; length of state section + DB CIRCUMFLEX_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW COM_CI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +COM_CI_LO_T1_END: ;; + ;; + DW 0 ;; + ;; +COM_CI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_SP_END-$ ;; length of state section + DB CIRCUMFLEX_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW COM_CI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,94 ;; STANDALONE CIRCUMFLEX +COM_CI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Tilde Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_TI_LO_END-$ ;; length of state section + DB TILDE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW COM_TI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 49,0A4H ;; scan code,ASCII - + COM_TI_LO_T1_END: ;; + ;; + DW 0 ;; + ;; + COM_TI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; CODE PAGE: Common +;;; STATE: Tilde Upper Case +;;; KEYBOARD TYPES: All +;;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_TI_UP_END-$ ;; length of state section + DB TILDE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW COM_TI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 49,0A5H ;; scan code,ASCII - + COM_TI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; + COM_TI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Tilde Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_TI_SP_END-$ ;; length of state section + DB TILDE_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW COM_TI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,07EH ;; STANDALONE TILDE +COM_TI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_TI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; Last State +COMMON_XLAT_END: ;; + ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; SU Specific Translate Section for 437 +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC SU_437_XLAT ;; +SU_437_XLAT: ;; + ;; + DW CP437_XLAT_END-$ ;; length of section + DW 437 ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_NA_UP_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP437_NA_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 5,0 ;; International Currency Symb +CP437_NA_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_NA_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_NA_K1_LO_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP437_NA_LO_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 41,015H ;; SECTION Symb +CP437_NA_LO_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_NA_K1_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Acute Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_AC_LO_END-$ ;; length of state section + DB ACUTE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW CP437_AC_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +CP437_AC_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_AC_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Acute Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_AC_UP_END-$ ;; length of state section + DB ACUTE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW CP437_AC_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of entries + DB 18,'' ;; scan code,ASCII - +CP437_AC_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_AC_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Acute Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_AC_SP_END-$ ;; length of state section + DB ACUTE_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW CP437_AC_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,39 ;; scan code,ASCII - SPACE +CP437_AC_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_AC_SP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Diaresis Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_DI_LO_END-$ ;; length of state section + DB DIARESIS_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 254,0 ;; error character = standalone accent + ;; + DW CP437_DI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 21,'' ;; scan code,ASCII - y + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +CP437_DI_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_DI_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Diaresis Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_DI_UP_END-$ ;; length of state section + DB DIARESIS_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 254,0 ;; error character = standalone accent + ;; + DW CP437_DI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 3 ;; number of scans + DB 22,'' ;; scan code,ASCII - U + DB 24,'' ;; scan code,ASCII - O + DB 30,'' ;; scan code,ASCII - A +CP437_DI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_DI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Diaresis Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; ;; +; DW CP437_DI_SP_END-$ ;; length of state section +; DB DIARESIS_SPACE ;; State ID +; DW ANY_KB ;; Keyboard Type +; DB 254,0 ;; error character = standalone accent +; ;; +; DW CP437_DI_SP_T1_END-$ ;; Size of xlat table +; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: +; DB 1 ;; number of scans +; DB 57,254 ;; error character = standalone accent +;CP437_DI_SP_T1_END: ;; +; ;; +; DW 0 ;; Size of xlat table - null table +;CP437_DI_SP_END: ;; length of state section +; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW 0 ;; LAST STATE + ;; +CP437_XLAT_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; SU Specific Translate Section for 850 +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC SU_850_XLAT ;; +SU_850_XLAT: ;; + ;; + DW CP850_XLAT_END-$ ;; length of section + DW 850 ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Divide Sign +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DIVID_END-$ ;; length of state section + DB DIVIDE_SIGN ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; error character = standalone accent + ;; + DW CP850_DIVID_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 2 ;; number of scans + DB 0E0H,0F6H,0E0H ;; + DB 53,0F6H,0E0H ;; DIVIDE SIGN +CP850_DIVID_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_DIVID_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Numeric Key Pad +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_PAD_K1_END-$ ;; length of state section + DB NUMERIC_PAD ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP850_PAD_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 55,09EH ;; +CP850_PAD_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_PAD_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_NA_UP_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP850_NA_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 5,0CFH ;; International Currency Symb +CP850_NA_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_NA_UP_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_NA_K1_LO_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP850_NA_LO_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 41,0F5H ;; SECTION Symb +CP850_NA_LO_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_NA_K1_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Acute Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_LO_END-$ ;; length of state section + DB ACUTE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 239,0 ;; error character = standalone accent + ;; + DW CP850_AC_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 21,0ECH ;; y acute + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +CP850_AC_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Acute Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_UP_END-$ ;; length of state section + DB ACUTE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 239,0 ;; error character = standalone accent + ;; + DW CP850_AC_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of entries + DB 18,090H ;; E acute + DB 21,0EDH ;; Y acute + DB 22,0E9H ;; U acute + DB 23,0D6H ;; I acute + DB 24,0E0H ;; O acute + DB 30,0B5H ;; A acute +CP850_AC_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Acute Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_SP_END-$ ;; length of state section + DB ACUTE_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 239,0 ;; error character = standalone accent + ;; + DW CP850_AC_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,239 ;; scan code,ASCII - SPACE +CP850_AC_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_SP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Diaresis Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_LO_END-$ ;; length of state section + DB DIARESIS_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW CP850_DI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 21,'' ;; scan code,ASCII - y + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +CP850_DI_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_DI_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Diaresis Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_UP_END-$ ;; length of state section + DB DIARESIS_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW CP850_DI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,0D3H ;; E Diaeresis + DB 22,'' ;; U Diaeresis + DB 23,0D8H ;; I Diaeresis + DB 24,'' ;; O Diaeresis + DB 30,'' ;; A Diaeresis +CP850_DI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_DI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Diaresis Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_SP_END-$ ;; length of state section + DB DIARESIS_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW CP850_DI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,249 ;; error character = standalone accent +CP850_DI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table +CP850_DI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Grave Upper +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_GR_UP_END-$ ;; length of state section + DB GRAVE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW CP850_GR_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,0D4H ;; E grave + DB 22,0EBH ;; U grave + DB 23,0DEH ;; I grave + DB 24,0E3H ;; O grave + DB 30,0B7H ;; A grave +CP850_GR_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_GR_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Tilde Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_TI_LO_END-$ ;; length of state section + DB TILDE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW CP850_TI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 2 ;; number of scans + DB 24,0E4H ;; scan code,ASCII - o tilde + DB 30,0C6H ;; scan code,ASCII - a tilde + CP850_TI_LO_T1_END: ;; + ;; + DW 0 ;; + ;; + CP850_TI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; CODE PAGE: 850 +;;; STATE: Tilde Upper Case +;;; KEYBOARD TYPES: All +;;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_TI_UP_END-$ ;; length of state section + DB TILDE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW CP850_TI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 2 ;; number of scans + DB 24,0E5H ;; scan code,ASCII - O tilde + DB 30,0C7H ;; scan code,ASCII - A tilde + CP850_TI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; + CP850_TI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Circumflex Upper +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_CI_UP_END-$ ;; length of state section + DB CIRCUMFLEX_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW CP850_CI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,0D2H ;; E circumflex + DB 22,0EAH ;; U circumflex + DB 23,0D7H ;; I circumflex + DB 24,0E2H ;; O circumflex + DB 30,0B6H ;; A circumflex +CP850_CI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_CI_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW 0 ;; LAST STATE + ;; +CP850_XLAT_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CODE ENDS ;; + END ;; diff --git a/v4.0/src/DEV/KEYBOARD/KDFSV.ASM b/v4.0/src/DEV/KEYBOARD/KDFSV.ASM new file mode 100644 index 0000000..b3d37f9 --- /dev/null +++ b/v4.0/src/DEV/KEYBOARD/KDFSV.ASM @@ -0,0 +1,1687 @@ + PAGE ,132 + TITLE DOS - Keyboard Definition File +;LATEST CHANGE MULTIPLICATION & DIVISION SIGNS +;DOLLAR SIGN output ON P12 should be International Currency sign +;Enabled P12 Tag for CP850 UC section +;****************** CNS 12/18 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DOS - - NLS Support - Keyboard Definition File +;; (c) Copyright 1988 Microsoft +;; +;; This file contains the keyboard tables for Swedish +;; +;; Linkage Instructions: +;; Refer to KDF.ASM. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + INCLUDE KEYBSHAR.INC ;; + INCLUDE POSTEQU.INC ;; + INCLUDE KEYBMAC.INC ;; + ;; + PUBLIC SV_LOGIC ;; + PUBLIC SV_437_XLAT ;; + PUBLIC SV_850_XLAT ;; + ;; +CODE SEGMENT PUBLIC 'CODE' ;; + ASSUME CS:CODE,DS:CODE ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Standard translate table options are a linear search table +;; (TYPE_2_TAB) and ASCII entries ONLY (ASCII_ONLY) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +STANDARD_TABLE EQU TYPE_2_TAB+ASCII_ONLY + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; SV State Logic +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +SV_LOGIC: + + DW LOGIC_END-$ ;; length + ;; + DW 0 ;; special features + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; COMMANDS START HERE + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; OPTIONS: If we find a scan match in +;; an XLATT or SET_FLAG operation then +;; exit from INT 9. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + OPTION EXIT_IF_FOUND ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Dead key definitions must come before +;; dead key translations to handle +;; dead key + dead key. +;; ***BD - THIS SECTION HAS BEEN UPDATED +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + IFF EITHER_CTL,NOT ;; + IFF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + SET_FLAG DEAD_UPPER ;; + ELSEF ;; + SET_FLAG DEAD_LOWER ;; + ENDIFF ;; + ELSEF ;; + IFKBD G_KB+P12_KB ;; For ENHANCED keyboard some + ANDF R_ALT_SHIFT ;; dead keys are on third shift + ANDF EITHER_SHIFT,NOT ;; which is accessed via the altgr key + SET_FLAG DEAD_THIRD ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ACUTE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +ACUTE_PROC: ;; + ;; + IFF ACUTE,NOT ;; + GOTO DIARESIS_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT ACUTE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT ACUTE_LOWER ;; + ELSEF ;; + XLATT ACUTE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT ACUTE_UPPER ;; + ELSEF ;; + XLATT ACUTE_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_ACUTE: ;; + PUT_ERROR_CHAR ACUTE_LOWER ;; If we get here then either the XLATT + BEEP ;; failed or we are ina bad shift state. + GOTO NON_DEAD ;; Either is invalid so BEEP and fall + ;; through to generate the second char. + ;; Note that the dead key flag will be + ;; reset before we get here. + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DIARESIS ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +DIARESIS_PROC: ;; + ;; + IFF DIARESIS,NOT ;; + GOTO GRAVE_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT DIARESIS_SPACE ;; exist for 437 so beep for + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_LOWER ;; + ELSEF ;; + XLATT DIARESIS_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_UPPER ;; + ELSEF ;; + XLATT DIARESIS_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_DIARESIS: ;; + PUT_ERROR_CHAR DIARESIS_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; GRAVE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +GRAVE_PROC: ;; + ;; + IFF GRAVE,NOT ;; + GOTO TILDE_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT GRAVE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_GRAVE: ;; + PUT_ERROR_CHAR GRAVE_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; TILDE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +TILDE_PROC: ;; + ;; + IFF TILDE,NOT ;; + GOTO CIRCUMFLEX_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT TILDE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT TILDE_LOWER ;; + ELSEF ;; + XLATT TILDE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT TILDE_UPPER ;; + ELSEF ;; + XLATT TILDE_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_TILDE: ;; + PUT_ERROR_CHAR TILDE_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CIRCUMFLEX ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CIRCUMFLEX_PROC: ;; + ;; + IFF CIRCUMFLEX,NOT ;; + GOTO NON_DEAD ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT CIRCUMFLEX_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_CIRCUMFLEX: ;; + PUT_ERROR_CHAR CIRCUMFLEX_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Upper, lower and third shifts +;; ***BD - NON_DEAD THRU LOGIC_END IS UPDATED +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +NON_DEAD: ;; +;ADDED FOR DIVIDE SIGN ;; ***** DIVIDE OMITTED **** CNS + IFKBD G_KB+P12_KB ;; Avoid accidentally translating + ANDF LC_E0 ;; the "/" on the numeric pad of the +; IFF EITHER_CTL,NOT ;; country comforms with U.S. currently +; ANDF EITHER_ALT,NOT +; XLATT DIVIDE_SIGN ;; +; ENDIFF +;BD END OF ADDITION + EXIT_STATE_LOGIC ;; + ENDIFF ;; + ;; + IFF EITHER_CTL,NOT ;; Lower and upper case. Alphabetic + IFF EITHER_ALT,NOT ;; keys are affected by CAPS LOCK. + IFF EITHER_SHIFT ;; Numeric keys are not. +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE,NOT ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION + XLATT NON_ALPHA_UPPER ;; + IFF CAPS_STATE ;; + XLATT ALPHA_LOWER ;; + ELSEF ;; + XLATT ALPHA_UPPER ;; + ENDIFF ;; + ELSEF ;; +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION + XLATT NON_ALPHA_LOWER ;; + IFF CAPS_STATE ;; + XLATT ALPHA_UPPER ;; + ELSEF ;; + XLATT ALPHA_LOWER ;; + ENDIFF ;; + ENDIFF ;; Third and Fourth shifts + ELSEF ;; ctl off, alt on at this point + IFKBD XT_KB+AT_KB+JR_KB ;; XT, AT, JR keyboards. Nordics + IFF EITHER_SHIFT ;; only. + XLATT FOURTH_SHIFT ;; ALT + shift + ELSEF ;; + XLATT THIRD_SHIFT ;; ALT + ENDIFF ;; + ELSEF ;; ENHANCED keyboard + IFF R_ALT_SHIFT ;; ALTGr + ANDF EITHER_SHIFT,NOT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; +;**************************************;; + IFF EITHER_SHIFT,NOT ;; + IFKBD XT_KB+AT_KB+JR_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ENDIFF ;; + IFKBD G_KB+P12_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; +;**************************************;; + IFKBD AT_KB+JR_KB+XT_KB ;; + IFF EITHER_CTL,NOT ;; + IFF ALT_SHIFT ;; ALT - case + XLATT ALT_CASE ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_ALT,NOT ;; CTRL - case + XLATT CTRL_CASE ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; + IFKBD G_KB+P12_KB ;; + IFF EITHER_CTL,NOT ;; + IFF ALT_SHIFT ;; ALT - case + ANDF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_ALT,NOT ;; CTRL - case + XLATT CTRL_CASE ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; + EXIT_STATE_LOGIC ;; + ;; +LOGIC_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;********************************************************************** +;; SV Common Translate Section +;; This section contains translations for the lower 128 characters +;; only since these will never change from code page to code page. +;; Some common Characters are included from 128 - 165 where appropriate. +;; In addition the dead key "Set Flag" tables are here since the +;; dead keys are on the same keytops for all code pages. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC SV_COMMON_XLAT ;; +SV_COMMON_XLAT: ;; + ;; + DW COMMON_XLAT_END-$ ;; length of section + DW -1 ;; code page + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Lower Shift Dead Key +;; KEYBOARD TYPES: All +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_LO_END-$ ;; length of state section + DB DEAD_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 2 ;; number of entries + DB 13 ;; scan code + FLAG ACUTE ;; flag bit to set + DB 27 ;; + FLAG DIARESIS ;; + ;; + ;; +COM_DK_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Upper Shift Dead Key +;; KEYBOARD TYPES: All +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_UP_END-$ ;; length of state section + DB DEAD_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 2 ;; number of entries + DB 13 ;; scan code + FLAG GRAVE ;; flag bit to set + DB 27 ;; + FLAG CIRCUMFLEX ;; + ;; +COM_DK_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift Dead Key +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Flag Table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_DK_TH_END-$ ;; length of state section + DB DEAD_THIRD ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; Set Flag Table + DW 1 ;; number of entries + DB 27 ;; scan code + FLAG TILDE ;; flag bit to set + ;; +COM_DK_TH_END: ;; + ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;****************************** +;;***BD - ADDED FOR NUMERIC PAD (DECIMAL SEPERATOR) +;;****************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common ;;********* CNS ******* change +;; STATE: Numeric Key Pad +;; KEYBOARD TYPES: All except the p12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_PAD_K1_END-$ ;; length of state section + DB NUMERIC_PAD ;; State ID + DW G_KB+AT_KB+XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_PAD_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 83,',' ;; decimal seperator = , +COM_PAD_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_PAD_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;****************************** +;;***BD - ADDED FOR ALT CASE +;;****************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alt Case +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_ALT_K1_END-$ ;; length of state section + DB ALT_CASE ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_ALT_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 0 ;; 2 number of entries +; DB 12,-1,-1 ;; +; DB 53,0,82H ;; +COM_ALT_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_ALT_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;****************************** +;;***BD - ADDED FOR CTRL CASE +;;****************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: XT, JR, AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K1_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW XT_KB+JR_KB+AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_CTRL_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 2 ;; number of entries + DB 12,-1,-1 ;; + DB 53,01FH,35h ;; +COM_CTRL_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CTRL_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K2_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_CTRL_K2_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 8 ;; number of entries + DB 9,01BH,09H ;; + DB 10,01DH,0AH ;; + DB 12,-1,-1 ;; + DB 26,-1,-1 ;; + DB 27,-1,-1 ;; + DB 43,-1,-1 ;; + DB 53,01FH,35H ;; + DB 86,01CH,56H ;; +COM_CTRL_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CTRL_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alpha Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AL_LO_END-$ ;; length of state section + DB ALPHA_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_AL_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 3 ;; number of entries + DB 26,086H ;; a-overcircle + DB 39,094H ;; o-diaeresis + DB 40,084H ;; a-diaeresis +COM_AL_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AL_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alpha Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_AL_UP_END-$ ;; length of state section + DB ALPHA_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_AL_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 3 ;; number of entries + DB 26,08FH ;; A-OVERCIRCLE + DB 39,099H ;; A-DIAERESIS + DB 40,08EH ;; O-DIAERESIS +COM_AL_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_AL_UP_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: G + P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K1_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 4 ;; number of entries + DB 12,"+" ;; + INCLUDED FOR SIMPLIC. + DB 43,"'" ;; ' + DB 86,"<" ;; < + DB 53,"-" ;; - +COM_NA_LO_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: XT + JR +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K2_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW XT_KB+JR_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K2_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 4 ;; number of entries + DB 12,"+" ;; + + DB 41,"'" ;; ' + DB 43,"<" ;; < + DB 53,"-" ;; - +COM_NA_LO_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K3_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K3_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 4 ;; number of entries + DB 12,"+" ;; + + DB 41,"<" ;; < + DB 43,"'" ;; ' + DB 53,"-" ;; - +COM_NA_LO_K3_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K3_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G + P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB + P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 13 ;; number of entries + DB 3,'"' ;; + DB 7,'&' ;; + DB 8,'/' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,'=' ;; + DB 12,'?' ;; + DB 41,'' ;; + DB 43,'*' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'_' ;; + DB 86,'>' ;; +COM_NA_UP_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: XT + JR +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K2_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW XT_KB + JR_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_K2_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 13 ;; number of entries + DB 3,'"' ;; + DB 4,09CH ;; POUND STERLING + DB 7,'&' ;; + DB 8,'/' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,'=' ;; + DB 12,'?' ;; + DB 41,'*' ;; + DB 43,'>' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'_' ;; +COM_NA_UP_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K2_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K3_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_K3_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 13 ;; number of entries + DB 3,'"' ;; + DB 4,09CH ;; POUND STERLING + DB 7,'&' ;; + DB 8,'/' ;; + DB 9,'(' ;; + DB 10,')' ;; + DB 11,'=' ;; + DB 12,'?' ;; + DB 41,'>' ;; + DB 43,'*' ;; + DB 51,';' ;; + DB 52,':' ;; + DB 53,'_' ;; +COM_NA_UP_K3_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K3_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB+P12_KB ;; Keyboard Type FERRARI + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 9 ;; number of entries + DB 3,'@' ;; + DB 4,09CH ;; + DB 5,'$' ;; + DB 8,'{' ;; + DB 9,'[' ;; + DB 10,']' ;; + DB 11,'}' ;; + DB 12,'\' ;; Broken Vertical Line + DB 86,'|' ;; +COM_THIRD_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift (ALTERNATE) +;; KEYBOARD TYPES: XT, JR +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K1_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW XT_KB+JR_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 9 ;; number of entries + DB 12,'-','-' ;; + DB 13,'=','=' ;; + DB 26,'[','[' ;; + DB 27,']',']' ;; + DB 39,';',';' ;; + DB 40,027H,027H ;; + DB 41,060H,060H ;; + DB 43,'\','\' ;; + DB 53,'/','/' ;; +COM_THIRD_K1_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Third Shift (ALTERNATE) +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_THIRD_K2_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_THIRD_K2_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 9 ;; number of entries + DB 12,'-','-' ;; + DB 13,'=','=' ;; + DB 26,'[','[' ;; + DB 27,']',']' ;; + DB 39,';',';' ;; + DB 40,027H,027H ;; + DB 41,'\','\' ;; + DB 43,060H,060H ;; + DB 53,'/','/' ;; +COM_THIRD_K2_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_THIRD_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Fourth Shift (ALTERNATE+SHIFT) +;; KEYBOARD TYPES: XT, JR +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_FOURTH_END-$ ;; length of state section + DB FOURTH_SHIFT ;; State ID + DW XT_KB+JR_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_FOURTH_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 18 ;; number of entries + DB 3,'@','@' ;; + DB 4,'#','#' ;; + DB 7,'^','^' ;; + DB 8,'&','&' ;; + DB 9,'*','*' ;; + DB 10,'(','(' ;; + DB 11,')',')' ;; + DB 12,'_','_' ;; + DB 13,'+','+' ;; + DB 26,'{','{' ;; + DB 27,'}','}' ;; + DB 39,':',':' ;; + DB 40,'"','"' ;; + DB 41,'~','~' ;; + DB 43,'|','|' ;; + DB 51,'<','<' ;; + DB 52,'>','>' ;; + DB 53,'?','?' ;; +COM_FOURTH_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_FOURTH_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Fourth Shift (ALTERNATE+SHIFT) +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_FOURTH_K1_END-$ ;; length of state section + DB FOURTH_SHIFT ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_FOURTH_K1_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 18 ;; number of entries + DB 3,'@','@' ;; + DB 4,'#','#' ;; + DB 7,'^','^' ;; + DB 8,'&','&' ;; + DB 9,'*','*' ;; + DB 10,'(','(' ;; + DB 11,')',')' ;; + DB 12,'_','_' ;; + DB 13,'+','+' ;; + DB 26,'{','{' ;; + DB 27,'}','}' ;; + DB 39,':',':' ;; + DB 40,'"','"' ;; + DB 41,'|','|' ;; + DB 43,'~','~' ;; + DB 51,'<','<' ;; + DB 52,'>','>' ;; + DB 53,'?','?' ;; +COM_FOURTH_K1_T1_END: ;; + ;; + DW 0 ;; Last xlat table +COM_FOURTH_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_GR_LO_END-$ ;; length of state section + DB GRAVE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW COM_GR_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +COM_GR_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_GR_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Grave Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_GR_SP_END-$ ;; length of state section + DB GRAVE_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW COM_GR_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,96 ;; STANDALONE GRAVE +COM_GR_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_GR_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_LO_END-$ ;; length of state section + DB CIRCUMFLEX_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW COM_CI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +COM_CI_LO_T1_END: ;; + ;; + DW 0 ;; + ;; +COM_CI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Circumflex Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CI_SP_END-$ ;; length of state section + DB CIRCUMFLEX_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW COM_CI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,94 ;; STANDALONE CIRCUMFLEX +COM_CI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Tilde Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_TI_LO_END-$ ;; length of state section + DB TILDE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW COM_TI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 49,0A4H ;; scan code,ASCII - + COM_TI_LO_T1_END: ;; + ;; + DW 0 ;; + ;; + COM_TI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; CODE PAGE: Common +;;; STATE: Tilde Upper Case +;;; KEYBOARD TYPES: All +;;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_TI_UP_END-$ ;; length of state section + DB TILDE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW COM_TI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 49,0A5H ;; scan code,ASCII - + COM_TI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; + COM_TI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Tilde Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_TI_SP_END-$ ;; length of state section + DB TILDE_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW COM_TI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,07EH ;; STANDALONE TILDE +COM_TI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_TI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; Last State +COMMON_XLAT_END: ;; + ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; SV Specific Translate Section for 437 +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC SV_437_XLAT ;; +SV_437_XLAT: ;; + ;; + DW CP437_XLAT_END-$ ;; length of section + DW 437 ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_NA_UP_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP437_NA_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 5,0 ;; International Currency Symb +CP437_NA_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_NA_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_NA_K1_LO_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP437_NA_LO_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 41,015H ;; SECTION Symb +CP437_NA_LO_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_NA_K1_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Acute Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_AC_LO_END-$ ;; length of state section + DB ACUTE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW CP437_AC_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +CP437_AC_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_AC_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Acute Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_AC_UP_END-$ ;; length of state section + DB ACUTE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW CP437_AC_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of entries + DB 18,'' ;; scan code,ASCII - +CP437_AC_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_AC_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Acute Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_AC_SP_END-$ ;; length of state section + DB ACUTE_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 39,0 ;; error character = standalone accent + ;; + DW CP437_AC_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,39 ;; scan code,ASCII - SPACE +CP437_AC_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_AC_SP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Diaresis Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_DI_LO_END-$ ;; length of state section + DB DIARESIS_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 254,0 ;; error character = standalone accent + ;; + DW CP437_DI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 21,'' ;; scan code,ASCII - y + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +CP437_DI_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_DI_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Diaresis Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_DI_UP_END-$ ;; length of state section + DB DIARESIS_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 254,0 ;; error character = standalone accent + ;; + DW CP437_DI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 3 ;; number of scans + DB 22,'' ;; scan code,ASCII - U + DB 24,'' ;; scan code,ASCII - O + DB 30,'' ;; scan code,ASCII - A +CP437_DI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_DI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 437 +;; STATE: Diaresis Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; ;; +; DW CP437_DI_SP_END-$ ;; length of state section +; DB DIARESIS_SPACE ;; State ID +; DW ANY_KB ;; Keyboard Type +; DB 254,0 ;; error character = standalone accent +; ;; +; DW CP437_DI_SP_T1_END-$ ;; Size of xlat table +; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: +; DB 1 ;; number of scans +; DB 57,254 ;; error character = standalone accent +;CP437_DI_SP_T1_END: ;; +; ;; +; DW 0 ;; Size of xlat table - null table +;CP437_DI_SP_END: ;; length of state section +; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW 0 ;; LAST STATE + ;; +CP437_XLAT_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; SV Specific Translate Section for 850 +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC SV_850_XLAT ;; +SV_850_XLAT: ;; + ;; + DW CP850_XLAT_END-$ ;; length of section + DW 850 ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Numeric Pad - Divide Sign +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; ;; +; DW CP850_DIVID_END-$ ;; length of state section +; DB DIVIDE_SIGN ;; State ID +; DW G_KB+P12_KB ;; Keyboard Type +; DB -1,-1 ;; error character = standalone accent +; ;; +; DW CP850_DIVID_T1_END-$ ;; Size of xlat table +; DB TYPE_2_TAB ;; xlat options: +; DB 0 ;; number of scans +; DB 0E0H,0F6H,0E0H ;; DIVIDE SIGN omitted sv/su +; DB 53,0F6H,0E0H ;; has decidied to stick with U.S. +; DB 0E0H,09eH,0E0H ;; standards in order to use BASIC +; DB 55,09eH,0E0H ;; +;CP850_DIVID_T1_END: ;; +; ;; +; DW 0 ;; Size of xlat table - null table +; ;; +;CP850_DIVID_END: ;; +; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Numeric Key Pad - Multiplication +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; ;; +; DW CP850_PAD_K1_END-$ ;; length of state section +; DB NUMERIC_PAD ;; State ID +; DW G_KB+P12_KB ;; Keyboard Type +; DB -1,-1 ;; Buffer entry for error character +; ;; +; DW CP850_PAD_K1_T1_END-$ ;; Size of xlat table +; DB STANDARD_TABLE ;; xlat options: +; DB 0 ;; number of entries +; DB 55,09eH (moved *** CNS ****) ;; MULTIPLICATION SIGN +;CP850_PAD_K1_T1_END: ;; +; ;; +; DW 0 ;; Size of xlat table - null table +; ;; +;CP850_PAD_K1_END: ;; +; ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_NA_UP_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type *** CNS 12/18 + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP850_NA_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 5,0CFH ;; International Currency Symb +CP850_NA_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_NA_UP_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: G, P12 +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_NA_K1_LO_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP850_NA_LO_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 41,0F5H ;; SECTION Symb +CP850_NA_LO_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_NA_K1_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Acute Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_LO_END-$ ;; length of state section + DB ACUTE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 239,0 ;; error character = standalone accent + ;; + DW CP850_AC_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 21,0ECH ;; y acute + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +CP850_AC_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Acute Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_UP_END-$ ;; length of state section + DB ACUTE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 239,0 ;; error character = standalone accent + ;; + DW CP850_AC_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of entries + DB 18,090H ;; E acute + DB 21,0EDH ;; Y acute + DB 22,0E9H ;; U acute + DB 23,0D6H ;; I acute + DB 24,0E0H ;; O acute + DB 30,0B5H ;; A acute +CP850_AC_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_UP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Acute Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_AC_SP_END-$ ;; length of state section + DB ACUTE_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 239,0 ;; error character = standalone accent + ;; + DW CP850_AC_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,239 ;; scan code,ASCII - SPACE +CP850_AC_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_AC_SP_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Diaresis Lower Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_LO_END-$ ;; length of state section + DB DIARESIS_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW CP850_DI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 6 ;; number of scans + DB 18,'' ;; scan code,ASCII - e + DB 21,'' ;; scan code,ASCII - y + DB 22,'' ;; scan code,ASCII - u + DB 23,'' ;; scan code,ASCII - i + DB 24,'' ;; scan code,ASCII - o + DB 30,'' ;; scan code,ASCII - a +CP850_DI_LO_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_DI_LO_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Diaresis Upper Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_UP_END-$ ;; length of state section + DB DIARESIS_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW CP850_DI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,0D3H ;; E Diaeresis + DB 22,'' ;; U Diaeresis + DB 23,0D8H ;; I Diaeresis + DB 24,'' ;; O Diaeresis + DB 30,'' ;; A Diaeresis +CP850_DI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_DI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Diaresis Space Bar +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_DI_SP_END-$ ;; length of state section + DB DIARESIS_SPACE ;; State ID + DW ANY_KB ;; Keyboard Type + DB 249,0 ;; error character = standalone accent + ;; + DW CP850_DI_SP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 1 ;; number of scans + DB 57,249 ;; error character = standalone accent +CP850_DI_SP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table +CP850_DI_SP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Grave Upper +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_GR_UP_END-$ ;; length of state section + DB GRAVE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 96,0 ;; error character = standalone accent + ;; + DW CP850_GR_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,0D4H ;; E grave + DB 22,0EBH ;; U grave + DB 23,0DEH ;; I grave + DB 24,0E3H ;; O grave + DB 30,0B7H ;; A grave +CP850_GR_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_GR_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Tilde Lower +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_TI_LO_END-$ ;; length of state section + DB TILDE_LOWER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW CP850_TI_LO_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 2 ;; number of scans + DB 24,0E4H ;; scan code,ASCII - o tilde + DB 30,0C6H ;; scan code,ASCII - a tilde + CP850_TI_LO_T1_END: ;; + ;; + DW 0 ;; + ;; + CP850_TI_LO_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; CODE PAGE: 850 +;;; STATE: Tilde Upper Case +;;; KEYBOARD TYPES: All +;;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_TI_UP_END-$ ;; length of state section + DB TILDE_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 07EH,0 ;; error character = standalone accent + ;; + DW CP850_TI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 2 ;; number of scans + DB 24,0E5H ;; scan code,ASCII - O tilde + DB 30,0C7H ;; scan code,ASCII - A tilde + CP850_TI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; + CP850_TI_UP_END: ;; length of state section + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: 850 +;; STATE: Circumflex Upper +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_CI_UP_END-$ ;; length of state section + DB CIRCUMFLEX_UPPER ;; State ID + DW ANY_KB ;; Keyboard Type + DB 94,0 ;; error character = standalone accent + ;; + DW CP850_CI_UP_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE+ZERO_SCAN ;; xlat options: + DB 5 ;; number of scans + DB 18,0D2H ;; E circumflex + DB 22,0EAH ;; U circumflex + DB 23,0D7H ;; I circumflex + DB 24,0E2H ;; O circumflex + DB 30,0B6H ;; A circumflex +CP850_CI_UP_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_CI_UP_END: ;; length of state section + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW 0 ;; LAST STATE + ;; +CP850_XLAT_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CODE ENDS ;; + END ;; diff --git a/v4.0/src/DEV/KEYBOARD/KDFUK.ASM b/v4.0/src/DEV/KEYBOARD/KDFUK.ASM new file mode 100644 index 0000000..1b3d7cf --- /dev/null +++ b/v4.0/src/DEV/KEYBOARD/KDFUK.ASM @@ -0,0 +1,655 @@ +;CODE to be deleted has a double ;; followed by actual asm code....**** +;; LATEST CHANGE ALT & CTL + + + + PAGE ,132 + TITLE DOS - Keyboard Definition File + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DOS - - NLS Support - Keyboard Defintion File +;; (c) Copyright 1988 Microsoft +;; +;; This file contains the keyboard tables for Spanish. +;; +;; Linkage Instructions: +;; Refer to KDF.ASM. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + INCLUDE KEYBSHAR.INC ;; + INCLUDE POSTEQU.INC ;; + INCLUDE KEYBMAC.INC ;; + ;; + PUBLIC UK_LOGIC ;; + PUBLIC UK_437_XLAT ;; + PUBLIC UK_850_XLAT ;; + ;; +CODE SEGMENT PUBLIC 'CODE' ;; + ASSUME CS:CODE,DS:CODE ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Standard translate table options are a liner search table +;; (TYPE_2_TAB) and ASCII entries ONLY (ASCII_ONLY) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +STANDARD_TABLE EQU TYPE_2_TAB+ASCII_ONLY + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; UK State Logic +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +UK_LOGIC: + + DW LOGIC_END-$ ;; length + ;; + DW 0 ;; special features + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; COMMANDS START HERE + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; OPTIONS: If we find a scan match in +;; an XLATT or SET_FLAG operation then +;; exit from INT 9. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + OPTION EXIT_IF_FOUND ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Dead key definitions must come before +;; dead key translations to handle +;; dead key + dead key. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + IFF EITHER_ALT,NOT ;; + ANDF EITHER_CTL,NOT ;; + IFF EITHER_SHIFT ;; + SET_FLAG DEAD_UPPER ;; + ELSEF ;; + SET_FLAG DEAD_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ACUTE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +ACUTE_PROC: ;; + ;; + IFF ACUTE,NOT ;; + GOTO DIARESIS_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT ACUTE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT ACUTE_LOWER ;; + ELSEF ;; + XLATT ACUTE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT ACUTE_UPPER ;; + ELSEF ;; + XLATT ACUTE_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_ACUTE: ;; + PUT_ERROR_CHAR ACUTE_LOWER ;; If we get here then either the XLATT + BEEP ;; failed or we are ina bad shift state. + GOTO NON_DEAD ;; Either is invalid so BEEP and fall + ;; through to generate the second char. + ;; Note that the dead key flag will be + ;; reset before we get here. + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DIARESIS ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +DIARESIS_PROC: ;; + ;; + IFF DIARESIS,NOT ;; + GOTO GRAVE_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT DIARESIS_SPACE ;; exist for 437 so beep for + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_LOWER ;; + ELSEF ;; + XLATT DIARESIS_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_UPPER ;; + ELSEF ;; + XLATT DIARESIS_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_DIARESIS: ;; + PUT_ERROR_CHAR DIARESIS_SPACE ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; GRAVE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +GRAVE_PROC: ;; + ;; + IFF GRAVE,NOT ;; + GOTO CIRCUMFLEX_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT GRAVE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_GRAVE: ;; + PUT_ERROR_CHAR GRAVE_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CIRCUMFLEX ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CIRCUMFLEX_PROC: ;; + ;; + IFF CIRCUMFLEX,NOT ;; + GOTO NON_DEAD ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT CIRCUMFLEX_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_CIRCUMFLEX: ;; + PUT_ERROR_CHAR CIRCUMFLEX_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Upper, lower and third shifts +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +NON_DEAD: ;; + ;; + IFKBD G_KB+P12_KB ;; Avoid accidentally translating + ANDF LC_E0 ;; the "/" on the numeric pad of the + EXIT_STATE_LOGIC ;; G keyboard + ENDIFF ;; +;;***BD ADDED FOR ALT, CTRL CASES ;; + IFF EITHER_CTL,NOT ;; + IFF ALT_SHIFT ;; ALT - case + ANDF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_ALT,NOT ;; CTRL - case + XLATT CTRL_CASE ;; + ENDIFF ;; + ENDIFF ;; +;;***BD END OF ADDITION + ;; + IFF EITHER_ALT,NOT ;; Lower and upper case. Alphabetic + ANDF EITHER_CTL,NOT ;; keys are affected by CAPS LOCK. + IFF EITHER_SHIFT ;; Numeric keys are not. +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE,NOT ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION + XLATT NON_ALPHA_UPPER ;; + IFF CAPS_STATE ;; + XLATT ALPHA_LOWER ;; + ELSEF ;; + XLATT ALPHA_UPPER ;; + ENDIFF ;; + ELSEF ;; +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION + XLATT NON_ALPHA_LOWER ;; + IFF CAPS_STATE ;; + XLATT ALPHA_UPPER ;; + ELSEF ;; + XLATT ALPHA_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_SHIFT,NOT ;; + IFKBD XT_KB+AT_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_CTL,NOT ;; + ANDF R_ALT_SHIFT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; + EXIT_STATE_LOGIC ;; + ;; +LOGIC_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; UK Common Translate Section +;; This section contains translations for the lower 128 characters +;; only since these will never change from code page to code page. +;; In addition the dead key "Set Flag" tables are here since the +;; dead keys are on the same keytops for all code pages. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC UK_COMMON_XLAT ;; +UK_COMMON_XLAT: ;; + ;; + DW COMMON_XLAT_END-$ ;; length of section + DW -1 ;; code page + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;;***BD - ADDED FOR ALT CASE +;;****************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alt Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_ALT_K2_END-$ ;; length of state section + DB ALT_CASE ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_ALT_K2_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 0 ;; number of entries +;;***BD THIS ENTRY IS A TEST ENTRY +;; DB 53,225,0 ;; TEST ENTRY +COM_ALT_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_ALT_K2_END: ;; + ;; +;;****************************** +;;***BD - ADDED FOR CTRL CASE +;;****************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: G_KB+P12_KB+AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K2_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW G_KB+P12_KB+AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_CTRL_K2_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 2 ;; number of entries +;;***BD THIS ENTRY IS A TEST ENTRY +;; DB 53,226,0 ;; TEST ENTRY + DB 43,-1,-1 ;; invalid slash + DB 41,28,41 ;; valid slash +COM_CTRL_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CTRL_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: G_KB+P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K1_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 2 ;; number of entries + DB 40,"'" ;; ' + DB 43,'#' ;; # +COM_NA_LO_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K2_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K2_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 3 ;; number of entries + DB 41,"\" ;; \ + DB 40,"'" ;; ' + DB 43,'#' ;; # +COM_NA_LO_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: XT_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K3_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K3_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 2 ;; number of entries + DB 40,"'" ;; ' + DB 41,'#' ;; # + DB 43,'\' ;; # +COM_NA_LO_K3_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K3_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G_KB+P12_KB+ +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 5 ;; number of entries + DB 41,0AAh ;; + DB 3,'"' ;; " + DB 4,09CH ;; + DB 40,'@' ;; at sign + DB 43,07EH ;; ~ +COM_NA_UP_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: XT_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K2_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_T1_K2_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 5 ;; number of entries + DB 3,'"' ;; " + DB 4,09CH ;; + DB 41,07EH ;; ~ + DB 40,'@' ;; at sign + DB 43,07CH ;; Broken vertical bar +COM_NA_UP_T1_K2_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K2_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: AT_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K3_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_T1_K3_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 5 ;; number of entries + DB 41,07Ch ;; + DB 3,'"' ;; " + DB 4,09CH ;; + DB 40,'@' ;; at sign + DB 43,07EH ;; ~ +COM_NA_UP_T1_K3_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K3_END: ;; + ;; + ;; + DW 0 ;; Last State +COMMON_XLAT_END: ;; + ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; UK Specific Translate Section for 437 +;; 437 IS COMPLETELY COVERED BY THE COMMON TABLE. +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC UK_437_XLAT ;; +UK_437_XLAT: ;; + ;; + DW CP437_XLAT_END-$ ;; length of section + DW 437 ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Third Shift +;; KEYBOARD TYPES: G_KB+P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_THIRD_K1_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP437_THIRD_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 41,0DDH ;; Solid vertical bar - graphics block +CP437_THIRD_K1_T1_END: ;; + ;; + DW 0 ;; Last xlat table +CP437_THIRD_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G_KB+P12_KB+ +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP437_NA_UP_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 86,07ch ;; vertical bar +CP437_NA_UP_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_NA_UP_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; LAST STATE + ;; +CP437_XLAT_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; UK Specific Translate Section for 850 +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC UK_850_XLAT ;; +UK_850_XLAT: ;; + ;; + DW CP850_XLAT_END-$ ;; length of section + DW 850 ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP850 +;; STATE: Third Shift +;; KEYBOARD TYPES: G_KB+P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_THIRD_K1_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP850_THIRD_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 41,07CH ;; Solid vertical bar - | +CP850_THIRD_K1_T1_END: ;; + ;; + DW 0 ;; Last xlat table +CP850_THIRD_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G_KB+P12_KB+ +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP850_NA_UP_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 86,0DDh ;; broken vertical +CP850_NA_UP_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_NA_UP_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; LAST STATE + ;; +CP850_XLAT_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +CODE ENDS ;; + END ;; diff --git a/v4.0/src/DEV/KEYBOARD/KDFUK166.ASM b/v4.0/src/DEV/KEYBOARD/KDFUK166.ASM new file mode 100644 index 0000000..4e7d1c7 --- /dev/null +++ b/v4.0/src/DEV/KEYBOARD/KDFUK166.ASM @@ -0,0 +1,655 @@ +;CODE to be deleted has a double ;; followed by actual asm code....**** +;; LATEST CHANGE ALT & CTL + + + + PAGE ,132 + TITLE DOS - Keyboard Definition File + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DOS - - NLS Support - Keyboard Defintion File +;; (c) Copyright 1988 Microsoft +;; +;; This file contains the keyboard tables for Spanish. +;; +;; Linkage Instructions: +;; Refer to KDF.ASM. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + INCLUDE KEYBSHAR.INC ;; + INCLUDE POSTEQU.INC ;; + INCLUDE KEYBMAC.INC ;; + ;; + PUBLIC UK2_LOGIC ;; + PUBLIC UK2_437_XLAT ;; + PUBLIC UK2_850_XLAT ;; + ;; +CODE SEGMENT PUBLIC 'CODE' ;; + ASSUME CS:CODE,DS:CODE ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Standard translate table options are a liner search table +;; (TYPE_2_TAB) and ASCII entries ONLY (ASCII_ONLY) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +STANDARD_TABLE EQU TYPE_2_TAB+ASCII_ONLY + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; UK State Logic +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +UK2_LOGIC: + + DW LOGIC_END-$ ;; length + ;; + DW 0 ;; special features + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; COMMANDS START HERE + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; OPTIONS: If we find a scan match in +;; an XLATT or SET_FLAG operation then +;; exit from INT 9. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + OPTION EXIT_IF_FOUND ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Dead key definitions must come before +;; dead key translations to handle +;; dead key + dead key. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + IFF EITHER_ALT,NOT ;; + ANDF EITHER_CTL,NOT ;; + IFF EITHER_SHIFT ;; + SET_FLAG DEAD_UPPER ;; + ELSEF ;; + SET_FLAG DEAD_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ACUTE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +ACUTE_PROC: ;; + ;; + IFF ACUTE,NOT ;; + GOTO DIARESIS_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT ACUTE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT ACUTE_LOWER ;; + ELSEF ;; + XLATT ACUTE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT ACUTE_UPPER ;; + ELSEF ;; + XLATT ACUTE_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_ACUTE: ;; + PUT_ERROR_CHAR ACUTE_LOWER ;; If we get here then either the XLATT + BEEP ;; failed or we are ina bad shift state. + GOTO NON_DEAD ;; Either is invalid so BEEP and fall + ;; through to generate the second char. + ;; Note that the dead key flag will be + ;; reset before we get here. + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DIARESIS ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +DIARESIS_PROC: ;; + ;; + IFF DIARESIS,NOT ;; + GOTO GRAVE_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT DIARESIS_SPACE ;; exist for 437 so beep for + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_LOWER ;; + ELSEF ;; + XLATT DIARESIS_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE ;; + XLATT DIARESIS_UPPER ;; + ELSEF ;; + XLATT DIARESIS_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_DIARESIS: ;; + PUT_ERROR_CHAR DIARESIS_SPACE ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; GRAVE ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +GRAVE_PROC: ;; + ;; + IFF GRAVE,NOT ;; + GOTO CIRCUMFLEX_PROC ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT GRAVE_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT GRAVE_LOWER ;; + ELSEF ;; + XLATT GRAVE_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_GRAVE: ;; + PUT_ERROR_CHAR GRAVE_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CIRCUMFLEX ACCENT TRANSLATIONS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CIRCUMFLEX_PROC: ;; + ;; + IFF CIRCUMFLEX,NOT ;; + GOTO NON_DEAD ;; + ENDIFF ;; + ;; + RESET_NLS ;; + IFF R_ALT_SHIFT,NOT ;; + XLATT CIRCUMFLEX_SPACE ;; + ENDIFF ;; + IFF EITHER_CTL,NOT ;; + ANDF EITHER_ALT,NOT ;; + IFF EITHER_SHIFT ;; + IFF CAPS_STATE ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ELSEF ;; + IFF CAPS_STATE,NOT ;; + XLATT CIRCUMFLEX_LOWER ;; + ELSEF ;; + XLATT CIRCUMFLEX_UPPER ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; +INVALID_CIRCUMFLEX: ;; + PUT_ERROR_CHAR CIRCUMFLEX_LOWER ;; standalone accent + BEEP ;; Invalid dead key combo. + GOTO NON_DEAD ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Upper, lower and third shifts +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +NON_DEAD: ;; + ;; + IFKBD G_KB+P12_KB ;; Avoid accidentally translating + ANDF LC_E0 ;; the "/" on the numeric pad of the + EXIT_STATE_LOGIC ;; G keyboard + ENDIFF ;; +;;***BD ADDED FOR ALT, CTRL CASES ;; + IFF EITHER_CTL,NOT ;; + IFF ALT_SHIFT ;; ALT - case + ANDF R_ALT_SHIFT,NOT ;; + XLATT ALT_CASE ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_ALT,NOT ;; CTRL - case + XLATT CTRL_CASE ;; + ENDIFF ;; + ENDIFF ;; +;;***BD END OF ADDITION + ;; + IFF EITHER_ALT,NOT ;; Lower and upper case. Alphabetic + ANDF EITHER_CTL,NOT ;; keys are affected by CAPS LOCK. + IFF EITHER_SHIFT ;; Numeric keys are not. +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE,NOT ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION + XLATT NON_ALPHA_UPPER ;; + IFF CAPS_STATE ;; + XLATT ALPHA_LOWER ;; + ELSEF ;; + XLATT ALPHA_UPPER ;; + ENDIFF ;; + ELSEF ;; +;;***BD ADDED FOR NUMERIC PAD + IFF NUM_STATE ;; + XLATT NUMERIC_PAD ;; + ENDIFF ;; +;;***BD END OF ADDITION + XLATT NON_ALPHA_LOWER ;; + IFF CAPS_STATE ;; + XLATT ALPHA_UPPER ;; + ELSEF ;; + XLATT ALPHA_LOWER ;; + ENDIFF ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_SHIFT,NOT ;; + IFKBD XT_KB+AT_KB ;; + IFF EITHER_CTL ;; + ANDF ALT_SHIFT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ELSEF ;; + IFF EITHER_CTL,NOT ;; + ANDF R_ALT_SHIFT ;; + XLATT THIRD_SHIFT ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ENDIFF ;; + ;; + EXIT_STATE_LOGIC ;; + ;; +LOGIC_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; UK Common Translate Section +;; This section contains translations for the lower 128 characters +;; only since these will never change from code page to code page. +;; In addition the dead key "Set Flag" tables are here since the +;; dead keys are on the same keytops for all code pages. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC UK2_COMMON_XLAT ;; +UK2_COMMON_XLAT: ;; + ;; + DW COMMON_XLAT_END-$ ;; length of section + DW -1 ;; code page + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;;***BD - ADDED FOR ALT CASE +;;****************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Alt Case +;; KEYBOARD TYPES: All +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_ALT_K2_END-$ ;; length of state section + DB ALT_CASE ;; State ID + DW ANY_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_ALT_K2_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 0 ;; number of entries +;;***BD THIS ENTRY IS A TEST ENTRY +;; DB 53,225,0 ;; TEST ENTRY +COM_ALT_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_ALT_K2_END: ;; + ;; +;;****************************** +;;***BD - ADDED FOR CTRL CASE +;;****************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Ctrl Case +;; KEYBOARD TYPES: G_KB+P12_KB+AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_CTRL_K2_END-$ ;; length of state section + DB CTRL_CASE ;; State ID + DW G_KB+P12_KB+AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_CTRL_K2_T1_END-$ ;; Size of xlat table + DB TYPE_2_TAB ;; xlat options: + DB 2 ;; number of entries +;;***BD THIS ENTRY IS A TEST ENTRY +;; DB 53,226,0 ;; TEST ENTRY + DB 43,-1,-1 ;; invalid slash + DB 41,28,41 ;; valid slash +COM_CTRL_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_CTRL_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: G_KB+P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K1_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 2 ;; number of entries + DB 40,"'" ;; ' + DB 43,'#' ;; # +COM_NA_LO_K1_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: AT +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K2_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K2_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 3 ;; number of entries + DB 41,"\" ;; \ + DB 40,"'" ;; ' + DB 43,'#' ;; # +COM_NA_LO_K2_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K2_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Lower Case +;; KEYBOARD TYPES: XT_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_LO_K3_END-$ ;; length of state section + DB NON_ALPHA_LOWER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_LO_K3_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 2 ;; number of entries + DB 40,"'" ;; ' + DB 41,'#' ;; # + DB 43,'\' ;; # +COM_NA_LO_K3_T1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_LO_K3_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G_KB+P12_KB+ +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 5 ;; number of entries + DB 41,0AAh ;; + DB 3,'"' ;; " + DB 4,09CH ;; + DB 40,'@' ;; at sign + DB 43,07EH ;; ~ +COM_NA_UP_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: XT_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K2_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW XT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_T1_K2_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 5 ;; number of entries + DB 3,'"' ;; " + DB 4,09CH ;; + DB 41,07EH ;; ~ + DB 40,'@' ;; at sign + DB 43,07CH ;; Broken vertical bar +COM_NA_UP_T1_K2_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K2_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: AT_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW COM_NA_UP_K3_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW AT_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW COM_NA_UP_T1_K3_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 5 ;; number of entries + DB 41,07Ch ;; + DB 3,'"' ;; " + DB 4,09CH ;; + DB 40,'@' ;; at sign + DB 43,07EH ;; ~ +COM_NA_UP_T1_K3_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +COM_NA_UP_K3_END: ;; + ;; + ;; + DW 0 ;; Last State +COMMON_XLAT_END: ;; + ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; UK Specific Translate Section for 437 +;; 437 IS COMPLETELY COVERED BY THE COMMON TABLE. +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC UK2_437_XLAT ;; +UK2_437_XLAT: ;; + ;; + DW CP437_XLAT_END-$ ;; length of section + DW 437 ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Third Shift +;; KEYBOARD TYPES: G_KB+P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_THIRD_K1_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP437_THIRD_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 41,0DDH ;; Solid vertical bar - graphics block +CP437_THIRD_K1_T1_END: ;; + ;; + DW 0 ;; Last xlat table +CP437_THIRD_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP437 +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G_KB+P12_KB+ +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP437_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP437_NA_UP_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 86,07ch ;; vertical bar +CP437_NA_UP_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP437_NA_UP_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; LAST STATE + ;; +CP437_XLAT_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;*************************************** +;; UK Specific Translate Section for 850 +;;*************************************** +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUBLIC UK2_850_XLAT ;; +UK2_850_XLAT: ;; + ;; + DW CP850_XLAT_END-$ ;; length of section + DW 850 ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: CP850 +;; STATE: Third Shift +;; KEYBOARD TYPES: G_KB+P12_KB +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_THIRD_K1_END-$ ;; length of state section + DB THIRD_SHIFT ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP850_THIRD_K1_T1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 41,07CH ;; Solid vertical bar - | +CP850_THIRD_K1_T1_END: ;; + ;; + DW 0 ;; Last xlat table +CP850_THIRD_K1_END: ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; CODE PAGE: Common +;; STATE: Non-Alpha Upper Case +;; KEYBOARD TYPES: G_KB+P12_KB+ +;; TABLE TYPE: Translate +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW CP850_NA_UP_K1_END-$ ;; length of state section + DB NON_ALPHA_UPPER ;; State ID + DW G_KB+P12_KB ;; Keyboard Type + DB -1,-1 ;; Buffer entry for error character + ;; + DW CP850_NA_UP_T1_K1_END-$ ;; Size of xlat table + DB STANDARD_TABLE ;; xlat options: + DB 1 ;; number of entries + DB 86,0DDh ;; broken vertical +CP850_NA_UP_T1_K1_END: ;; + ;; + DW 0 ;; Size of xlat table - null table + ;; +CP850_NA_UP_K1_END: ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + DW 0 ;; LAST STATE + ;; +CP850_XLAT_END: ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +CODE ENDS ;; + END ;; diff --git a/v4.0/src/DEV/KEYBOARD/KDFUK168.ASM b/v4.0/src/DEV/KEYBOARD/KDFUK168.ASM new file mode 100644 index 0000000..29da334 --- /dev/null +++ b/v4.0/src/DEV/KEYBOARD/KDFUK168.ASM @@ -0,0 +1,848 @@ +;CODE to be deleted has a double ;; followed by actual asm code....**** +;; LATEST CHANGE ALT & CTL + + + + PAGE ,132 + TITLE DOS - Keyboard Definition File + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DOS - - NLS Support - Keyboard Defintion File +;; (c) Copyright 1988 Microsoft +;; +;; This file contains the keyboard tables for Spanish. +;; +;; Linkage Instructions: +;; Refer to KDF.ASM. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + INCLUDE KEYBSHAR.INC ;; ;AN000; + INCLUDE POSTEQU.INC ;; ;AN000; + INCLUDE KEYBMAC.INC ;; ;AN000; + ;; ;AN000; + PUBLIC UK1_LOGIC ;; ;AN000; + PUBLIC UK1_437_XLAT ;; ;AN000; + PUBLIC UK1_850_XLAT ;; ;AN000; + ;; ;AN000; +CODE SEGMENT PUBLIC 'CODE' ;; ;AN000; + ASSUME CS:CODE,DS:CODE ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; Standard translate table options are a liner search table ;AN000; +;; (TYPE_2_TAB) and ASCII entries ONLY (ASCII_ONLY) ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; +STANDARD_TABLE EQU TYPE_2_TAB+ASCII_ONLY ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;*************************************** ;AN000; +;; UK State Logic ;AN000; +;;*************************************** ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + ;; ;AN000; +UK1_LOGIC: ;AN000; + ;AN000; + DW LOGIC_END-$ ;; length ;AN000; + ;; ;AN000; + DW 0 ;; special features ;AN000; + ;; ;AN000; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; COMMANDS START HERE ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; OPTIONS: If we find a scan match in ;AN000; +;; an XLATT or SET_FLAG operation then ;AN000; +;; exit from INT 9. ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + OPTION EXIT_IF_FOUND ;; ;AN000; + ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; Dead key definitions must come before ;AN000; +;; dead key translations to handle ;AN000; +;; dead key + dead key. ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + IFF EITHER_ALT,NOT ;; ;AN000; + ANDF EITHER_CTL,NOT ;; ;AN000; + IFF EITHER_SHIFT ;; ;AN000; + SET_FLAG DEAD_UPPER ;; ;AN000; + ELSEF ;; ;AN000; + SET_FLAG DEAD_LOWER ;; ;AN000; + ENDIFF ;; ;AN000; + ENDIFF ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; ACUTE ACCENT TRANSLATIONS ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; +ACUTE_PROC: ;; ;AN000; + ;; ;AN000; + IFF ACUTE,NOT ;; ;AN000; + GOTO DIARESIS_PROC ;; ;AN000; + ENDIFF ;; ;AN000; + ;; ;AN000; + RESET_NLS ;; ;AN000; + IFF R_ALT_SHIFT,NOT ;; ;AN000; + XLATT ACUTE_SPACE ;; ;AN000; + ENDIFF ;; ;AN000; + IFF EITHER_CTL,NOT ;; ;AN000; + ANDF EITHER_ALT,NOT ;; ;AN000; + IFF EITHER_SHIFT ;; ;AN000; + IFF CAPS_STATE ;; ;AN000; + XLATT ACUTE_LOWER ;; ;AN000; + ELSEF ;; ;AN000; + XLATT ACUTE_UPPER ;; ;AN000; + ENDIFF ;; ;AN000; + ELSEF ;; ;AN000; + IFF CAPS_STATE ;; ;AN000; + XLATT ACUTE_UPPER ;; ;AN000; + ELSEF ;; ;AN000; + XLATT ACUTE_LOWER ;; ;AN000; + ENDIFF ;; ;AN000; + ENDIFF ;; ;AN000; + ENDIFF ;; ;AN000; + ;; ;AN000; +INVALID_ACUTE: ;; ;AN000; + PUT_ERROR_CHAR ACUTE_LOWER ;; If we get here then either the XLATT ;AN000; + BEEP ;; failed or we are ina bad shift state. ;AN000; + GOTO NON_DEAD ;; Either is invalid so BEEP and fall ;AN000; + ;; through to generate the second char. ;AN000; + ;; Note that the dead key flag will be ;AN000; + ;; reset before we get here. ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; DIARESIS ACCENT TRANSLATIONS ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; +DIARESIS_PROC: ;; ;AN000; + ;; ;AN000; + IFF DIARESIS,NOT ;; ;AN000; + GOTO GRAVE_PROC ;; ;AN000; + ENDIFF ;; ;AN000; + ;; ;AN000; + RESET_NLS ;; ;AN000; + IFF R_ALT_SHIFT,NOT ;; ;AN000; + XLATT DIARESIS_SPACE ;; exist for 437 so beep for ;AN000; + ENDIFF ;; ;AN000; + IFF EITHER_CTL,NOT ;; ;AN000; + ANDF EITHER_ALT,NOT ;; ;AN000; + IFF EITHER_SHIFT ;; ;AN000; + IFF CAPS_STATE ;; ;AN000; + XLATT DIARESIS_LOWER ;; ;AN000; + ELSEF ;; ;AN000; + XLATT DIARESIS_UPPER ;; ;AN000; + ENDIFF ;; ;AN000; + ELSEF ;; ;AN000; + IFF CAPS_STATE ;; ;AN000; + XLATT DIARESIS_UPPER ;; ;AN000; + ELSEF ;; ;AN000; + XLATT DIARESIS_LOWER ;; ;AN000; + ENDIFF ;; ;AN000; + ENDIFF ;; ;AN000; + ENDIFF ;; ;AN000; + ;; ;AN000; +INVALID_DIARESIS: ;; ;AN000; + PUT_ERROR_CHAR DIARESIS_SPACE ;; standalone accent ;AN000; + BEEP ;; Invalid dead key combo. ;AN000; + GOTO NON_DEAD ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; GRAVE ACCENT TRANSLATIONS ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; +GRAVE_PROC: ;; ;AN000; + ;; ;AN000; + IFF GRAVE,NOT ;; ;AN000; + GOTO CIRCUMFLEX_PROC ;; ;AN000; + ENDIFF ;; ;AN000; + ;; ;AN000; + RESET_NLS ;; ;AN000; + IFF R_ALT_SHIFT,NOT ;; ;AN000; + XLATT GRAVE_SPACE ;; ;AN000; + ENDIFF ;; ;AN000; + IFF EITHER_CTL,NOT ;; ;AN000; + ANDF EITHER_ALT,NOT ;; ;AN000; + IFF EITHER_SHIFT ;; ;AN000; + IFF CAPS_STATE ;; ;AN000; + XLATT GRAVE_LOWER ;; ;AN000; + ELSEF ;; ;AN000; + XLATT GRAVE_UPPER ;; ;AN000; + ENDIFF ;; ;AN000; + ELSEF ;; ;AN000; + IFF CAPS_STATE,NOT ;; ;AN000; + XLATT GRAVE_LOWER ;; ;AN000; + ELSEF ;; ;AN000; + XLATT GRAVE_UPPER ;; ;AN000; + ENDIFF ;; ;AN000; + ENDIFF ;; ;AN000; + ENDIFF ;; ;AN000; + ;; ;AN000; +INVALID_GRAVE: ;; ;AN000; + PUT_ERROR_CHAR GRAVE_LOWER ;; standalone accent ;AN000; + BEEP ;; Invalid dead key combo. ;AN000; + GOTO NON_DEAD ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CIRCUMFLEX ACCENT TRANSLATIONS ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; +CIRCUMFLEX_PROC: ;; ;AN000; + ;; ;AN000; + IFF CIRCUMFLEX,NOT ;; ;AN000; + GOTO NON_DEAD ;; ;AN000; + ENDIFF ;; ;AN000; + ;; ;AN000; + RESET_NLS ;; ;AN000; + IFF R_ALT_SHIFT,NOT ;; ;AN000; + XLATT CIRCUMFLEX_SPACE ;; ;AN000; + ENDIFF ;; ;AN000; + IFF EITHER_CTL,NOT ;; ;AN000; + ANDF EITHER_ALT,NOT ;; ;AN000; + IFF EITHER_SHIFT ;; ;AN000; + IFF CAPS_STATE ;; ;AN000; + XLATT CIRCUMFLEX_LOWER ;; ;AN000; + ELSEF ;; ;AN000; + XLATT CIRCUMFLEX_UPPER ;; ;AN000; + ENDIFF ;; ;AN000; + ELSEF ;; ;AN000; + IFF CAPS_STATE,NOT ;; ;AN000; + XLATT CIRCUMFLEX_LOWER ;; ;AN000; + ELSEF ;; ;AN000; + XLATT CIRCUMFLEX_UPPER ;; ;AN000; + ENDIFF ;; ;AN000; + ENDIFF ;; ;AN000; + ENDIFF ;; ;AN000; + ;; ;AN000; +INVALID_CIRCUMFLEX: ;; ;AN000; + PUT_ERROR_CHAR CIRCUMFLEX_LOWER ;; standalone accent ;AN000; + BEEP ;; Invalid dead key combo. ;AN000; + GOTO NON_DEAD ;; ;AN000; + ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; Upper, lower and third shifts ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; +NON_DEAD: ;; ;AN000; + ;; ;AN000; + IFKBD G_KB+P12_KB ;; Avoid accidentally translating ;AN000; + ANDF LC_E0 ;; the "/" on the numeric pad of the ;AN000; + EXIT_STATE_LOGIC ;; G keyboard ;AN000; + ENDIFF ;; ;AN000; +;;***BD ADDED FOR ALT, CTRL CASES ;; ;AN000; + IFF EITHER_CTL,NOT ;; ;AN000; + IFF ALT_SHIFT ;; ALT - case ;AN000; + ANDF R_ALT_SHIFT,NOT ;; ;AN000; + XLATT ALT_CASE ;; ;AN000; + ENDIFF ;; ;AN000; + ELSEF ;; ;AN000; + IFF EITHER_ALT,NOT ;; CTRL - case ;AN000; + XLATT CTRL_CASE ;; ;AN000; + ENDIFF ;; ;AN000; + ENDIFF ;; ;AN000; +;;***BD END OF ADDITION ;AN000; + ;; ;AN000; + IFF EITHER_ALT,NOT ;; Lower and upper case. Alphabetic ;AN000; + ANDF EITHER_CTL,NOT ;; keys are affected by CAPS LOCK. ;AN000; + IFF EITHER_SHIFT ;; Numeric keys are not. ;AN000; +;;***BD ADDED FOR NUMERIC PAD ;AN000; + IFF NUM_STATE,NOT ;; ;AN000; + XLATT NUMERIC_PAD ;; ;AN000; + ENDIFF ;; ;AN000; +;;***BD END OF ADDITION ;AN000; + XLATT NON_ALPHA_UPPER ;; ;AN000; + IFF CAPS_STATE ;; ;AN000; + XLATT ALPHA_LOWER ;; ;AN000; + ELSEF ;; ;AN000; + XLATT ALPHA_UPPER ;; ;AN000; + ENDIFF ;; ;AN000; + ELSEF ;; ;AN000; +;;***BD ADDED FOR NUMERIC PAD ;AN000; + IFF NUM_STATE ;; ;AN000; + XLATT NUMERIC_PAD ;; ;AN000; + ENDIFF ;; ;AN000; +;;***BD END OF ADDITION ;AN000; + XLATT NON_ALPHA_LOWER ;; ;AN000; + IFF CAPS_STATE ;; ;AN000; + XLATT ALPHA_UPPER ;; ;AN000; + ELSEF ;; ;AN000; + XLATT ALPHA_LOWER ;; ;AN000; + ENDIFF ;; ;AN000; + ENDIFF ;; ;AN000; + ELSEF ;; ;AN000; + IFF EITHER_SHIFT,NOT ;; ;AN000; + IFKBD XT_KB+AT_KB ;; ;AN000; + IFF EITHER_CTL ;; ;AN000; + ANDF ALT_SHIFT ;; ;AN000; + XLATT THIRD_SHIFT ;; ;AN000; + ENDIFF ;; ;AN000; + ELSEF ;; ;AN000; + IFF EITHER_CTL,NOT ;; ;AN000; + ANDF R_ALT_SHIFT ;; ;AN000; + XLATT THIRD_SHIFT ;; ;AN000; + ENDIFF ;; ;AN000; + ENDIFF ;; ;AN000; + ENDIFF ;; ;AN000; + ENDIFF ;; ;AN000; + ;; ;AN000; + EXIT_STATE_LOGIC ;; ;AN000; + ;; ;AN000; +LOGIC_END: ;; ;AN000; + ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;*************************************** ;AN000; +;; UK Common Translate Section ;AN000; +;; This section contains translations for the lower 128 characters ;AN000; +;; only since these will never change from code page to code page. ;AN000; +;; In addition the dead key "Set Flag" tables are here since the ;AN000; +;; dead keys are on the same keytops for all code pages. ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + PUBLIC UK1_COMMON_XLAT ;; ;AN000; +UK1_COMMON_XLAT: ;; ;AN000; + ;; ;AN000; + DW COMMON_XLAT_END-$ ;; length of section ;AN000; + DW -1 ;; code page ;AN000; + ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;*************************************** ;AN000; +;;***BD - ADDED FOR ALT CASE ;AN000; +;;****************************** ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: Common ;AN000; +;; STATE: Alt Case ;AN000; +;; KEYBOARD TYPES: All ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW COM_ALT_K2_END-$ ;; length of state section ;AN000; + DB ALT_CASE ;; State ID ;AN000; + DW ANY_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW COM_ALT_K2_T1_END-$ ;; Size of xlat table ;AN000; + DB TYPE_2_TAB ;; xlat options: ;AN000; + DB 0 ;; number of entries ;AN000; +;;***BD THIS ENTRY IS A TEST ENTRY ;AN000; +;; DB 53,225,0 ;; TEST ENTRY ;AN000; +COM_ALT_K2_T1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Size of xlat table - null table ;AN000; + ;; ;AN000; +COM_ALT_K2_END: ;; ;AN000; + ;; ;AN000; +;;****************************** ;AN000; +;;***BD - ADDED FOR CTRL CASE ;AN000; +;;****************************** ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: Common ;AN000; +;; STATE: Ctrl Case ;AN000; +;; KEYBOARD TYPES: G_KB+P12+AT ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW COM_CTRL_K2_END-$ ;; length of state section ;AN000; + DB CTRL_CASE ;; State ID ;AN000; + DW G_KB+P12_KB+AT_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW COM_CTRL_K2_T1_END-$ ;; Size of xlat table ;AN000; + DB TYPE_2_TAB ;; xlat options: ;AN000; + DB 2 ;; number of entries ;AN000; +;;***BD THIS ENTRY IS A TEST ENTRY ;AN000; +;; DB 53,226,0 ;; TEST ENTRY ;AN000; + DB 43,-1,-1 ;; invalid slash ;AN000; + DB 41,28,41 ;; valid slash ;AN000; +COM_CTRL_K2_T1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Size of xlat table - null table ;AN000; + ;; ;AN000; +COM_CTRL_K2_END: ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: Common ;AN000; +;; STATE: Non-Alpha Lower Case ;AN000; +;; KEYBOARD TYPES: G_KB ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW COM_NA_LO_K1_END-$ ;; length of state section ;AN000; + DB NON_ALPHA_LOWER ;; State ID ;AN000; + DW G_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW COM_NA_LO_K1_T1_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE ;; xlat options: ;AN000; + DB 6 ;; number of entries ;AN000; + DB 13,"" ;; ;AN000; + DB 26,"@" ;; ' ;AN000; + DB 27,"[" ;; ' ;AN000; + DB 40,":" ;; ' ;AN000; + DB 41,"\" ;; ' ;AN000; + DB 43,']' ;; # ;AN000; +COM_NA_LO_K1_T1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Size of xlat table - null table ;AN000; + ;; ;AN000; +COM_NA_LO_K1_END: ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: Common ;AN000; +;; STATE: Non-Alpha Lower Case ;AN000; +;; KEYBOARD TYPES: P12_KB ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW COM_NA_LO_PK1_END-$ ;; length of state section ;AN000; + DB NON_ALPHA_LOWER ;; State ID ;AN000; + DW P12_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW COM_NA_LO_PK1_T1_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE ;; xlat options: ;AN000; + DB 2 ;; number of entries ;AN000; + DB 40,"'" ;; ' ;AN000; + DB 43,'#' ;; # ;AN000; +COM_NA_LO_PK1_T1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Size of xlat table - null table ;AN000; + ;; ;AN000; +COM_NA_LO_PK1_END: ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: Common ;AN000; +;; STATE: Non-Alpha Lower Case ;AN000; +;; KEYBOARD TYPES: AT ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW COM_NA_LO_K2_END-$ ;; length of state section ;AN000; + DB NON_ALPHA_LOWER ;; State ID ;AN000; + DW AT_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW COM_NA_LO_K2_T1_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE ;; xlat options: ;AN000; + DB 3 ;; number of entries ;AN000; + DB 41,"\" ;; \ ;AN000; + DB 40,"'" ;; ' ;AN000; + DB 43,'#' ;; # ;AN000; +COM_NA_LO_K2_T1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Size of xlat table - null table ;AN000; + ;; ;AN000; +COM_NA_LO_K2_END: ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: Common ;AN000; +;; STATE: Non-Alpha Lower Case ;AN000; +;; KEYBOARD TYPES: XT_KB ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW COM_NA_LO_K3_END-$ ;; length of state section ;AN000; + DB NON_ALPHA_LOWER ;; State ID ;AN000; + DW XT_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW COM_NA_LO_K3_T1_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE ;; xlat options: ;AN000; + DB 2 ;; number of entries ;AN000; + DB 40,"'" ;; ' ;AN000; + DB 41,'#' ;; # ;AN000; + DB 43,'\' ;; # ;AN000; +COM_NA_LO_K3_T1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Size of xlat table - null table ;AN000; + ;; ;AN000; +COM_NA_LO_K3_END: ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: Common ;AN000; +;; STATE: Non-Alpha Upper Case ;AN000; +;; KEYBOARD TYPES: G_KB+P ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW COM_NA_UP_K1_END-$ ;; length of state section ;AN000; + DB NON_ALPHA_UPPER ;; State ID ;AN000; + DW G_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW COM_NA_UP_T1_K1_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE ;; xlat options: ;AN000; + DB 14 ;; number of entries ;AN000; + DB 3,'"' ;; ;AN000; + DB 4,"" ;; ;AN000; + DB 7,"&" ;; ;AN000; + DB 8,"'" ;; ;AN000; + DB 9,"(" ;; ;AN000; + DB 10,")" ;; ;AN000; + DB 11,"#" ;; ;AN000; + DB 12,"=" ;; ;AN000; + DB 26,"`" ;; ;AN000; + DB 27,"{" ;; ;AN000; + DB 39,"+" ;; ;AN000; + DB 40,"*" ;; ;AN000; + DB 43,"}" ;; ;AN000; + DB 86,"_" ;; ;AN000; +COM_NA_UP_T1_K1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Size of xlat table - null table ;AN000; + ;; ;AN000; +COM_NA_UP_K1_END: ;; ;AN000; + ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: Common ;AN000; +;; STATE: Non-Alpha Upper Case ;AN000; +;; KEYBOARD TYPES: P12_KB ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW COM_NA_UP_PK1_END-$ ;; length of state section ;AN000; + DB NON_ALPHA_UPPER ;; State ID ;AN000; + DW P12_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW COM_NA_UP_T1_PK1_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE ;; xlat options: ;AN000; + DB 5 ;; number of entries ;AN000; + DB 41,0AAh ;; ;AN000; + DB 3,'"' ;; " ;AN000; + DB 4,09CH ;; ;AN000; + DB 40,'@' ;; at sign ;AN000; + DB 43,07EH ;; ~ ;AN000; +COM_NA_UP_T1_PK1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Size of xlat table - null table ;AN000; + ;; ;AN000; +COM_NA_UP_PK1_END: ;; ;AN000; + ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: Common ;AN000; +;; STATE: Non-Alpha Upper Case ;AN000; +;; KEYBOARD TYPES: XT_KB ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW COM_NA_UP_K2_END-$ ;; length of state section ;AN000; + DB NON_ALPHA_UPPER ;; State ID ;AN000; + DW XT_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW COM_NA_UP_T1_K2_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE ;; xlat options: ;AN000; + DB 5 ;; number of entries ;AN000; + DB 3,'"' ;; " ;AN000; + DB 4,09CH ;; ;AN000; + DB 41,07EH ;; ~ ;AN000; + DB 40,'@' ;; at sign ;AN000; + DB 43,07CH ;; Broken vertical bar ;AN000; +COM_NA_UP_T1_K2_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Size of xlat table - null table ;AN000; + ;; ;AN000; +COM_NA_UP_K2_END: ;; ;AN000; + ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: Common ;AN000; +;; STATE: Non-Alpha Upper Case ;AN000; +;; KEYBOARD TYPES: AT_KB ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW COM_NA_UP_K3_END-$ ;; length of state section ;AN000; + DB NON_ALPHA_UPPER ;; State ID ;AN000; + DW AT_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW COM_NA_UP_T1_K3_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE ;; xlat options: ;AN000; + DB 5 ;; number of entries ;AN000; + DB 41,07Ch ;; ;AN000; + DB 3,'"' ;; " ;AN000; + DB 4,09CH ;; ;AN000; + DB 40,'@' ;; at sign ;AN000; + DB 43,07EH ;; ~ ;AN000; +COM_NA_UP_T1_K3_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Size of xlat table - null table ;AN000; + ;; ;AN000; +COM_NA_UP_K3_END: ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: COMMON ;AN000; +;; STATE: Third Shift ;AN000; +;; KEYBOARD TYPES: G_KB+P ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW COM_THIRD_K1_END-$ ;; length of state section ;AN000; + DB THIRD_SHIFT ;; State ID ;AN000; + DW G_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW COM_THIRD_K1_T1_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE ;; xlat options: ;AN000; + DB 8 ;; number of entries ;AN000; + DB 3,0FDH ;; SUPERSCRPIT 2 ;AN000; + DB 4,0FCH ;; SUPERSCRIPT 3 ;AN000; + DB 6,0ABH ;; ONE HALF SYMBOL ;AN000; + DB 10,0F1H ;; PLUS OR MINUS SYMBOL ;AN000; + DB 11,0F8H ;; DEGREE SYMBOL ;AN000; + DB 27,07EH ;; TILDE ;AN000; + DB 40,05EH ;; CIRCUMFLEX CARAT ;AN000; + DB 50,0E6H ;; MU ;AN000; +COM_THIRD_K1_T1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Last xlat table ;AN000; +COM_THIRD_K1_END: ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW 0 ;; Last State ;AN000; +COMMON_XLAT_END: ;; ;AN000; + ;; ;AN000; + ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;*************************************** ;AN000; +;; UK Specific Translate Section for 437 ;AN000; +;; 437 IS COMPLETELY COVERED BY THE COMMON TABLE except for vertical bars ;AN000; +;;*************************************** ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + PUBLIC UK1_437_XLAT ;; ;AN000; +UK1_437_XLAT: ;; ;AN000; + ;; ;AN000; + DW CP437_XLAT_END-$ ;; length of section ;AN000; + DW 437 ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: CP437 ;AN000; +;; STATE: Third Shift ;AN000; +;; KEYBOARD TYPES: P12_KB ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW CP437_THIRD_PK1_END-$ ;; length of state section ;AN000; + DB THIRD_SHIFT ;; State ID ;AN000; + DW P12_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW CP437_THIRD_PK1_T1_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE ;; xlat options: ;AN000; + DB 1 ;; number of entries ;AN000; + DB 41,0DDH ;; Solid vertical bar - graphics block ;AN000; + CP437_THIRD_PK1_T1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Last xlat table ;AN000; + CP437_THIRD_PK1_END: ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: CP437 ;AN000; +;; STATE: Non-Alpha Upper Case ;AN000; +;; KEYBOARD TYPES: G_KB ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW CP437_NA_UP_K1_END-$ ;; length of state section ;AN000; + DB NON_ALPHA_UPPER ;; State ID ;AN000; + DW G_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW CP437_NA_UP_T1_K1_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE ;; xlat options: ;AN000; + DB 2 ;; number of entries ;AN000; + DB 41,0DDh ;; GRAPHICS vertical bar ;AN000; + DB 13,"" ;; may change current codepoint = 192(c4);AN000; +CP437_NA_UP_T1_K1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Size of xlat table - null table ;AN000; + ;; ;AN000; +CP437_NA_UP_K1_END: ;; ;AN000; + ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: CP437 ;AN000; +;; STATE: Non-Alpha Upper Case ;AN000; +;; KEYBOARD TYPES: P12_KB ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW CP437_NA_UP_PK1_END-$ ;; length of state section ;AN000; + DB NON_ALPHA_UPPER ;; State ID ;AN000; + DW P12_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW CP437_NA_UP_PT1_K1_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE ;; xlat options: ;AN000; + DB 1 ;; number of entries ;AN000; + DB 86,07ch ;; vertical bar ;AN000; +CP437_NA_UP_PT1_K1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Size of xlat table - null table ;AN000; + ;; ;AN000; +CP437_NA_UP_PK1_END: ;; ;AN000; + ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: CP437 ;AN000; +;; STATE: Non-Alpha LOWER Case ;AN000; +;; KEYBOARD TYPES: G_KB ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW CP437_NA_LO_K1_END-$ ;; length of state section ;AN000; + DB NON_ALPHA_LOWER ;; State ID ;AN000; + DW G_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW CP437_NA_LO_T1_K1_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE ;; xlat options: ;AN000; + DB 1 ;; number of entries ;AN000; + DB 86,07Ch ;; SOLID(PIPING)VERTICAL bar ;AN000; +CP437_NA_LO_T1_K1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Size of xlat table - null table ;AN000; + ;; ;AN000; +CP437_NA_LO_K1_END: ;; ;AN000; + ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + DW 0 ;; LAST STATE ;AN000; + ;; ;AN000; +CP437_XLAT_END: ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;*************************************** ;AN000; +;; UK Specific Translate Section for 850 ;AN000; +;;*************************************** ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + PUBLIC UK1_850_XLAT ;; ;AN000; +UK1_850_XLAT: ;; ;AN000; + ;; ;AN000; + DW CP850_XLAT_END-$ ;; length of section ;AN000; + DW 850 ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: CP850 ;AN000; +;; STATE: Third Shift ;AN000; +;; KEYBOARD TYPES: P12_KB ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW CP850_THIRD_PK1_END-$ ;; length of state section ;AN000; + DB THIRD_SHIFT ;; State ID ;AN000; + DW P12_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW CP850_THIRD_PK1_T1_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE ;; xlat options: ;AN000; + DB 1 ;; number of entries ;AN000; + DB 41,07CH ;; Solid vertical bar - | ;AN000; + CP850_THIRD_PK1_T1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Last xlat table ;AN000; + CP850_THIRD_PK1_END: ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: Common ;AN000; +;; STATE: Non-Alpha Upper Case ;AN000; +;; KEYBOARD TYPES: G_KB ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW CP850_NA_UP_K1_END-$ ;; length of state section ;AN000; + DB NON_ALPHA_UPPER ;; State ID ;AN000; + DW G_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW CP850_NA_UP_T1_K1_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE ;; xlat options: ;AN000; + DB 2 ;; number of entries ;AN000; + DB 41,07Ch ;; SOLID vertical (PIPING) ;AN000; + DB 13,0EEH ;; OVERSCORE SYMBOL ;AN000; +CP850_NA_UP_T1_K1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Size of xlat table - null table ;AN000; + ;; ;AN000; +CP850_NA_UP_K1_END: ;; ;AN000; + ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: Common ;AN000; +;; STATE: Non-Alpha Upper Case ;AN000; +;; KEYBOARD TYPES: P12_KB ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW CP850_NA_UP_PK1_END-$ ;; length of state section ;AN000; + DB NON_ALPHA_UPPER ;; State ID ;AN000; + DW P12_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW CP850_NA_UP_T1_PK1_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE ;; xlat options: ;AN000; + DB 1 ;; number of entries ;AN000; + DB 86,0DDh ;; broken vertical ;AN000; +CP850_NA_UP_T1_PK1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Size of xlat table - null table ;AN000; + ;; ;AN000; +CP850_NA_UP_PK1_END: ;; ;AN000; + ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +;; CODE PAGE: Common ;AN000; +;; STATE: Non-Alpha LOWER Case ;AN000; +;; KEYBOARD TYPES: G_KB ;AN000; +;; TABLE TYPE: Translate ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; + DW CP850_NA_LO_K1_END-$ ;; length of state section ;AN000; + DB NON_ALPHA_LOWER ;; State ID ;AN000; + DW G_KB ;; Keyboard Type ;AN000; + DB -1,-1 ;; Buffer entry for error character ;AN000; + ;; ;AN000; + DW CP850_NA_LO_T1_K1_END-$ ;; Size of xlat table ;AN000; + DB STANDARD_TABLE ;; xlat options: ;AN000; + DB 1 ;; number of entries ;AN000; + DB 86,0DDh ;; broken vertical ;AN000; +CP850_NA_LO_T1_K1_END: ;; ;AN000; + ;; ;AN000; + DW 0 ;; Size of xlat table - null table ;AN000; + ;; ;AN000; +CP850_NA_LO_K1_END: ;; ;AN000; + ;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; + DW 0 ;; LAST STATE ;AN000; + ;; ;AN000; +CP850_XLAT_END: ;; ;AN000; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000; +CODE ENDS ;; ;AN000; + END ;; ;AN000; diff --git a/v4.0/src/DEV/KEYBOARD/KEYBMAC.INC b/v4.0/src/DEV/KEYBOARD/KEYBMAC.INC new file mode 100644 index 0000000..8f1b108 --- /dev/null +++ b/v4.0/src/DEV/KEYBOARD/KEYBMAC.INC @@ -0,0 +1,323 @@ +.XLIST +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DOS - - NLS Support - Keyboard Definition File +;; (C) Copyright 1988 Microsoft +;; +;; File Name: KEYBMAC.INC +;; ---------- +;; +;; Description: +;; ------------ +;; Include file containing macros for the Keyboard Definition File. +;; +;; Change History: +;; --------------- +;; +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Dead key flags +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +ACUTE EQU 80H ;; NLS_FLAG_1 +GRAVE EQU 40H ;; +DIARESIS EQU 20H ;; +CIRCUMFLEX EQU 10H ;; +CEDILLA EQU 08H ;; +TILDE EQU 04H ;; + ;; NLS_FLAG_2 : nothing defined yet + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; State IDs +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +DEAD_LOWER EQU 1 ;; dead keys on lower shift +DEAD_UPPER EQU 2 ;; +ALPHA_LOWER EQU 3 ;; +ALPHA_UPPER EQU 4 ;; +NON_ALPHA_LOWER EQU 5 ;; +NON_ALPHA_UPPER EQU 6 ;; +THIRD_SHIFT EQU 7 ;; +ACUTE_LOWER EQU 8 ;; +ACUTE_UPPER EQU 9 ;; +ACUTE_SPACE EQU 10 ;; +GRAVE_LOWER EQU 11 ;; +GRAVE_UPPER EQU 12 ;; +GRAVE_SPACE EQU 13 ;; +DIARESIS_LOWER EQU 14 ;; +DIARESIS_UPPER EQU 15 ;; +DIARESIS_SPACE EQU 16 ;; +CIRCUMFLEX_LOWER EQU 17 ;; +CIRCUMFLEX_UPPER EQU 18 ;; +CIRCUMFLEX_SPACE EQU 19 ;; +CEDILLA_LOWER EQU 20 ;; +CEDILLA_UPPER EQU 21 ;; +CEDILLA_SPACE EQU 22 ;; +CEDILLA_CEDILLA EQU 23 ;; +DEAD_THIRD EQU 24 ;; +ACUTE_ACUTE EQU 25 ;; +GRAVE_GRAVE EQU 26 ;; +DIARESIS_DIARESIS EQU 27 ;; +CIRCUMFLEX_CIRCUMFLEX EQU 28 ;; +FOURTH_SHIFT EQU 29 ;; +DEAD_FOURTH EQU 30 ;; +TILDE_LOWER EQU 31 ;; +TILDE_UPPER EQU 32 ;; +TILDE_SPACE EQU 33 ;; +ALT_CASE EQU 34 ;; +CTRL_CASE EQU 35 ;; +NUMERIC_PAD EQU 36 ;; +DIVIDE_SIGN EQU 37 ;; +BOTLH_CAPS EQU 38 ;; +BOTRH_CAPS EQU 39 ;; +BOTLH_F_CAPS EQU 40 ;; +BOTRH_F_CAPS EQU 41 ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Logic Macros +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + +UNKNOWN = 255 + +FIND_FLAG MACRO FLAG_MASK + IFIDN , + FLAG_ID = EXT_KB_FLAG_ID + ELSE + IFIDN , + FLAG_ID = EXT_KB_FLAG_ID + ELSE + IFIDN , + FLAG_ID = KB_FLAG_ID + ELSE + IFIDN , + FLAG_ID = KB_FLAG_ID + ELSE + IFIDN , + FLAG_ID = EXT_KB_FLAG_ID + ELSE + IFIDN , + FLAG_ID = EXT_KB_FLAG_ID + ELSE + IFIDN , + FLAG_ID = KB_FLAG_ID + ELSE + IFIDN , + FLAG_ID = KB_FLAG_ID + ELSE + IFIDN , + FLAG_ID = KB_FLAG_ID + ELSE + IFIDN , + FLAG_ID = KB_FLAG_ID + ELSE + IFIDN , + FLAG_ID = KB_FLAG_3_ID + ELSE + IFIDN , + FLAG_ID = KB_FLAG_3_ID + ELSE + IFIDN , + FLAG_ID = NLS_FLAG_1_ID + ELSE + IFIDN , + FLAG_ID = NLS_FLAG_1_ID + ELSE + IFIDN , + FLAG_ID = NLS_FLAG_1_ID + ELSE + IFIDN , + FLAG_ID = NLS_FLAG_1_ID + ELSE + IFIDN , + FLAG_ID = NLS_FLAG_1_ID + ELSE + IFIDN , + FLAG_ID = NLS_FLAG_1_ID + ELSE + IFIDN , + FLAG_ID = KB_FLAG_3_ID + ELSE + FLAG_ID = UNKNOWN + ENDIF + ENDIF + ENDIF + ENDIF + ENDIF + ENDIF + ENDIF + ENDIF + ENDIF + ENDIF + ENDIF + ENDIF + ENDIF + ENDIF + ENDIF + ENDIF + ENDIF + ENDIF + ENDIF + ENDM + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +FLAG MACRO FLAG_MASK + FIND_FLAG FLAG_MASK + IF (FLAG_ID EQ UNKNOWN) + IF2 + %OUT Unknown parameter FLAG_MASK on FLAG MACRO + ENDIF + ELSE + DB FLAG_ID + DB FLAG_MASK + ENDIF + ENDM + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +IFF MACRO FLAG_MASK,MASK_TYPE + MAC_OK = 1 + IFB + NOT_BIT = 00000000B + ELSE + IFIDN , + NOT_BIT = 00001000B + ELSE + MAC_OK = 0 + IF2 + %OUT Unknown parameter MASK_TYPE on IFF MACRO + ENDIF + ENDIF + ENDIF + IF MAC_OK + FIND_FLAG FLAG_MASK + IF (FLAG_ID EQ UNKNOWN) + IF2 + %OUT Unknown parameter FLAG_MASK on IFF MACRO + ENDIF + ELSE + DB IFF_COMMAND+NOT_BIT+FLAG_ID + DB FLAG_MASK + ENDIF + ENDIF + ENDM + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +IFKBD MACRO SYS + DB IFKBD_COMMAND + DW SYS + ENDM + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +ANDF MACRO FLAG_MASK,MASK_TYPE + MAC_OK = 1 + IFB + NOT_BIT = 00000000B + ELSE + IFIDN , + NOT_BIT = 00001000B + ELSE + MAC_OK = 0 + IF2 + %OUT Unknown parameter MASK_TYPE on ANDF MACRO + ENDIF + ENDIF + ENDIF + IF MAC_OK + FIND_FLAG FLAG_MASK + IF (FLAG_ID EQ UNKNOWN) + IF2 + %OUT Unknown parameter FLAG_MASK on ANDF MACRO + ENDIF + ELSE + DB ANDF_COMMAND+NOT_BIT+FLAG_ID + DB FLAG_MASK + ENDIF + ENDIF + ENDM + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +ELSEF MACRO + DB ELSEF_COMMAND + ENDM + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +ENDIFF MACRO + DB ENDIFF_COMMAND + ENDM + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +XLATT MACRO STATE + DB XLATT_COMMAND + DB STATE + ENDM + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +PUT_ERROR_CHAR MACRO STATE + DB PUT_ERROR_COMMAND + DB STATE + ENDM + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +OPTION MACRO MASK,MASK_TYPE + MAC_OK = 1 + IFB + NOT_BIT = 00000000B + ELSE + IFIDN , + NOT_BIT = 00001000B + ELSE + MAC_OK = 0 + IF2 + %OUT Unknown parameter MASK_TYPE on OPTION MACRO + ENDIF + ENDIF + ENDIF + IF MAC_OK + DB OPTION_COMMAND+NOT_BIT + DB MASK + ENDIF + ENDM + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +SET_FLAG MACRO STATE + DB SET_FLAG_COMMAND + DB STATE + ENDM + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +RESET_NLS MACRO + DB RESET_NLS_COMMAND + ENDM + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +BEEP MACRO + DB BEEP_COMMAND + ENDM + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +GOTO MACRO GOTO_OFFSET + DB GOTO_COMMAND + DW GOTO_OFFSET-$-2 + ENDM + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +EXIT_INT_9 MACRO + DB GOTO_COMMAND+EXIT_INT_9_FLAG + DW 0 + ENDM + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +EXIT_STATE_LOGIC MACRO + DB GOTO_COMMAND+EXIT_STATE_LOGIC_FLAG + DW 0 + ENDM + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +CHECK_FOR_CORE_KEY MACRO + DB CHECK_CORE_COMMAND + ENDM + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +.LIST diff --git a/v4.0/src/DEV/KEYBOARD/KEYBOARD.LNK b/v4.0/src/DEV/KEYBOARD/KEYBOARD.LNK new file mode 100644 index 0000000..3b52fd0 --- /dev/null +++ b/v4.0/src/DEV/KEYBOARD/KEYBOARD.LNK @@ -0,0 +1,6 @@ +kdfnow.OBJ+KDFSP.OBJ+KDFPO.OBJ+KDFFR120.obj+kdffr189.obJ+KDFDK.OBJ+ +KDFSG.OBJ+KDFGE.OBJ+KDFIT141.OBJ+KDFIT142.OBJ+KDFUK166.OBJ+KDFUK168.OBJ+ +KDFSF.OBJ+KDFBE.OBJ+KDFNL.OBJ+KDFNO.OBJ+KDFCF.OBJ+ +kdfsv.obj+KDFLA.OBJ+kdfeof.OBJ +KEYBOARD.EXE; + \ No newline at end of file diff --git a/v4.0/src/DEV/KEYBOARD/KEYBSHAR.INC b/v4.0/src/DEV/KEYBOARD/KEYBSHAR.INC new file mode 100644 index 0000000..d7ac257 --- /dev/null +++ b/v4.0/src/DEV/KEYBOARD/KEYBSHAR.INC @@ -0,0 +1,304 @@ +.XLIST + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; DOS - - NLS Support - KEYB Command +;; (C) Copyright 1988 Microsoft +;; +;; File Name: KEYBSHAR.INC +;; ---------- +;; +;; Description: +;; ------------ +;; Include file containing structure definitions Shared Data Area +;; for the Shared Data Area. +;; The Shared Data Area contains data which is required by +;; both the resident and transient KEYB code. The Shared +;; Data Area is allocated in the KEYBI2F file and will be +;; resident following initial installation. +;; +;; Change History: +;; --------------- +;; +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; SHARED_DATA_STR defines the initial fixed length portion of the +;; Shared Data Area. +;; Tables are loaded beginning at TABLE_AREA in the following order: +;; State Logic +;; Common Translate Section +;; Specific Translate Sections for +;; each code page +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; SPECIAL_FEATURES equates: +TYPEWRITER_CAPS_LK EQU 8000H ;; typewriter style caps lock +JR_HOT_KEY_1_2 EQU 4000H ;; on PCjr use 1/2 as the hot keys + ;; instead of F1/F2 + ;; + ;; Some useful scan codes: +F1_SCAN EQU 59 ;; F1 +F2_SCAN EQU 60 ;; F2 +ONE_SCAN EQU 2 ;; "1" +TWO_SCAN EQU 3 ;; "2" + ;; + ;; SYSTEM_FLAG equates: +EXT_16 EQU 8000H ;; extended int16 support is there +PC_AT EQU 4000H ;; code for pcat +PC_LAP EQU 2000H ;; code for pc lap computer (p-12) +PC_XT EQU 1000H ;; code for PC, PC/XT, PORTABLE +PC_JR EQU 0800H ;; code for PCjr +PC_PAL EQU 0400H ;; code for ??? +PC_386 EQU 0200H ;; code for ??? +PC_NET EQU 0100H ;; PC Net is installed + ;; + ;; HOT_KEY_FLAG EQUATES: +US_MODE EQU 0 ;; hot key is active => US +LANG_MODE EQU 0FFH ;; hot key is inactive + ;; + ;; ----------------------------------- +SHARED_DATA_STR STRUC ;; SHARED DATA AREA + ;; +OLD_INT_9 DD 0 ;; saved int 9 vector +OLD_INT_2F DD 0 ;; saved int 2F vector +OLD_INT_48 DD 0 ;; saved int 48 vector (if PCjr) +KEYB_TYPE DW 0 ;; type of keyboard +SYSTEM_FLAG DW 0 ;; system configuration flags +TABLE_OK DB 0 ;; flag to INT 9 that table is built +JR_KB_FLAG DB 0 ;; flag for special PCjr processing + DB 4 DUP(0) ;; reserved + ;; + ;; Table copy begins here: +ACTIVE_LANGUAGE DB 'US' ;; language code +INVOKED_CP_TABLE DW 437 ;; ptr to table for invoked code page +ACTIVE_XLAT_PTR DW -1 ;; ptr to active Specific Translate Sect +FIRST_XLAT_PTR DW -1 ;; ptr to first Specific Translate Sect +RESIDENT_END DW 0ffffh ;; offset of last byte in resident mem +LOGIC_PTR DW -1 ;; ptr to State Logic +COMMON_XLAT_PTR DW -1 ;; ptr to Common Translate Section +SPECIAL_FEATURES DW ? ;; special Features +TABLE_OVERFLOW DB 0 ;; overflow flag for table rebuild +HOT_KEY_ON_SCAN DB ? ;; scan codes to use with ALT+CTRL +HOT_KEY_OFF_SCAN DB ? ;; to turn hot key on and off + DB 4 DUP(0) ;; reserved +TABLE_AREA DB ? ;; tables loaded here: + ;; State Logic + ;; Common Translate Section + ;; Specific Translate Sections for + ;; each code page +SHARED_DATA_STR ENDS ;; + ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; State Logic equates. +;; Contains equates for our NLS Flags and for the State Logic +;; commands. +;; State Logic command macros are defined in KEYBMAC.INC +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +STATE_LOGIC_STR STRUC ;; + ;; +SL_LOGIC_LEN DW ? ;; length of state logic +SL_SPECIAL_FEATURES DW ? ;; +SL_LOGIC_CMDS DB 0 ;; state logic commands begin here + ;; +STATE_LOGIC_STR ENDS ;; + ;; + ;; +NUM_BIOS_FLAGS EQU 4 ;; +NUM_NLS_FLAGS EQU 2 ;; '+1' below is the EXT_KB_FLAG +NUM_FLAGS EQU NUM_BIOS_FLAGS+NUM_NLS_FLAGS+1 + ;; + ;; +EITHER_SHIFT EQU 80H ;; EXT_KB_FLAG : our own shift state +EITHER_CTL EQU 40H ;; flags +EITHER_ALT EQU 20H ;; +SCAN_MATCH EQU 08H ;; set if scan code found in XLATT + ;; or SET_FLAG searches + ;; + ;; +KB_FLAG_ID EQU 0 ;; Flag ID's as coded in IFF and ANDF +KB_FLAG_1_ID EQU 1 ;; commands +KB_FLAG_2_ID EQU 2 ;; +KB_FLAG_3_ID EQU 3 ;; +EXT_KB_FLAG_ID EQU 4 ;; +NLS_FLAG_1_ID EQU 5 ;; +NLS_FLAG_2_ID EQU 6 ;; + ;; +COMMAND_BITS EQU 0F0H ;; Mask to isolate command code +SUB_CMD_BITS EQU 0FH ;; mask to isolate sub command code +NOT_TEST EQU 08H ;; NOT bit in IFF, ANDF +COMMAND_SHIFT EQU 4 ;; shift amount for command code +FLAG_ID_BITS EQU 07H ;; mask to isolate flag id in IFF, ANDF +NUM_COMMANDS EQU 0CH ;; number of commands + ;; +IFF_COMMAND EQU 00H ;; +ANDF_COMMAND EQU 10H ;; +ELSEF_COMMAND EQU 20H ;; +ENDIFF_COMMAND EQU 30H ;; +XLATT_COMMAND EQU 40H ;; +OPTION_COMMAND EQU 50H ;; +SET_FLAG_COMMAND EQU 60H ;; +PUT_ERROR_COMMAND EQU 70H ;; +IFKBD_COMMAND EQU 80H ;; +GOTO_COMMAND EQU 90H ;; +BEEP_COMMAND EQU 0A0H ;; +RESET_NLS_COMMAND EQU 0B0H ;; +CHECK_CORE_COMMAND EQU 0C0H ;; + ;; + ;; +EXIT_INT_9_FLAG EQU 01H ;; Special forms of GOTO. These +EXIT_STATE_LOGIC_FLAG EQU 02H ;; values are in the right nibble + ;; of the GOTO command. + ;; + ;; PROCESSING OPTIONS: +EXIT_IF_FOUND EQU 80H ;; exit INT 9 if a translation + ;; match is found + ;; +ANY_KB EQU 0FFFFH ;; +JR_KB EQU 8000H ;; Keyboard types +XT_KB EQU 4000H ;; +AT_KB EQU 2000H ;; +G_KB EQU 1000H ;; +P_KB EQU 0800H ;; +P12_KB EQU 0400H ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Translate Table Sections. Both the Specific and Common +;; Translate Sections are formatted as follows. +;; +;; The Specific Translate Sections are chained together using the +;; XS_NEXT_SECT_PTR field (-1 if last section). +;; Translate Sections contains multiple States. +;; A State contains the translate tables for a single +;; shift state (IE lower case, upper case ....) +;; Each State may contain multiple translate tables. +;; +;; The Translate Section layout is defined using several STRUCs. +;; These STRUCs are allocated in the Shared Data Area as follows: +;; +;; XLAT_SECT_STR ; header info for the section +;; STATE_STR ; header for state #1 +;; XLAT_STR ; first translate tab for state #1 +;; XLAT_TYPE_1_STR or XLAT_TYPE_2_STR +;; XLAT_STR ; second translate tab +;; XLAT_TYPE_1_STR or XLAT_TYPE_2_STR +;; ... +;; STATE_STR ; header for state #2 +;; XLAT_STR +;; XLAT_TYPE_1_STR or XLAT_TYPE_2_STR +;; ... +;; ... +;; +;; A State may contain a "Set_Flag" table instead of translate tables. +;; These tables are used to set the NLS flags instead of generating +;; ASCII codes (for example: to remember dead key states). +;; There can be only on Set_Flag table per state. +;; The Set_Flag table layout is defined in the SET_FLAG_STR STRUC. +;; +;; So some states will contain translate tables (to generate ASCII codes) +;; and some states will contain a Set_Flag table (to record dead key +;; status). +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +XLAT_SECT_STR STRUC ;; + ;; +XS_NEXT_SECT_PTR DW ? ;; Pointer to next Specific Translate + ;; Section +XS_CP_ID DW ? ;; code page id +XS_FIRST_STATE DB ? ;; + ;; +XLAT_SECT_STR ENDS ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; State structure. +;; The last State is a null State containing only the +;; XS_STATE_LEN field with a value of 0. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +STATE_STR STRUC ;; + ;; +XS_STATE_LEN DW ? ;; length of state section +XS_STATE_ID DB ? ;; State ID +XS_KBD_TYPE DW ? ;; Keyboard Type +XS_ERROR_CHAR DW ? ;; Buffer entry for error character +XS_FIRST_TAB DB ? ;; + ;; +STATE_STR ENDS ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Translate Table structures. +;; There may be many translate tables in a State. The last +;; table is a null table containing only the XLAT_TAB_SIZE field with +;; a value of 0. +;; The xlate table can be in one of two forms: +;; Type 1 = Table contains buffer entries only. +;; Scan code is used as an index into xlat table +;; Type 2 = Table contains pairs of SCAN/BUFFER_ENTRY. +;; Table must be searched for matching scan. +;; Type 1 is the default. Type 2 tables should be identified by setting +;; the TYPE_2_TAB bit in XLAT_OPTIONS. +;; Buffer entries default to 2-bytes per entry. +;; Optionally the table may contain ASCII codes only +;; (1-byte entries). This is specified by setting the ASCII_ONLY bit +;; in XLAT_OPTIONS. 2-byte buffer entries are coded ASCII,SCAN. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; Translate options: +ASCII_ONLY EQU 80H ;; Only ASCII codes listed - use + ;; incoming scan for buffer entry +TYPE_2_TAB EQU 40H ;; search xlat table for matching scan +ZERO_SCAN EQU 20H ;; set the scan half of the buffer + ;; entry to 0 + ;; +NULL_ASCII_CODE EQU -1 ;; + ;; +DEFAULT_TAB_2_ENT_SZ EQU 3 ;; +ASC_ONLY_TAB_2_ENT_SZ EQU 2 ;; + ;; + ;; +XLAT_STR STRUC ;; + ;; +XLAT_TAB_SIZE DW ? ;; Size in bytes of this table - + ;; includes this field, options etc. +XLAT_OPTIONS DB ? ;; xlat options + ;; XLAT TABLE IS HERE +XLAT_STR ENDS ;; + ;; +XLAT_TYPE_1_STR STRUC ;; use scan code as index into table + DB TYPE XLAT_STR DUP(?) ;; filler +XLAT_SCAN_LO DB ? ;; Scan code +XLAT_SCAN_HI DB ? ;; range +XLAT_1_BUF_ENTRY DB ? ;; The table itself +XLAT_TYPE_1_STR ENDS ;; + ;; +XLAT_TYPE_2_STR STRUC ;; search table for scan + DB TYPE XLAT_STR DUP(?) ;; filler +XLAT_NUM DB ? ;; number of scans +XLAT_SCAN DB ? ;; Scan code +XLAT_2_BUF_ENTRY DB ? ;; The table itself +XLAT_TYPE_2_STR ENDS ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Set_Flag Tables. +;; State Sections immediately following the LAST_ENTRYs. +;; Dead key definitions. If the scan matches then +;; set the bit in NLS_FLAGs indicated in DK_MASK +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +SF_ENT_SZ EQU 3 ;; size of entry + ;; +SET_FLAG_STR STRUC ;; + ;; +SF_NUM DB 0 ;; Number of entries +SF_SCAN_CODE DB 0 ;; scan code +SF_FLAG_ID DB 0 ;; flag id +SF_FLAG_MASK DB 0 ;; flag mask + ;; +SET_FLAG_STR ENDS ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +.LIST diff --git a/v4.0/src/DEV/KEYBOARD/MAKEFILE b/v4.0/src/DEV/KEYBOARD/MAKEFILE new file mode 100644 index 0000000..5bdd36f --- /dev/null +++ b/v4.0/src/DEV/KEYBOARD/MAKEFILE @@ -0,0 +1,59 @@ +#*************************** Makefile for Bios ************************ + +msg =..\..\msg +dos =..\..\dos +inc =..\..\inc + +# +###################### Dependencies begin here ######################### +# + +all: keyboard.sys + +kdfnow.obj: kdfnow.asm keybmac.inc keybshar.inc $(inc)\postequ.inc + +kdffr120.obj: kdffr120.asm keybmac.inc keybshar.inc $(inc)\postequ.inc + +kdffr189.obj: kdffr189.asm keybmac.inc keybshar.inc $(inc)\postequ.inc + +kdfeof.obj: kdfeof.asm keybmac.inc keybshar.inc $(inc)\postequ.inc + +kdfuk166.obj: kdfuk166.asm keybmac.inc keybshar.inc $(inc)\postequ.inc + +kdfuk168.obj: kdfuk168.asm keybmac.inc keybshar.inc $(inc)\postequ.inc + +kdfit141.obj: kdfit141.asm keybmac.inc keybshar.inc $(inc)\postequ.inc + +kdfit142.obj: kdfit142.asm keybmac.inc keybshar.inc $(inc)\postequ.inc + +kdfge.obj: kdfge.asm keybmac.inc keybshar.inc $(inc)\postequ.inc + +kdfsp.obj: kdfsp.asm keybmac.inc keybshar.inc $(inc)\postequ.inc + +kdfnl.obj: kdfnl.asm keybmac.inc keybshar.inc $(inc)\postequ.inc + +kdfno.obj: kdfno.asm keybmac.inc keybshar.inc $(inc)\postequ.inc + +kdfdk.obj: kdfdk.asm keybmac.inc keybshar.inc $(inc)\postequ.inc + +kdfsg.obj: kdfsg.asm keybmac.inc keybshar.inc $(inc)\postequ.inc + +kdfsf.obj: kdfsf.asm keybmac.inc keybshar.inc $(inc)\postequ.inc + +kdfpo.obj: kdfpo.asm keybmac.inc keybshar.inc $(inc)\postequ.inc + +kdfbe.obj: kdfbe.asm keybmac.inc keybshar.inc $(inc)\postequ.inc + +kdfcf.obj: kdfcf.asm keybmac.inc keybshar.inc $(inc)\postequ.inc + +kdfla.obj: kdfla.asm keybmac.inc keybshar.inc $(inc)\postequ.inc + +kdfsv.obj: kdfsv.asm keybmac.inc keybshar.inc $(inc)\postequ.inc + +keyboard.sys: kdfsp.obj kdfpo.obj kdffr120.obj kdffr189.obj kdfdk.obj \ + kdfsg.obj kdfge.obj kdfit141.obj kdfit142.obj kdfuk166.obj \ + kdfsf.obj kdfbe.obj kdfnl.obj kdfno.obj kdfcf.obj \ + kdfla.obj kdfsv.obj kdfeof.obj kdfnow.obj kdfuk168.obj + link @keyboard.lnk + exe2bin keyboard.exe keyboard.sys + del keyboard.exe diff --git a/v4.0/src/DEV/MAKEFILE b/v4.0/src/DEV/MAKEFILE new file mode 100644 index 0000000..502cf51 --- /dev/null +++ b/v4.0/src/DEV/MAKEFILE @@ -0,0 +1,31 @@ +#************************** DEV root level Makefile *********************** + +make =nmake + +all: + cd country + $(make) + cd ..\ansi + $(make) + cd ..\keyboard + $(make) + cd ..\display + $(make) + cd ..\printer + $(make) + cd ..\driver + $(make) + cd ..\ramdrive + $(make) + cd ..\smartdrv + $(make) + cd ..\xma2ems + $(make) + cd ..\vdisk + $(make) + cd ..\xmaem + $(make) + cd .. + + + diff --git a/v4.0/src/DEV/PRINTER/4201/4201.CPI b/v4.0/src/DEV/PRINTER/4201/4201.CPI new file mode 100644 index 0000000..7b16921 Binary files /dev/null and b/v4.0/src/DEV/PRINTER/4201/4201.CPI differ diff --git a/v4.0/src/DEV/PRINTER/4201/4201.INC b/v4.0/src/DEV/PRINTER/4201/4201.INC new file mode 100644 index 0000000..7c82aa8 --- /dev/null +++ b/v4.0/src/DEV/PRINTER/4201/4201.INC @@ -0,0 +1,801 @@ + db 0FFH,046H,04FH,04EH,054H,020H,020H,020H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 001H,000H,001H,017H,000H,000H,000H,005H + db 000H,01CH,000H,035H,000H,000H,000H,002H + db 000H,034H,032H,030H,031H,020H,020H,020H + db 020H,05FH,003H,000H,000H,000H,000H,000H + db 000H,0A5H,000H,000H,000H,01CH,000H,051H + db 000H,000H,000H,002H,000H,034H,032H,030H + db 031H,020H,020H,020H,020H,0B5H,001H,000H + db 000H,000H,000H,000H,000H,064H,006H,000H + db 000H,01CH,000H,06DH,000H,000H,000H,002H + db 000H,034H,032H,030H,031H,020H,020H,020H + db 020H,05CH,003H,000H,000H,000H,000H,000H + db 000H,087H,006H,000H,000H,01CH,000H,089H + db 000H,000H,000H,002H,000H,034H,032H,030H + db 031H,020H,020H,020H,020H,061H,003H,000H + db 000H,000H,000H,000H,000H,045H,00BH,000H + db 000H,01CH,000H,000H,000H,000H,000H,002H + db 000H,034H,032H,030H,031H,020H,020H,020H + db 020H,052H,003H,000H,000H,000H,000H,000H + db 000H,04FH,00CH,000H,000H,001H,000H,001H + db 000H,0B9H,005H,001H,000H,00CH,000H,005H + db 01BH,049H,000H,01BH,036H,005H,01BH,049H + db 004H,01BH,036H,01BH,03DH,001H,000H,015H + db 01BH,03DH,000H,000H,01BH,049H,004H,000H + db 01BH,03DH,029H,000H,014H,084H,000H,009H + db 04EH,014H,084H,0A4H,0A4H,0A4H,084H,014H + db 04EH,000H,000H,000H,009H,004H,00AH,02AH + db 0AAH,06AH,02AH,02AH,01CH,002H,000H,000H + db 000H,009H,0C0H,0A0H,0A0H,0FEH,080H,080H + db 080H,080H,0FEH,000H,000H,000H,000H,01BH + db 03DH,077H,000H,014H,08DH,000H,009H,00AH + db 00AH,00AH,00AH,00AH,00AH,00AH,00AH,00AH + db 000H,000H,000H,009H,00EH,014H,024H,0A4H + db 064H,024H,024H,014H,00EH,000H,000H,000H + db 017H,000H,050H,0AAH,0AAH,0AAH,0AAH,0AAH + db 014H,000H,000H,000H,000H,009H,03EH,02AH + db 02AH,02AH,06AH,0AAH,02AH,022H,022H,000H + db 000H,000H,009H,03EH,02AH,02AH,0AAH,06AH + db 02AH,02AH,022H,022H,000H,000H,000H,009H + db 03EH,02AH,06AH,0AAH,0AAH,0AAH,06AH,022H + db 022H,000H,000H,000H,008H,04CH,012H,092H + db 092H,092H,012H,052H,00CH,000H,000H,000H + db 000H,009H,03EH,0AAH,0AAH,02AH,02AH,02AH + db 0AAH,0A2H,022H,000H,000H,000H,017H,000H + db 000H,0A2H,0A2H,03EH,022H,0A2H,080H,000H + db 000H,000H,000H,000H,01BH,03DH,01CH,000H + db 014H,098H,000H,008H,05DH,022H,022H,022H + db 022H,022H,022H,05DH,000H,000H,000H,000H + db 009H,01CH,022H,062H,0A2H,0A2H,0A2H,062H + db 022H,01CH,000H,000H,000H,000H,01BH,03DH + db 01CH,000H,014H,09DH,000H,009H,03CH,002H + db 002H,082H,042H,002H,002H,002H,03CH,000H + db 000H,000H,009H,05CH,002H,082H,082H,082H + db 082H,082H,002H,05CH,000H,000H,000H,000H + db 01BH,03DH,01CH,000H,014H,0A0H,000H,025H + db 000H,000H,000H,000H,0EEH,000H,000H,000H + db 000H,000H,000H,000H,025H,000H,000H,000H + db 000H,040H,080H,000H,000H,000H,000H,000H + db 000H,000H,01BH,03DH,043H,000H,014H,0A4H + db 000H,016H,000H,080H,080H,000H,000H,080H + db 080H,000H,000H,000H,000H,080H,015H,000H + db 000H,001H,001H,005H,002H,000H,000H,000H + db 000H,000H,000H,025H,000H,000H,000H,0A8H + db 0A8H,0A8H,050H,000H,000H,000H,000H,000H + db 009H,080H,080H,080H,080H,080H,080H,080H + db 080H,080H,000H,000H,000H,016H,000H,000H + db 062H,0A2H,0BEH,0A2H,062H,000H,000H,000H + db 000H,000H,000H,01BH,03DH,00FH,000H,014H + db 0ADH,000H,00BH,0A8H,0A8H,0AAH,054H,008H + db 010H,022H,046H,08AH,002H,01FH,000H,000H + db 01BH,03DH,032H,000H,015H,084H,000H,000H + db 000H,000H,001H,000H,001H,000H,021H,000H + db 023H,002H,025H,004H,06DH,008H,025H,010H + db 034H,0A0H,024H,000H,0A4H,000H,0A4H,000H + db 0A4H,000H,024H,000H,014H,0A0H,005H,010H + db 04DH,008H,005H,004H,003H,002H,001H,000H + db 001H,000H,001H,000H,000H,000H,01BH,03DH + db 032H,000H,015H,086H,000H,000H,000H,000H + db 000H,000H,000H,000H,030H,020H,030H,020H + db 078H,071H,078H,071H,078H,0F9H,078H,0F9H + db 07FH,0FFH,000H,080H,000H,080H,000H,080H + db 000H,080H,000H,080H,07FH,0FFH,000H,081H + db 000H,081H,000H,081H,000H,081H,000H,000H + db 000H,000H,000H,000H,01BH,03DH,092H,000H + db 015H,08DH,001H,000H,000H,00AH,000H,00AH + db 000H,00AH,000H,00AH,000H,00AH,000H,00AH + db 000H,00AH,000H,00AH,000H,00AH,000H,00AH + db 000H,00AH,000H,00AH,000H,00AH,000H,00AH + db 000H,00AH,000H,00AH,000H,00AH,000H,00AH + db 000H,00AH,000H,00AH,000H,00AH,000H,00AH + db 000H,00AH,000H,000H,000H,000H,001H,000H + db 001H,000H,021H,000H,023H,002H,025H,004H + db 02DH,008H,025H,010H,0B4H,020H,024H,000H + db 024H,080H,024H,000H,064H,000H,024H,000H + db 014H,020H,005H,010H,00DH,008H,005H,004H + db 003H,002H,001H,000H,001H,000H,001H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,010H,030H + db 029H,003H,000H,009H,040H,041H,024H,001H + db 000H,081H,000H,0A5H,000H,081H,012H,080H + db 001H,082H,000H,090H,04AH,0C0H,004H,00CH + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,01BH,03DH,062H,000H,015H,091H + db 000H,000H,000H,000H,000H,000H,021H,000H + db 021H,000H,021H,000H,021H,000H,03FH,03EH + db 021H,008H,021H,008H,0A1H,008H,021H,008H + db 021H,088H,021H,008H,061H,008H,02DH,01CH + db 021H,000H,021H,000H,021H,000H,021H,000H + db 021H,000H,033H,026H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,021H,000H + db 021H,000H,021H,000H,021H,000H,03FH,03EH + db 061H,008H,021H,008H,021H,088H,021H,008H + db 0A1H,008H,0A1H,008H,0A1H,008H,02DH,01CH + db 021H,080H,021H,000H,061H,000H,021H,000H + db 021H,000H,033H,026H,000H,000H,000H,000H + db 01BH,03DH,062H,000H,015H,094H,000H,000H + db 000H,000H,000H,000H,021H,000H,021H,000H + db 021H,000H,021H,000H,0BFH,0BEH,0A1H,088H + db 0A1H,088H,021H,008H,021H,008H,021H,008H + db 021H,008H,021H,008H,02DH,01CH,0A1H,080H + db 0A1H,080H,0A1H,080H,021H,000H,021H,000H + db 033H,026H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,021H,000H,0A1H,080H,0A1H,080H + db 0A1H,080H,021H,000H,021H,000H,03FH,03EH + db 021H,000H,021H,000H,0A1H,080H,0A1H,080H + db 0A1H,080H,021H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,01BH,03DH + db 062H,000H,015H,098H,000H,000H,000H,000H + db 000H,000H,042H,000H,000H,000H,018H,054H + db 000H,028H,024H,000H,000H,000H,000H,044H + db 000H,044H,000H,044H,000H,044H,000H,044H + db 000H,044H,000H,044H,000H,000H,024H,000H + db 000H,028H,018H,054H,000H,000H,042H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,01CH,01CH + db 002H,020H,060H,002H,000H,000H,001H,0C0H + db 001H,040H,081H,040H,081H,040H,081H,040H + db 001H,040H,001H,0C0H,000H,000H,060H,002H + db 002H,020H,01CH,01CH,000H,000H,000H,000H + db 000H,000H,000H,000H,01BH,03DH,062H,000H + db 015H,09DH,000H,000H,000H,000H,020H,000H + db 020H,000H,020H,000H,03CH,03CH,022H,000H + db 020H,002H,020H,000H,081H,000H,001H,000H + db 001H,080H,001H,000H,041H,000H,001H,000H + db 001H,000H,020H,000H,020H,002H,022H,000H + db 03CH,03CH,020H,000H,020H,000H,020H,000H + db 000H,000H,000H,000H,000H,000H,020H,000H + db 020H,000H,020H,000H,03CH,03CH,022H,000H + db 060H,002H,020H,000H,001H,080H,001H,000H + db 081H,000H,081H,000H,081H,000H,001H,000H + db 001H,080H,020H,000H,060H,002H,022H,000H + db 03CH,03CH,020H,000H,020H,000H,020H,000H + db 000H,000H,01BH,03DH,062H,000H,015H,0A0H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 0E7H,0E7H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,040H,000H + db 000H,000H,000H,080H,000H,000H,080H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 01BH,03DH,0F2H,000H,015H,0A4H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,080H,080H,080H,080H + db 080H,080H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,080H,080H,080H,080H + db 080H,080H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,080H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,001H + db 001H,000H,000H,002H,002H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,008H,080H + db 000H,000H,080H,008H,0A0H,008H,0A0H,008H + db 0A0H,008H,0A0H,008H,020H,000H,008H,0A0H + db 050H,050H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,080H,000H + db 080H,000H,080H,000H,080H,000H,080H,000H + db 080H,000H,080H,000H,080H,000H,080H,000H + db 080H,000H,080H,000H,080H,000H,080H,000H + db 080H,000H,080H,000H,080H,000H,080H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,021H,000H,061H,000H,021H,000H + db 021H,080H,021H,000H,0A1H,000H,0BFH,03EH + db 0A1H,000H,021H,000H,021H,080H,021H,000H + db 061H,000H,021H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,01BH,03DH + db 032H,000H,015H,0ADH,000H,000H,010H,080H + db 080H,010H,080H,010H,080H,050H,081H,050H + db 080H,052H,002H,000H,070H,0A4H,004H,000H + db 000H,008H,008H,000H,000H,010H,010H,000H + db 002H,022H,024H,006H,008H,04AH,040H,002H + db 000H,082H,000H,002H,007H,007H,000H,002H + db 000H,002H,000H,000H,001H,000H,001H,000H + db 01DH,000H,001H,000H,00CH,000H,005H,01BH + db 049H,000H,01BH,036H,005H,01BH,049H,004H + db 01BH,036H,01BH,03DH,001H,000H,015H,01BH + db 03DH,000H,000H,01BH,049H,004H,000H,001H + db 000H,001H,000H,0B8H,004H,001H,000H,00CH + db 000H,005H,01BH,049H,000H,01BH,036H,005H + db 01BH,049H,004H,01BH,036H,01BH,03DH,001H + db 000H,015H,01BH,03DH,000H,000H,01BH,049H + db 004H,000H,01BH,03DH,029H,000H,014H,084H + db 000H,009H,044H,00AH,08AH,0AAH,0AAH,06AH + db 04AH,05CH,082H,000H,000H,000H,009H,004H + db 00AH,02AH,0AAH,06AH,02AH,02AH,01CH,002H + db 000H,000H,000H,009H,00EH,014H,024H,024H + db 064H,0A4H,024H,014H,00EH,000H,000H,000H + db 000H,01BH,03DH,0DFH,000H,014H,089H,000H + db 009H,07EH,02AH,0AAH,0AAH,0AAH,0AAH,0AAH + db 022H,062H,000H,000H,000H,009H,01CH,02AH + db 02AH,0AAH,06AH,02AH,02AH,02AH,018H,000H + db 000H,000H,016H,000H,000H,022H,022H,07EH + db 0A2H,022H,000H,000H,000H,000H,000H,00BH + db 040H,000H,09CH,0A2H,0A2H,0A2H,0A2H,0A2H + db 09CH,000H,040H,000H,016H,000H,000H,012H + db 092H,05EH,002H,002H,000H,000H,000H,000H + db 000H,009H,04EH,014H,084H,0A4H,0A4H,064H + db 044H,054H,08EH,000H,000H,000H,009H,04EH + db 014H,084H,0A4H,0A4H,0A4H,084H,014H,04EH + db 000H,000H,000H,009H,03EH,02AH,02AH,02AH + db 06AH,0AAH,02AH,022H,022H,000H,000H,000H + db 009H,00EH,014H,024H,0A4H,064H,024H,024H + db 014H,00EH,000H,000H,000H,009H,03EH,02AH + db 02AH,0AAH,06AH,02AH,02AH,022H,022H,000H + db 000H,000H,008H,04CH,012H,092H,092H,092H + db 012H,052H,00CH,000H,000H,000H,000H,008H + db 04CH,092H,092H,092H,052H,052H,052H,08CH + db 000H,000H,000H,000H,008H,00CH,012H,012H + db 092H,052H,012H,012H,00CH,000H,000H,000H + db 000H,009H,03CH,002H,002H,002H,042H,082H + db 002H,002H,03CH,000H,000H,000H,009H,01CH + db 002H,002H,082H,042H,002H,002H,01CH,002H + db 000H,000H,000H,016H,000H,000H,022H,0A2H + db 07EH,022H,022H,000H,000H,000H,000H,000H + db 008H,04CH,092H,092H,092H,052H,052H,052H + db 08CH,000H,000H,000H,000H,000H,01BH,03DH + db 00FH,000H,014H,09DH,000H,009H,03CH,002H + db 002H,082H,042H,002H,002H,002H,03CH,000H + db 000H,000H,000H,01BH,03DH,00FH,000H,014H + db 09FH,000H,008H,01CH,022H,022H,022H,062H + db 0A2H,022H,01CH,000H,000H,000H,000H,000H + db 01BH,03DH,00FH,000H,014H,0A9H,000H,008H + db 01CH,022H,022H,0A2H,062H,022H,022H,01CH + db 000H,000H,000H,000H,000H,01BH,03DH,032H + db 000H,015H,084H,000H,000H,000H,000H,000H + db 000H,000H,000H,002H,004H,044H,002H,000H + db 0A0H,001H,028H,081H,028H,081H,028H,081H + db 028H,001H,028H,001H,0A8H,001H,028H,041H + db 028H,041H,028H,040H,028H,000H,00AH,010H + db 08AH,08EH,01EH,001H,000H,001H,000H,001H + db 000H,000H,000H,01BH,03DH,032H,000H,015H + db 086H,000H,000H,000H,000H,001H,000H,001H + db 000H,021H,000H,023H,002H,025H,004H,02DH + db 008H,025H,010H,034H,020H,024H,000H,064H + db 000H,024H,000H,024H,080H,024H,000H,094H + db 020H,005H,010H,00DH,008H,005H,004H,003H + db 002H,001H,000H,001H,000H,001H,000H,000H + db 000H,01BH,03DH,032H,000H,015H,089H,000H + db 000H,000H,000H,000H,000H,021H,000H,021H + db 000H,021H,000H,021H,000H,03FH,03EH,061H + db 008H,021H,008H,021H,088H,021H,008H,0A1H + db 008H,0A1H,008H,0A1H,008H,02DH,01CH,021H + db 080H,021H,000H,061H,000H,021H,000H,021H + db 000H,033H,026H,000H,000H,000H,000H,01BH + db 03DH,062H,000H,015H,08BH,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,021H,000H,021H,000H,021H,000H,021H + db 000H,021H,000H,061H,000H,03FH,03EH,021H + db 080H,021H,000H,0A1H,000H,021H,000H,021H + db 000H,021H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,00CH,008H,000H,014H,012H + db 000H,000H,000H,040H,022H,000H,000H,021H + db 080H,021H,000H,0A1H,000H,0A1H,000H,0A1H + db 000H,021H,000H,021H,080H,000H,000H,040H + db 022H,000H,000H,012H,000H,000H,014H,00CH + db 008H,000H,000H,000H,000H,01BH,03DH,062H + db 000H,015H,08EH,000H,000H,000H,000H,001H + db 000H,001H,000H,021H,000H,023H,082H,025H + db 004H,0ADH,008H,0A5H,010H,0B4H,020H,0A4H + db 000H,0A4H,000H,024H,000H,024H,080H,024H + db 080H,014H,0A0H,005H,090H,00DH,088H,005H + db 004H,083H,002H,001H,000H,001H,000H,001H + db 000H,000H,000H,000H,000H,000H,000H,001H + db 000H,001H,000H,021H,000H,023H,002H,025H + db 004H,06DH,008H,025H,010H,034H,0A0H,024H + db 000H,0A4H,000H,0A4H,000H,0A4H,000H,024H + db 000H,014H,0A0H,005H,010H,04DH,008H,005H + db 004H,003H,002H,001H,000H,001H,000H,001H + db 000H,000H,000H,01BH,03DH,062H,000H,015H + db 091H,000H,000H,000H,000H,001H,000H,001H + db 000H,021H,000H,023H,002H,025H,004H,02DH + db 008H,025H,010H,0B4H,020H,024H,000H,024H + db 080H,024H,000H,064H,000H,024H,000H,014H + db 020H,005H,010H,00DH,008H,005H,004H,003H + db 002H,001H,000H,001H,000H,001H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,021H + db 000H,021H,000H,021H,000H,021H,000H,03FH + db 03EH,021H,008H,021H,008H,0A1H,008H,021H + db 008H,021H,088H,021H,008H,061H,008H,02DH + db 01CH,021H,000H,021H,000H,021H,000H,021H + db 000H,021H,000H,033H,026H,000H,000H,000H + db 000H,01BH,03DH,032H,000H,015H,094H,000H + db 000H,000H,000H,000H,000H,000H,000H,00CH + db 00CH,042H,010H,000H,080H,010H,002H,080H + db 000H,081H,020H,081H,020H,001H,020H,001H + db 0A0H,001H,020H,041H,020H,041H,020H,040H + db 000H,010H,002H,000H,080H,082H,010H,00CH + db 00CH,000H,000H,000H,000H,000H,000H,01BH + db 03DH,032H,000H,015H,096H,000H,000H,000H + db 000H,020H,000H,020H,000H,020H,000H,03CH + db 03CH,022H,000H,020H,002H,020H,000H,001H + db 000H,001H,000H,041H,000H,001H,000H,001H + db 080H,001H,000H,081H,000H,020H,000H,020H + db 002H,022H,000H,03CH,03CH,020H,000H,020H + db 000H,020H,000H,000H,000H,01BH,03DH,062H + db 000H,015H,098H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,021H + db 000H,021H,000H,021H,000H,0A1H,000H,021H + db 000H,021H,080H,03FH,03EH,061H,000H,021H + db 000H,021H,000H,021H,000H,021H,000H,021H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,00CH,008H,000H,014H,012H,080H,000H + db 000H,080H,022H,080H,000H,0A1H,000H,0A1H + db 000H,0A1H,000H,021H,000H,021H,080H,021H + db 080H,021H,080H,000H,080H,000H,0A2H,000H + db 000H,092H,000H,000H,014H,00CH,008H,000H + db 000H,000H,000H,01BH,03DH,032H,000H,015H + db 09DH,000H,000H,000H,000H,020H,000H,020H + db 000H,020H,000H,03CH,03CH,022H,000H,020H + db 002H,020H,000H,081H,000H,001H,000H,001H + db 080H,001H,000H,041H,000H,001H,000H,001H + db 000H,020H,000H,020H,002H,022H,000H,03CH + db 03CH,020H,000H,020H,000H,020H,000H,000H + db 000H,01BH,03DH,032H,000H,015H,09FH,000H + db 000H,000H,000H,000H,000H,00CH,008H,000H + db 014H,012H,000H,000H,000H,000H,022H,000H + db 000H,021H,000H,021H,000H,061H,000H,021H + db 000H,021H,080H,021H,000H,0A1H,000H,000H + db 000H,000H,022H,000H,000H,012H,000H,000H + db 014H,00CH,008H,000H,000H,000H,000H,01BH + db 03DH,032H,000H,015H,0A9H,000H,000H,000H + db 000H,000H,000H,00CH,008H,000H,014H,012H + db 000H,000H,000H,000H,022H,000H,000H,0A1H + db 000H,021H,000H,021H,080H,021H,000H,061H + db 000H,021H,000H,021H,000H,000H,000H,000H + db 022H,000H,000H,012H,000H,000H,014H,00CH + db 008H,000H,000H,000H,000H,001H,000H,001H + db 000H,004H,001H,001H,000H,00CH,000H,005H + db 01BH,049H,000H,01BH,036H,005H,01BH,049H + db 004H,01BH,036H,01BH,03DH,001H,000H,015H + db 01BH,03DH,000H,000H,01BH,049H,004H,000H + db 01BH,03DH,029H,000H,014H,09BH,000H,009H + db 01CH,023H,022H,026H,02AH,032H,022H,05CH + db 000H,000H,000H,000H,009H,012H,012H,07EH + db 092H,092H,082H,082H,082H,042H,000H,000H + db 000H,00AH,03AH,044H,000H,08AH,092H,0A2H + db 000H,044H,0B8H,000H,000H,000H,000H,01BH + db 03DH,032H,000H,015H,09BH,080H,000H,000H + db 000H,000H,000H,018H,018H,004H,020H,000H + db 000H,021H,004H,000H,002H,002H,040H,002H + db 044H,006H,040H,002H,048H,00AH,040H,002H + db 050H,012H,040H,002H,060H,022H,040H,060H + db 000H,020H,084H,000H,000H,004H,020H,018H + db 018H,000H,000H,000H,000H,01BH,03DH,032H + db 000H,015H,09DH,000H,000H,000H,000H,000H + db 000H,018H,018H,024H,024H,002H,040H,000H + db 001H,041H,002H,001H,000H,003H,080H,005H + db 084H,001H,088H,009H,090H,011H,080H,021H + db 0A0H,001H,0C0H,000H,080H,040H,082H,080H + db 000H,002H,040H,024H,024H,018H,018H,000H + db 000H,000H,000H,01BH,03DH,00FH,000H,014H + db 0AFH,000H,009H,05DH,022H,022H,022H,022H + db 022H,022H,05DH,000H,000H,000H,01BH,03DH + db 032H,000H,015H,0AFH,000H,000H,000H,000H + db 000H,000H,042H,000H,000H,000H,018H,054H + db 000H,028H,024H,000H,000H,000H,000H,044H + db 000H,044H,000H,044H,000H,044H,000H,044H + db 000H,044H,000H,044H,000H,000H,024H,000H + db 000H,028H,018H,054H,000H,000H,042H,000H + db 000H,000H,000H,000H,000H,000H,000H,001H + db 000H,001H,000H,0AFH,00CH,001H,000H,00CH + db 000H,005H,01BH,049H,000H,01BH,036H,005H + db 01BH,049H,004H,01BH,036H,01BH,03DH,001H + db 000H,015H,01BH,03DH,000H,000H,01BH,049H + db 004H,000H,01BH,03DH,00FH,000H,014H,086H + db 000H,00AH,004H,00AH,06AH,0AAH,0AAH,0AAH + db 06AH,01CH,002H,000H,000H,000H,000H,01BH + db 03DH,036H,000H,014H,09BH,000H,009H,01DH + db 022H,026H,02AH,02AH,032H,022H,05CH,000H + db 000H,000H,000H,009H,012H,012H,07EH,092H + db 092H,082H,082H,082H,042H,000H,000H,000H + db 00AH,03AH,044H,000H,08AH,092H,0A2H,000H + db 044H,0B8H,000H,000H,000H,019H,000H,044H + db 000H,028H,000H,010H,000H,028H,000H,044H + db 000H,000H,000H,01BH,03DH,00FH,000H,014H + db 0A9H,000H,00BH,03CH,042H,081H,081H,0BDH + db 0A9H,0A9H,095H,081H,042H,03CH,000H,000H + db 01BH,03DH,036H,000H,014H,0B5H,000H,009H + db 00EH,014H,024H,024H,064H,0A4H,024H,014H + db 00EH,000H,000H,000H,009H,04EH,014H,084H + db 0A4H,0A4H,0A4H,084H,014H,04EH,000H,000H + db 000H,009H,00EH,014H,024H,0A4H,064H,024H + db 024H,014H,00EH,000H,000H,000H,00BH,038H + db 044H,000H,092H,0AAH,0AAH,0AAH,082H,000H + db 044H,038H,000H,000H,01BH,03DH,00FH,000H + db 014H,0BDH,000H,008H,018H,024H,024H,024H + db 07EH,024H,024H,024H,000H,000H,000H,000H + db 000H,01BH,03DH,01CH,000H,014H,0C6H,000H + db 009H,044H,00AH,08AH,0AAH,0AAH,06AH,04AH + db 05CH,082H,000H,000H,000H,009H,04EH,014H + db 084H,0A4H,0A4H,064H,044H,054H,08EH,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,01BH,03DH,0A2H,001H,014H,0DDH,000H + db 025H,000H,000H,000H,000H,0EEH,000H,000H + db 000H,000H,000H,000H,000H,016H,000H,000H + db 022H,0A2H,07EH,022H,022H,000H,000H,000H + db 000H,001H,00BH,0FCH,0FCH,0FCH,0FCH,0FCH + db 0FCH,0FCH,0FCH,0FCH,0FCH,0FCH,000H,008H + db 01CH,022H,022H,022H,062H,0A2H,022H,01CH + db 000H,000H,000H,000H,008H,01FH,020H,040H + db 084H,092H,082H,06AH,004H,000H,000H,000H + db 000H,00BH,040H,000H,09CH,0A2H,0A2H,0A2H + db 0A2H,0A2H,09CH,000H,040H,000H,008H,01CH + db 022H,022H,0A2H,062H,022H,022H,01CH,000H + db 000H,000H,000H,008H,04CH,092H,092H,092H + db 052H,052H,052H,08CH,000H,000H,000H,000H + db 009H,040H,01CH,080H,0A2H,0A2H,062H,040H + db 05CH,080H,000H,000H,080H,008H,001H,07EH + db 008H,008H,008H,008H,078H,004H,000H,000H + db 000H,000H,009H,081H,081H,0FFH,025H,025H + db 025H,024H,024H,018H,000H,000H,000H,018H + db 000H,081H,0FFH,0A5H,024H,024H,024H,024H + db 018H,000H,000H,000H,009H,03CH,002H,002H + db 002H,042H,082H,002H,002H,03CH,000H,000H + db 000H,009H,05CH,002H,082H,082H,082H,082H + db 082H,002H,05CH,000H,000H,000H,009H,03CH + db 002H,002H,082H,042H,002H,002H,002H,03CH + db 000H,000H,080H,008H,020H,010H,009H,002H + db 044H,088H,010H,020H,000H,000H,000H,000H + db 009H,040H,020H,010H,008H,046H,088H,010H + db 020H,040H,000H,000H,000H,009H,080H,080H + db 080H,080H,080H,080H,080H,080H,080H,000H + db 000H,000H,025H,000H,000H,000H,000H,040H + db 080H,000H,000H,000H,000H,000H,020H,00BH + db 010H,010H,010H,010H,010H,010H,010H,010H + db 010H,000H,000H,000H,009H,022H,022H,022H + db 022H,0FAH,022H,022H,022H,022H,000H,000H + db 000H,009H,00AH,00AH,00AH,00AH,00AH,00AH + db 00AH,00AH,00AH,000H,000H,000H,00BH,0A8H + db 0A8H,0AAH,054H,008H,010H,022H,046H,08AH + db 002H,01FH,000H,009H,0C0H,0A0H,0A0H,0FEH + db 080H,080H,080H,080H,0FEH,000H,000H,000H + db 017H,000H,050H,0AAH,0AAH,0AAH,0AAH,0AAH + db 014H,000H,000H,000H,000H,019H,000H,010H + db 010H,010H,0D6H,0D6H,0D6H,010H,010H,010H + db 000H,080H,015H,000H,000H,001H,001H,005H + db 002H,000H,000H,000H,000H,000H,000H,016H + db 000H,000H,060H,090H,090H,090H,060H,000H + db 000H,000H,000H,000H,018H,000H,030H,030H + db 030H,000H,000H,030H,030H,030H,000H,000H + db 000H,025H,000H,000H,000H,000H,010H,010H + db 000H,000H,000H,000H,000H,000H,016H,000H + db 000H,048H,008H,0F8H,008H,008H,000H,000H + db 000H,000H,000H,025H,000H,000H,000H,0A8H + db 0A8H,0A8H,050H,000H,000H,000H,000H,000H + db 000H,01BH,03DH,084H,000H,014H,0CFH,000H + db 008H,05DH,022H,022H,022H,022H,022H,022H + db 05DH,000H,000H,000H,000H,017H,000H,004H + db 02AH,08AH,04AH,02AH,09AH,004H,000H,000H + db 000H,000H,009H,092H,0FEH,092H,092H,082H + db 082H,082H,044H,038H,000H,000H,000H,009H + db 07EH,02AH,0AAH,0AAH,0AAH,0AAH,0AAH,022H + db 062H,000H,000H,000H,009H,03EH,0AAH,0AAH + db 02AH,02AH,02AH,0AAH,0A2H,022H,000H,000H + db 000H,009H,03EH,02AH,02AH,0AAH,06AH,02AH + db 02AH,022H,022H,000H,000H,000H,016H,000H + db 000H,012H,012H,01EH,002H,002H,000H,000H + db 000H,000H,000H,016H,000H,000H,022H,022H + db 07EH,0A2H,022H,000H,000H,000H,000H,000H + db 00BH,040H,000H,080H,0A2H,0A2H,0BEH,0A2H + db 0A2H,080H,000H,040H,000H,017H,000H,000H + db 0A2H,0A2H,03EH,022H,0A2H,080H,000H,000H + db 000H,000H,01BH,03DH,032H,000H,015H,09BH + db 080H,000H,000H,000H,000H,000H,018H,018H + db 004H,020H,000H,000H,021H,004H,000H,002H + db 002H,040H,002H,044H,006H,040H,002H,048H + db 00AH,040H,002H,050H,012H,040H,002H,060H + db 022H,040H,060H,000H,020H,084H,000H,000H + db 004H,020H,018H,018H,000H,000H,000H,000H + db 01BH,03DH,032H,000H,015H,09DH,000H,000H + db 000H,000H,000H,000H,018H,018H,024H,024H + db 002H,040H,000H,001H,041H,002H,001H,000H + db 003H,080H,005H,084H,001H,088H,009H,090H + db 011H,080H,021H,0A0H,001H,0C0H,000H,080H + db 040H,082H,080H,000H,002H,040H,024H,024H + db 018H,018H,000H,000H,000H,000H,01BH,03DH + db 032H,000H,015H,086H,000H,000H,000H,000H + db 000H,000H,000H,000H,002H,004H,004H,002H + db 000H,020H,041H,0A8H,001H,028H,081H,068H + db 081H,068H,081H,068H,081H,068H,081H,068H + db 081H,068H,081H,068H,000H,028H,040H,08AH + db 010H,00AH,00EH,01EH,001H,000H,001H,000H + db 001H,000H,000H,000H,01BH,03DH,032H,000H + db 015H,09EH,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 024H,000H,000H,000H,000H,028H,018H,000H + db 000H,000H,000H,010H,000H,000H,018H,000H + db 000H,028H,000H,000H,024H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,01BH,03DH,032H,000H,015H,0A9H + db 000H,000H,000H,000H,01CH,018H,000H,024H + db 022H,000H,000H,000H,000H,042H,000H,000H + db 05DH,03CH,049H,020H,049H,020H,049H,020H + db 049H,020H,049H,020H,049H,020H,049H,028H + db 04DH,020H,010H,014H,000H,042H,000H,000H + db 022H,000H,000H,024H,01CH,018H,000H,000H + db 01BH,03DH,0C2H,000H,015H,0B5H,000H,000H + db 000H,000H,001H,000H,001H,000H,021H,000H + db 023H,002H,025H,004H,02DH,008H,025H,010H + db 034H,020H,024H,000H,064H,000H,024H,000H + db 024H,080H,024H,000H,094H,020H,005H,010H + db 00DH,008H,005H,004H,003H,002H,001H,000H + db 001H,000H,001H,000H,000H,000H,000H,000H + db 000H,000H,001H,000H,001H,000H,021H,000H + db 023H,002H,025H,004H,06DH,008H,025H,010H + db 034H,0A0H,024H,000H,0A4H,000H,0A4H,000H + db 0A4H,000H,024H,000H,014H,0A0H,005H,010H + db 04DH,008H,005H,004H,003H,002H,001H,000H + db 001H,000H,001H,000H,000H,000H,000H,000H + db 000H,000H,001H,000H,001H,000H,021H,000H + db 023H,002H,025H,004H,02DH,008H,025H,010H + db 0B4H,020H,024H,000H,024H,080H,024H,000H + db 064H,000H,024H,000H,014H,020H,005H,010H + db 00DH,008H,005H,004H,003H,002H,001H,000H + db 001H,000H,001H,000H,000H,000H,000H,000H + db 000H,000H,01CH,018H,000H,024H,022H,000H + db 000H,000H,000H,042H,008H,018H,055H,000H + db 041H,024H,041H,024H,041H,024H,041H,024H + db 041H,024H,041H,024H,041H,024H,041H,000H + db 014H,000H,000H,042H,000H,000H,022H,000H + db 000H,024H,01CH,018H,000H,000H,01BH,03DH + db 032H,000H,015H,0BDH,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,018H,018H + db 004H,020H,020H,004H,000H,000H,002H,040H + db 002H,040H,002H,040H,0FFH,0FFH,002H,040H + db 002H,040H,002H,040H,022H,000H,022H,000H + db 030H,060H,000H,004H,000H,000H,000H,000H + db 000H,000H,000H,000H,01BH,03DH,062H,000H + db 015H,0C6H,000H,000H,000H,000H,000H,000H + db 000H,000H,002H,004H,044H,002H,000H,0A0H + db 001H,028H,081H,028H,081H,028H,081H,028H + db 001H,028H,001H,0A8H,001H,028H,041H,028H + db 041H,028H,040H,028H,000H,00AH,010H,08AH + db 08EH,01EH,001H,000H,001H,000H,001H,000H + db 000H,000H,000H,000H,000H,000H,001H,000H + db 001H,000H,021H,000H,023H,082H,025H,004H + db 0ADH,008H,0A5H,010H,0B4H,020H,0A4H,000H + db 0A4H,000H,024H,000H,024H,080H,024H,080H + db 014H,0A0H,005H,090H,00DH,088H,005H,004H + db 083H,002H,001H,000H,001H,000H,001H,000H + db 000H,000H,01BH,03DH,0E2H,001H,015H,0CFH + db 000H,000H,000H,000H,000H,000H,042H,000H + db 000H,000H,018H,054H,000H,028H,024H,000H + db 000H,000H,000H,044H,000H,044H,000H,044H + db 000H,044H,000H,044H,000H,044H,000H,044H + db 000H,000H,024H,000H,000H,028H,018H,054H + db 000H,000H,042H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 004H,00CH,0AAH,000H,000H,000H,000H,0D2H + db 000H,000H,051H,000H,011H,000H,011H,0C0H + db 011H,000H,0B1H,000H,001H,000H,001H,020H + db 010H,000H,000H,002H,000H,010H,00AH,000H + db 004H,00CH,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,010H,001H,090H + db 001H,090H,001H,090H,07FH,0FEH,001H,090H + db 001H,090H,001H,090H,001H,090H,001H,090H + db 001H,090H,001H,080H,001H,080H,001H,080H + db 000H,000H,040H,002H,000H,000H,002H,040H + db 024H,024H,018H,018H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,021H,000H + db 021H,000H,021H,000H,021H,000H,03FH,03EH + db 061H,008H,021H,008H,021H,088H,021H,008H + db 0A1H,008H,0A1H,008H,0A1H,008H,02DH,01CH + db 021H,080H,021H,000H,061H,000H,021H,000H + db 021H,000H,033H,026H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,021H,000H + db 021H,000H,021H,000H,021H,000H,0BFH,0BEH + db 0A1H,088H,0A1H,088H,021H,008H,021H,008H + db 021H,008H,021H,008H,021H,008H,02DH,01CH + db 0A1H,080H,0A1H,080H,0A1H,080H,021H,000H + db 021H,000H,033H,026H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,021H,000H + db 021H,000H,021H,000H,021H,000H,03FH,03EH + db 021H,008H,021H,008H,0A1H,008H,021H,008H + db 021H,088H,021H,008H,061H,008H,02DH,01CH + db 021H,000H,021H,000H,021H,000H,021H,000H + db 021H,000H,033H,026H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,001H,000H,001H,000H,001H,020H + db 001H,020H,001H,020H,001H,020H,001H,020H + db 001H,020H,01FH,03EH,001H,000H,001H,000H + db 001H,000H,001H,000H,001H,000H,001H,000H + db 001H,000H,001H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,021H,000H,021H,000H + db 021H,000H,021H,000H,021H,000H,061H,000H + db 03FH,03EH,021H,080H,021H,000H,0A1H,000H + db 021H,000H,021H,000H,021H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,021H,000H,061H,000H + db 021H,000H,021H,080H,021H,000H,0A1H,000H + db 0BFH,03EH,0A1H,000H,021H,000H,021H,080H + db 021H,000H,061H,000H,021H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,021H,000H,0A1H,080H + db 0A1H,080H,0A1H,080H,021H,000H,021H,000H + db 03FH,03EH,021H,000H,021H,000H,0A1H,080H + db 0A1H,080H,0A1H,080H,021H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 01BH,03DH,062H,000H,015H,0DDH,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,0E7H,0E7H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,021H,000H,021H,000H,021H,000H + db 0A1H,000H,021H,000H,021H,080H,03FH,03EH + db 061H,000H,021H,000H,021H,000H,021H,000H + db 021H,000H,021H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,01BH,03DH + db 032H,000H,015H,0E0H,000H,000H,000H,000H + db 000H,000H,00CH,008H,000H,014H,012H,000H + db 000H,000H,000H,022H,000H,000H,021H,000H + db 021H,000H,061H,000H,021H,000H,021H,080H + db 021H,000H,0A1H,000H,000H,000H,000H,022H + db 000H,000H,012H,000H,000H,014H,00CH,008H + db 000H,000H,000H,000H,01BH,03DH,0C2H,000H + db 015H,0E2H,000H,000H,000H,000H,000H,000H + db 00CH,008H,000H,014H,012H,000H,000H,000H + db 040H,022H,000H,000H,021H,080H,021H,000H + db 0A1H,000H,0A1H,000H,0A1H,000H,021H,000H + db 021H,080H,000H,000H,040H,022H,000H,000H + db 012H,000H,000H,014H,00CH,008H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 00CH,008H,000H,014H,012H,000H,000H,000H + db 000H,022H,000H,000H,0A1H,000H,021H,000H + db 021H,080H,021H,000H,061H,000H,021H,000H + db 021H,000H,000H,000H,000H,022H,000H,000H + db 012H,000H,000H,014H,00CH,008H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,00CH,00CH,042H,010H,000H,080H + db 010H,002H,080H,000H,081H,020H,081H,020H + db 001H,020H,001H,0A0H,001H,020H,041H,020H + db 041H,020H,040H,000H,010H,002H,000H,080H + db 082H,010H,00CH,00CH,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 00CH,008H,000H,014H,012H,080H,000H,000H + db 080H,022H,080H,000H,0A1H,000H,0A1H,000H + db 0A1H,000H,021H,000H,021H,080H,021H,080H + db 021H,080H,000H,080H,000H,0A2H,000H,000H + db 092H,000H,000H,014H,00CH,008H,000H,000H + db 000H,000H,01BH,03DH,0E2H,001H,015H,0E7H + db 080H,000H,080H,000H,080H,001H,080H,001H + db 080H,001H,0FFH,0FFH,024H,001H,024H,001H + db 000H,001H,000H,045H,000H,045H,000H,044H + db 000H,044H,000H,044H,000H,044H,000H,044H + db 000H,044H,000H,044H,000H,000H,024H,000H + db 000H,028H,018H,010H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,001H,080H + db 001H,080H,001H,080H,001H,080H,07FH,0FEH + db 021H,084H,021H,084H,021H,084H,021H,084H + db 021H,084H,021H,084H,020H,004H,020H,004H + db 020H,004H,020H,004H,020H,004H,020H,004H + db 000H,000H,004H,020H,018H,018H,000H,000H + db 000H,000H,000H,000H,020H,000H,020H,000H + db 020H,000H,03CH,03CH,022H,000H,020H,002H + db 020H,000H,001H,000H,001H,000H,041H,000H + db 001H,000H,001H,080H,001H,000H,081H,000H + db 020H,000H,020H,002H,022H,000H,03CH,03CH + db 020H,000H,020H,000H,020H,000H,000H,000H + db 000H,000H,000H,000H,020H,000H,020H,000H + db 020H,000H,03CH,03CH,022H,000H,060H,002H + db 020H,000H,001H,080H,001H,000H,081H,000H + db 081H,000H,081H,000H,001H,000H,001H,080H + db 020H,000H,060H,002H,022H,000H,03CH,03CH + db 020H,000H,020H,000H,020H,000H,000H,000H + db 000H,000H,000H,000H,020H,000H,020H,000H + db 020H,000H,03CH,03CH,022H,000H,020H,002H + db 020H,000H,081H,000H,001H,000H,001H,080H + db 001H,000H,041H,000H,001H,000H,001H,000H + db 020H,000H,020H,002H,022H,000H,03CH,03CH + db 020H,000H,020H,000H,020H,000H,000H,000H + db 000H,000H,000H,000H,000H,020H,000H,020H + db 000H,020H,010H,020H,000H,031H,008H,021H + db 000H,029H,004H,001H,000H,005H,043H,001H + db 002H,003H,002H,081H,000H,005H,084H,000H + db 000H,028H,008H,020H,000H,030H,010H,020H + db 000H,020H,000H,020H,000H,020H,000H,000H + db 000H,000H,000H,000H,020H,000H,020H,000H + db 020H,000H,020H,000H,020H,020H,030H,000H + db 021H,010H,009H,000H,001H,008H,005H,000H + db 047H,006H,005H,000H,001H,088H,009H,000H + db 0A1H,010H,030H,000H,020H,020H,020H,000H + db 020H,000H,020H,000H,020H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 080H,000H,080H,000H,080H,000H,080H,000H + db 080H,000H,080H,000H,080H,000H,080H,000H + db 080H,000H,080H,000H,080H,000H,080H,000H + db 080H,000H,080H,000H,080H,000H,080H,000H + db 080H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,040H,000H + db 000H,000H,000H,080H,000H,000H,080H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,008H + db 000H,008H,000H,008H,000H,008H,000H,008H + db 000H,008H,000H,008H,000H,008H,000H,008H + db 000H,008H,000H,008H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 01BH,03DH,0C2H,000H,015H,0F2H,080H,000H + db 002H,001H,002H,001H,002H,001H,002H,001H + db 002H,001H,002H,001H,002H,001H,002H,001H + db 002H,001H,002H,001H,002H,001H,002H,001H + db 002H,001H,002H,001H,002H,001H,002H,001H + db 002H,001H,002H,001H,002H,001H,002H,001H + db 002H,001H,002H,001H,002H,001H,000H,000H + db 010H,080H,080H,010H,080H,010H,080H,050H + db 081H,050H,080H,052H,002H,000H,070H,0A4H + db 004H,000H,000H,008H,008H,000H,000H,010H + db 010H,000H,002H,022H,024H,006H,008H,04AH + db 040H,002H,000H,082H,000H,002H,007H,007H + db 000H,002H,000H,002H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,030H,020H + db 030H,020H,078H,071H,078H,071H,078H,0F9H + db 078H,0F9H,07FH,0FFH,000H,080H,000H,080H + db 000H,080H,000H,080H,000H,080H,07FH,0FFH + db 000H,081H,000H,081H,000H,081H,000H,081H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,010H,030H,029H,003H,000H,009H + db 040H,041H,024H,001H,000H,081H,000H,0A5H + db 000H,081H,012H,080H,001H,082H,000H,090H + db 04AH,0C0H,004H,00CH,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,01BH,03DH + db 032H,000H,015H,0F7H,080H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,001H,001H,000H + db 000H,002H,002H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,01BH,03DH,032H,000H + db 015H,0F9H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 080H,080H,080H,080H,080H,080H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,080H,080H,080H,080H,080H,080H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,01BH,03DH,062H,000H,015H,0FBH + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,008H + db 040H,008H,000H,008H,000H,088H,000H,088H + db 0F8H,0F8H,000H,008H,000H,008H,000H,008H + db 000H,008H,000H,008H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 008H,080H,000H,000H,080H,008H,0A0H,008H + db 0A0H,008H,0A0H,008H,0A0H,008H,020H,000H + db 008H,0A0H,050H,050H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 01BH,03DH,00FH,000H,014H,0BEH,000H,009H + db 080H,054H,034H,014H,01EH,014H,034H,054H + db 080H,000H,000H,01BH,03DH,032H,000H,015H + db 0BEH,000H,000H,000H,000H,000H,080H,000H + db 080H,000H,094H,040H,094H,000H,0D4H,020H + db 094H,001H,0B4H,011H,014H,001H,014H,009H + db 004H,00FH,00EH,009H,004H,001H,014H,011H + db 014H,001H,0B4H,020H,094H,000H,0D4H,040H + db 094H,000H,094H,000H,080H,000H,080H,000H + db 000H,000H,000H,000H diff --git a/v4.0/src/DEV/PRINTER/4201/4201.MAK b/v4.0/src/DEV/PRINTER/4201/4201.MAK new file mode 100644 index 0000000..a457074 --- /dev/null +++ b/v4.0/src/DEV/PRINTER/4201/4201.MAK @@ -0,0 +1,7 @@ +#---- MAKEFILE FOR 4201.CPI ------------ +# This make file prevents build output errors for (subdirs.bat config line +# Mark Nosewicz + +4201.CPI: 4201.CPI + ECHO 4201.CPI HAS BEEN CHANGED + \ No newline at end of file diff --git a/v4.0/src/DEV/PRINTER/4201/MAKEFILE b/v4.0/src/DEV/PRINTER/4201/MAKEFILE new file mode 100644 index 0000000..e69de29 diff --git a/v4.0/src/DEV/PRINTER/4208/4208-CPY.ASM b/v4.0/src/DEV/PRINTER/4208/4208-CPY.ASM new file mode 100644 index 0000000..6bb3695 --- /dev/null +++ b/v4.0/src/DEV/PRINTER/4208/4208-CPY.ASM @@ -0,0 +1,10 @@ + +CODE segment public 'code' +ASSUME CS:CODE,DS:NOTHING,ES:NOTHING,SS:NOTHING + org 0 + + include copyrigh.inc + +code ends + end + \ No newline at end of file diff --git a/v4.0/src/DEV/PRINTER/4208/4208.CPI b/v4.0/src/DEV/PRINTER/4208/4208.CPI new file mode 100644 index 0000000..4fe1a18 Binary files /dev/null and b/v4.0/src/DEV/PRINTER/4208/4208.CPI differ diff --git a/v4.0/src/DEV/PRINTER/4208/4208.INC b/v4.0/src/DEV/PRINTER/4208/4208.INC new file mode 100644 index 0000000..6aa3dfe --- /dev/null +++ b/v4.0/src/DEV/PRINTER/4208/4208.INC @@ -0,0 +1,90 @@ + db 0FFH,046H,04FH,04EH,054H,020H,020H,020H + db 000H,000H,000H,000H,000H,000H,000H,000H + db 001H,000H,001H,017H,000H,000H,000H,009H + db 000H,01AH,000H,035H,000H,000H,000H,002H + db 000H,034H,032H,030H,038H,020H,020H,020H + db 020H,0B5H,001H,000H,000H,000H,000H,000H + db 000H,015H,001H,000H,000H,01AH,000H,051H + db 000H,000H,000H,002H,000H,034H,032H,030H + db 038H,020H,020H,020H,020H,05EH,003H,000H + db 000H,000H,000H,000H,000H,02BH,001H,000H + db 000H,01AH,000H,06DH,000H,000H,000H,002H + db 000H,034H,032H,030H,038H,020H,020H,020H + db 020H,060H,003H,000H,000H,000H,000H,000H + db 000H,041H,001H,000H,000H,01AH,000H,089H + db 000H,000H,000H,002H,000H,034H,032H,030H + db 038H,020H,020H,020H,020H,052H,003H,000H + db 000H,000H,000H,000H,000H,057H,001H,000H + db 000H,01AH,000H,0A5H,000H,000H,000H,002H + db 000H,034H,032H,030H,038H,020H,020H,020H + db 020H,053H,003H,000H,000H,000H,000H,000H + db 000H,06DH,001H,000H,000H,01AH,000H,0C1H + db 000H,000H,000H,002H,000H,034H,032H,030H + db 038H,020H,020H,020H,020H,055H,003H,000H + db 000H,000H,000H,000H,000H,083H,001H,000H + db 000H,01AH,000H,0DDH,000H,000H,000H,002H + db 000H,034H,032H,030H,038H,020H,020H,020H + db 020H,057H,003H,000H,000H,000H,000H,000H + db 000H,099H,001H,000H,000H,01AH,000H,000H + db 000H,000H,000H,002H,000H,034H,032H,030H + db 038H,020H,020H,020H,020H,05FH,003H,000H + db 000H,000H,000H,000H,000H,0AFH,001H,000H + db 000H,01AH,000H,000H,000H,000H,000H,002H + db 000H,034H,032H,030H,038H,020H,020H,020H + db 020H,000H,000H,000H,000H,000H,000H,000H + db 000H,000H,000H,000H,000H,001H,000H,001H + db 000H,010H,000H,002H,000H,00CH,000H,01BH + db 049H,002H,000H,000H,000H,000H,000H,000H + db 000H,01BH,036H,001H,000H,001H,000H,010H + db 000H,002H,000H,00CH,000H,01BH,049H,00EH + db 01BH,049H,007H,01BH,049H,006H,000H,01BH + db 036H,001H,000H,001H,000H,010H,000H,002H + db 000H,00CH,000H,01BH,049H,00EH,01BH,049H + db 007H,01BH,049H,006H,000H,01BH,036H,001H + db 000H,001H,000H,010H,000H,002H,000H,00CH + db 000H,01BH,049H,00EH,01BH,049H,007H,01BH + db 049H,006H,000H,01BH,036H,001H,000H,001H + db 000H,010H,000H,002H,000H,00CH,000H,01BH + db 049H,00EH,01BH,049H,007H,01BH,049H,006H + db 000H,01BH,036H,001H,000H,001H,000H,010H + db 000H,002H,000H,00CH,000H,01BH,049H,00EH + db 01BH,049H,007H,01BH,049H,006H,000H,01BH + db 036H,001H,000H,001H,000H,010H,000H,002H + db 000H,00CH,000H,01BH,049H,00EH,01BH,049H + db 007H,01BH,049H,006H,000H,01BH,036H,001H + db 000H,001H,000H,010H,000H,002H,000H,00CH + db 000H,01BH,049H,00EH,01BH,049H,007H,01BH + db 049H,006H,000H,01BH,036H,001H,000H,001H + db 000H,010H,000H,002H,000H,00CH,000H,01BH + db 049H,00EH,01BH,049H,007H,01BH,049H,006H + db 000H,01BH,036H,00AH,00DH,054H,068H,065H + db 020H,049H,042H,04DH,020H,050H,065H,072H + db 073H,06FH,06EH,061H,06CH,020H,043H,06FH + db 06DH,070H,075H,074H,065H,072H,020H,050H + db 072H,069H,06EH,074H,065H,072H,020H,043H + db 06FH,064H,065H,020H,050H,061H,067H,065H + db 020H,044H,072H,069H,076H,065H,072H,00AH + db 00DH,056H,065H,072H,073H,069H,06FH,06EH + db 020H,033H,02EH,033H,030H,020H,028H,043H + db 029H,020H,043H,06FH,070H,079H,072H,069H + db 067H,068H,074H,020H,049H,042H,04DH,020H + db 043H,06FH,072H,070H,020H,031H,039H,038H + db 037H,00AH,00DH,04CH,069H,063H,065H,06EH + db 073H,065H,064H,020H,04DH,061H,074H,065H + db 072H,069H,061H,06CH,020H,02DH,020H,050H + db 072H,06FH,067H,072H,061H,06DH,020H,050H + db 072H,06FH,070H,065H,072H,074H,079H,020H + db 06FH,066H,020H,049H,042H,04DH,01AH,01AH + db 040H,040H,040H,023H,023H,023H,020H,044H + db 04FH,053H,020H,033H,02EH,033H,030H,020H + db 044H,072H,069H,076H,065H,072H,020H,044H + db 052H,056H,030H,035H,048H,02CH,020H,031H + db 030H,02FH,032H,031H,02FH,038H,036H,00DH + db 00AH,01AH,000H,020H,020H,020H,020H,020H + db 020H,020H,020H,020H,020H,020H,020H,020H + db 020H,020H,020H,020H,020H,020H,020H,020H + db 020H,020H,020H,020H,020H,020H,020H,020H + db 020H,020H,020H,020H,020H,020H,020H,020H + db 020H,020H,020H,020H,020H,020H,020H,020H + db 020H,020H,020H,020H,020H,020H,020H,020H + db 020H,020H,020H,020H,020H,020H,020H,020H diff --git a/v4.0/src/DEV/PRINTER/4208/4208.MAK b/v4.0/src/DEV/PRINTER/4208/4208.MAK new file mode 100644 index 0000000..b3d0c4d --- /dev/null +++ b/v4.0/src/DEV/PRINTER/4208/4208.MAK @@ -0,0 +1,7 @@ +#---- MAKEFILE FOR 4208.CPI ------------ +# This make file prevents build output errors for (subdirs.bat config line +# Mark Nosewicz + +4208.CPI: 4208.CPI + ECHO 4208.CPI HAS BEEN CHANGED + \ No newline at end of file diff --git a/v4.0/src/DEV/PRINTER/4208/MAKEFILE b/v4.0/src/DEV/PRINTER/4208/MAKEFILE new file mode 100644 index 0000000..e69de29 diff --git a/v4.0/src/DEV/PRINTER/5202/5202.ASM b/v4.0/src/DEV/PRINTER/5202/5202.ASM new file mode 100644 index 0000000..ed6c3cf --- /dev/null +++ b/v4.0/src/DEV/PRINTER/5202/5202.ASM @@ -0,0 +1,108 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; DESCRIPTION : Code Page Switching 5202 Printer Font File +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +ESC1 EQU 01BH ; + ; +CSEG SEGMENT ; + ASSUME CS:CSEG,DS:CSEG ; +BEGIN: ORG 0 ; + ; +FNTHEAD:DB 0FFH,"FONT " ; FILE TAG + DB 8 DUP(0) ; RESERVED + DW 1 ; CNT OF POINTERS IN HEADER + DB 1 ; TYPE FOR INFO POINTER + DW OFFSET INFO,0 ; POINTER TO INFO IN FILE + ; +info : DW 5 ; COUNT OF ENTRIES + ; +QUI437: DW LEN_437 ; SIZE OF ENTRY HEADER + DW QUI850,0 ; POINTER TO NEXT HEADER + DW 2 ; DEVICE TYPE + DB "5202 " ; DEVICE SUBTYPE ID + DW 437 ; CODE PAGE ID + DW 3 DUP(0) ; RESERVED + DW OFFSET DATA437,0 ; POINTER TO FONTS +LEN_437 EQU ($-QUI437)-2 ; + ; +QUI850: DW LEN_850 ; SIZE OF ENTRY HEADER + DW QUI860,0 ; POINTER TO NEXT HEADER + DW 2 ; DEVICE TYPE + DB "5202 " ; DEVICE SUBTYPE ID + DW 850 ; CODE PAGE ID + DW 3 DUP(0) ; RESERVED + DW OFFSET DATA850,0 ; POINTER TO FONTS +LEN_850 EQU ($-QUI850)-2 ; + ; +QUI860: DW LEN_860 ; SIZE OF ENTRY HEADER + DW QUI863,0 ; POINTER TO NEXT HEADER + DW 2 ; DEVICE TYPE + DB "5202 " ; DEVICE SUBTYPE ID + DW 860 ; CODE PAGE ID + DW 3 DUP(0) ; RESERVED + DW OFFSET DATA860,0 ; POINTER TO FONTS +LEN_860 EQU ($-QUI860)-2 ; + ; +QUI863: DW LEN_863 ; SIZE OF ENTRY HEADER + DW QUI865,0 ; POINTER TO NEXT HEADER + DW 2 ; DEVICE TYPE + DB "5202 " ; DEVICE SUBTYPE ID + DW 863 ; CODE PAGE ID + DW 3 DUP(0) ; RESERVED + DW OFFSET DATA863,0 ; POINTER TO FONTS +LEN_863 EQU ($-QUI863)-2 ; + ; +QUI865: DW LEN_865 ; SIZE OF ENTRY HEADER + DW 0,0 ; POINTER TO NEXT HEADER + DW 2 ; DEVICE TYPE + DB "5202 " ; DEVICE SUBTYPE ID + DW 865 ; CODE PAGE ID + DW 3 DUP(0) ; RESERVED + DW OFFSET DATA865,0 ; POINTER TO FONTS +LEN_865 EQU ($-QUI865)-2 ; + ; +DATA437:DW 1 ; CART/NON-CART + DW 1 ; # OF FONTS + DW 16 ; LENGTH OF DATA + DW 2 ; SELECTION TYPE + DW 12 ; SELECTION length + DB ESC1,91,84,5,0,00,00,001H,0B5H,00 ; select code page ****** + dB ESC1,"6" ; + ; +DATA850:DW 1 ; CART/NON-CART + DW 1 ; # OF FONTS + DW 16 ; LENGTH OF DATA + DW 2 ; SELECTION TYPE + DW 12 ; SELECTION length + DB ESC1,91,84,5,0,00,00,003H,052H,00 ; select code page ****** + dB ESC1,"6" ; + ; +DATA860:DW 1 ; CART/NON-CART + DW 1 ; # OF FONTS + DW 16 ; LENGTH OF DATA + DW 2 ; SELECTION TYPE + DW 12 ; SELECTION length + DB ESC1,91,84,5,0,00,00,003H,05CH,00 ; select code page ****** + dB ESC1,"6" ; + ; +DATA863:DW 1 ; CART/NON-CART + DW 1 ; # OF FONTS + DW 16 ; LENGTH OF DATA + DW 2 ; SELECTION TYPE + DW 12 ; SELECTION length + DB ESC1,91,84,5,0,00,00,003H,05FH,00 ; select code page ****** + dB ESC1,"6" ; + ; +DATA865:DW 1 ; CART/NON-CART + DW 1 ; # OF FONTS + DW 16 ; LENGTH OF DATA + DW 2 ; SELECTION TYPE + DW 12 ; SELECTION length + DB ESC1,91,84,5,0,00,00,003H,061H,00 ; select code page ****** + dB ESC1,"6" ; + +include copyrigh.inc + +CSEG ENDS ; + END BEGIN ; diff --git a/v4.0/src/DEV/PRINTER/5202/MAKEFILE b/v4.0/src/DEV/PRINTER/5202/MAKEFILE new file mode 100644 index 0000000..7bb70db --- /dev/null +++ b/v4.0/src/DEV/PRINTER/5202/MAKEFILE @@ -0,0 +1,21 @@ +#********************** Makefile for Printer\5202.CPI ********************** + +inc =..\..\..\inc +dos =..\..\..\dos +hinc =..\..\..\h +msg =..\..\..\message + +# +######################### Dependencies Begin Here ########################## +# + +all: 5202.cpi + +5202.obj: 5202.asm $(inc)\copyrigh.inc makefile + + +5202.cpi: 5202.obj + link 5202; + exe2bin 5202 5202.cpi + del 5202.exe + diff --git a/v4.0/src/DEV/PRINTER/CPSFONT.ASM b/v4.0/src/DEV/PRINTER/CPSFONT.ASM new file mode 100644 index 0000000..74fa12b --- /dev/null +++ b/v4.0/src/DEV/PRINTER/CPSFONT.ASM @@ -0,0 +1,1961 @@ + + PAGE ,132 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; FILENAME: CPS Device Driver -- Font Parser +;; MODULE NAME: CPSFONT +;; TYPE: Font Parser Module +;; LINK PROCEDURE: Link CPS+CPSSUB+CPSINT9+...+CPSINIT into .EXE format +;; CPS must be first. CPSINIT must be last. Everything +;; before CPSINIT will be resident. +;; INCLUDE FILES: +;; CPSPEQU.INC +;; +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +INCLUDE CPSPEQU.INC ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CSEG SEGMENT PUBLIC 'CODE' ;; + ASSUME CS:CSEG ;; + ASSUME DS:NOTHING ;; + ;; +PUBLIC FTABLE,FONT_PARSER ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; ************************************ +;; ** ** +;; ** Resident Code ** +;; ** ** +;; ************************************ +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; FONT_PARSER data +;; +;; -- Interface table : FTABLE +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +FTABLE: FBUFS <0FFFFH,,,> ;; for temporary testing +FTB1 FTBLK <,,,,,,,,,,,,> ;; -- at most 12 entries +FTB2 FTBLK <,,,,,,,,,,,,> ;; +FTB3 FTBLK <,,,,,,,,,,,,> ;; +FTB4 FTBLK <,,,,,,,,,,,,> ;; +FTB5 FTBLK <,,,,,,,,,,,,> ;; +FTB6 FTBLK <,,,,,,,,,,,,> ;; +FTB7 FTBLK <,,,,,,,,,,,,> ;; +FTB8 FTBLK <,,,,,,,,,,,,> ;; +FTB9 FTBLK <,,,,,,,,,,,,> ;; +FTBa FTBLK <,,,,,,,,,,,,> ;; +FTBb FTBLK <,,,,,,,,,,,,> ;; +FTBc FTBLK <,,,,,,,,,,,,> ;; + ;; +FP_ERROR DW 0000H ;; internal error register + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; the followings are bytes accumulated + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +FTAG_LEN EQU 8 ;; FILE TAGE in the font file header +FTAG_COUNT DW 0000H ;; + ;; +FTAG_PATTERN LABEL BYTE ;; + DB 0FFH ;; + DB 'FONT ' ;; + ;; + ;; + ;; POINTER in the font file header +fptr_LOW LABEL WORD ;; +fptr_LOL DB 00H ;; NEXT +fptr_LOH DB 00H ;; +fptr_HIGH LABEL WORD ;; +fptr_HIL DB 00H ;; +fptr_HIH DB 00H ;; + ;; + ;; + ;; +ENTRY_WORD LABEL WORD ;; +ENTRY_LOB DB 00H ;; ENTRY COUNT +ENTRY_HIB DB 00H ;; +NEXT_LOW LABEL WORD ;; +NEXT_LOL DB 00H ;; NEXT +NEXT_LOH DB 00H ;; +NEXT_HIGH LABEL WORD ;; +NEXT_HIL DB 00H ;; +NEXT_HIH DB 00H ;; +TYPE_WORD LABEL WORD ;; +TYPE_LOB DB 00H ;; TYPE +TYPE_HIB DB 00H ;; +TID_CNT DW 00000H ;; TYPEID COUNT(0 to 8) +TYPE_ID : DB ' ' ;; TYPEID +CPG_WORD LABEL WORD ;; +CPG_LOB DB 00H ;; CODE PAGE +CPG_HIB DB 00H ;; +FONT_LOW LABEL WORD ;; +FONT_LOL DB 00H ;; FONT ADDRESS +FONT_LOH DB 00H ;; +FONT_HIGH LABEL WORD ;; +FONT_HIL DB 00H ;; +FONT_HIH DB 00H ;; +;; the followings are contained in the font-block in the exact order & length +MOD_WORD LABEL WORD ;; +MOD_LOB DB 00H ;; MODIFIER +MOD_HIB DB 00H ;; +FONTS_WORD LABEL WORD ;; +FONTS_LOB DB 00H ;; FONTS +FONTS_HIB DB 00H ;; +FDLEN_WORD LABEL WORD ;; +FDLEN_LOB DB 00H ;; FONT DATA LENGTH +FDLEN_HIB DB 00H ;; +PRE_FONT_ND EQU ($-MOD_WORD) ;; used to update target for font data + ;; to follow. -- for NON-DISPLAY +DISP_ROWS DB 00H ;; DISPLAY's parameters : +DISP_COLS DB 00H ;; BOX SIZE +DISP_X DB 00H ;; ASPECT RATIO +DISP_Y DB 00H ;; +COUNT_WORD LABEL WORD ;; NO. OF DISPLAY CHARACTERS +COUNT_LOB DB 00H ;; +COUNT_HIB DB 00H ;; +PRE_FONT_D EQU ($-MOD_WORD) ;; used to update target for font data + ;; to follow. -- for DISPLAY + ;; +PTR_SEL_WORD LABEL WORD ;; +PTR_SELOB DB 00H ;; +PTR_SEHIB DB 00H ;; +PRE_FONT_P0 EQU ($-PTR_SELOB+PRE_FONT_ND) ;; to update target for font data + ;; to follow -- for PRINTER with + ;; selection type = 0. + ;; +PTR_LEN_WORD LABEL WORD ;; +PTR_LNLOB DB 00H ;; +PTR_LNHIB DB 00H ;; +PRE_FONT_P EQU ($-PTR_SELOB+PRE_FONT_ND) ;; to update target for font data + ;; to follow -- for PRINTER with + ;; selection type <> 0. + ;; + ;; +;; also update STAGE_CASES and indexing constants + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; the stage the parsing is in : ;;;;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +STAGE_CASES LABEL WORD ;; the stage the parsing is in : + ;; + ;; *** INDEXED BY STAGE-INDEX + ;; + DW OFFSET ENTRYLO ;; 0 + DW OFFSET ENTRYHI ;; 1 + DW OFFSET NEXTLOL ;; 2 + DW OFFSET NEXTLOH ;; 3 + DW OFFSET NEXTHIL ;; 4 + DW OFFSET NEXTHIH ;; 5 + DW OFFSET TYPELO ;; 6 + DW OFFSET TYPEHI ;; 7 + DW OFFSET TYPEIDS ;; 8 + DW OFFSET CPGLO ;; 9 + DW OFFSET CPGHI ;; A + DW OFFSET FONTLOL ;; B + DW OFFSET FONTLOH ;; C + DW OFFSET FONTHIL ;; D + DW OFFSET FONTHIH ;; E + DW 00H ;; MATCH case -- end of SEARCH stages + DW 00H ;; SCAN case -- before PRE-FOUND stage + DW OFFSET MODLO ;; 11 + DW OFFSET MODHI ;; 12 + DW OFFSET FONTSLO ;; 13 + DW OFFSET FONTSHI ;; 14 + DW OFFSET FDLENLO ;; 15 + DW OFFSET FDLENHI ;; 16 -- lead to FONT case,NON- DISPLAY + DW OFFSET DSPROWS ;; 17 -- DISPLAY only + DW OFFSET DSPCOLS ;; 18 + DW OFFSET DSPX ;; 19 + DW OFFSET DSPY ;; 1A + DW OFFSET DSPCOUNTLO ;; 1B + DW OFFSET DSPCOUNTHI ;; 1C -- lead to FONT case, DISPLAY + DW OFFSET PTRSELLO ;; 1D -- PRINTER only + DW OFFSET PTRSELHI ;; 1E + DW OFFSET PTRLENLO ;; 1F + DW OFFSET PTRLENHI ;; 20 -- lead to FONT case, PRINTER + DW 00H ;; FOUND case + DW 00H ;; GET_FONT case + DW 00H ;; PASS special stage + DW OFFSET FILETAG ;; 24 + DW OFFSET fptrLOL ;; 25 + DW OFFSET fptrLOH ;; 26 + DW OFFSET fptrHIL ;; 27 + DW OFFSET fptrHIH ;; 28 + DW 00H ;; FPTR_SKIP_CASE + ;; + ;; The followings are individual stage +STAGE_MAX EQU ($-STAGE_CASES)/2 ;; number of stages + ;; + ;; STAGE-INDEX + ;; + ;; **** INDEX TO STAGE_CASES **** +ENTRY_LOX EQU 00H ;; +ENTRY_HIX EQU 01H ;; +NEXT_LOLX EQU 02H ;; NEXT +NEXT_LOHX EQU 03H ;; +NEXT_HILX EQU 04H ;; +NEXT_HIHX EQU 05H ;; +TYPE_LOBX EQU 06H ;; TYPE +TYPE_HIBX EQU 07H ;; +TYPE_IDX EQU 08H ;; TYPEID +CPG_LOBX EQU 09H ;; CODE PAGE +CPG_HIBX EQU 0AH ;; +FONT_LOLX EQU 0BH ;; FONT ADDRESS +FONT_LOHX EQU 0CH ;; +FONT_HILX EQU 0DH ;; +FONT_HIHX EQU 0EH ;; + ;; ------------------------------ +MATCHX EQU 0FH ;; MATCH is the end of SEARCH's stages +SCANX EQU 10H ;; SCANX is before the PRE-FOUND stages + ;; ------------------------------ +MOD_LOBX EQU 11H ;; MODIFIER +MOD_HIBX EQU 12H ;; +FONTS_LOBX EQU 13H ;; FONTS +FONTS_HIBX EQU 14H ;; +FDLEN_LOBX EQU 15H ;; FONT DATA LENGTH +FDLEN_HIBX EQU 16H ;; +DISP_ROWSX EQU 17H ;; DISPLAY -- CHAR. SIZE +DISP_COLSX EQU 18H ;; +DISP_XX EQU 19H ;; DISPLAY -- ASPECT RATIO +DISP_YX EQU 1AH ;; +COUNT_LOBX EQU 1BH ;; DISPLAY -- COUNT +COUNT_HIBX EQU 1CH ;; +PTRSELLOX EQU 1DH ;; +PTRSELHIX EQU 1EH ;; +PTRLENLOX EQU 1FH ;; +PTRLENHIX EQU 20H ;; + ;; + ;; ------------------------------ +FOUNDX EQU 21H ;; GET_FX is the end of PRE-FOUND stage +GET_FX EQU 22H ;; + ;; ------------------------------ +PASSX EQU 23H ;; see pass_brk table + ;; ------------------------------ +FTAGX EQU 24H ;; RESTART ==> FILE TAG + ;; +fptr_LOLX EQU 25H ;; POINTER in font file header +fptr_LOHX EQU 26H ;; +fptr_HILX EQU 27H ;; +fptr_HIHX EQU 28H ;; --------------------------------- + ;; +fptr_SKIPX EQU 29H ;; ==> ENTRY_LOX + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; PASS -- to skip some bytes ;;;;;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; the PASS mechanism is used to skip + ;; a number of bytes between two fields + ;; The numbers are tabulated in + ;; PASS_BRK table in the accumulative + ;; sum. The PASS_POSTX(and PASS_POSTXX) + ;; are used to tell what is the stage + ;; after all the bytes have skipped. + ;; +PASS_POSTX DW STAGE_MAX ;; the stage after pass-stage + ;; +FILE_OFFSET EQU 0BH ;; spaces to be skipped in font file : + ;; ( after TAG, before POINTER) + ;; +PASS_CNT DW 0 ;; +PASS_BRK LABEL WORD ;; + DW FILE_OFFSET ;; skip in the font file header + DW FILE_OFFSET+2 ;; pass header-length, needs to reset + ;; PASS_CNT for each of the font_header + DW FILE_OFFSET+8 ;; pass header-reserved bytes +PASS_INDX EQU ($-PASS_BRK)/2 ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; the control variables : ;;;;;;;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +STAGE DW STAGE_MAX ;; of the STAGE-INDEX + ;; +Pre_font_len DW 00000H ;; no. of bytes before the FONT DATA + ;; + ;; +COUNT_LO DW 00000H ;; no. of bytes parsed so far +COUNT_hI DW 00000H ;; + ;; +HIT_LO DW 00000H ;; the next byte that is addressed by : +HIT_HI DW 00000H ;; either NEXT or TARGET in FTBLK. + ;; +HIT_FLAG DW 00000H ;; IF ZERO, the NEXT is approaching +HIT_BX DW 00000H ;; where FTB is found for nearest hit + ;; +NUM_FTB DW 00000H ;; as defined in the FP_BUFFER + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; FONT_PARSER routine +;; +;; -- to be called at every packet received to extract informations +;; from Font File on byte basis. +;; +;; -- Interface though FTABLE +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +FONT_PARSER PROC ;; + PUSH DS ;; save all registers Revised + PUSH ES ;; + PUSH AX ;; + PUSH BX ;; + PUSH CX ;; + PUSH DX ;; + PUSH DI ;; + PUSH SI ;; + ;; BP isn't used, so it isn't saved + LEA BX,FTABLE ;; + PUSH CS ;; + POP ES ;; ES:[BX] + LDS SI,FTP.BUFFER_ADDR ;; DS:[SI] + MOV CX,FTP.BUFFER_LEN ;; CX = length of packet + MOV DX,FTP.NUM_FTBLK ;; DX = number of FTB + MOV cs:num_ftb,DX ;; + AND DX,DX ;; + JNZ VALID_BUFFER ;; + MOV cs:fp_error,0020H ;; ERROR 0020H + JMP FP_RET ;; +VALID_BUFFER : ;; + MOV AX,FTP.FLAG ;; + AND AX,FLAG_RESTART ;; + Jnz has_RESTART ;; + JMP NO_RESTART ;; + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +has_restart : ;; + PUSH BX ;; reset all the output fields + ADD BX,TYPE FBUFS ;; FTP = FONT BLOCK + XOR AX,AX ;; + ;; + MOV cs:ftag_count,AX ;; + MOV cs:fptr_low,AX ;; + MOV cs:fptr_high,AX ;; + MOV cs:pre_font_len,AX ;; + MOV cs:count_lo,AX ;; + MOV cs:count_hi,AX ;; + MOV cs:next_low,AX ;; + MOV cs:next_high,AX ;; + MOV cs:hit_lo,AX ;; + MOV cs:hit_hi,AX ;; + MOV cs:hit_flag,AX ;; + MOV cs:pass_cnt,AX ;; + MOV cs:pass_postx,STAGE_MAX ;; + ;; + MOV cs:stage,STAGE_MAX ;; + ;; +RESET_FTB : ;; + MOV FTP.FTB_STATUS,FSTAT_SEARCH + MOV FTP.FTB_TYPE,AX ;; + MOV FTP.FTB_MOD,AX ;; + MOV FTP.FTB_FONTS,AX ;; + MOV FTP.FTB_ROWS,AL ;; + MOV FTP.FTB_COLS,AL ;; + MOV FTP.FTB_X,AL ;; + MOV FTP.FTB_Y,AL ;; + MOV FTP.FTB_COUNT,AX ;; + MOV FTP.FTB_DLEFT,AX ;; + MOV FTP.FTB_DLEN,AX ;; + MOV FTP.FTB_DALO,AX ;; + MOV FTP.FTB_DAHI,AX ;; + MOV FTP.TARGET_LO,AX ;; + MOV FTP.TARGET_HI,AX ;; + ;; + ADD BX, TYPE FTBLK ;; + ;; + DEC DX ;; + AND DX,DX ;; + JNZ RESET_FTB ;; + ;; + POP BX ;; +NO_RESTART : ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; any FTBLKs have their data all + ;; returned ? if so set their status + ;; from FOUND to COMPLETE + PUSH BX ;; + ADD BX,TYPE FBUFS ;; FTP = FONT BLOCK + ;; + MOV DX,cs:num_ftb ;; + ;; +SET_COMPLETE : ;; + MOV AX,FTP.FTB_STATUS ;; + CMP AX,FSTAT_FONT ;; + JNE SET_NEXT ;; + ;; + MOV AX,FTP.FTB_DLEFT ;; + AND AX,AX ;; + JNZ SET_NEXT ;; + ;; + MOV FTP.FTB_STATUS,FSTAT_COMPLETE + ;; +SET_NEXT : ;; + ;; + ADD BX,TYPE FTBLK ;; + ;; + DEC DX ;; + AND DX,DX ;; + JNZ SET_COMPLETE ;; + ;; + POP BX ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ADD BX,TYPE FBUFS ;; FTP = FONT BLOCK + ;; + PUSH CX ;; STACK 1 = CX +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; DO WHILE CX is not zero : +;; +;; -- on each loop, the CX, COUNTs are updated +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +FTB_LOOP : ;; + POP AX ;; STACK -1 + SUB AX,CX ;; + ADD cs:count_lo,AX ;; + JNC NO_CARRY ;; + ADD cs:count_hi,1000H ;; +NO_CARRY : ;; + PUSH CX ;; STACK 1 = CX + AND CX,CX ;; + JNZ FTB_CONT ;; + JMP FTB_LPEND ;; + ;; DO CASES : +FTB_CONT : ;; ========== + ;; + MOV AX,cs:stage ;; + ;; + CMP AX,STAGE_MAX ;; + JNE FTB_010 ;; + JMP START_CASE ;; ** RESTART ** + ;; +FTB_010 : ;; + CMP AX,MATCHX ;; + JAE FTB_020 ;; + JMP SEARCH_CASE ;; ** SEARCH ** + ;; +FTB_020 : ;; + CMP AX,MATCHX ;; + JNE FTB_030 ;; + JMP MATCH_CASE ;; ** MATCH ** + ;; +FTB_030 : ;; + CMP AX,SCANX ;; + JNE FTB_040 ;; + JMP SCAN_CASE ;; ** SCAN ** + ;; +FTB_040 : ;; + CMP AX,FOUNDX ;; + JAE FTB_050 ;; + JMP PRE_FOUND_CASE ;; ** PRE-FOUND ** + ;; +FTB_050 : ;; + CMP AX,FOUNDX ;; + JNE FTB_060 ;; + JMP FOUND_CASE ;; ** FOUND ** + ;; +FTB_060 : ;; + CMP AX,GET_FX ;; + JNE FTB_070 ;; + JMP GETFONT_CASE ;; ** GET_FONT ** + ;; +FTB_070 : ;; + CMP AX,PASSX ;; + JNE FTB_080 ;; + JMP PASS ;; ** PASS ** + ;; +FTB_080 : ;; + CMP AX,FPTR_SKIPX ;; + JAE FTB_090 ;; + JMP SEARCH_CASE ;; ** SEARCH ** + ;; +FTB_090 : ;; + CMP AX,FPTR_SKIPX ;; + JNE FTB_FFF ;; + JMP FPTR_SKIP_CASE ;; ** SEARCH ** + ;; +FTB_FFF : ;; + MOV FTP.FTB_STATUS,STAT_DEVERR + JMP FTB_LPEND ;; ** DEVICE ERROR ** + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; at the entry of each STAGES /CASES +;; +;; -- DS:[SI] (FPKT) points to PACKET, of DOS's buffer +;; -- CX remaining packet length +;; -- ES:[BX] points to the first FTBLK +;; -- COUNT_LO, COUNT_HI, upto but and including the address pointed by FPKT +;; +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +;============================================================================ +START_CASE : ;; pass the FILE leading bytes + ;; + MOV cs:ftag_count,0 ;; + MOV cs:stage,ftagx ;; + JMP FTB_LOOP ;; + ;; +;============================================================================= +FPTR_SKIP_CASE : ;; skip until the ENTRY pointed by + ;; POINTER (in FPTR) is reached. + ;; + ;; ************** + MOV AX,cs:fptr_low ;; * HIT = FPTR * + MOV cs:hit_lo,AX ;; ************** + MOV DX,cs:fptr_high ;; + MOV cs:hit_hi,DX ;; + ;; + CMP AX,0FFFFH ;; + JNE FPTR_SKIP_VALID ;; + CMP DX,0FFFFH ;; + JNE FPTR_SKIP_VALID ;; + ;; + MOV FTP.FTB_STATUS,STAT_BADATA ;; returned at the first FTBLK + JMP FPTR_SKIP_MORE ;; + ;; +FPTR_SKIP_VALID : ;; + ;; normalised HIT_HI, HIT_LO + MOV AX,DX ;; + AND AX,00FFFH ;; + PUSH CX ;; + MOV CX,4 ;; + SHL AX,CL ;; + POP CX ;; + AND DX,0F000H ;; + ADD AX,cs:hit_lo ;; + JNC NO_CARRY10 ;; + ADD DX,01000H ;; +NO_CARRY10: ;; + MOV cs:hit_lo,AX ;; + MOV cs:hit_hi,DX ;; + ;; ************************** + ;; * compare FPTR and COUNT * + ;; ************************** + ;; DX:AX = HIT_HI:HIT_LO (normalised) + ;; + SUB AX,cs:count_lo ;; + Jnc more_fptrlo ;; + sub dx,01000h ;; + jc fptr_bad ;; + ;; +more_fptrlo : ;; + SUB DX,cs:count_hi ;; + JC fptr_BAD ;; + ;; + INC AX ;; COUNT can be at the HIT, then AX=0 + JNC NO_CARRY11 ;; INC AX to make AX comparable to CX + ADD DX,01000H ;; i.e. AX = offset + 1 + ;; +NO_CARRY11: ;; + CMP AX,CX ;; + JA fptr_skip_more ;; AX > CX, whole CX to be skipped + ;; + PUSH DX ;; normalise dx:ax + AND DX,00FFFH ;; + PUSH CX ;; + MOV CX,4 ;; + SHL DX,CL ;; + POP CX ;; + ADD AX,DX ;; + POP DX ;; + JNC NO_CARRY13 ;; + ADD DX,01000H ;; +NO_CARRY13: ;; + AND DX,0F000H ;; + ;; + PUSH AX ;; + PUSH DX ;; STACK +1 : normalosed DX:AX + SUB AX,CX ;; + JNC NO_BORROW11 ;; + SUB DX,1000H ;; + JC fptr_MORE_CXp ;; dx:ax < cx +NO_BORROW11: ;; + ;; dx:ax >= cx + AND AX,AX ;; + JNE fptr_skip_MOREP ;; + AND DX,DX ;; + JNE fptr_skip_MOREP ;; + ;; dx:ax = cx, or + ;; offset + 1 = CX + ;; + ;; ************************************ + ;; * POINTER is within the current CX * + ;; ************************************ +fptr_MORE_CXP : ;; + POP DX ;; + POP AX ;; STACK -1 + ;; +fptr_MORE_CX : ;; DX = 0,to have more CX than offset+1 + DEC AX ;; = offset : 0 and above + SUB CX,AX ;; + ADD SI,AX ;; where the first byte is + ;; + MOV cs:stage,entry_lox ;; ENTRIES in the font file + ;; + JMP FTB_LOOP ;; ****** RETURN ******* + ;; + ;; *********************************** + ;; * more to skip ==> FPTR_SKIP_CASE * + ;; *********************************** +fptr_skip_morep: ;; + POP DX ;; + POP AX ;; STACK -1 + ;; +fptr_skip_more : ;; + ADD SI,CX ;; + SUB CX,CX ;; + JMP FTB_LOOP ;; ****** RETURN ***** + ;; + ;; *********************************** + ;; * bad POINTER in font file header * + ;; *********************************** + ;; +fptr_bad : ;; + MOV cs:fptr_low,0FFFFH ;; + MOV cs:fptr_high,0FFFFH ;; + ;; + MOV FTP.FTB_STATUS,STAT_BADATA ;; returned at the first FTBLK + ;; + JMP FPTR_SKIP_MORE ;; + ;; +;============================================================================= +SEARCH_CASE : ;; + ;; still looking for header to match + ;; the input : codepage and typeid + ;; + MOV DI,cs:stage ;; + ;; + ADD DI,DI ;; double to index to WORD-offset + ;; + JMP CS:STAGE_CASES[DI] ;; call routine to process the stage + ;; + ;; +;=========================================================================== +MATCH_CASE : ;; + ;; + PUSH BX ;; + MOV DX,cs:num_ftb ;; + ;; + ;; +MATCH_LOOP : ;; + MOV AX,FTP.FTB_STATUS ;; + CMP AX,FSTAT_SEARCH ;; + JE MATCH_SEARCH ;; + JMP MATCH_NEXT ;; + ;; +MATCH_SEARCH : ;; + MOV AX,FTP.FTB_CP ;; check the FTB with SEARCH status + CMP AX,cs:cpg_word ;; + JNE MATCH_MORE ;; + PUSH DS ;; code page matched + PUSH SI ;; + PUSH CX ;; + ;; + PUSH CS ;; + POP DS ;; + MOV SI,OFFSET TYPE_ID ;; + LEA DI,[BX].FTB_TID ;; + MOV CX,8 ;; + REPE CMPSB ;; + ;; + POP CX ;; + POP SI ;; + POP DS ;; + ;; + JNE MATCH_MORE ;; + ;; MATCH !!!!! (type_id matched) + MOV FTP.FTB_STATUS,FSTAT_MATCH + MOV AX,cs:type_word ;; + MOV FTP.FTB_TYPE,AX ;; + MOV AX,cs:font_low ;; + MOV FTP.TARGET_LO,AX ;; + MOV AX,cs:font_high ;; + MOV FTP.TARGET_HI,AX ;; + ;; + JMP MATCH_NEXT ;; + ;; +MATCH_MORE : ;; if this is the last rounf ? + ;; + MOV AX,cs:next_low ;; NEXT = FFFF:FFFF means no more + CMP AX,-1 ;; header to come. + JNE MATCH_NEXT ;; + ;; + MOV AX,cs:next_high ;; + CMP AX,-1 ;; + JNE MATCH_NEXT ;; + ;; + MOV FTP.FTB_STATUS,STAT_NOFIND ;; ERROR : no match + ;; +MATCH_NEXT : ;; + ADD BX,FTP.FTB_LENGTH ;; + DEC DX ;; + AND DX,DX ;; + JZ MATCH_ALL ;; + JMP MATCH_LOOP ;; + ;; +MATCH_ALL : ;; + MOV cs:stage,SCANX ;; + ;; +MATCH_DONE : ;; + POP BX ;; + JMP FTB_LOOP ;; + ;; +;=========================================================================== +SCAN_CASE : ;; + ;; ********************************** + ;; * determine whether it the font * + ;; * data(TARGET),or the next font * + ;; * header(NEXT) that is approaching + ;; ********************************** + ;; + MOV AX,cs:next_low ;; + MOV cs:hit_lo,AX ;; + MOV AX,cs:next_high ;; + MOV cs:hit_hi,AX ;; + XOR AX,AX ;; + MOV cs:hit_flag,AX ;; + ;; + MOV DI,cs:hit_hi ;; normalised HIT_HI, HIT_LO + MOV AX,DI ;; + AND AX,00FFFH ;; + PUSH CX ;; + MOV CX,4 ;; + SHL AX,CL ;; + POP CX ;; + AND DI,0F000H ;; + ADD AX,cs:hit_lo ;; + JNC NO_CARRY2 ;; + ADD DI,01000H ;; +NO_CARRY2 : ;; + MOV cs:hit_lo,AX ;; + MOV cs:hit_hi,DI ;; + ;; + MOV DX,cs:num_ftb ;; + ;; + PUSH BX ;; +SCAN_LOOP : ;; + MOV AX,FTP.FTB_STATUS ;; + CMP AX,FSTAT_MATCH ;; + JNE SCAN_NEXT ;; + ;; + ;; + MOV DI,FTP.TARGET_HI ;; NORMALISED TARGET + MOV AX,DI ;; + AND AX,00FFFH ;; + PUSH CX ;; + MOV CX,4 ;; + SHL AX,CL ;; + POP CX ;; + AND DI,0F000H ;; + ADD AX,FTP.TARGET_LO ;; + JNC NO_CARRY1 ;; + ADD DI,01000H ;; +NO_CARRY1 : ;; DI:AX = NORMALISED TARGET + ;; + ;; ** compare the TARGET and the NEXT + ;; + CMP DI,cs:hit_hi ;; + JA SCAN_NEXT ;; + ;; + JE SCAN_EQU ;; + JMP NEAR_FONT ;; + ;; +SCAN_EQU : ;; + CMP AX,cs:hit_lo ;; + JA SCAN_NEXT ;; + JE SCAN_ERROR_CHK ;; + ;; ********************************** + ;; * the font data is approaching * + ;; ********************************** +NEAR_FONT : ;; + MOV cs:hit_flag,-1 ;; + MOV cs:hit_lo,AX ;; + MOV cs:hit_hi,DI ;; + MOV cs:hit_bx,BX ;; used for BAD_BX and in FOUND_CASE + JMP SCAN_NEXT ;; + ;; + ;; ********************************** + ;; * the NEXT header is approaching * + ;; ********************************** +SCAN_ERROR_CHK : ;; + MOV AX,cs:hit_flag ;; + AND AX,AX ;; + JNZ SCAN_NEXT ;; + MOV FTP.FTB_STATUS,STAT_BADATA ;; next header and font cannot be the + ;; same + ;; +SCAN_NEXT : ;; + DEC DX ;; + AND DX,DX ;; + JZ SCAN_DONE ;; + ;; + ADD BX,FTP.FTB_LENGTH ;; + JMP SCAN_LOOP ;; ** is there any closer font data ? + ;; + ;; ************************************ + ;; * the HIT is either font data(TARGET + ;; * or the font block (NEXT). * + ;; ************************************ +SCAN_DONE : ;; + POP BX ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + MOV DX,cs:hit_hi ;; HIT_FLAG, HIT_LO, HIT_HI defined + MOV AX,cs:hit_lo ;; + ;; + CMP AX,0FFFFH ;; + JNE NOT_FFFF_HIT ;; + CMP DX,0FFFFH ;; + JNE NOT_FFFF_HIT ;; + JMP SCAN_MORE ;; stage remained as SCAN, discard data + ;; +NOT_FFFF_HIT : ;; + ;; DX:AX = HIT_HI:HIT_LO (normalised) + SUB AX,cs:count_lo ;; + JNC NO_BORROW ;; + SUB DX,01000H ;; + JC SCAN_BAD ;; +NO_BORROW: ;; + SUB DX,cs:count_hi ;; + JC SCAN_BAD ;; + ;; + INC AX ;; COUNT can be at the HIT, then AX=0 + JNC NO_CARRYX ;; INC AX to make AX comparable to CX + ADD DX,01000H ;; i.e. AX = offset + 1 + ;; +NO_CARRYX : ;; + CMP AX,CX ;; + JA SCAN_MORE ;; + ;; + PUSH DX ;; + AND DX,00FFFH ;; + PUSH CX ;; + MOV CX,4 ;; + SHL DX,CL ;; + POP CX ;; + ADD AX,DX ;; + POP DX ;; + JNC NO_CARRY3 ;; + ADD DX,01000H ;; +NO_CARRY3 : ;; + AND DX,0F000H ;; + ;; + ;; + PUSH AX ;; + PUSH DX ;; + SUB AX,CX ;; + JNC NO_BORROW1 ;; + SUB DX,1000H ;; + JC MORE_CXp ;; +NO_BORROW1 : ;; + ;; dx:ax >= cx + AND AX,AX ;; + JNE SCAN_MOREP ;; + AND DX,DX ;; + JNE SCAN_MOREP ;; + ;; + ;; offset + 1 = CX + ;; +MORE_CXP : ;; + POP DX ;; + POP AX ;; + ;; +MORE_CX : ;; DX = 0,to have more CX than offset+1 + DEC AX ;; = offset : 0 and above + SUB CX,AX ;; + ADD SI,AX ;; where the first byte is + MOV AX,cs:hit_flag ;; + AND AX,AX ;; + JE NEXT_REACHED ;; + ;; + MOV cs:stage,MOD_LOBX ;; font-data reached, + ;; + JMP FTB_LOOP ;; ****** RETURN ******* + ;; +NEXT_REACHED : ;; + MOV cs:stage,PASSX ;; + MOV cs:pass_postx,next_lolX ;; + MOV cs:pass_cnt,FILE_OFFSET ;; + ;; + ;; + JMP FTB_LOOP ;; ****** RETURN ******* + ;; + ;; *********************************** +SCAN_MOREP : ;; * scan more FTBLK for the nearest * + ;; * font data * + ;; *********************************** + POP DX ;; + POP AX ;; + ;; +SCAN_MORE : ;; + ADD SI,CX ;; + SUB CX,CX ;; + JMP FTB_LOOP ;; more SCAN stage + ;; +SCAN_BAD: ;; ************************* + MOV AX,cs:hit_flag ;; * scan is bad * + AND AX,AX ;; ************************* + JNZ BAD_BX ;; + MOV AX,-1 ;; NEXT is pointing backwards + MOV cs:next_low,AX ;; + MOV cs:next_high,AX ;; no more NEXT + MOV FTP.FTB_STATUS,STAT_BADATA ;; returned at the first FTBLK + JMP FTB_LOOP ;; + ;; +BAD_BX : ;; + PUSH BX ;; FONT is pointing backwards + MOV BX,cs:hit_bx ;; + MOV FTP.FTB_STATUS,STAT_BADATA + POP BX ;; + JMP FTB_LOOP ;; + ;; +;=========================================================================== +PRE_FOUND_CASE : ;; + ;; extract informations from the font + ;; block until font_length is defined + ;; + MOV DI,cs:stage ;; + ;; + ADD DI,DI ;; double to index to WORD-offset + ;; + JMP CS:STAGE_CASES[DI] ;; call routine to process the stage + ;; +;=========================================================================== +FOUND_CASE : ;; + MOV DI,OFFSET FTB_LOOP ;; as FOUND has two places to return to + PUSH DI ;; +;=========================================================================== +FOUND_DO : ;; + ;; define informations into FTBLK of + ;; HIT_BX defined in the SCAN case + PUSH BX ;; + MOV BX,cs:hit_bx ;; + ;; FTBLK : + MOV AX,cs:mod_word ;; + MOV FTP.FTB_MOD,AX ;; + MOV AX,cs:fonts_word ;; + MOV FTP.FTB_FONTS,AX ;; + ;; + MOV AX,cs:fdlen_word ;; + MOV FTP.FTB_DLEFT,AX ;; + MOV FTP.FTB_DLEN,0 ;; + MOV FTP.FTB_DALO,0 ;; + MOV FTP.FTB_DAHI,0 ;; + ;; + MOV FTP.FTB_STATUS,FSTAT_FOUND + ;; + CMP FTP.FTB_TYPE,TYPE_DISPLAY; + JNE CHECK_PTR_TYPE ;; + CMP cs:pre_font_len,PRE_FONT_D ;; + JNE DISPLAY_BAD ;; + JMP DISPLAY_DONE ;; + ;; +CHECK_PTR_TYPE : ;; + CMP FTP.FTB_TYPE,TYPE_PRINTER; + JNE SET_STAGE ;; + CMP cs:ptr_sel_word,0 ;; + JNE PRINTER_HAS_SEL ;; + CMP cs:pre_font_len,PRE_FONT_P0;; + JNE PRINTER_BAD ;; + JMP PRINTER_DONE ;; + ;; +PRINTER_HAS_SEL : ;; + CMP cs:pre_font_len,PRE_FONT_P ;; + JNE PRINTER_BAD ;; + JMP PRINTER_DONE ;; + ;; +DISPLAY_BAD : ;; + ;; + MOV FTP.FTB_STATUS,STAT_BADATA ;the FDLEN_WORD should be 0. + ;; +DISPLAY_DONE : ;; + MOV AL,cs:disp_rows ;; + MOV FTP.FTB_ROWS,AL ;; + MOV AL,cs:disp_cols ;; + MOV FTP.FTB_COLS,AL ;; + MOV AL,cs:disp_x ;; + MOV FTP.FTB_X,AL ;; + MOV AL,cs:disp_y ;; + MOV FTP.FTB_Y,AL ;; + MOV AX,cs:count_word ;; + MOV FTP.FTB_COUNT,AX ;; + JMP SET_STAGE ;; + ;; +PRINTER_BAD : ;; + ;; + MOV FTP.FTB_STATUS,STAT_BADATA ;the FDLEN_WORD should be 0. + ;; +PRINTER_DONE : ;; + MOV AX,cs:ptr_sel_word ;; + MOV FTP.FTB_SELECT,AX ;; + MOV AX,cs:ptr_len_word ;; + MOV FTP.FTB_SELLEN,AX ;; + ;; +SET_STAGE : ;; STAGE : + MOV AX,cs:fdlen_word ;; if no font data to follow + AND AX,AX ;; + JNZ GET_FDATA ;; + MOV cs:stage,SCANX ;; then scan for next header or font + JMP FONT_RET ;; + ;; +GET_FDATA : ;; update the moving target + MOV cs:stage,GET_FX ;; + MOV AX,cs:pre_font_len ;; + ADD FTP.TARGET_LO,AX ;; + JNC FONT_RET ;; + ADD FTP.TARGET_HI,01000H ;; + ;; +FONT_RET : ;; + POP BX ;; + RET ;; + ;; +;=========================================================================== +GETFONT_CASE : ;; as ES:[SI], at COUNT, there is font + ;; data + MOV DX,cs:num_ftb ;; + PUSH BX ;; + ;; + MOV cs:hit_hi,0 ;; temp. register + MOV cs:hit_flag,0 ;; assumed can be changed to SCAN stage + ;; + MOV DI,cs:count_hi ;; normalised COUNT_HI,COUNT_LO + MOV AX,DI ;; + AND AX,00FFFH ;; + PUSH CX ;; + MOV CX,4 ;; + SHL AX,CL ;; + POP CX ;; + AND DI,0F000H ;; + ADD AX,cs:count_lo ;; + JNC NO_CARRY4 ;; + ADD DI,01000H ;; +NO_CARRY4 : ;; + MOV cs:count_lo,AX ;; + MOV cs:count_hi,DI ;; + ;; + ;; +GETFONT_LOOP : ;; + MOV AX,FTP.FTB_STATUS ;; + CMP AX,FSTAT_FONT ;; + JE GETFONT_CONT ;; + ;; + CMP AX,FSTAT_FOUND ;; + JE GETFONT_FOUND ;; + ;; + JMP NEXT_GETFONT ;; + ;; +GETFONT_FOUND : ;; + MOV AX,FTP.FTB_DLEFT ;; + AND AX,AX ;; + JZ NEXT_GF ;; + MOV FTP.FTB_STATUS,FSTAT_FONT; + JMP GETFONT_CONT1 ;; + ;; + ;; +GETFONT_CONT : ;; + MOV AX,FTP.FTB_DLEFT ;; + AND AX,AX ;; + JNZ GETFONT_CONT1 ;; +NEXT_GF : ;; + JMP NEXT_GETFONT ;; + ;; only on FOUND and DLEFT <> 0 +GETFONT_CONT1: ;; + MOV DI,FTP.TARGET_HI ;; normalised TARGET + MOV AX,DI ;; + AND AX,00FFFH ;; + PUSH CX ;; + MOV CX,4 ;; + SHL AX,CL ;; + POP CX ;; + AND DI,0F000H ;; + ADD AX,FTP.TARGET_LO ;; + JNC NO_CARRY5 ;; + ADD DI,01000H ;; +NO_CARRY5 : ;; DI:AX = TARGET (normalised) + ;; + CMP DI,cs:count_hi ;; + JB GETFONT_BAD ;; + JNE NEXT_GETFONT ;; + CMP AX,cs:count_lo ;; + JB GETFONT_BAD ;; + JNE NEXT_GETFONT ;; + ;; + MOV FTP.FTB_DALO,SI ;; where the font data is in the packet + MOV FTP.FTB_DAHI,DS ;; + ;; + MOV AX,FTP.FTB_DLEFT ;; + CMP AX,CX ;; + JAE UPTO_CX ;; + ;; upto FDLEFT + MOV FTP.FTB_DLEFT,0 ;; + MOV FTP.FTB_DLEN,AX ;; + CMP cs:hit_hi,AX ;; + JNB NOT_HIGHER0 ;; + MOV cs:hit_hi,AX ;; +NOT_HIGHER0 : ;; + ADD FTP.TARGET_LO,AX ;; + JNC NEXT_GETFONT ;; + ADD FTP.TARGET_HI,01000H ;; + JMP NEXT_GETFONT ;; + ;; +GETFONT_BAD : ;; + MOV FTP.FTB_STATUS,STAT_BADATA ;; pointing backwards + JMP NEXT_GETFONT ;; + ;; +UPTO_CX : ;; + SUB AX,CX ;; + MOV FTP.FTB_DLEFT,AX ;; + MOV FTP.FTB_DLEN,CX ;; + MOV cs:hit_hi,CX ;; + ADD FTP.TARGET_LO,CX ;; + JNC NO_CARRYOVER ;; + ADD FTP.TARGET_HI,01000H ;; +NO_CARRYOVER : ;; + AND AX,AX ;; all data have been returned ? + JZ NEXT_GETFONT ;; + ;; + MOV cs:hit_flag,-1 ;; no ! stay in the GET_FONT stage + ;; +NEXT_GETFONT : ;; + ADD BX,FTP.FTB_LENGTH ;; + DEC DX ;; + AND DX,DX ;; + JZ GETFONT_END ;; + JMP GETFONT_LOOP ;; + ;; +GETFONT_END : ;; + MOV AX,cs:hit_hi ;; + ADD SI,AX ;; + SUB CX,AX ;; + ;; + CMP cs:hit_flag,0 ;; + Jne GETFONT_DONE ;; + MOV cs:stage,SCANX ;; no more in the GET_FONT stage + ;; + ;; +GETFONT_DONE : ;; + POP BX ;; + JMP FTB_LOOP ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; STAGES -- "called by" SERACH_CASE +;; +;; -- DS:[SI] (FPKT) points to PACKET, of DOS's buffer +;; -- CX remaining packet length +;; -- ES:[BX] points to the first FTBLK +;; -- COUNT_LO, COUNT_HI, upto but not including the address pointed by FPKT +;; +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;;+++++++++++++++++++++++++++++++++ +filetag : ;; + ;; +; mov ax,ftag_len ;; + cmp cs:ftag_count,ftag_len ;; + jB valid_ftag ;; + JE FTAG_FAILED ;; + ;; + mov ftp.ftb_status,stat_deverr + mov cs:fp_error,00022H ;; ERROR 0022H + ;; +FTAG_FAILED : ;; discard all the bytes, while + ADD SI,CX ;; stage stays as FTAGX + SUB CX,CX ;; + JMP FTB_LOOP ;; **** RETURN (bytes discarded) **** + ;; +VALID_FTAG : ;; + MOV AX,FPKT ;; + INC SI ;; + DEC CX ;; + ;; + MOV DI,cs:ftag_count ;; + CMP AL,cs:ftag_pattern[DI] ;; + JE FTAG_NEXTB ;; + ;; + mov ftp.ftb_status,stat_badata + MOV ax,ftag_len ;; stays in FTAGX to consume all bytes + MOV cs:ftag_count,ax ;; stays in FTAGX to consume all bytes + JMP FTB_LOOP ;; **** RETURN (FAILED !) **** + ;; +FTAG_NEXTB : ;; + INC DI ;; + MOV cs:ftag_count,DI ;; + ;; + CMP DI,ftag_len ;; + JE FTAG_DONE ;; + ;; + JMP FTB_LOOP ;; **** RETURN ( MORE TO COME) **** + ;; +FTAG_DONE : ;; + MOV cs:pass_cnt,0 ;; + MOV cs:stage,PASSX ;; + MOV cs:pass_postx,fptr_lolx ;; + ;; + JMP FTB_LOOP ;; **** NEXT STAGE **** + ;; + ;;+++++++++++++++++++++++++++++++++ +fptrLOL : ;; STAGE the low byte of the low fptr + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_fptrLO ;; + MOV cs:fptr_lol,AL ;; + MOV cs:stage,fptr_lohX ;; + JMP FTB_LOOP ;; +WORD_fptrLO : ;; + INC SI ;; + DEC CX ;; + MOV cs:fptr_low,AX ;; + MOV cs:stage,fptr_HILX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +fptrLOH : ;; STAGE the high byte of the low fptr + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:fptr_loh,AL ;; + MOV cs:stage,fptr_HILX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +fptrHIL : ;; STAGE the low byte of the high fptr + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_fptrHI ;; + MOV cs:fptr_hil,AL ;; + MOV cs:stage,fptr_hihX ;; + JMP FTB_LOOP ;; +WORD_fptrHI : ;; + INC SI ;; + DEC CX ;; + MOV cs:fptr_high,AX ;; + MOV cs:stage,FPTR_SKIPX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +fptrHIH : ;; STAGE the high byte of the high fptr + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:fptr_hih,AL ;; + MOV cs:stage,FPTR_SKIPX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +ENTRYLO : ;; STAGE - ENTRY LOW BYTE + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_ENTRY ;; + MOV cs:entry_lob,AL ;; + MOV cs:stage,ENTRY_HIX ;; + JMP FTB_LOOP ;; +WORD_ENTRY : ;; + INC SI ;; + DEC CX ;; + MOV cs:entry_word,AX ;; + MOV cs:stage,PASSX ;; 2 bytes to be passed + MOV cs:pass_postx,NEXT_LOLX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +ENTRYHI : ;; stage - ENTRY HIGN BYTE + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:entry_hib,AL ;; + MOV cs:stage,PASSX ;; 2 bytes to be passed + MOV cs:pass_postx,NEXT_LOLX ;; + AND CX,CX ;; + JNZ ENTHI_PASS1 ;; + JMP FTB_LOOP ;; +ENTHI_PASS1 : ;; + INC SI ;; + INC cs:pass_cnt ;; + DEC CX ;; + AND CX,CX ;; + JNZ ENTHI_PASS2 ;; + JMP FTB_LOOP ;; +ENTHI_PASS2 : ;; + INC SI ;; + INC cs:pass_cnt ;; + DEC CX ;; + MOV cs:stage,NEXT_LOLX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +NEXTLOL : ;; STAGE the low byte of the low NEXT + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_NEXTLO ;; + MOV cs:next_lol,AL ;; + MOV cs:stage,NEXT_LOHX ;; + JMP FTB_LOOP ;; +WORD_NEXTLO : ;; + INC SI ;; + DEC CX ;; + MOV cs:next_low,AX ;; + MOV cs:stage,next_hilX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +NEXTLOH : ;; STAGE the high byte of the low NEXT + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:next_loh,AL ;; + MOV cs:stage,next_hilX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +NEXTHIL : ;; STAGE the low byte of the high NEXT + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_NEXTHI ;; + MOV cs:next_hil,AL ;; + MOV cs:stage,NEXT_HIHX ;; + JMP FTB_LOOP ;; +WORD_NEXTHI : ;; + INC SI ;; + DEC CX ;; + MOV cs:next_high,AX ;; + MOV cs:stage,type_lobX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +NEXTHIH : ;; STAGE the high byte of the high NEXT + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:next_hih,AL ;; + MOV cs:stage,type_lobX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +TYPELO : ;; STAGE the low byte of the TYPE + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_TYPE ;; + MOV cs:type_lob,AL ;; + MOV cs:stage,type_hibX ;; + JMP FTB_LOOP ;; +WORD_TYPE : ;; + INC SI ;; + DEC CX ;; + MOV cs:type_word,AX ;; + MOV cs:stage,type_idX ;; + MOV cs:tid_cnt,0 ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +TYPEHI : ;; STAGE the high byte of the TYPE + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:type_hib,AL ;; + MOV cs:stage,TYPE_IDX ;; + MOV cs:tid_cnt,0 ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +TYPEIDS : ;; STAGE the type id + CMP cs:tid_cnt,8 ;; + JNA VALID_TID ;; + MOV FTP.FTB_STATUS,STAT_DEVERR + MOV cs:fp_error,00021H ;; ERROR 0021H + ADD SI,CX ;; + SUB CX,CX ;; + JMP FTB_LOOP ;; + ;; +VALID_TID : ;; + MOV AX,8 ;; + SUB AX,cs:tid_cnt ;; + CMP CX,AX ;; + JNB TID_ALL ;; + ;; all data in FPKT are stored + PUSH ES ;; + PUSH CS ;; + POP ES ;; + ;; + MOV DI,OFFSET TYPE_ID ;; + ADD DI,cs:tid_cnt ;; + ADD cs:tid_cnt,CX ;; + REP MOVSB ;; SI is incremented accordingly + POP ES ;; + ;; + MOV CX,0 ;; STAGE remained + JMP FTB_LOOP ;; +TID_ALL : ;; + PUSH CX ;; + ;; + PUSH ES ;; + PUSH CS ;; + POP ES ;; + ;; + MOV DI,OFFSET TYPE_ID ;; + ADD DI,cs:tid_cnt ;; + MOV CX,AX ;; + REP MOVSB ;; SI is incremented accordingly + POP ES ;; + ;; + ADD cs:tid_cnt,AX ;; + POP CX ;; + SUB CX,AX ;; + ;; + MOV cs:stage,CPG_LOBX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +CPGLO : ;; STAGE the low byte of the CODE PAGE + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_CPG ;; + MOV cs:cpg_lob,AL ;; + MOV cs:stage,CPG_HIBX ;; + JMP FTB_LOOP ;; +WORD_CPG : ;; + INC SI ;; + DEC CX ;; + MOV cs:cpg_word,AX ;; + MOV cs:stage,PASSX ;; + MOV cs:pass_postx,font_lolX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +CPGHI : ;; STAGE the high byte of the CODE PAGE + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:cpg_hib,AL ;; + MOV cs:stage,PASSX ;; + MOV cs:pass_postx,font_lolX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +FONTLOL : ;; STAGE the low byte of the low FONT + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_FONTLO ;; + MOV cs:font_lol,AL ;; + MOV cs:stage,FONT_LOHX ;; + JMP FTB_LOOP ;; +WORD_FONTLO : ;; + INC SI ;; + DEC CX ;; + MOV cs:font_low,AX ;; + MOV cs:stage,FONT_HILX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +FONTLOH : ;; STAGE the high byte of the low FONT + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:font_loh,AL ;; + MOV cs:stage,FONT_HILX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +FONTHIL : ;; STAGE the low byte of the high FONT + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_FONTHI ;; + MOV cs:font_hil,AL ;; + MOV cs:stage,FONT_HIHX ;; + JMP FTB_LOOP ;; +WORD_FONTHI : ;; + INC SI ;; + DEC CX ;; + MOV cs:font_high,AX ;; +;;;;;; MOV cs:stage,MOD_LOBX ;; end of SCAN + ;; anymore headers to be processed ? + MOV cs:stage,MATCHX ;; + MOV AX,cs:entry_word ;; + DEC AX ;; + MOV cs:entry_word,AX ;; + AND AX,AX ;; + JNZ CHECK_NEXT ;; + ;; no more header to be processed ! + MOV AX,-1 ;; + MOV cs:next_low,AX ;; + MOV cs:next_high,AX ;; as ENTRY has been consumed + JMP FTB_LOOP ;; + ;; +CHECK_NEXT : ;; + MOV AX,cs:next_low ;; + AND AX,AX ;; + JNZ MORE_HEADER ;; + MOV AX,cs:next_high ;; + AND AX,AX ;; + JNZ MORE_HEADER ;; + ;; no more header to be processed ! + MOV AX,-1 ;; + MOV cs:next_low,AX ;; as NEXT is nil + MOV cs:next_high,AX ;; + ;; +MORE_HEADER : ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +FONTHIH : ;; STAGE the high byte of the high FONT + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:font_hih,AL ;; +;;;;; MOV cs:stage,MOD_LOBX ;; end of SCAN + ;; + MOV cs:stage,MATCHX ;; + ;; anymore headers to be processed ? + MOV AX,cs:entry_word ;; + DEC AX ;; + MOV cs:entry_word,AX ;; + AND AX,AX ;; + JNZ CHECK_NEXT0 ;; + ;; no more header to be processed ! + MOV AX,-1 ;; + MOV cs:next_low,AX ;; + MOV cs:next_high,AX ;; as ENTRY has been consumed + JMP FTB_LOOP ;; + ;; +CHECK_NEXT0 : ;; + MOV AX,cs:next_low ;; + AND AX,AX ;; + JNZ MORE_HEADER0 ;; + MOV AX,cs:next_high ;; + AND AX,AX ;; + JNZ MORE_HEADER0 ;; + ;; no more header to be processed ! + MOV AX,-1 ;; + MOV cs:next_low,AX ;; as NEXT is nil + MOV cs:next_high,AX ;; + ;; +MORE_HEADER0 : ;; + JMP FTB_LOOP ;; + ;; + ;;+++++++++++++++++++++++++++++++++ +MODLO : ;; STAGE the low byte of the MODIFIER + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_MOD ;; + MOV MOD_LOB,AL ;; + MOV cs:stage,MOD_HIBX ;; + JMP FTB_LOOP ;; +WORD_MOD : ;; + INC SI ;; + DEC CX ;; + MOV cs:mod_word,AX ;; + MOV cs:stage,fonts_lobX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +MODHI : ;; STAGE the high byte of the MODIFIER + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:mod_hib,AL ;; + MOV cs:stage,FONTS_LOBX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +FONTSLO : ;; STAGE the low byte of the FONTS + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_FONTS ;; + MOV cs:fonts_lob,AL ;; + MOV cs:stage,FONTS_HIBX ;; + JMP FTB_LOOP ;; +WORD_FONTS : ;; + INC SI ;; + DEC CX ;; + MOV cs:fonts_word,AX ;; + MOV cs:stage,FDLEN_LOBX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +FONTSHI : ;; STAGE the high byte of the FONTS + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:fonts_hib,AL ;; + MOV cs:stage,FDLEN_LOBX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +FDLENLO : ;; the low byte of the FONT-LENGTH + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_FDLEN ;; + MOV cs:fdlen_lob,AL ;; + MOV cs:stage,FDLEN_HIBX ;; + JMP FTB_LOOP ;; +WORD_FDLEN : ;; + INC SI ;; + DEC CX ;; + MOV cs:pre_font_len,PRE_FONT_ND;; + MOV cs:fdlen_word,AX ;; + AND AX,AX ;; + JZ NO_DISP_PTR ;; + CMP cs:type_word,TYPE_DISPLAY ;; + JE DISPLAY_TYPE1 ;; + CMP cs:type_word,TYPE_PRINTER ;; + JE PRINTER_TYPE1 ;; + ;; +NO_DISP_PTR : ;; + MOV cs:stage,FOUNDX ;; FSTAT is to be changed + JMP FTB_LOOP ;; +DISPLAY_TYPE1 : ;; + MOV cs:stage,DISP_ROWSX ;; + JMP FTB_LOOP ;; +PRINTER_TYPE1 : ;; + MOV cs:stage,PTRSELLOX ;; + JMP FTB_LOOP ;; + ;; + ;;+++++++++++++++++++++++++++++++++ +FDLENHI : ;; STAGE the high byte of the F-LENGTH + MOV cs:pre_font_len,PRE_FONT_ND + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:fdlen_hib,AL ;; + MOV AX,cs:fdlen_word ;; + AND AX,AX ;; + JZ NO_DISP_PTR2 ;; + CMP cs:type_word,TYPE_DISPLAY ;; + JE DISPLAY_TYPE2 ;; + CMP cs:type_word,TYPE_PRINTER ;; + JE PRINTER_TYPE2 ;; +NO_DISP_PTR2: ;; + MOV cs:stage,FOUNDX ;; FSTAT is to be changed + JMP FTB_LOOP ;; +DISPLAY_TYPE2 : ;; + MOV cs:stage,DISP_ROWSX ;; + JMP FTB_LOOP ;; +PRINTER_TYPE2 : ;; + MOV cs:stage,PTRSELLOX ;; + JMP FTB_LOOP ;; + ;; + ;;+++++++++++++++++++++++++++++++++ +DSPROWS : ;; STAGE : get the rows + XOR AX,AX ;; + MOV cs:disp_rows,AL ;; + MOV cs:disp_cols,AL ;; + MOV cs:DISP_X,AL ;; + MOV cs:disp_y,AL ;; + MOV cs:count_word,AX ;; + ;; + INC cs:pre_font_len ;; + MOV AX,FPKT ;; + INC SI ;; + DEC CX ;; + MOV cs:disp_rows,AL ;; + MOV AX,cs:fdlen_word ;; + DEC AX ;; + MOV cs:fdlen_word,AX ;; + JZ NO_DISP_FONT3 ;; + MOV cs:stage,disp_colsX ;; + JMP FTB_LOOP ;; +NO_DISP_FONT3 : ;; + MOV cs:stage,FOUNDX ;; FSTAT is to be changed + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +DSPCOLS : ;; STAGE : get the COLS + INC cs:pre_font_len ;; + MOV AX,FPKT ;; + INC SI ;; + DEC CX ;; + MOV cs:disp_cols,AL ;; + MOV AX,cs:fdlen_word ;; + DEC AX ;; + MOV cs:fdlen_word,AX ;; + JZ NO_DISP_FONT3 ;; + MOV cs:stage,DISP_XX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +DSPX : ;; STAGE : get the aspect X + INC cs:pre_font_len ;; + MOV AX,FPKT ;; + INC SI ;; + DEC CX ;; + MOV DISP_X,AL ;; + MOV AX,cs:fdlen_word ;; + DEC AX ;; + MOV cs:fdlen_word,AX ;; + JZ NO_DISP_FONT3 ;; + MOV cs:stage,DISP_YX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +DSPY : ;; STAGE : get the aspect Y + INC cs:pre_font_len ;; + MOV AX,FPKT ;; + INC SI ;; + DEC CX ;; + MOV cs:disp_y,AL ;; + MOV AX,cs:fdlen_word ;; + DEC AX ;; + MOV cs:fdlen_word,AX ;; + JZ NO_DISP_FONT3 ;; + MOV cs:stage,COUNT_LOBX ;; + JMP FTB_LOOP ;; + ;; + ;;+++++++++++++++++++++++++++++++++ +DSPCOUNTLO : ;; the low byte of the FONT-LENGTH + INC cs:pre_font_len ;; + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + PUSH AX ;; check if length is enough + MOV AX,cs:fdlen_word ;; + DEC AX ;; + MOV cs:fdlen_word,AX ;; + POP AX ;; + JNZ A_WORD_COUNT ;; + JMP NO_DISP_FONT3 ;; +A_WORD_COUNT : ;; + AND CX,CX ;; + JNZ WORD_COUNT ;; + MOV cs:count_lob,AL ;; + MOV cs:stage,COUNT_HIBX ;; + JMP FTB_LOOP ;; +WORD_COUNT : ;; + INC cs:pre_font_len ;; + INC SI ;; + DEC CX ;; + MOV cs:count_word,AX ;; +; MOV cs:pre_font_len,PRE_FONT_D; + ;; + MOV AX,cs:fdlen_word ;; + DEC AX ;; + MOV cs:fdlen_word,AX ;; + MOV cs:stage,FOUNDX ;; FSTAT is to be changed + JMP FTB_LOOP ;; + ;; + ;;+++++++++++++++++++++++++++++++++ +DSPCOUNTHI : ;; STAGE the high byte of the F-LENGTH + INC cs:pre_font_len ;; + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:count_hib,AL ;; +; MOV cs:pre_font_len,PRE_FONT_D; + ;; + MOV AX,cs:fdlen_word ;; + DEC AX ;; + MOV cs:fdlen_word,AX ;; + MOV cs:stage,FOUNDX ;; FSTAT is to be changed + JMP FTB_LOOP ;; + ;; + ;; + ;;+++++++++++++++++++++++++++++++++ +PTRSELLO : ;; the low byte of the SELECTION_TYPE + INC cs:pre_font_len ;; + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + PUSH AX ;; check if length is enough + MOV AX,cs:fdlen_word ;; + DEC AX ;; + MOV cs:fdlen_word,AX ;; + POP AX ;; + JNZ A_WORD_SEL ;; + JMP NO_PTR_FONT3 ;; +A_WORD_SEL : ;; + AND CX,CX ;; + JNZ WORD_SEL ;; + MOV cs:ptr_selob,AL ;; + MOV cs:stage,PTRSELHIX ;; + JMP FTB_LOOP ;; +WORD_SEL : ;; + INC cs:pre_font_len ;; + INC SI ;; + DEC CX ;; + MOV cs:ptr_sel_word,AX ;; + ;; + MOV AX,cs:fdlen_word ;; + DEC AX ;; + MOV cs:fdlen_word,AX ;; + ;; + CMP cs:ptr_sel_word,0 ;; + JNE PTR_SEL_NOT0 ;; + ;; + ;; + MOV cs:stage,FOUNDX ;; FSTAT is to be changed + JMP FTB_LOOP ;; + ;; +PTR_SEL_NOT0 : ;; + MOV cs:stage,PTRLENLOX ;; + JMP FTB_LOOP ;; + ;; + ;;+++++++++++++++++++++++++++++++++ +PTRSELHI: ;; STAGE the high byte of SELECT_TYPE + INC cs:pre_font_len ;; + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:ptr_sehib,AL ;; + ;; + MOV AX,cs:fdlen_word ;; + DEC AX ;; + MOV cs:fdlen_word,AX ;; + ;; + CMP cs:ptr_sel_word,0 ;; + JNE PTR_SEL_NOT0 ;; + ;; + ;; + MOV cs:stage,FOUNDX ;; FSTAT is to be changed + JMP FTB_LOOP ;; + ;; + ;; + ;;+++++++++++++++++++++++++++++++++ +PTRLENLO : ;; the low byte of SELECTION_LENGTH + INC cs:pre_font_len ;; + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + PUSH AX ;; check if length is enough + MOV AX,cs:fdlen_word ;; + DEC AX ;; + MOV cs:fdlen_word,AX ;; + POP AX ;; + JNZ A_WORD_SELEN ;; + JMP NO_PTR_FONT3 ;; +A_WORD_SELEN : ;; + AND CX,CX ;; + JNZ WORD_SELEN ;; + MOV cs:ptr_lnlob,AL ;; + MOV cs:stage,PTRLENHIX ;; + JMP FTB_LOOP ;; +WORD_SELEN : ;; + INC cs:pre_font_len ;; + INC SI ;; + DEC CX ;; + MOV cs:ptr_len_word,AX ;; + ;; + MOV AX,cs:fdlen_word ;; + DEC AX ;; + MOV cs:fdlen_word,AX ;; + MOV cs:stage,FOUNDX ;; FSTAT is to be changed + JMP FTB_LOOP ;; + ;; + ;;+++++++++++++++++++++++++++++++++ +PTRLENHI : ;; STAGE the high byte of SELECT_LENGTH + INC cs:pre_font_len ;; + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:ptr_lnhib,AL ;; + ;; + MOV AX,cs:fdlen_word ;; + DEC AX ;; + MOV cs:fdlen_word,AX ;; + MOV cs:stage,FOUNDX ;; FSTAT is to be changed + JMP FTB_LOOP ;; + ;; +NO_PTR_FONT3 : ;; + MOV cs:stage,FOUNDX ;; FSTAT is to be changed + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +PASS : ;; STAGE - PASS DUMMY BYTES + ;; + PUSH DX ;; + PUSH ES ;; + PUSH DI ;; + ;; + PUSH CS ;; + POP ES ;; + MOV DI,OFFSET PASS_BRK ;; + MOV DX,PASS_INDX ;; + MOV AX,cs:pass_cnt ;; + ;; +NEXT_BRK: ;; find the next pass-break + CMP AX,ES:[DI] ;; + ;; + JB UPTO_BRK ;; + ;; + DEC DX ;; + JZ PASS_ERR ;; + INC DI ;; + INC DI ;; + JMP NEXT_BRK ;; + ;; +UPTO_BRK : ;; next break point found + MOV DX,ES:[DI] ;; + SUB DX,AX ;; bytes to be skipped + CMP CX,DX ;; all to be skipped ? + JAE PASS_ALL ;; + ;; + ADD cs:pass_cnt,CX ;; + ADD SI,CX ;; + SUB CX,CX ;; + JMP PASS_END ;; + ;; +PASS_ALL : ;; + ADD cs:pass_cnt,DX ;; + ADD SI,DX ;; + SUB CX,DX ;; + ;; + MOV AX,cs:pass_postx ;; + MOV cs:stage,AX ;; + ;; +; cmp ax,passx ;; is the next stage a pass-stage ? +; jne not_passx ;; +; mov ax,pass_postxx ;; +; mov pass_postx,ax ;; +; mov pass_postxx,stage_max ;; can support only 2 consecutive pass + ;; +;not_passx : ;; + ;; + JMP PASS_END ;; + ;; +PASS_ERR : ;; DEVICE ERROR, wrong stage + POP DI ;; + POP ES ;; + POP DX ;; + MOV FTP.FTB_STATUS,STAT_DEVERR + SUB CX,CX ;; ignore all the input string + JMP PASS_DONE ;; + ;; +PASS_END : ;; + POP DI ;; + POP ES ;; + POP DX ;; +PASS_DONE : ;; + JMP FTB_LOOP ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +FTB_LPEND : ;; + ;; + CMP cs:stage,FOUNDX ;; + JNE NOT_FOUNDX ;; + ;; + CALL FOUND_DO ;; + ;; +NOT_FOUNDX : ;; + ;; + POP CX ;; STACK -1 + ;; +FP_RET : ;; + POP SI ;; restore registers + POP DI ;; + POP DX ;; + POP CX ;; + POP BX ;; + POP AX ;; + POP ES ;; + POP DS ;; + ;; + RET ;; +FONT_PARSER ENDP ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +CSEG ENDS + END diff --git a/v4.0/src/DEV/PRINTER/CPSFONT3.ASM b/v4.0/src/DEV/PRINTER/CPSFONT3.ASM new file mode 100644 index 0000000..74fa12b --- /dev/null +++ b/v4.0/src/DEV/PRINTER/CPSFONT3.ASM @@ -0,0 +1,1961 @@ + + PAGE ,132 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; FILENAME: CPS Device Driver -- Font Parser +;; MODULE NAME: CPSFONT +;; TYPE: Font Parser Module +;; LINK PROCEDURE: Link CPS+CPSSUB+CPSINT9+...+CPSINIT into .EXE format +;; CPS must be first. CPSINIT must be last. Everything +;; before CPSINIT will be resident. +;; INCLUDE FILES: +;; CPSPEQU.INC +;; +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +INCLUDE CPSPEQU.INC ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CSEG SEGMENT PUBLIC 'CODE' ;; + ASSUME CS:CSEG ;; + ASSUME DS:NOTHING ;; + ;; +PUBLIC FTABLE,FONT_PARSER ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; ************************************ +;; ** ** +;; ** Resident Code ** +;; ** ** +;; ************************************ +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; FONT_PARSER data +;; +;; -- Interface table : FTABLE +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +FTABLE: FBUFS <0FFFFH,,,> ;; for temporary testing +FTB1 FTBLK <,,,,,,,,,,,,> ;; -- at most 12 entries +FTB2 FTBLK <,,,,,,,,,,,,> ;; +FTB3 FTBLK <,,,,,,,,,,,,> ;; +FTB4 FTBLK <,,,,,,,,,,,,> ;; +FTB5 FTBLK <,,,,,,,,,,,,> ;; +FTB6 FTBLK <,,,,,,,,,,,,> ;; +FTB7 FTBLK <,,,,,,,,,,,,> ;; +FTB8 FTBLK <,,,,,,,,,,,,> ;; +FTB9 FTBLK <,,,,,,,,,,,,> ;; +FTBa FTBLK <,,,,,,,,,,,,> ;; +FTBb FTBLK <,,,,,,,,,,,,> ;; +FTBc FTBLK <,,,,,,,,,,,,> ;; + ;; +FP_ERROR DW 0000H ;; internal error register + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; the followings are bytes accumulated + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +FTAG_LEN EQU 8 ;; FILE TAGE in the font file header +FTAG_COUNT DW 0000H ;; + ;; +FTAG_PATTERN LABEL BYTE ;; + DB 0FFH ;; + DB 'FONT ' ;; + ;; + ;; + ;; POINTER in the font file header +fptr_LOW LABEL WORD ;; +fptr_LOL DB 00H ;; NEXT +fptr_LOH DB 00H ;; +fptr_HIGH LABEL WORD ;; +fptr_HIL DB 00H ;; +fptr_HIH DB 00H ;; + ;; + ;; + ;; +ENTRY_WORD LABEL WORD ;; +ENTRY_LOB DB 00H ;; ENTRY COUNT +ENTRY_HIB DB 00H ;; +NEXT_LOW LABEL WORD ;; +NEXT_LOL DB 00H ;; NEXT +NEXT_LOH DB 00H ;; +NEXT_HIGH LABEL WORD ;; +NEXT_HIL DB 00H ;; +NEXT_HIH DB 00H ;; +TYPE_WORD LABEL WORD ;; +TYPE_LOB DB 00H ;; TYPE +TYPE_HIB DB 00H ;; +TID_CNT DW 00000H ;; TYPEID COUNT(0 to 8) +TYPE_ID : DB ' ' ;; TYPEID +CPG_WORD LABEL WORD ;; +CPG_LOB DB 00H ;; CODE PAGE +CPG_HIB DB 00H ;; +FONT_LOW LABEL WORD ;; +FONT_LOL DB 00H ;; FONT ADDRESS +FONT_LOH DB 00H ;; +FONT_HIGH LABEL WORD ;; +FONT_HIL DB 00H ;; +FONT_HIH DB 00H ;; +;; the followings are contained in the font-block in the exact order & length +MOD_WORD LABEL WORD ;; +MOD_LOB DB 00H ;; MODIFIER +MOD_HIB DB 00H ;; +FONTS_WORD LABEL WORD ;; +FONTS_LOB DB 00H ;; FONTS +FONTS_HIB DB 00H ;; +FDLEN_WORD LABEL WORD ;; +FDLEN_LOB DB 00H ;; FONT DATA LENGTH +FDLEN_HIB DB 00H ;; +PRE_FONT_ND EQU ($-MOD_WORD) ;; used to update target for font data + ;; to follow. -- for NON-DISPLAY +DISP_ROWS DB 00H ;; DISPLAY's parameters : +DISP_COLS DB 00H ;; BOX SIZE +DISP_X DB 00H ;; ASPECT RATIO +DISP_Y DB 00H ;; +COUNT_WORD LABEL WORD ;; NO. OF DISPLAY CHARACTERS +COUNT_LOB DB 00H ;; +COUNT_HIB DB 00H ;; +PRE_FONT_D EQU ($-MOD_WORD) ;; used to update target for font data + ;; to follow. -- for DISPLAY + ;; +PTR_SEL_WORD LABEL WORD ;; +PTR_SELOB DB 00H ;; +PTR_SEHIB DB 00H ;; +PRE_FONT_P0 EQU ($-PTR_SELOB+PRE_FONT_ND) ;; to update target for font data + ;; to follow -- for PRINTER with + ;; selection type = 0. + ;; +PTR_LEN_WORD LABEL WORD ;; +PTR_LNLOB DB 00H ;; +PTR_LNHIB DB 00H ;; +PRE_FONT_P EQU ($-PTR_SELOB+PRE_FONT_ND) ;; to update target for font data + ;; to follow -- for PRINTER with + ;; selection type <> 0. + ;; + ;; +;; also update STAGE_CASES and indexing constants + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; the stage the parsing is in : ;;;;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +STAGE_CASES LABEL WORD ;; the stage the parsing is in : + ;; + ;; *** INDEXED BY STAGE-INDEX + ;; + DW OFFSET ENTRYLO ;; 0 + DW OFFSET ENTRYHI ;; 1 + DW OFFSET NEXTLOL ;; 2 + DW OFFSET NEXTLOH ;; 3 + DW OFFSET NEXTHIL ;; 4 + DW OFFSET NEXTHIH ;; 5 + DW OFFSET TYPELO ;; 6 + DW OFFSET TYPEHI ;; 7 + DW OFFSET TYPEIDS ;; 8 + DW OFFSET CPGLO ;; 9 + DW OFFSET CPGHI ;; A + DW OFFSET FONTLOL ;; B + DW OFFSET FONTLOH ;; C + DW OFFSET FONTHIL ;; D + DW OFFSET FONTHIH ;; E + DW 00H ;; MATCH case -- end of SEARCH stages + DW 00H ;; SCAN case -- before PRE-FOUND stage + DW OFFSET MODLO ;; 11 + DW OFFSET MODHI ;; 12 + DW OFFSET FONTSLO ;; 13 + DW OFFSET FONTSHI ;; 14 + DW OFFSET FDLENLO ;; 15 + DW OFFSET FDLENHI ;; 16 -- lead to FONT case,NON- DISPLAY + DW OFFSET DSPROWS ;; 17 -- DISPLAY only + DW OFFSET DSPCOLS ;; 18 + DW OFFSET DSPX ;; 19 + DW OFFSET DSPY ;; 1A + DW OFFSET DSPCOUNTLO ;; 1B + DW OFFSET DSPCOUNTHI ;; 1C -- lead to FONT case, DISPLAY + DW OFFSET PTRSELLO ;; 1D -- PRINTER only + DW OFFSET PTRSELHI ;; 1E + DW OFFSET PTRLENLO ;; 1F + DW OFFSET PTRLENHI ;; 20 -- lead to FONT case, PRINTER + DW 00H ;; FOUND case + DW 00H ;; GET_FONT case + DW 00H ;; PASS special stage + DW OFFSET FILETAG ;; 24 + DW OFFSET fptrLOL ;; 25 + DW OFFSET fptrLOH ;; 26 + DW OFFSET fptrHIL ;; 27 + DW OFFSET fptrHIH ;; 28 + DW 00H ;; FPTR_SKIP_CASE + ;; + ;; The followings are individual stage +STAGE_MAX EQU ($-STAGE_CASES)/2 ;; number of stages + ;; + ;; STAGE-INDEX + ;; + ;; **** INDEX TO STAGE_CASES **** +ENTRY_LOX EQU 00H ;; +ENTRY_HIX EQU 01H ;; +NEXT_LOLX EQU 02H ;; NEXT +NEXT_LOHX EQU 03H ;; +NEXT_HILX EQU 04H ;; +NEXT_HIHX EQU 05H ;; +TYPE_LOBX EQU 06H ;; TYPE +TYPE_HIBX EQU 07H ;; +TYPE_IDX EQU 08H ;; TYPEID +CPG_LOBX EQU 09H ;; CODE PAGE +CPG_HIBX EQU 0AH ;; +FONT_LOLX EQU 0BH ;; FONT ADDRESS +FONT_LOHX EQU 0CH ;; +FONT_HILX EQU 0DH ;; +FONT_HIHX EQU 0EH ;; + ;; ------------------------------ +MATCHX EQU 0FH ;; MATCH is the end of SEARCH's stages +SCANX EQU 10H ;; SCANX is before the PRE-FOUND stages + ;; ------------------------------ +MOD_LOBX EQU 11H ;; MODIFIER +MOD_HIBX EQU 12H ;; +FONTS_LOBX EQU 13H ;; FONTS +FONTS_HIBX EQU 14H ;; +FDLEN_LOBX EQU 15H ;; FONT DATA LENGTH +FDLEN_HIBX EQU 16H ;; +DISP_ROWSX EQU 17H ;; DISPLAY -- CHAR. SIZE +DISP_COLSX EQU 18H ;; +DISP_XX EQU 19H ;; DISPLAY -- ASPECT RATIO +DISP_YX EQU 1AH ;; +COUNT_LOBX EQU 1BH ;; DISPLAY -- COUNT +COUNT_HIBX EQU 1CH ;; +PTRSELLOX EQU 1DH ;; +PTRSELHIX EQU 1EH ;; +PTRLENLOX EQU 1FH ;; +PTRLENHIX EQU 20H ;; + ;; + ;; ------------------------------ +FOUNDX EQU 21H ;; GET_FX is the end of PRE-FOUND stage +GET_FX EQU 22H ;; + ;; ------------------------------ +PASSX EQU 23H ;; see pass_brk table + ;; ------------------------------ +FTAGX EQU 24H ;; RESTART ==> FILE TAG + ;; +fptr_LOLX EQU 25H ;; POINTER in font file header +fptr_LOHX EQU 26H ;; +fptr_HILX EQU 27H ;; +fptr_HIHX EQU 28H ;; --------------------------------- + ;; +fptr_SKIPX EQU 29H ;; ==> ENTRY_LOX + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; PASS -- to skip some bytes ;;;;;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; the PASS mechanism is used to skip + ;; a number of bytes between two fields + ;; The numbers are tabulated in + ;; PASS_BRK table in the accumulative + ;; sum. The PASS_POSTX(and PASS_POSTXX) + ;; are used to tell what is the stage + ;; after all the bytes have skipped. + ;; +PASS_POSTX DW STAGE_MAX ;; the stage after pass-stage + ;; +FILE_OFFSET EQU 0BH ;; spaces to be skipped in font file : + ;; ( after TAG, before POINTER) + ;; +PASS_CNT DW 0 ;; +PASS_BRK LABEL WORD ;; + DW FILE_OFFSET ;; skip in the font file header + DW FILE_OFFSET+2 ;; pass header-length, needs to reset + ;; PASS_CNT for each of the font_header + DW FILE_OFFSET+8 ;; pass header-reserved bytes +PASS_INDX EQU ($-PASS_BRK)/2 ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; the control variables : ;;;;;;;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +STAGE DW STAGE_MAX ;; of the STAGE-INDEX + ;; +Pre_font_len DW 00000H ;; no. of bytes before the FONT DATA + ;; + ;; +COUNT_LO DW 00000H ;; no. of bytes parsed so far +COUNT_hI DW 00000H ;; + ;; +HIT_LO DW 00000H ;; the next byte that is addressed by : +HIT_HI DW 00000H ;; either NEXT or TARGET in FTBLK. + ;; +HIT_FLAG DW 00000H ;; IF ZERO, the NEXT is approaching +HIT_BX DW 00000H ;; where FTB is found for nearest hit + ;; +NUM_FTB DW 00000H ;; as defined in the FP_BUFFER + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; FONT_PARSER routine +;; +;; -- to be called at every packet received to extract informations +;; from Font File on byte basis. +;; +;; -- Interface though FTABLE +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +FONT_PARSER PROC ;; + PUSH DS ;; save all registers Revised + PUSH ES ;; + PUSH AX ;; + PUSH BX ;; + PUSH CX ;; + PUSH DX ;; + PUSH DI ;; + PUSH SI ;; + ;; BP isn't used, so it isn't saved + LEA BX,FTABLE ;; + PUSH CS ;; + POP ES ;; ES:[BX] + LDS SI,FTP.BUFFER_ADDR ;; DS:[SI] + MOV CX,FTP.BUFFER_LEN ;; CX = length of packet + MOV DX,FTP.NUM_FTBLK ;; DX = number of FTB + MOV cs:num_ftb,DX ;; + AND DX,DX ;; + JNZ VALID_BUFFER ;; + MOV cs:fp_error,0020H ;; ERROR 0020H + JMP FP_RET ;; +VALID_BUFFER : ;; + MOV AX,FTP.FLAG ;; + AND AX,FLAG_RESTART ;; + Jnz has_RESTART ;; + JMP NO_RESTART ;; + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +has_restart : ;; + PUSH BX ;; reset all the output fields + ADD BX,TYPE FBUFS ;; FTP = FONT BLOCK + XOR AX,AX ;; + ;; + MOV cs:ftag_count,AX ;; + MOV cs:fptr_low,AX ;; + MOV cs:fptr_high,AX ;; + MOV cs:pre_font_len,AX ;; + MOV cs:count_lo,AX ;; + MOV cs:count_hi,AX ;; + MOV cs:next_low,AX ;; + MOV cs:next_high,AX ;; + MOV cs:hit_lo,AX ;; + MOV cs:hit_hi,AX ;; + MOV cs:hit_flag,AX ;; + MOV cs:pass_cnt,AX ;; + MOV cs:pass_postx,STAGE_MAX ;; + ;; + MOV cs:stage,STAGE_MAX ;; + ;; +RESET_FTB : ;; + MOV FTP.FTB_STATUS,FSTAT_SEARCH + MOV FTP.FTB_TYPE,AX ;; + MOV FTP.FTB_MOD,AX ;; + MOV FTP.FTB_FONTS,AX ;; + MOV FTP.FTB_ROWS,AL ;; + MOV FTP.FTB_COLS,AL ;; + MOV FTP.FTB_X,AL ;; + MOV FTP.FTB_Y,AL ;; + MOV FTP.FTB_COUNT,AX ;; + MOV FTP.FTB_DLEFT,AX ;; + MOV FTP.FTB_DLEN,AX ;; + MOV FTP.FTB_DALO,AX ;; + MOV FTP.FTB_DAHI,AX ;; + MOV FTP.TARGET_LO,AX ;; + MOV FTP.TARGET_HI,AX ;; + ;; + ADD BX, TYPE FTBLK ;; + ;; + DEC DX ;; + AND DX,DX ;; + JNZ RESET_FTB ;; + ;; + POP BX ;; +NO_RESTART : ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; any FTBLKs have their data all + ;; returned ? if so set their status + ;; from FOUND to COMPLETE + PUSH BX ;; + ADD BX,TYPE FBUFS ;; FTP = FONT BLOCK + ;; + MOV DX,cs:num_ftb ;; + ;; +SET_COMPLETE : ;; + MOV AX,FTP.FTB_STATUS ;; + CMP AX,FSTAT_FONT ;; + JNE SET_NEXT ;; + ;; + MOV AX,FTP.FTB_DLEFT ;; + AND AX,AX ;; + JNZ SET_NEXT ;; + ;; + MOV FTP.FTB_STATUS,FSTAT_COMPLETE + ;; +SET_NEXT : ;; + ;; + ADD BX,TYPE FTBLK ;; + ;; + DEC DX ;; + AND DX,DX ;; + JNZ SET_COMPLETE ;; + ;; + POP BX ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ADD BX,TYPE FBUFS ;; FTP = FONT BLOCK + ;; + PUSH CX ;; STACK 1 = CX +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; DO WHILE CX is not zero : +;; +;; -- on each loop, the CX, COUNTs are updated +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +FTB_LOOP : ;; + POP AX ;; STACK -1 + SUB AX,CX ;; + ADD cs:count_lo,AX ;; + JNC NO_CARRY ;; + ADD cs:count_hi,1000H ;; +NO_CARRY : ;; + PUSH CX ;; STACK 1 = CX + AND CX,CX ;; + JNZ FTB_CONT ;; + JMP FTB_LPEND ;; + ;; DO CASES : +FTB_CONT : ;; ========== + ;; + MOV AX,cs:stage ;; + ;; + CMP AX,STAGE_MAX ;; + JNE FTB_010 ;; + JMP START_CASE ;; ** RESTART ** + ;; +FTB_010 : ;; + CMP AX,MATCHX ;; + JAE FTB_020 ;; + JMP SEARCH_CASE ;; ** SEARCH ** + ;; +FTB_020 : ;; + CMP AX,MATCHX ;; + JNE FTB_030 ;; + JMP MATCH_CASE ;; ** MATCH ** + ;; +FTB_030 : ;; + CMP AX,SCANX ;; + JNE FTB_040 ;; + JMP SCAN_CASE ;; ** SCAN ** + ;; +FTB_040 : ;; + CMP AX,FOUNDX ;; + JAE FTB_050 ;; + JMP PRE_FOUND_CASE ;; ** PRE-FOUND ** + ;; +FTB_050 : ;; + CMP AX,FOUNDX ;; + JNE FTB_060 ;; + JMP FOUND_CASE ;; ** FOUND ** + ;; +FTB_060 : ;; + CMP AX,GET_FX ;; + JNE FTB_070 ;; + JMP GETFONT_CASE ;; ** GET_FONT ** + ;; +FTB_070 : ;; + CMP AX,PASSX ;; + JNE FTB_080 ;; + JMP PASS ;; ** PASS ** + ;; +FTB_080 : ;; + CMP AX,FPTR_SKIPX ;; + JAE FTB_090 ;; + JMP SEARCH_CASE ;; ** SEARCH ** + ;; +FTB_090 : ;; + CMP AX,FPTR_SKIPX ;; + JNE FTB_FFF ;; + JMP FPTR_SKIP_CASE ;; ** SEARCH ** + ;; +FTB_FFF : ;; + MOV FTP.FTB_STATUS,STAT_DEVERR + JMP FTB_LPEND ;; ** DEVICE ERROR ** + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; at the entry of each STAGES /CASES +;; +;; -- DS:[SI] (FPKT) points to PACKET, of DOS's buffer +;; -- CX remaining packet length +;; -- ES:[BX] points to the first FTBLK +;; -- COUNT_LO, COUNT_HI, upto but and including the address pointed by FPKT +;; +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +;============================================================================ +START_CASE : ;; pass the FILE leading bytes + ;; + MOV cs:ftag_count,0 ;; + MOV cs:stage,ftagx ;; + JMP FTB_LOOP ;; + ;; +;============================================================================= +FPTR_SKIP_CASE : ;; skip until the ENTRY pointed by + ;; POINTER (in FPTR) is reached. + ;; + ;; ************** + MOV AX,cs:fptr_low ;; * HIT = FPTR * + MOV cs:hit_lo,AX ;; ************** + MOV DX,cs:fptr_high ;; + MOV cs:hit_hi,DX ;; + ;; + CMP AX,0FFFFH ;; + JNE FPTR_SKIP_VALID ;; + CMP DX,0FFFFH ;; + JNE FPTR_SKIP_VALID ;; + ;; + MOV FTP.FTB_STATUS,STAT_BADATA ;; returned at the first FTBLK + JMP FPTR_SKIP_MORE ;; + ;; +FPTR_SKIP_VALID : ;; + ;; normalised HIT_HI, HIT_LO + MOV AX,DX ;; + AND AX,00FFFH ;; + PUSH CX ;; + MOV CX,4 ;; + SHL AX,CL ;; + POP CX ;; + AND DX,0F000H ;; + ADD AX,cs:hit_lo ;; + JNC NO_CARRY10 ;; + ADD DX,01000H ;; +NO_CARRY10: ;; + MOV cs:hit_lo,AX ;; + MOV cs:hit_hi,DX ;; + ;; ************************** + ;; * compare FPTR and COUNT * + ;; ************************** + ;; DX:AX = HIT_HI:HIT_LO (normalised) + ;; + SUB AX,cs:count_lo ;; + Jnc more_fptrlo ;; + sub dx,01000h ;; + jc fptr_bad ;; + ;; +more_fptrlo : ;; + SUB DX,cs:count_hi ;; + JC fptr_BAD ;; + ;; + INC AX ;; COUNT can be at the HIT, then AX=0 + JNC NO_CARRY11 ;; INC AX to make AX comparable to CX + ADD DX,01000H ;; i.e. AX = offset + 1 + ;; +NO_CARRY11: ;; + CMP AX,CX ;; + JA fptr_skip_more ;; AX > CX, whole CX to be skipped + ;; + PUSH DX ;; normalise dx:ax + AND DX,00FFFH ;; + PUSH CX ;; + MOV CX,4 ;; + SHL DX,CL ;; + POP CX ;; + ADD AX,DX ;; + POP DX ;; + JNC NO_CARRY13 ;; + ADD DX,01000H ;; +NO_CARRY13: ;; + AND DX,0F000H ;; + ;; + PUSH AX ;; + PUSH DX ;; STACK +1 : normalosed DX:AX + SUB AX,CX ;; + JNC NO_BORROW11 ;; + SUB DX,1000H ;; + JC fptr_MORE_CXp ;; dx:ax < cx +NO_BORROW11: ;; + ;; dx:ax >= cx + AND AX,AX ;; + JNE fptr_skip_MOREP ;; + AND DX,DX ;; + JNE fptr_skip_MOREP ;; + ;; dx:ax = cx, or + ;; offset + 1 = CX + ;; + ;; ************************************ + ;; * POINTER is within the current CX * + ;; ************************************ +fptr_MORE_CXP : ;; + POP DX ;; + POP AX ;; STACK -1 + ;; +fptr_MORE_CX : ;; DX = 0,to have more CX than offset+1 + DEC AX ;; = offset : 0 and above + SUB CX,AX ;; + ADD SI,AX ;; where the first byte is + ;; + MOV cs:stage,entry_lox ;; ENTRIES in the font file + ;; + JMP FTB_LOOP ;; ****** RETURN ******* + ;; + ;; *********************************** + ;; * more to skip ==> FPTR_SKIP_CASE * + ;; *********************************** +fptr_skip_morep: ;; + POP DX ;; + POP AX ;; STACK -1 + ;; +fptr_skip_more : ;; + ADD SI,CX ;; + SUB CX,CX ;; + JMP FTB_LOOP ;; ****** RETURN ***** + ;; + ;; *********************************** + ;; * bad POINTER in font file header * + ;; *********************************** + ;; +fptr_bad : ;; + MOV cs:fptr_low,0FFFFH ;; + MOV cs:fptr_high,0FFFFH ;; + ;; + MOV FTP.FTB_STATUS,STAT_BADATA ;; returned at the first FTBLK + ;; + JMP FPTR_SKIP_MORE ;; + ;; +;============================================================================= +SEARCH_CASE : ;; + ;; still looking for header to match + ;; the input : codepage and typeid + ;; + MOV DI,cs:stage ;; + ;; + ADD DI,DI ;; double to index to WORD-offset + ;; + JMP CS:STAGE_CASES[DI] ;; call routine to process the stage + ;; + ;; +;=========================================================================== +MATCH_CASE : ;; + ;; + PUSH BX ;; + MOV DX,cs:num_ftb ;; + ;; + ;; +MATCH_LOOP : ;; + MOV AX,FTP.FTB_STATUS ;; + CMP AX,FSTAT_SEARCH ;; + JE MATCH_SEARCH ;; + JMP MATCH_NEXT ;; + ;; +MATCH_SEARCH : ;; + MOV AX,FTP.FTB_CP ;; check the FTB with SEARCH status + CMP AX,cs:cpg_word ;; + JNE MATCH_MORE ;; + PUSH DS ;; code page matched + PUSH SI ;; + PUSH CX ;; + ;; + PUSH CS ;; + POP DS ;; + MOV SI,OFFSET TYPE_ID ;; + LEA DI,[BX].FTB_TID ;; + MOV CX,8 ;; + REPE CMPSB ;; + ;; + POP CX ;; + POP SI ;; + POP DS ;; + ;; + JNE MATCH_MORE ;; + ;; MATCH !!!!! (type_id matched) + MOV FTP.FTB_STATUS,FSTAT_MATCH + MOV AX,cs:type_word ;; + MOV FTP.FTB_TYPE,AX ;; + MOV AX,cs:font_low ;; + MOV FTP.TARGET_LO,AX ;; + MOV AX,cs:font_high ;; + MOV FTP.TARGET_HI,AX ;; + ;; + JMP MATCH_NEXT ;; + ;; +MATCH_MORE : ;; if this is the last rounf ? + ;; + MOV AX,cs:next_low ;; NEXT = FFFF:FFFF means no more + CMP AX,-1 ;; header to come. + JNE MATCH_NEXT ;; + ;; + MOV AX,cs:next_high ;; + CMP AX,-1 ;; + JNE MATCH_NEXT ;; + ;; + MOV FTP.FTB_STATUS,STAT_NOFIND ;; ERROR : no match + ;; +MATCH_NEXT : ;; + ADD BX,FTP.FTB_LENGTH ;; + DEC DX ;; + AND DX,DX ;; + JZ MATCH_ALL ;; + JMP MATCH_LOOP ;; + ;; +MATCH_ALL : ;; + MOV cs:stage,SCANX ;; + ;; +MATCH_DONE : ;; + POP BX ;; + JMP FTB_LOOP ;; + ;; +;=========================================================================== +SCAN_CASE : ;; + ;; ********************************** + ;; * determine whether it the font * + ;; * data(TARGET),or the next font * + ;; * header(NEXT) that is approaching + ;; ********************************** + ;; + MOV AX,cs:next_low ;; + MOV cs:hit_lo,AX ;; + MOV AX,cs:next_high ;; + MOV cs:hit_hi,AX ;; + XOR AX,AX ;; + MOV cs:hit_flag,AX ;; + ;; + MOV DI,cs:hit_hi ;; normalised HIT_HI, HIT_LO + MOV AX,DI ;; + AND AX,00FFFH ;; + PUSH CX ;; + MOV CX,4 ;; + SHL AX,CL ;; + POP CX ;; + AND DI,0F000H ;; + ADD AX,cs:hit_lo ;; + JNC NO_CARRY2 ;; + ADD DI,01000H ;; +NO_CARRY2 : ;; + MOV cs:hit_lo,AX ;; + MOV cs:hit_hi,DI ;; + ;; + MOV DX,cs:num_ftb ;; + ;; + PUSH BX ;; +SCAN_LOOP : ;; + MOV AX,FTP.FTB_STATUS ;; + CMP AX,FSTAT_MATCH ;; + JNE SCAN_NEXT ;; + ;; + ;; + MOV DI,FTP.TARGET_HI ;; NORMALISED TARGET + MOV AX,DI ;; + AND AX,00FFFH ;; + PUSH CX ;; + MOV CX,4 ;; + SHL AX,CL ;; + POP CX ;; + AND DI,0F000H ;; + ADD AX,FTP.TARGET_LO ;; + JNC NO_CARRY1 ;; + ADD DI,01000H ;; +NO_CARRY1 : ;; DI:AX = NORMALISED TARGET + ;; + ;; ** compare the TARGET and the NEXT + ;; + CMP DI,cs:hit_hi ;; + JA SCAN_NEXT ;; + ;; + JE SCAN_EQU ;; + JMP NEAR_FONT ;; + ;; +SCAN_EQU : ;; + CMP AX,cs:hit_lo ;; + JA SCAN_NEXT ;; + JE SCAN_ERROR_CHK ;; + ;; ********************************** + ;; * the font data is approaching * + ;; ********************************** +NEAR_FONT : ;; + MOV cs:hit_flag,-1 ;; + MOV cs:hit_lo,AX ;; + MOV cs:hit_hi,DI ;; + MOV cs:hit_bx,BX ;; used for BAD_BX and in FOUND_CASE + JMP SCAN_NEXT ;; + ;; + ;; ********************************** + ;; * the NEXT header is approaching * + ;; ********************************** +SCAN_ERROR_CHK : ;; + MOV AX,cs:hit_flag ;; + AND AX,AX ;; + JNZ SCAN_NEXT ;; + MOV FTP.FTB_STATUS,STAT_BADATA ;; next header and font cannot be the + ;; same + ;; +SCAN_NEXT : ;; + DEC DX ;; + AND DX,DX ;; + JZ SCAN_DONE ;; + ;; + ADD BX,FTP.FTB_LENGTH ;; + JMP SCAN_LOOP ;; ** is there any closer font data ? + ;; + ;; ************************************ + ;; * the HIT is either font data(TARGET + ;; * or the font block (NEXT). * + ;; ************************************ +SCAN_DONE : ;; + POP BX ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + MOV DX,cs:hit_hi ;; HIT_FLAG, HIT_LO, HIT_HI defined + MOV AX,cs:hit_lo ;; + ;; + CMP AX,0FFFFH ;; + JNE NOT_FFFF_HIT ;; + CMP DX,0FFFFH ;; + JNE NOT_FFFF_HIT ;; + JMP SCAN_MORE ;; stage remained as SCAN, discard data + ;; +NOT_FFFF_HIT : ;; + ;; DX:AX = HIT_HI:HIT_LO (normalised) + SUB AX,cs:count_lo ;; + JNC NO_BORROW ;; + SUB DX,01000H ;; + JC SCAN_BAD ;; +NO_BORROW: ;; + SUB DX,cs:count_hi ;; + JC SCAN_BAD ;; + ;; + INC AX ;; COUNT can be at the HIT, then AX=0 + JNC NO_CARRYX ;; INC AX to make AX comparable to CX + ADD DX,01000H ;; i.e. AX = offset + 1 + ;; +NO_CARRYX : ;; + CMP AX,CX ;; + JA SCAN_MORE ;; + ;; + PUSH DX ;; + AND DX,00FFFH ;; + PUSH CX ;; + MOV CX,4 ;; + SHL DX,CL ;; + POP CX ;; + ADD AX,DX ;; + POP DX ;; + JNC NO_CARRY3 ;; + ADD DX,01000H ;; +NO_CARRY3 : ;; + AND DX,0F000H ;; + ;; + ;; + PUSH AX ;; + PUSH DX ;; + SUB AX,CX ;; + JNC NO_BORROW1 ;; + SUB DX,1000H ;; + JC MORE_CXp ;; +NO_BORROW1 : ;; + ;; dx:ax >= cx + AND AX,AX ;; + JNE SCAN_MOREP ;; + AND DX,DX ;; + JNE SCAN_MOREP ;; + ;; + ;; offset + 1 = CX + ;; +MORE_CXP : ;; + POP DX ;; + POP AX ;; + ;; +MORE_CX : ;; DX = 0,to have more CX than offset+1 + DEC AX ;; = offset : 0 and above + SUB CX,AX ;; + ADD SI,AX ;; where the first byte is + MOV AX,cs:hit_flag ;; + AND AX,AX ;; + JE NEXT_REACHED ;; + ;; + MOV cs:stage,MOD_LOBX ;; font-data reached, + ;; + JMP FTB_LOOP ;; ****** RETURN ******* + ;; +NEXT_REACHED : ;; + MOV cs:stage,PASSX ;; + MOV cs:pass_postx,next_lolX ;; + MOV cs:pass_cnt,FILE_OFFSET ;; + ;; + ;; + JMP FTB_LOOP ;; ****** RETURN ******* + ;; + ;; *********************************** +SCAN_MOREP : ;; * scan more FTBLK for the nearest * + ;; * font data * + ;; *********************************** + POP DX ;; + POP AX ;; + ;; +SCAN_MORE : ;; + ADD SI,CX ;; + SUB CX,CX ;; + JMP FTB_LOOP ;; more SCAN stage + ;; +SCAN_BAD: ;; ************************* + MOV AX,cs:hit_flag ;; * scan is bad * + AND AX,AX ;; ************************* + JNZ BAD_BX ;; + MOV AX,-1 ;; NEXT is pointing backwards + MOV cs:next_low,AX ;; + MOV cs:next_high,AX ;; no more NEXT + MOV FTP.FTB_STATUS,STAT_BADATA ;; returned at the first FTBLK + JMP FTB_LOOP ;; + ;; +BAD_BX : ;; + PUSH BX ;; FONT is pointing backwards + MOV BX,cs:hit_bx ;; + MOV FTP.FTB_STATUS,STAT_BADATA + POP BX ;; + JMP FTB_LOOP ;; + ;; +;=========================================================================== +PRE_FOUND_CASE : ;; + ;; extract informations from the font + ;; block until font_length is defined + ;; + MOV DI,cs:stage ;; + ;; + ADD DI,DI ;; double to index to WORD-offset + ;; + JMP CS:STAGE_CASES[DI] ;; call routine to process the stage + ;; +;=========================================================================== +FOUND_CASE : ;; + MOV DI,OFFSET FTB_LOOP ;; as FOUND has two places to return to + PUSH DI ;; +;=========================================================================== +FOUND_DO : ;; + ;; define informations into FTBLK of + ;; HIT_BX defined in the SCAN case + PUSH BX ;; + MOV BX,cs:hit_bx ;; + ;; FTBLK : + MOV AX,cs:mod_word ;; + MOV FTP.FTB_MOD,AX ;; + MOV AX,cs:fonts_word ;; + MOV FTP.FTB_FONTS,AX ;; + ;; + MOV AX,cs:fdlen_word ;; + MOV FTP.FTB_DLEFT,AX ;; + MOV FTP.FTB_DLEN,0 ;; + MOV FTP.FTB_DALO,0 ;; + MOV FTP.FTB_DAHI,0 ;; + ;; + MOV FTP.FTB_STATUS,FSTAT_FOUND + ;; + CMP FTP.FTB_TYPE,TYPE_DISPLAY; + JNE CHECK_PTR_TYPE ;; + CMP cs:pre_font_len,PRE_FONT_D ;; + JNE DISPLAY_BAD ;; + JMP DISPLAY_DONE ;; + ;; +CHECK_PTR_TYPE : ;; + CMP FTP.FTB_TYPE,TYPE_PRINTER; + JNE SET_STAGE ;; + CMP cs:ptr_sel_word,0 ;; + JNE PRINTER_HAS_SEL ;; + CMP cs:pre_font_len,PRE_FONT_P0;; + JNE PRINTER_BAD ;; + JMP PRINTER_DONE ;; + ;; +PRINTER_HAS_SEL : ;; + CMP cs:pre_font_len,PRE_FONT_P ;; + JNE PRINTER_BAD ;; + JMP PRINTER_DONE ;; + ;; +DISPLAY_BAD : ;; + ;; + MOV FTP.FTB_STATUS,STAT_BADATA ;the FDLEN_WORD should be 0. + ;; +DISPLAY_DONE : ;; + MOV AL,cs:disp_rows ;; + MOV FTP.FTB_ROWS,AL ;; + MOV AL,cs:disp_cols ;; + MOV FTP.FTB_COLS,AL ;; + MOV AL,cs:disp_x ;; + MOV FTP.FTB_X,AL ;; + MOV AL,cs:disp_y ;; + MOV FTP.FTB_Y,AL ;; + MOV AX,cs:count_word ;; + MOV FTP.FTB_COUNT,AX ;; + JMP SET_STAGE ;; + ;; +PRINTER_BAD : ;; + ;; + MOV FTP.FTB_STATUS,STAT_BADATA ;the FDLEN_WORD should be 0. + ;; +PRINTER_DONE : ;; + MOV AX,cs:ptr_sel_word ;; + MOV FTP.FTB_SELECT,AX ;; + MOV AX,cs:ptr_len_word ;; + MOV FTP.FTB_SELLEN,AX ;; + ;; +SET_STAGE : ;; STAGE : + MOV AX,cs:fdlen_word ;; if no font data to follow + AND AX,AX ;; + JNZ GET_FDATA ;; + MOV cs:stage,SCANX ;; then scan for next header or font + JMP FONT_RET ;; + ;; +GET_FDATA : ;; update the moving target + MOV cs:stage,GET_FX ;; + MOV AX,cs:pre_font_len ;; + ADD FTP.TARGET_LO,AX ;; + JNC FONT_RET ;; + ADD FTP.TARGET_HI,01000H ;; + ;; +FONT_RET : ;; + POP BX ;; + RET ;; + ;; +;=========================================================================== +GETFONT_CASE : ;; as ES:[SI], at COUNT, there is font + ;; data + MOV DX,cs:num_ftb ;; + PUSH BX ;; + ;; + MOV cs:hit_hi,0 ;; temp. register + MOV cs:hit_flag,0 ;; assumed can be changed to SCAN stage + ;; + MOV DI,cs:count_hi ;; normalised COUNT_HI,COUNT_LO + MOV AX,DI ;; + AND AX,00FFFH ;; + PUSH CX ;; + MOV CX,4 ;; + SHL AX,CL ;; + POP CX ;; + AND DI,0F000H ;; + ADD AX,cs:count_lo ;; + JNC NO_CARRY4 ;; + ADD DI,01000H ;; +NO_CARRY4 : ;; + MOV cs:count_lo,AX ;; + MOV cs:count_hi,DI ;; + ;; + ;; +GETFONT_LOOP : ;; + MOV AX,FTP.FTB_STATUS ;; + CMP AX,FSTAT_FONT ;; + JE GETFONT_CONT ;; + ;; + CMP AX,FSTAT_FOUND ;; + JE GETFONT_FOUND ;; + ;; + JMP NEXT_GETFONT ;; + ;; +GETFONT_FOUND : ;; + MOV AX,FTP.FTB_DLEFT ;; + AND AX,AX ;; + JZ NEXT_GF ;; + MOV FTP.FTB_STATUS,FSTAT_FONT; + JMP GETFONT_CONT1 ;; + ;; + ;; +GETFONT_CONT : ;; + MOV AX,FTP.FTB_DLEFT ;; + AND AX,AX ;; + JNZ GETFONT_CONT1 ;; +NEXT_GF : ;; + JMP NEXT_GETFONT ;; + ;; only on FOUND and DLEFT <> 0 +GETFONT_CONT1: ;; + MOV DI,FTP.TARGET_HI ;; normalised TARGET + MOV AX,DI ;; + AND AX,00FFFH ;; + PUSH CX ;; + MOV CX,4 ;; + SHL AX,CL ;; + POP CX ;; + AND DI,0F000H ;; + ADD AX,FTP.TARGET_LO ;; + JNC NO_CARRY5 ;; + ADD DI,01000H ;; +NO_CARRY5 : ;; DI:AX = TARGET (normalised) + ;; + CMP DI,cs:count_hi ;; + JB GETFONT_BAD ;; + JNE NEXT_GETFONT ;; + CMP AX,cs:count_lo ;; + JB GETFONT_BAD ;; + JNE NEXT_GETFONT ;; + ;; + MOV FTP.FTB_DALO,SI ;; where the font data is in the packet + MOV FTP.FTB_DAHI,DS ;; + ;; + MOV AX,FTP.FTB_DLEFT ;; + CMP AX,CX ;; + JAE UPTO_CX ;; + ;; upto FDLEFT + MOV FTP.FTB_DLEFT,0 ;; + MOV FTP.FTB_DLEN,AX ;; + CMP cs:hit_hi,AX ;; + JNB NOT_HIGHER0 ;; + MOV cs:hit_hi,AX ;; +NOT_HIGHER0 : ;; + ADD FTP.TARGET_LO,AX ;; + JNC NEXT_GETFONT ;; + ADD FTP.TARGET_HI,01000H ;; + JMP NEXT_GETFONT ;; + ;; +GETFONT_BAD : ;; + MOV FTP.FTB_STATUS,STAT_BADATA ;; pointing backwards + JMP NEXT_GETFONT ;; + ;; +UPTO_CX : ;; + SUB AX,CX ;; + MOV FTP.FTB_DLEFT,AX ;; + MOV FTP.FTB_DLEN,CX ;; + MOV cs:hit_hi,CX ;; + ADD FTP.TARGET_LO,CX ;; + JNC NO_CARRYOVER ;; + ADD FTP.TARGET_HI,01000H ;; +NO_CARRYOVER : ;; + AND AX,AX ;; all data have been returned ? + JZ NEXT_GETFONT ;; + ;; + MOV cs:hit_flag,-1 ;; no ! stay in the GET_FONT stage + ;; +NEXT_GETFONT : ;; + ADD BX,FTP.FTB_LENGTH ;; + DEC DX ;; + AND DX,DX ;; + JZ GETFONT_END ;; + JMP GETFONT_LOOP ;; + ;; +GETFONT_END : ;; + MOV AX,cs:hit_hi ;; + ADD SI,AX ;; + SUB CX,AX ;; + ;; + CMP cs:hit_flag,0 ;; + Jne GETFONT_DONE ;; + MOV cs:stage,SCANX ;; no more in the GET_FONT stage + ;; + ;; +GETFONT_DONE : ;; + POP BX ;; + JMP FTB_LOOP ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; STAGES -- "called by" SERACH_CASE +;; +;; -- DS:[SI] (FPKT) points to PACKET, of DOS's buffer +;; -- CX remaining packet length +;; -- ES:[BX] points to the first FTBLK +;; -- COUNT_LO, COUNT_HI, upto but not including the address pointed by FPKT +;; +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;;+++++++++++++++++++++++++++++++++ +filetag : ;; + ;; +; mov ax,ftag_len ;; + cmp cs:ftag_count,ftag_len ;; + jB valid_ftag ;; + JE FTAG_FAILED ;; + ;; + mov ftp.ftb_status,stat_deverr + mov cs:fp_error,00022H ;; ERROR 0022H + ;; +FTAG_FAILED : ;; discard all the bytes, while + ADD SI,CX ;; stage stays as FTAGX + SUB CX,CX ;; + JMP FTB_LOOP ;; **** RETURN (bytes discarded) **** + ;; +VALID_FTAG : ;; + MOV AX,FPKT ;; + INC SI ;; + DEC CX ;; + ;; + MOV DI,cs:ftag_count ;; + CMP AL,cs:ftag_pattern[DI] ;; + JE FTAG_NEXTB ;; + ;; + mov ftp.ftb_status,stat_badata + MOV ax,ftag_len ;; stays in FTAGX to consume all bytes + MOV cs:ftag_count,ax ;; stays in FTAGX to consume all bytes + JMP FTB_LOOP ;; **** RETURN (FAILED !) **** + ;; +FTAG_NEXTB : ;; + INC DI ;; + MOV cs:ftag_count,DI ;; + ;; + CMP DI,ftag_len ;; + JE FTAG_DONE ;; + ;; + JMP FTB_LOOP ;; **** RETURN ( MORE TO COME) **** + ;; +FTAG_DONE : ;; + MOV cs:pass_cnt,0 ;; + MOV cs:stage,PASSX ;; + MOV cs:pass_postx,fptr_lolx ;; + ;; + JMP FTB_LOOP ;; **** NEXT STAGE **** + ;; + ;;+++++++++++++++++++++++++++++++++ +fptrLOL : ;; STAGE the low byte of the low fptr + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_fptrLO ;; + MOV cs:fptr_lol,AL ;; + MOV cs:stage,fptr_lohX ;; + JMP FTB_LOOP ;; +WORD_fptrLO : ;; + INC SI ;; + DEC CX ;; + MOV cs:fptr_low,AX ;; + MOV cs:stage,fptr_HILX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +fptrLOH : ;; STAGE the high byte of the low fptr + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:fptr_loh,AL ;; + MOV cs:stage,fptr_HILX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +fptrHIL : ;; STAGE the low byte of the high fptr + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_fptrHI ;; + MOV cs:fptr_hil,AL ;; + MOV cs:stage,fptr_hihX ;; + JMP FTB_LOOP ;; +WORD_fptrHI : ;; + INC SI ;; + DEC CX ;; + MOV cs:fptr_high,AX ;; + MOV cs:stage,FPTR_SKIPX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +fptrHIH : ;; STAGE the high byte of the high fptr + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:fptr_hih,AL ;; + MOV cs:stage,FPTR_SKIPX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +ENTRYLO : ;; STAGE - ENTRY LOW BYTE + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_ENTRY ;; + MOV cs:entry_lob,AL ;; + MOV cs:stage,ENTRY_HIX ;; + JMP FTB_LOOP ;; +WORD_ENTRY : ;; + INC SI ;; + DEC CX ;; + MOV cs:entry_word,AX ;; + MOV cs:stage,PASSX ;; 2 bytes to be passed + MOV cs:pass_postx,NEXT_LOLX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +ENTRYHI : ;; stage - ENTRY HIGN BYTE + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:entry_hib,AL ;; + MOV cs:stage,PASSX ;; 2 bytes to be passed + MOV cs:pass_postx,NEXT_LOLX ;; + AND CX,CX ;; + JNZ ENTHI_PASS1 ;; + JMP FTB_LOOP ;; +ENTHI_PASS1 : ;; + INC SI ;; + INC cs:pass_cnt ;; + DEC CX ;; + AND CX,CX ;; + JNZ ENTHI_PASS2 ;; + JMP FTB_LOOP ;; +ENTHI_PASS2 : ;; + INC SI ;; + INC cs:pass_cnt ;; + DEC CX ;; + MOV cs:stage,NEXT_LOLX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +NEXTLOL : ;; STAGE the low byte of the low NEXT + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_NEXTLO ;; + MOV cs:next_lol,AL ;; + MOV cs:stage,NEXT_LOHX ;; + JMP FTB_LOOP ;; +WORD_NEXTLO : ;; + INC SI ;; + DEC CX ;; + MOV cs:next_low,AX ;; + MOV cs:stage,next_hilX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +NEXTLOH : ;; STAGE the high byte of the low NEXT + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:next_loh,AL ;; + MOV cs:stage,next_hilX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +NEXTHIL : ;; STAGE the low byte of the high NEXT + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_NEXTHI ;; + MOV cs:next_hil,AL ;; + MOV cs:stage,NEXT_HIHX ;; + JMP FTB_LOOP ;; +WORD_NEXTHI : ;; + INC SI ;; + DEC CX ;; + MOV cs:next_high,AX ;; + MOV cs:stage,type_lobX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +NEXTHIH : ;; STAGE the high byte of the high NEXT + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:next_hih,AL ;; + MOV cs:stage,type_lobX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +TYPELO : ;; STAGE the low byte of the TYPE + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_TYPE ;; + MOV cs:type_lob,AL ;; + MOV cs:stage,type_hibX ;; + JMP FTB_LOOP ;; +WORD_TYPE : ;; + INC SI ;; + DEC CX ;; + MOV cs:type_word,AX ;; + MOV cs:stage,type_idX ;; + MOV cs:tid_cnt,0 ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +TYPEHI : ;; STAGE the high byte of the TYPE + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:type_hib,AL ;; + MOV cs:stage,TYPE_IDX ;; + MOV cs:tid_cnt,0 ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +TYPEIDS : ;; STAGE the type id + CMP cs:tid_cnt,8 ;; + JNA VALID_TID ;; + MOV FTP.FTB_STATUS,STAT_DEVERR + MOV cs:fp_error,00021H ;; ERROR 0021H + ADD SI,CX ;; + SUB CX,CX ;; + JMP FTB_LOOP ;; + ;; +VALID_TID : ;; + MOV AX,8 ;; + SUB AX,cs:tid_cnt ;; + CMP CX,AX ;; + JNB TID_ALL ;; + ;; all data in FPKT are stored + PUSH ES ;; + PUSH CS ;; + POP ES ;; + ;; + MOV DI,OFFSET TYPE_ID ;; + ADD DI,cs:tid_cnt ;; + ADD cs:tid_cnt,CX ;; + REP MOVSB ;; SI is incremented accordingly + POP ES ;; + ;; + MOV CX,0 ;; STAGE remained + JMP FTB_LOOP ;; +TID_ALL : ;; + PUSH CX ;; + ;; + PUSH ES ;; + PUSH CS ;; + POP ES ;; + ;; + MOV DI,OFFSET TYPE_ID ;; + ADD DI,cs:tid_cnt ;; + MOV CX,AX ;; + REP MOVSB ;; SI is incremented accordingly + POP ES ;; + ;; + ADD cs:tid_cnt,AX ;; + POP CX ;; + SUB CX,AX ;; + ;; + MOV cs:stage,CPG_LOBX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +CPGLO : ;; STAGE the low byte of the CODE PAGE + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_CPG ;; + MOV cs:cpg_lob,AL ;; + MOV cs:stage,CPG_HIBX ;; + JMP FTB_LOOP ;; +WORD_CPG : ;; + INC SI ;; + DEC CX ;; + MOV cs:cpg_word,AX ;; + MOV cs:stage,PASSX ;; + MOV cs:pass_postx,font_lolX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +CPGHI : ;; STAGE the high byte of the CODE PAGE + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:cpg_hib,AL ;; + MOV cs:stage,PASSX ;; + MOV cs:pass_postx,font_lolX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +FONTLOL : ;; STAGE the low byte of the low FONT + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_FONTLO ;; + MOV cs:font_lol,AL ;; + MOV cs:stage,FONT_LOHX ;; + JMP FTB_LOOP ;; +WORD_FONTLO : ;; + INC SI ;; + DEC CX ;; + MOV cs:font_low,AX ;; + MOV cs:stage,FONT_HILX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +FONTLOH : ;; STAGE the high byte of the low FONT + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:font_loh,AL ;; + MOV cs:stage,FONT_HILX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +FONTHIL : ;; STAGE the low byte of the high FONT + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_FONTHI ;; + MOV cs:font_hil,AL ;; + MOV cs:stage,FONT_HIHX ;; + JMP FTB_LOOP ;; +WORD_FONTHI : ;; + INC SI ;; + DEC CX ;; + MOV cs:font_high,AX ;; +;;;;;; MOV cs:stage,MOD_LOBX ;; end of SCAN + ;; anymore headers to be processed ? + MOV cs:stage,MATCHX ;; + MOV AX,cs:entry_word ;; + DEC AX ;; + MOV cs:entry_word,AX ;; + AND AX,AX ;; + JNZ CHECK_NEXT ;; + ;; no more header to be processed ! + MOV AX,-1 ;; + MOV cs:next_low,AX ;; + MOV cs:next_high,AX ;; as ENTRY has been consumed + JMP FTB_LOOP ;; + ;; +CHECK_NEXT : ;; + MOV AX,cs:next_low ;; + AND AX,AX ;; + JNZ MORE_HEADER ;; + MOV AX,cs:next_high ;; + AND AX,AX ;; + JNZ MORE_HEADER ;; + ;; no more header to be processed ! + MOV AX,-1 ;; + MOV cs:next_low,AX ;; as NEXT is nil + MOV cs:next_high,AX ;; + ;; +MORE_HEADER : ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +FONTHIH : ;; STAGE the high byte of the high FONT + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:font_hih,AL ;; +;;;;; MOV cs:stage,MOD_LOBX ;; end of SCAN + ;; + MOV cs:stage,MATCHX ;; + ;; anymore headers to be processed ? + MOV AX,cs:entry_word ;; + DEC AX ;; + MOV cs:entry_word,AX ;; + AND AX,AX ;; + JNZ CHECK_NEXT0 ;; + ;; no more header to be processed ! + MOV AX,-1 ;; + MOV cs:next_low,AX ;; + MOV cs:next_high,AX ;; as ENTRY has been consumed + JMP FTB_LOOP ;; + ;; +CHECK_NEXT0 : ;; + MOV AX,cs:next_low ;; + AND AX,AX ;; + JNZ MORE_HEADER0 ;; + MOV AX,cs:next_high ;; + AND AX,AX ;; + JNZ MORE_HEADER0 ;; + ;; no more header to be processed ! + MOV AX,-1 ;; + MOV cs:next_low,AX ;; as NEXT is nil + MOV cs:next_high,AX ;; + ;; +MORE_HEADER0 : ;; + JMP FTB_LOOP ;; + ;; + ;;+++++++++++++++++++++++++++++++++ +MODLO : ;; STAGE the low byte of the MODIFIER + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_MOD ;; + MOV MOD_LOB,AL ;; + MOV cs:stage,MOD_HIBX ;; + JMP FTB_LOOP ;; +WORD_MOD : ;; + INC SI ;; + DEC CX ;; + MOV cs:mod_word,AX ;; + MOV cs:stage,fonts_lobX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +MODHI : ;; STAGE the high byte of the MODIFIER + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:mod_hib,AL ;; + MOV cs:stage,FONTS_LOBX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +FONTSLO : ;; STAGE the low byte of the FONTS + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_FONTS ;; + MOV cs:fonts_lob,AL ;; + MOV cs:stage,FONTS_HIBX ;; + JMP FTB_LOOP ;; +WORD_FONTS : ;; + INC SI ;; + DEC CX ;; + MOV cs:fonts_word,AX ;; + MOV cs:stage,FDLEN_LOBX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +FONTSHI : ;; STAGE the high byte of the FONTS + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:fonts_hib,AL ;; + MOV cs:stage,FDLEN_LOBX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +FDLENLO : ;; the low byte of the FONT-LENGTH + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + AND CX,CX ;; + JNZ WORD_FDLEN ;; + MOV cs:fdlen_lob,AL ;; + MOV cs:stage,FDLEN_HIBX ;; + JMP FTB_LOOP ;; +WORD_FDLEN : ;; + INC SI ;; + DEC CX ;; + MOV cs:pre_font_len,PRE_FONT_ND;; + MOV cs:fdlen_word,AX ;; + AND AX,AX ;; + JZ NO_DISP_PTR ;; + CMP cs:type_word,TYPE_DISPLAY ;; + JE DISPLAY_TYPE1 ;; + CMP cs:type_word,TYPE_PRINTER ;; + JE PRINTER_TYPE1 ;; + ;; +NO_DISP_PTR : ;; + MOV cs:stage,FOUNDX ;; FSTAT is to be changed + JMP FTB_LOOP ;; +DISPLAY_TYPE1 : ;; + MOV cs:stage,DISP_ROWSX ;; + JMP FTB_LOOP ;; +PRINTER_TYPE1 : ;; + MOV cs:stage,PTRSELLOX ;; + JMP FTB_LOOP ;; + ;; + ;;+++++++++++++++++++++++++++++++++ +FDLENHI : ;; STAGE the high byte of the F-LENGTH + MOV cs:pre_font_len,PRE_FONT_ND + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:fdlen_hib,AL ;; + MOV AX,cs:fdlen_word ;; + AND AX,AX ;; + JZ NO_DISP_PTR2 ;; + CMP cs:type_word,TYPE_DISPLAY ;; + JE DISPLAY_TYPE2 ;; + CMP cs:type_word,TYPE_PRINTER ;; + JE PRINTER_TYPE2 ;; +NO_DISP_PTR2: ;; + MOV cs:stage,FOUNDX ;; FSTAT is to be changed + JMP FTB_LOOP ;; +DISPLAY_TYPE2 : ;; + MOV cs:stage,DISP_ROWSX ;; + JMP FTB_LOOP ;; +PRINTER_TYPE2 : ;; + MOV cs:stage,PTRSELLOX ;; + JMP FTB_LOOP ;; + ;; + ;;+++++++++++++++++++++++++++++++++ +DSPROWS : ;; STAGE : get the rows + XOR AX,AX ;; + MOV cs:disp_rows,AL ;; + MOV cs:disp_cols,AL ;; + MOV cs:DISP_X,AL ;; + MOV cs:disp_y,AL ;; + MOV cs:count_word,AX ;; + ;; + INC cs:pre_font_len ;; + MOV AX,FPKT ;; + INC SI ;; + DEC CX ;; + MOV cs:disp_rows,AL ;; + MOV AX,cs:fdlen_word ;; + DEC AX ;; + MOV cs:fdlen_word,AX ;; + JZ NO_DISP_FONT3 ;; + MOV cs:stage,disp_colsX ;; + JMP FTB_LOOP ;; +NO_DISP_FONT3 : ;; + MOV cs:stage,FOUNDX ;; FSTAT is to be changed + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +DSPCOLS : ;; STAGE : get the COLS + INC cs:pre_font_len ;; + MOV AX,FPKT ;; + INC SI ;; + DEC CX ;; + MOV cs:disp_cols,AL ;; + MOV AX,cs:fdlen_word ;; + DEC AX ;; + MOV cs:fdlen_word,AX ;; + JZ NO_DISP_FONT3 ;; + MOV cs:stage,DISP_XX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +DSPX : ;; STAGE : get the aspect X + INC cs:pre_font_len ;; + MOV AX,FPKT ;; + INC SI ;; + DEC CX ;; + MOV DISP_X,AL ;; + MOV AX,cs:fdlen_word ;; + DEC AX ;; + MOV cs:fdlen_word,AX ;; + JZ NO_DISP_FONT3 ;; + MOV cs:stage,DISP_YX ;; + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +DSPY : ;; STAGE : get the aspect Y + INC cs:pre_font_len ;; + MOV AX,FPKT ;; + INC SI ;; + DEC CX ;; + MOV cs:disp_y,AL ;; + MOV AX,cs:fdlen_word ;; + DEC AX ;; + MOV cs:fdlen_word,AX ;; + JZ NO_DISP_FONT3 ;; + MOV cs:stage,COUNT_LOBX ;; + JMP FTB_LOOP ;; + ;; + ;;+++++++++++++++++++++++++++++++++ +DSPCOUNTLO : ;; the low byte of the FONT-LENGTH + INC cs:pre_font_len ;; + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + PUSH AX ;; check if length is enough + MOV AX,cs:fdlen_word ;; + DEC AX ;; + MOV cs:fdlen_word,AX ;; + POP AX ;; + JNZ A_WORD_COUNT ;; + JMP NO_DISP_FONT3 ;; +A_WORD_COUNT : ;; + AND CX,CX ;; + JNZ WORD_COUNT ;; + MOV cs:count_lob,AL ;; + MOV cs:stage,COUNT_HIBX ;; + JMP FTB_LOOP ;; +WORD_COUNT : ;; + INC cs:pre_font_len ;; + INC SI ;; + DEC CX ;; + MOV cs:count_word,AX ;; +; MOV cs:pre_font_len,PRE_FONT_D; + ;; + MOV AX,cs:fdlen_word ;; + DEC AX ;; + MOV cs:fdlen_word,AX ;; + MOV cs:stage,FOUNDX ;; FSTAT is to be changed + JMP FTB_LOOP ;; + ;; + ;;+++++++++++++++++++++++++++++++++ +DSPCOUNTHI : ;; STAGE the high byte of the F-LENGTH + INC cs:pre_font_len ;; + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:count_hib,AL ;; +; MOV cs:pre_font_len,PRE_FONT_D; + ;; + MOV AX,cs:fdlen_word ;; + DEC AX ;; + MOV cs:fdlen_word,AX ;; + MOV cs:stage,FOUNDX ;; FSTAT is to be changed + JMP FTB_LOOP ;; + ;; + ;; + ;;+++++++++++++++++++++++++++++++++ +PTRSELLO : ;; the low byte of the SELECTION_TYPE + INC cs:pre_font_len ;; + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + PUSH AX ;; check if length is enough + MOV AX,cs:fdlen_word ;; + DEC AX ;; + MOV cs:fdlen_word,AX ;; + POP AX ;; + JNZ A_WORD_SEL ;; + JMP NO_PTR_FONT3 ;; +A_WORD_SEL : ;; + AND CX,CX ;; + JNZ WORD_SEL ;; + MOV cs:ptr_selob,AL ;; + MOV cs:stage,PTRSELHIX ;; + JMP FTB_LOOP ;; +WORD_SEL : ;; + INC cs:pre_font_len ;; + INC SI ;; + DEC CX ;; + MOV cs:ptr_sel_word,AX ;; + ;; + MOV AX,cs:fdlen_word ;; + DEC AX ;; + MOV cs:fdlen_word,AX ;; + ;; + CMP cs:ptr_sel_word,0 ;; + JNE PTR_SEL_NOT0 ;; + ;; + ;; + MOV cs:stage,FOUNDX ;; FSTAT is to be changed + JMP FTB_LOOP ;; + ;; +PTR_SEL_NOT0 : ;; + MOV cs:stage,PTRLENLOX ;; + JMP FTB_LOOP ;; + ;; + ;;+++++++++++++++++++++++++++++++++ +PTRSELHI: ;; STAGE the high byte of SELECT_TYPE + INC cs:pre_font_len ;; + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:ptr_sehib,AL ;; + ;; + MOV AX,cs:fdlen_word ;; + DEC AX ;; + MOV cs:fdlen_word,AX ;; + ;; + CMP cs:ptr_sel_word,0 ;; + JNE PTR_SEL_NOT0 ;; + ;; + ;; + MOV cs:stage,FOUNDX ;; FSTAT is to be changed + JMP FTB_LOOP ;; + ;; + ;; + ;;+++++++++++++++++++++++++++++++++ +PTRLENLO : ;; the low byte of SELECTION_LENGTH + INC cs:pre_font_len ;; + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + PUSH AX ;; check if length is enough + MOV AX,cs:fdlen_word ;; + DEC AX ;; + MOV cs:fdlen_word,AX ;; + POP AX ;; + JNZ A_WORD_SELEN ;; + JMP NO_PTR_FONT3 ;; +A_WORD_SELEN : ;; + AND CX,CX ;; + JNZ WORD_SELEN ;; + MOV cs:ptr_lnlob,AL ;; + MOV cs:stage,PTRLENHIX ;; + JMP FTB_LOOP ;; +WORD_SELEN : ;; + INC cs:pre_font_len ;; + INC SI ;; + DEC CX ;; + MOV cs:ptr_len_word,AX ;; + ;; + MOV AX,cs:fdlen_word ;; + DEC AX ;; + MOV cs:fdlen_word,AX ;; + MOV cs:stage,FOUNDX ;; FSTAT is to be changed + JMP FTB_LOOP ;; + ;; + ;;+++++++++++++++++++++++++++++++++ +PTRLENHI : ;; STAGE the high byte of SELECT_LENGTH + INC cs:pre_font_len ;; + MOV AX,FPKT ;; + INC SI ;; byte by byte + DEC CX ;; + MOV cs:ptr_lnhib,AL ;; + ;; + MOV AX,cs:fdlen_word ;; + DEC AX ;; + MOV cs:fdlen_word,AX ;; + MOV cs:stage,FOUNDX ;; FSTAT is to be changed + JMP FTB_LOOP ;; + ;; +NO_PTR_FONT3 : ;; + MOV cs:stage,FOUNDX ;; FSTAT is to be changed + JMP FTB_LOOP ;; + ;;+++++++++++++++++++++++++++++++++ +PASS : ;; STAGE - PASS DUMMY BYTES + ;; + PUSH DX ;; + PUSH ES ;; + PUSH DI ;; + ;; + PUSH CS ;; + POP ES ;; + MOV DI,OFFSET PASS_BRK ;; + MOV DX,PASS_INDX ;; + MOV AX,cs:pass_cnt ;; + ;; +NEXT_BRK: ;; find the next pass-break + CMP AX,ES:[DI] ;; + ;; + JB UPTO_BRK ;; + ;; + DEC DX ;; + JZ PASS_ERR ;; + INC DI ;; + INC DI ;; + JMP NEXT_BRK ;; + ;; +UPTO_BRK : ;; next break point found + MOV DX,ES:[DI] ;; + SUB DX,AX ;; bytes to be skipped + CMP CX,DX ;; all to be skipped ? + JAE PASS_ALL ;; + ;; + ADD cs:pass_cnt,CX ;; + ADD SI,CX ;; + SUB CX,CX ;; + JMP PASS_END ;; + ;; +PASS_ALL : ;; + ADD cs:pass_cnt,DX ;; + ADD SI,DX ;; + SUB CX,DX ;; + ;; + MOV AX,cs:pass_postx ;; + MOV cs:stage,AX ;; + ;; +; cmp ax,passx ;; is the next stage a pass-stage ? +; jne not_passx ;; +; mov ax,pass_postxx ;; +; mov pass_postx,ax ;; +; mov pass_postxx,stage_max ;; can support only 2 consecutive pass + ;; +;not_passx : ;; + ;; + JMP PASS_END ;; + ;; +PASS_ERR : ;; DEVICE ERROR, wrong stage + POP DI ;; + POP ES ;; + POP DX ;; + MOV FTP.FTB_STATUS,STAT_DEVERR + SUB CX,CX ;; ignore all the input string + JMP PASS_DONE ;; + ;; +PASS_END : ;; + POP DI ;; + POP ES ;; + POP DX ;; +PASS_DONE : ;; + JMP FTB_LOOP ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +FTB_LPEND : ;; + ;; + CMP cs:stage,FOUNDX ;; + JNE NOT_FOUNDX ;; + ;; + CALL FOUND_DO ;; + ;; +NOT_FOUNDX : ;; + ;; + POP CX ;; STACK -1 + ;; +FP_RET : ;; + POP SI ;; restore registers + POP DI ;; + POP DX ;; + POP CX ;; + POP BX ;; + POP AX ;; + POP ES ;; + POP DS ;; + ;; + RET ;; +FONT_PARSER ENDP ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +CSEG ENDS + END diff --git a/v4.0/src/DEV/PRINTER/CPSPEQU.INC b/v4.0/src/DEV/PRINTER/CPSPEQU.INC new file mode 100644 index 0000000..ca086cb --- /dev/null +++ b/v4.0/src/DEV/PRINTER/CPSPEQU.INC @@ -0,0 +1,577 @@ + + PAGE ,132 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; FILENAME: CPS Printer Device Driver EQUAL Include +;; MODULE NAME: CPSEQU +;; TYPE: Include File +;; +;; LINK PROCEDURE: See CPSPx.ASM +;; +;; INCLUDE FILES: +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Request Header (Common portion) +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +RH EQU ES:[DI] ;; addressability to Request Header + ;; +RHC STRUC ;; fields common to all request types +RHC_LEN DB ? ;; length of Request Header + DB ? ;; unit code (subunit) +RHC_CMD DB ? ;; command code +RHC_STA DW ? ;; status + DQ ? ;; reserved for DOS +RHC ENDS ;; end of common portion + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; Command in the Request Header + ;; (see CMD_CODES table) + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CMD_INI EQU 0 ;; init command +CMD_WRT EQU 8 ;; write command +CMD_GIO EQU 19 ;; generic IOCTL command + ;; (see major/minor GIO functions) + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; status values for RHC_STA + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +STAT_DONE EQU 01H ;; function complete - high order byte +STAT_CMDERR EQU 8003H ;; invalid command code error +STAT_ERROR EQU 8000H ;; error returned by normal driver + ;; +;; see Generic IOCTL Request Header section +;; for more errorneous status. ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Request Header for INIT +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +RH0 STRUC ;; + DB (TYPE RHC) DUP (?) ;; common portion + ;; + DB ? ;; not used for CHAR devices +RH0_ENDO DW ? ;; offset of ending address +RH0_ENDS DW ? ;; segment of ending address +RH0_BPBA DD ? ;; pointer to BPBA + db ? +RH0_CONFIG_ERRMSG dw 0 ;DCR D493 "Error in CONFIG.SYS..." msg flag. +RH0 ENDS ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Request Header for IOCTL +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +RH3 STRUC ;; + DB (TYPE RHC) DUP (?) ;; common portion + ;; + ;; + DB ? ;; media descriptor +RH3_DTAO DW ? ;; offset of transfer address +RH3_DTAS DW ? ;; segment of transfer address +RH3_CNT DW ? ;; byte count +RH3 ENDS ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Request Header for GENERIC IOCTL +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +GIH STRUC ;; + DB (TYPE RHC) DUP (?) ;; common portion + ;; + ;; +GIH_MAF DB ? ;; major function +GIH_MIF DB ? ;; minor function +GIH_SI DW ? ;; content of SI +GIH_DI DW ? ;; content of DI +GIH_GBA DD ? ;; Address of Generic Buffer +GIH ENDS ;; + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; GIO major/minor functions + ;; (see GIO_CODES table) + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +MAF_CON EQU 03 ;; major function for CON device +MAF_PTR EQU 05 ;; major function for LPTX device + ;; +MIF_DST EQU 4CH ;; minor function : designate start +MIF_DEN EQU 4DH ;; designate end +MIF_IVK EQU 4AH ;; invoke +MIF_QIV EQU 6AH ;; query-invoked +MIF_QLS EQU 6BH ;; query-list + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Designate Start (MIF_DST)Flags + ;; see GBIS structure + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +DSF_FIFOCP EQU 08000H ;; Single code page FIFO command +DSF_CARTCP EQU 00001H ;; Code page for Cartridge/semi- + ;; hardware RAM + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Generic IOCTL errorneous status + ;; upon return + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +STAT_DELETE EQU 08000H ;; previous degignate deleted (DST) + ;; STAT_DELETE : only for FIFO +STAT_NOFIND EQU 08008H ;; codepage,device not found (DST) +STAT_DEVERR EQU 0800AH ;; Device error (DST,IVK,QIV,QLS,WRT) +STAT_BADATA EQU 0800CH ;; bad font file (DST) +STAT_NOBUFF EQU 0800CH ;; no font buffer for (REFRESH) +STAT_BADDEN EQU 0800CH ;; no DST (DEN) +STAT_bffDEN EQU 08000H ;; bad font file (DEN) +STAT_TOMANY EQU 0800aH ;; too manay codepages (DST) +STAT_DUPLCP EQU 0800aH ;; too manay codepages (DST) +STAT_NOCPIV EQU 08007H ;; no codepage designated/invoked +STAT_NOCP EQU 08007H ;; no codepage designated/invoked + ;; (IVK, QIV, QLS) + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Generic IOCTL Buffer DS:[SI] +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +GIOB EQU DS:[SI] ;; + ;; +GB1S STRUC ;; +GB1_FLAG DW ? ;; flag +GB1_LEN DW ? ;; length +GB1_NUM DW ? ;; length +GB1_CP DW ? ;; +GB1S ENDS ;; + ;; + ;; +GB2S STRUC ;; +GB2_LEN DW ? ;; length +GB2_CP DW ? ;; +GB2S ENDS ;; + ;; + ;; +GB3S STRUC ;; +GB3_LEN DW ? ;; length +GB3_GBL DW ? ;; hardware code page number +GB3S ENDS ;; + ;; +GB3_MINILEN EQU 4 ;; minimium length of GB3 + ;; +GBLS STRUC ;; +GBL_LEN DW ? ;; length +GBL_CP DW ? ;; hardware code page number +GBLS ENDS ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; DEVICE Header DS:[SI] -- to locate the next LPTn header +;; NEXT device header ES:[DI] +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +HP EQU DS:[SI] ;; +NHD EQU ES:[DI] ;; + ;; +NAME_LEN EQU 8 ;; + ;; +DHS STRUC ;; +DH_NEXTO DW ? ;; offset of pointer to next header +DH_NEXTS DW ? ;; segment of pointer to next header + DW ? ;; attribute +DH_STRAO DW ? ;; offset to strategy routine +DH_INTRO DW ? ;; offset to interrupt routine +DH_NAME DB NAME_LEN DUP(0) ;; device name in this header +DHS ENDS ;; end of common portion + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; FONT_PARSER data +;; +;; -- Interface table : FTABLE +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +FPKT EQU DS:[SI] ;; + ;; +FTP EQU ES:[BX] ;; + ;; ( I=Input O=Output ) +FTBLK STRUC ;; +FTB_LENGTH DW TYPE FTBLK ;; (NOT TO BE CHANGED) +FTB_STATUS DW 0FFFFH ;; (O) parsing compelte +FTB_TYPE DW 0 ;; (O) +FTB_TID DB 8 DUP(?) ;; (I) +FTB_CP DW 0FFFFH ;; (I) +FTB_MOD DW 0 ;; (O) +FTB_FONTS DW 0 ;; (O) +FTB_ROWS DB 0 ;; (O) DISPLAY TYPE DEVICE +FTB_COLS DB 0 ;; (O) DISPLAY TYPE DEVICE +FTB_X DB 0 ;; (O) DISPLAY TYPE DEVICE +FTB_Y DB 0 ;; (O) DISPLAY TYPE DEVICE +FTB_COUNT DW 0 ;; (O) DISPLAY TYPE DEVICE +FTB_SELECT DW 0 ;; (O) PRINTER TYPE DEVICE +FTB_SELLEN DW 0 ;; (O) PRINTER TYPE DEVICE +FTB_DLEFT DW 0 ;; (O) =0, none to come +FTB_DLEN DW 0 ;; (O) =0, not in this packet +FTB_DALO DW 0 ;; (O) in the DOS "packet" buffer +FTB_DAHI DW 0 ;; (O) " " " " " +TARGET_LO DW 0 ;; internal registers +TARGET_HI DW 0 ;; internal registers +FTBLK ENDS ;; + ;; +TYPE_DISPLAY EQU 01H ;; display type device +TYPE_PRINTER EQU 02H ;; printer type device + ;; +FBUFS STRUC ;; +FLAG DW 0 ;; +BUFFER_LEN DW 0 ;; +BUFFER_ADDR DD 0 ;; +NUM_FTBLK DW 0 ;; no. of FTBKL entries +FBUFS ENDS ;; + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; FLAGS : +FLAG_RESTART EQU 000001H ;; bit 1 = restart the parsing + ;; + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; STATUS : (in FTB_STATUS) + ;; +FSTAT_COMPLETE EQU 0FFFFH ;; parsing compeleted. (good status) +FSTAT_FONT EQU 0FFFEH ;; font data is defined and returned +FSTAT_FOUND EQU 0FFFDH ;; informations including font-length +FSTAT_MATCH EQU 0FFFCH ;; font header matches FTBLK +FSTAT_SEARCH EQU 0FFFBH ;; seraching for header & font +FSTAT_BOTTOM EQU 0FFF0H ;; below this are the DOS_STATUS. + ;; +;; the FSTAT with value lower than 0FFF0H is to be returned to the DOS + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; DEVICE Command Parser Table ES:[DI] +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +table_len equ 290 ;; + ;; +PSE EQU ES:[DI] ;; + ;; +PAR_OT STRUC ;; +PAR_DEV_NUM DW ? ;; +PAR_OFF DW ? ;; +PAR_OT ENDS ;; + ;; +PAR_DEVOT STRUC ;; OFFSET to the parameters of a device +PAR_onum DW ? ;; number of offsets in the table +PAR_DNMO DW ? ;; device-name table offset +PAR_DIDO DW ? ;; device-id table offset +PAR_HWCPO DW ? ;; hwcp table offset +PAR_DESGO DW ? ;; designate table offset +PAR_PARMO DW ? ;; parameter table offset +PAR_DEVOT ENDS ;; + ;; +PAR_DNMT STRUC ;; DEVICE NAME table +PAR_DNML DW ? ;; length of device name +PAR_DNM DB ? ;; device name +PAR_DNMT ENDS ;; + ;; +PAR_DIDT STRUC ;; DEVICE ID table +PAR_DIDL DW ? ;; device ID length +PAR_DID DB ? ;; device ID +PAR_DIDT ENDS ;; + ;; +PAR_HWCPT STRUC ;; hwcp table +PAR_HWCPL DW ? ;; hwcp entry number +PAR_HWCP DW ? ;; hwcp +PAR_HWCPT ENDS ;; + ;; + ;; +PAR_DESGT STRUC ;; DESIGNATE table +PAR_DESGL DW ? ;; entry number +PAR_DESG DW ? ;; designate +PAR_FONT DW ? ;; fonts +PAR_DESGT ENDS ;; + ;; + ;; +PAR_PARMT STRUC ;; parameter table +PAR_PARML DW ? ;; length +PAR_PARM DW ? ;; +PAR_PARMT ENDS ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; LPTn printer data structure CS:[BX] +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +BUF EQU CS:[BX] ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; STATES + ;; +NORMAL EQU 0 ;; normal state +CPSW EQU 1 ;; +DESG_WR EQU 2 ;; designate write +DESG_END EQU 3 ;; designate end +LOCKED EQU 4 ;; WGR locked + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +GOOD EQU 0 ;; STATUS : +REPLX EQU 8000H ;; codepage replaced in DST +FAIL EQU 4000H ;; fail in designate +LOADED EQU 2000H ;; the font has just been loaded to +REFRESH EQU 0800H ;; there was a refresh via DST + ;; + ;; also + ;; -- DSF_CARTCP + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; for BFLAG : +BF_PRN EQU 0 ;; 0 = PRN initialized (interrupt) +BF_LPT1 EQU 1 ;; 1 = LPT1 initialized (interrupt) +BF_LPT2 EQU 2 ;; 2 = LPT2 initialized (interrupt) +BF_LPT3 EQU 3 ;; 3 = LPT3 initialized (interrupt) +BF_MEM_DONE EQU 08000H ;; memory done for this device + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; BUFFER DATA structure +BUF_DATA STRUC ;;................................. +BFLAG DW -1 ;; buf flag for initialisation + ;; -1 = buf not yet initialised + ;; (see BF_PRN, BF_LPT's) + ;; +DEV_HDRO DW -1 ;; device driver n header offset +DEV_HDRS DW -1 ;; +LPT_STRAO DW -1 ;; dos lptn strategy offset +LPT_STRAS DW -1 ;; +LPT_INTRO DW -1 ;; dos lptn strategy offset +LPT_INTRS DW -1 ;; +RH_PTRO DW -1 ;; request header offset +RH_PTRS DW -1 ;; segment ....................(unique) + ;; + ;; (following is replicated for LPT1 ) + ;; +RNORMO DW -1 ;; request-normal driver header offset +prn_bufo dw -1 ;; offset to prn buffer +did_prn dw 0 ;; where PRN is in the DID order +PCLASS DW 0 ;; +STATE DW NORMAL ;; +STATUS DW GOOD ;; + ;; (the followings should be used + ;; IFF BUT.STATE <> NORMAL : ) + ;; +PDESCO DW -1 ;; offset to printer description table. + ;; + ;;===== hwcp and designated slots ==== +HSLMX DW 0 ;; HSLMX is the size of HARDslot (at + ;; HARDSO) and the buffer(at HRBUFO) + ;; +HARDMX DW 0 ;; no. of HWCP+cart slots supported + ;; (less than or equal to .HSLOTS) +HARDSO DW -1 ;; offset to hardware slots n + ;; +HCARMX DW 0 ;; no. of cart slots supported +HRBUFO DW -1 ;; offset to cart slots' buffer + ;; + ;;===== physical and designated RAM === + ;; +RSLMX DW 0 ;; RSLMX is the size of RAMslot (at + ;; RAMSO) and the RAM buffer(at RMBUFO) + ;; + ;; +RAMMX DW 0 ;; no. of physical RAM slots(max.=1) +RAMSO DW -1 ;; offset to RAM slots(incl. designated + ;; +RBUFMX DW 0 ;; no. of designated RAM slots supported +RMBUFO DW -1 ;; offset to RAM slots's buffer + ;; +FTSZPA DW -1 ;; font buffer in paragraph = FONTSZ +FTSIZE DW 0 ;; font buffer size = FTSZPA x 16 +FTSTART DW -1 ;; start of font buffer +FTSLOTO DW -1 ;; segment address of font buffer + ;; -- of the one to be designated to +FTDLO DW -1 ;; offset to where the FTSTART:OFFSET + ;; (next destination = total length + ;; so far) +FSELEN DW 0 ;; length of selection control copied + ;; to the selection buffer + ;; (USED BY SELECT TYPE = 1 ONLY) + ;; -- initialized to 0, if selection + ;; is not 0, copied the selection + ;; from the font file until the + ;; length is reached. After copying + ;; to selection buffer, reset to 0 +FSELMAX DW 0 ;; max. room reserved for selection + ;; controls. + ;; +PAR_EXTRACTO DB (TYPE PAR_DEVOT) DUP (-1);; Offset to parameter extracts +SAVED_CP DW -1 ;; WGR saved code page during lock ;AN000; +BUFEND DW 0 ;; END OF BUFFER, for LPT1 copy. +BUF_DATA ENDS ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Printer Description Table +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +DEVN_LEN EQU 8 ;; device name (type-id) length + ;; +PDSH STRUC ;; +PD_LEN DW 30 ;; length of each entry +TYPEID DB ' ' ;; device name (id), length DEVN_LEN +VMINOR DB 0 ;; version : .00 +VMAJOR DB 1 ;; version : 1. +CLASS DW ? ;; reserved +FONTSZ DW ? ;; font buffer size in paragraph (max) +HSLOTS DW ? ;; hard-slots number (max # of Hslots) +HWCPMIN DW ? ;; what left by min_hwcp can be cart. +RSLOTS DW ? ;; ram-slots number (max # of Rslots) +PDSH ENDS ;; the SELH_O, and SELR_O are defined + ;; in the next two entries in PDS + ;; + ;; +PDS STRUC ;; + DB (TYPE PDSH) DUP (?) ;; common portion +SELH_O DW ? ;; offset to select controls on Hslots +SELR_O DW ? ;; offset to select controls on Rslots +SELB_O DW ? ;; offset to buffered select controls +PDS ENDS ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; HARD / RAM slots table structure/constants +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; NOTE : must be only FOUR bytes for + ;; codepage positioning + ;; calculation as compared + ;; with each entry in FTDL_OFF + ;; +SLTS STRUC ;; slots-table structure +SLT_CP DW -1 ;; code page : no code page +SLT_AT DW 0 ;; attribute : empty +SLTS ENDS ;; + ;; + ;; ATTRIBUTES : +AT_RAM1 EQU 00001H ;; in the 1st physical RAM slot +AT_RAM2 EQU 00002H ;; in the 2nd physical RAM slot +AT_RAM3 EQU 00004H ;; in the 3rd physical RAM slot +AT_RAM4 EQU 00008H ;; in the 4th physical RAM slot +AT_RAMS EQU 0000FH ;;(note the current logic supports + ;; only ONE physical RAM slot) + ;; +AT_OCC EQU 01000H ;; slot occupied +AT_ACT EQU 02000H ;; slot active +AT_HWCP EQU 04000H ;; slot is hwcp +AT_OLD EQU 08000H ;; codepage in buffer is not newly + ;; designated. +AT_LOAD EQU 00100H ;; slot with font to be loaded +AT_FONT EQU 00200H ;; font in this slot has been loaded +AT_NO_LOAD EQU NOT AT_LOAD ;; to reset the bit +AT_NO_FONT EQU NOT AT_FONT ;; to reset the bit +AT_SELECT EQU 00400H ;; for SELECT TYPE = 1 + ;; -- mark the FTBLK where control is + ;; copied from. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; constants on SLOTS +HARDSL_MAX EQU 12 ;; + ;; +RAMSL_MAX EQU 12 ;; + ;; +CTL_MAX EQU 32 ;; max.length of each selection control +CTL5202_OFFS EQU 8 ;; offset to CTL5202_H for codepage + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; General Constants +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +STACK_SIZE EQU 28H ;; in paragraph, total 200H bytes + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; +; STRUCS AND EQUATES +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +PARSE_NAME STRUC ;; ;AN000; +N_LENGTH DW ? ;; ;AN000; +FNAME DB " " ;; ;AN000; +PARSE_NAME ENDS ;; ;AN000; + ;; +PARSE_OFFSETS STRUC ;; ;AN000; + DW ? ;; ;AN000; +DN_OFFSET DW ? ;; ;AN000; +DI_OFFSET DW ? ;; ;AN000; +DCP_OFFSET DW ? ;; ;AN000; +DD_OFFSET DW ? ;; ;AN000; + DW ? ;; ;AN000; +PARSE_OFFSETS ENDS ;; ;AN000; + ;; +PARSE_HWCP STRUC ;; ;AN000; +NUM_HWCPS DW ? ;; ;AN000; +HWCP_1 DW ? ;; ;AN000; +HWCP_2 DW ? ;; ;AN000; +HWCP_3 DW ? ;; ;AN000; +HWCP_4 DW ? ;; ;AN000; +HWCP_5 DW ? ;; ;AN000; +HWCP_6 DW ? ;; ;AN000; +HWCP_7 DW ? ;; ;AN000; +HWCP_8 DW ? ;; ;AN000; +HWCP_9 DW ? ;; ;AN000; +HWCP_10 DW ? ;; ;AN000; +PARSE_HWCP ENDS ;; ;AN000; + ;; +PARSE_DESG STRUC ;; ;AN000; +NUM_VALUES DW ? ;; ;AN000; +NUM_DESGS DW ? ;; ;AN000; +NUM_FONTS DW ? ;; ;AN000; +PARSE_DESG ENDS ;; ;AN000; + ;; + ;; +ZERO EQU 0H ;; ;AN000; +ONE EQU 1H ;; ;AN000; +TWO EQU 2H ;; ;AN000; +THREE EQU 3H ;; ;AN000; +FOUR EQU 4H ;; ;AN000; +FIVE EQU 5H ;; ;AN000; +SIX EQU 6H ;; ;AN000; +SEVEN EQU 7H ;; ;AN000; +EIGHT EQU 8H ;; ;AN000; +NINE EQU 9H ;; ;AN000; +TEN EQU 0AH ;; ;AN000; +NUMBER EQU 1 ;; ;AN000; +STRING EQU 3 ;; ;AN000; +COMPLEX EQU 4 ;; ;AN000; +RC_EOL EQU -1 ;; ;AN000; +RC_NO_ERROR EQU 0 ;; ;AN000; +RC_OP_MISSING EQU 2 ;; ;AN000; +ON EQU 1 ;; ;AN000; +OFF EQU 0 ;; ;AN000; +BAD_SYNTAX_MSG EQU 12 ;; ;AN000; +BAD_DEVICE_MSG EQU 2 ;; ;AN000; +; + diff --git a/v4.0/src/DEV/PRINTER/CPSPI.ASM b/v4.0/src/DEV/PRINTER/CPSPI.ASM new file mode 100644 index 0000000..30bb7c9 --- /dev/null +++ b/v4.0/src/DEV/PRINTER/CPSPI.ASM @@ -0,0 +1,2422 @@ + + PAGE ,132 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; FILENAME: CPS Printer Device Driver INIT module (CPSPInn) +;; MODULE NAME: +;; TYPE: Assemble file (non-resident code) +;; LINK PROCEDURE: Link CPSPMnn+CPSFONT+CPSPInn into .EXE format. CPSPM01 +;; must be first. CPSPInn must be last. Everything +;; before CPSPInn will be resident. +;; INCLUDE FILES: +;; CPSPEQU.INC +;; +;; LAYOUT : This file is divided into two main section : +;; ++++++++++++++++++++++++ +;; ++ DEVICE Parser ++ +;; ++++++++++++++++++++++++ +;; +;; ++++++++++++++++++++++++ +;; ++ INIT Command ++ +;; ++++++++++++++++++++++++ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +INCLUDE CPSPEQU.INC ;; + ;; +PUBLIC INIT ;; +PUBLIC CODE_END ;; for MAP listing only +PUBLIC RESIDENT_END ;; +PUBLIC STACK_ALLOCATED ;; + ;; + ;; +EXTRN PRINTER_DESC_NUM:WORD ;; +EXTRN PRINTER_DESC_TBL:WORD ;; +EXTRN INIT_CHK:WORD,TABLE:WORD ;; +EXTRN HARD_SL1:BYTE,RAM_SL1:BYTE ;; +EXTRN HARD_SL2:BYTE,RAM_SL2:BYTE ;; +EXTRN HARD_SL3:BYTE,RAM_SL3:BYTE ;; +EXTRN HARD_SL4:BYTE,RAM_SL4:BYTE ;; +EXTRN RESERVED1:WORD,RESERVED2:WORD ;; + ;; +EXTRN MSG_NO_INIT_P:BYTE ;; +EXTRN MSG_NO_INIT:BYTE ;; +EXTRN MSG_BAD_SYNTAX:BYTE ;; +EXTRN MSG_INSUFF_MEM:BYTE ;; + ;; + ;; +CSEG SEGMENT PARA PUBLIC 'CODE' ;; + ASSUME CS:CSEG ;; + ;; + ;; +CODE_END EQU $ ;; end of resident code + ;; + DW 0 ;; -- there are 16 bytes kept, + ;; including this word + ;; +RESIDENT_END DW 0FFFH ;; end of extended resident area +STACK_ALLOCATED DW -1 ;; end of extended resident area + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; End of resident code +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Incorporating Device Command Parser : +;; +;; -- extracted from PARSE4E.ASM, size 49582 bytes +;; +;; (some modifications have to be made in the section right after the parser's +;; document and before the GET_PARMS_A, one of them is :) +;; +;; -- move the TABLE to the printer device driver's main module +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; ++++++++++++++++++++++++ +;; ++ DEVICE Parser ++ +;; ++++++++++++++++++++++++ +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; +;; PARSER's code -- non resident +;; +;; -- set ES:[DI] pointing to the Request Header before calling PARSER +;; +;; to be called as PARSER with ES:[DI] defined as Request Header +;; If there is any syntax error in the DEVICE command line, the +;; Parser return a 0 in the first word (NUMBER)of the first table. +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +; +; Description: A command parser for DEVICE command in the CONFIG.SYS file. +; ------------ +; +; Procedures contained in the file: +; --------------------------------- +; PARSER: Main routine for command processing. +; GET_CHAR: Gets a character from command line. +; IS_ALPH: Checks if character is an alpha character. +; IS_DIGIT: Checks if character is a digit. +; IS_DELIM: Checks if character is a DOS delimiter. +; DEVICE_PARSE: Pulls device name from command line and +; inserts in table. +; ID_PARSE: Pulls id name from command line and insers in table +; HWCP_PARMS: Extract HWCP number, converts it to binary and +; inserts it in table. +; HWCP_PARSE: Extracts HWCP number if only one number is given. +; MUL_HWCP: Extracts multiple HWCP's numbers, if they are given +; in a list. +; DESG_PARMS: Extracts designate number, converts it to binary +; and inserts it in table. +; DESG_FONT: Extracts the designate and the font if both were +; given in command line. +; DESG_PARSE: Pulls designate number if it is the only one given. +; GET_NUMBER: Converts a number to binary. +; OFFSET_TABLE: Updates the counter in table #1. +; FIND_RIGHT_BR: Looks for a right bracket. +; +; +; Change history: +; --------------- +; +; +;LOGIC: +;------ +; Establish addressability to parameters. +; Skip until end of path and file name -first delimiter +; +; Loop: +; Isolate the first non-delimiter or non delimeter characters. +; If End_of_Line_Delimiter then +; return an error_code +; Else +; If first non-delimiter is ALPHA then +; (assume a device name) +; Extracts device name +; Update offset counter +; +; Isolate the first non-delimiter characters after id name. +; If End_of_Line_Delimiter then +; return an error_code +; Else +; If first non-delimiter is ALPHA-NUMARIC or +; If character is '(' then +; (assume an id name) +; Extracts id name +; Update offset counter +; +; Pull out HWCP +; If error flag is set then exit +; Else if end of line flag is set then exit +; +; Pull out DESG parms +; If error_flag is set then exit. +; Else if end of line flag is set then exit +; Else if Number of devices is four then Exit +; Else Loop +; +; +;Subroutines Logic: +;------------------ +; +; GET_CHAR: +; --------- +; Load character in AL +; If character less than 20h then +; turn Z-flag on +; +; IS_ALPHA: +; --------- +; Save character +; 'Convert character to upper case' +; If character >=A and <=Z then +; turn Z-flag on +; exit +; Else +; Restore character +; exit. +; +; IS_DIGIT: +; --------- If Character >=0 and <=9 then +; turn Z-flag on +; +; IS_DELIMITER: +; ------------- +; If character a dos delimiter (' ','=',',',';',TAB) +; then turn Z-flag on +; +; DEVICE_PARSE: +; ------------- +; Set device name length counter. +; Loop +; If a dos delimiter then +; add spaces to name (if require) +; Else if char is ALPHA-NUM then +; save in table +; If name >8 character thne +; error; exit +; Else +; error; exit +; +; ID_PARSE: +; --------- Set id name length counter. +; Loop +; If a dos delimiter then +; add spaces to name (if require) +; Else if char is ALPHA-NUM then +; save in table +; If name >8 character then +; error; exit +; Else if char is ')' or '(' then +; set flags +; Else +; error; exit +; +; HWCP_PARMS: +; ----------- +; Loop: Set flags off +; If char is a DIGIT then +; convert number to binary +; update table +; Else if char is ',' then +; no HWCP was given +; exit +; Else if char is '(' then +; assume multiple HWCP +; Else if char is ')' then +; end of parms, exit +; Else if not a delimiter then +; error, exit set carry flag set carry flag +; Loop +; +; HWCP_PARSE: +; ----------- Increment counter +; Get number and convert to binary +; Update the table +; Set table_5 pointer +; +; MUL_HWCP: +; --------- +; Loop: If char is ')' then +; end of list, exit +; If char is a DIGIT +; Get number and convert to binary +; Update table. +; If char is not a delimiter then +; error, exit set carry flag +; Loop +; +; DESG_PARMS: +; ----------- +; Loop: If char is a DIGIT then +; Get number and convert to binary +; Update table. +; If char is a ')' then +; end of parms, exit +; If char is a '(' then +; assume given desg. and font +; If char is a ',' then +; no desg ginven +; scane for ')' +; If char is not a delimiter then +; error, exit set carry flag +; Loop +; +; DESG_FONT: +; ---------- +; Loop: If char is a ',' then +; no desg number was given +; update table +; If char is a ')' then +; end of desg-font pair, exit +; If char is a DIGIT then +; Get number and convert to binary +; Update table +; If char not a delimiter then +; error, exit set carry flag +; Loop +; +; DESG_PARSE: +; ----------- Get number and conver to binary +; Update table +; +; GET_NUMBER: +; ----------- Get ASCII number from parms +; conver to binary +; add to total +; +; OFFSET_TABLE: +; ------------- +; Increment the number of parms +; +; FIND_RIGHT_BR: +; -------------- +; Loop: If char is ')' then +; found bracket exit +; If char is not ' ' then +; error, exit set carry flag +; Loop +; END +;------------------------------------------------------ +; +; The following is the table structure of the parser. All fields are +; two bytes field (accept for the device and id name) +; +; TABLE HEADER : +; +; Ŀ +; N = Number of devices. +; Ĵ +; Device # 1 offset >Ŀ +; Ĵ +; Device # 2 offset Table_1 (a) +; Ĵ +; Device # 3 offset +; Ĵ +; Device # 4 offset +; +; +; +; N = 1,2,3 or 4. A two bytes number indicating the number of device specified. +; DEVICE # N OFFSET : a two bytes offset address to table_1. (ie. Device #1 offset +; is a pointer to table_1 (a). Device #2 offset is a pointer to table_1 +; (b)...etc.). If an error was detected in the command N is set to zero. +; +; +; +; TABLE_1 : +; +; +; Ŀ Ŀ +; N = Number of Offsets. +; Ĵ ij Table_2 (a) +; Device Name offset +; Ĵ +; Device Id offset Ŀ +; Ĵ Ŀ +; Device HWCP offset Ŀ +; Ĵ ij Table_3 (a) +; Device Desg offset Ŀ +; Ĵ +; "Reserved" +; Ŀ +; +; ij Table_4 (a) +; +; +; Ŀ +; +; ij Table_5 (a) +; +; +; +; +; N=Length of table_1, or the number of offsets contained in table_1. +; The offsets are pointers (two bytes) to the parameters value of the device. +; "Reserved" : a two byte memory reserved for future use of the "PARMS" option. +; +; +; TABLE_2 : +; +; +; Ŀ +; N = Length of devices name +; Ĵ +; Device name +; +; +; N = Length of device name. Device length is always 8 byte long. +; Device Name : the name of the device (eg. LPT1, CON, PRN). The name +; is paded with spaces to make up the rest of the 8 characters. +; +; +; +; TABLE_3 : +; +; +; Ŀ +; N = Length of Id name. +; Ĵ +; Id Name +; +; +; N = Length of id name. Id name length is always 8 byte long. +; Id Name : the name of the id (eg. EGA, VGA, 3812). The name +; is paded with spaces to make up the rest of the 8 character. +; +; +; +; TABLE_4 : +; +; +; Ŀ +; N = Length of table. +; Ĵ +; HWCP # 1 +; Ĵ +; HWCP # 2 +; Ĵ +; . +; . +; . +; Ĵ +; HWCP # 10 +; +; +; +; N = Length of table in words. Or the number of HWCP's. +; HWCP # N : a hardware code page number converted to binary. The maximum +; number of pages allowed is 10. +; +; +; +; TABLE_5 : +; +; +; Ŀ +; N = Length of table. +; Ĵ +; Designate +; Ĵ +; Font +; +; +; N = Lenght of table. 0 - nothing was specified +; 1 - Only a designate was specified. +; 2 - Designate and font were given. If the Desg field +; was left empty in the DEVICE command then the +; Designate field is filled with 0FFFFH. +; Designate, Font : Are the Desg. and Font binary numbers. +; +;------------------------------------------------------ +; + +;RESERVED MEMORY: +TABLE_1 DW ? ; Pointer at offsets. +TABLE_2 DW ? ; Pointer at device name. +TABLE_3 DW ? ; Pointer at id name. +TABLE_4 DW ? ; Pointer at hwcp. +TABLE_5 DW ? ; Pointer at desg and font. +;TABLE DB 290 DUP (?) ; Table of parsed parms. Max 4 devices. +DEVNUM DW ? ; Counter to number of devices. +RIGHT_FLAG DB ? ; Flag to indicate a left bracket. +DEV_ERR_FLG DB ? ; Device name error flag. +ID_ERR_FLG DB ? ; Id name error flag. +ERROR_FLAG DB ? ; Error flag_terminate program if set to 1. +COMMA_FLAG DB ? ; Indicate the number of commas incounterd. +HWCP_FLAG DB ? ; Flag for multiple hwcps. +DESG_FLAG DB ? ; Flag indicates desg. and font. + +;Main part of program-links different sumbroutines together + +PARSER PROC + + PUSH AX ; ;;;;;;;;;;;;;;;;;; + PUSH BX ; ; + PUSH CX ; ; SAVE + PUSH DX ; ; ALL + PUSH DS ; ; REGISTERS. + PUSH ES ; ; + PUSH DI ; ; + PUSH SI ; ;;;;;;;;;;;;;;;;;; + + LES SI,RH.RH0_BPBA ; Point at all after DEVICE= + ; in the CONFIG.SYS file. + + +;Skip to end of file name, to the first DOS delimiter. + + MOV DEVNUM,02H ; Number of devices counter. + +GET_PARMS_A: CALL GET_CHAR ; Get command character in AL . + JZ EXIT_B ; No parms found. + CALL IS_DELIM ; If not a delimiter then. + JNE GET_PARMS_A ; Check next character. + + MOV DI,OFFSET TABLE ; Get the table address. + ADD DI,02H ; Point at devices offsets. + MOV BX,DI ; + ADD BX,08H ; Point BX at parms offsets. +TAB2: CALL UPDATE_TABLE ; Update table pointers value. + +CLR_DELIM: CALL GET_CHAR ; Get character into AL. + JZ EXIT_B ; No parms found. + CALL IS_ALPHA ; If alpha then assume. + JZ DEVICE ; A device name. + CALL IS_DELIM ; Is it a delimiter + JNE EXIT_A ; If not then error. + JMP CLR_DELIM ; Get next character. + +DEVICE: MOV DEV_ERR_FLG,00H ; Set device error flag off; + CALL DEVICE_PARSE ; Call routine to parse device name. + CMP DEV_ERR_FLG,01H ; If error flag is + JZ EXIT_A ; set then exit. + CALL OFFSET_TABLE ; Update table. + +ID_PARMS: CALL GET_CHAR ; Load a character in AL. + JZ EXIT_A ; Exit if end of line (error). + CMP AL,'(' ; If AL is a '(' then + JE ID ; Parse ID name. + CALL IS_ALPHA ; If an Alpha + JE ID ; Then parse ID name. + CALL IS_DIGIT ; If a digit + JE ID ; Then parse ID name. + CALL IS_DELIM ; If not a delimiter + JNE EXIT_A ; Then error, exit + JMP ID_PARMS ; Get another number + +EXIT_B: CMP DEVNUM,02H ; If device number above 2 then + JA EXIT_C ; Exit parse. + JMP EXIT_A ; Else error, exit + +ID: MOV ID_ERR_FLG,00H ; Set id error flag off. + CALL ID_PARSE ; Parse ID name. + CMP ID_ERR_FLG,01H ; Was error flag set, then + JE EXIT_A ; Print error message. + CALL OFFSET_TABLE ; Update table of offsets. + + CALL HWCP_PARMS ; Get code page number + CMP ERROR_FLAG,01H ; If error, then + JE EXIT_A ; Print error message and exit + CMP ERROR_FLAG,02H ; If end of string + JE EXIT_H ; Then exit. + + CALL DESG_PARMS ; Get designate number + CMP ERROR_FLAG,01H ; If error, then + JE EXIT_A ; Print error message and exit + JMP EXIT_H ; Then exit. + +EXIT_A: MOV DI,OFFSET TABLE ; Load table offset + MOV DS:WORD PTR [DI],00H ; Set error to on. + STC ; Set carry flag + JMP EXIT_P ; Exit parse. + +EXIT_H: MOV DI,OFFSET TABLE ; Load table offset. + ADD DS:WORD PTR [DI],01H ; Increment number of devices. + CMP DEVNUM,08H ; If 4 devices loaded + JE EXIT_C ; Then exit parse. + ADD DEVNUM,02H ; Increment the number of devices + ADD DI,DEVNUM ; Point at next devices offset. + MOV BX,TABLE_5 ; BX point at + ADD BX,06H ; end of previous table. + JMP TAB2 ; Get next device. + +EXIT_C: CLC + +EXIT_P: POP SI ; ;;;;;;;;;;;;;;;;;; + POP DI ; ; + POP ES ; ; RESTORE + POP DS ; ; ALL + POP DX ; ; REGISTERS. + POP CX ; ; + POP BX ; ; + POP AX ; ;;;;;;;;;;;;;;;;;; + RET + +PARSER ENDP + + +;******************************************************** +;** GET_CHAR : a routine to get next character pointed ** +;** to by ES:SI into AL. ** +;******************************************************** + +GET_CHAR PROC + + MOV AL,ES:BYTE PTR [SI] ; Load character pointed to + CMP AL,09H ; by ES:[SI] in AL. + JE ZOFF ; If tab then O.K + CMP AL,20H ; Turn Z-flag on + JL TURN_Z_ON ; if character +ZOFF: INC SI ; is below + JMP GET_CHAR_X ; 20h. + ; ( End of line +TURN_Z_ON: CMP AL,AL ; delimiters ). +GET_CHAR_X: RET + +GET_CHAR ENDP + + +;******************************************************** +;** IS_ALPHA : a routine to check the character in ** +;** AL if it is an alpha character (a...z,A...Z). ** +;** If character is lower case, convert to upper case. ** +;******************************************************** + +IS_ALPHA PROC + + PUSH AX ; Save value of AL + AND AL,0DFH ; Convert to upper case + CMP AL,'A' ; If <'A', then + JB IS_ALPHA_X ; NZ-flag is set, exit + CMP AL,'Z' ; If >'Z', then + JA IS_ALPHA_X ; NZ-flag is set, exit + CMP AL,AL ; Force Z-flag + POP DX ; Discard lower case. + JMP IA_X ; Exit. +IS_ALPHA_X: POP AX ; Restore value of AL +IA_X: RET + +IS_ALPHA ENDP + + +;******************************************************** +;** IS_DIGIT : a routine to check if the character in ** +;** AL register is a digit (i.e. 1..9). ** +;******************************************************** + +IS_DIGIT PROC + + CMP AL,'0' ; If < '0' then + JB IS_NUM_X ; NZ-flag is set, exit + CMP AL,'9' ; If > '9' then + JA IS_NUM_X ; NZ-flag is set, exit + CMP AL,AL ; Set Z-flag to indecate digit +IS_NUM_X: RET + +IS_DIGIT ENDP + + +;******************************************************** +;** IS_DELIM : This routine check if the character in ** +;** AL is a delimiter. ('+',' ',';',',','=',tab) ** +;******************************************************** + +IS_DELIM PROC + + CMP AL,' ' ; Test for space. + JE IS_DELIM_X ; Z-flag is set, exit + CMP AL,',' ; Test for comma. + JE IS_DELIM_X ; Z-flag is set, exit + CMP AL,';' ; Test for semicolon. + JE IS_DELIM_X ; Z-flag is set, exit + CMP AL,'=' ; Test for equal sign. + JE IS_DELIM_X ; Z-flag is set, exit + CMP AL,09h ; Test for TAB. + +IS_DELIM_X: RET ; Exit + +IS_DELIM ENDP + + +;******************************************************** +;** DEVICE_PARSE : Parse the device driver name and ** +;** store in table. Update offset. ** +;******************************************************** + +DEVICE_PARSE PROC + + MOV DI,TABLE_2 + MOV DS:WORD PTR [DI],0008H ; Save dev name size. + ADD DI,02H ; Increment DI. + MOV CX,9 ; Set counter. +NEXT_C: CALL IS_ALPHA ; if Check then. + JZ SAVE_C ; Save it. + CALL IS_DIGIT ; if Digit then. + JZ SAVE_C ; Save it. + CMP AL,'-' ; If '-' then. + JZ SAVE_C ; Save it. + CALL IS_DELIM ; If a delimiter then. + JZ ADD_SPACE1 ; Pad with spaces. + CMP AL,':' ; If a colon + JE ADD_SPACE1 ; then end device parse + JMP ERR_DEV_PAR ; Else an error. + +SAVE_C: DEC CX ; Decrement counter. + CMP CX,0 ; If counter zero then. + JE ERR_DEV_PAR ; Error. + MOV DS:BYTE PTR [DI],AL ; Save char in table. + INC DI ; Increment pointer. + CALL GET_CHAR ; Get another char. + JZ ERR_DEV_PAR + JMP NEXT_C ; Check char. + +ERR_DEV_PAR: MOV DEV_ERR_FLG,01H ; Set error flag. + JMP DEV_PAR_X ; Exit. + +ADD_SPACE1: DEC CX ; Check counter. + CMP CX,1 + JL DEV_PAR_X ; Exit if already 8. +LL1: MOV DS:BYTE PTR [DI],' ' ; Pad name with spaces. + INC DI ; Increment pointer. + LOOP LL1 ; Loop again. +DEV_PAR_X: RET + +DEVICE_PARSE ENDP + + +;******************************************************** +;** ID_PARSE : Parse the id driver name and ** +;** store in table. Update offset. ** +;******************************************************** + +ID_PARSE PROC + + MOV DI,TABLE_3 + MOV DS:WORD PTR [DI],0008H ; Save dev name size. + ADD DI,02H ; Increment DI. + MOV RIGHT_FLAG,00H ; Clear flag. + MOV CX,9 ; Set counter. + +NEXT_I: CALL IS_ALPHA ; If Check then. + JZ SAVE_I ; Save it. + CALL IS_DIGIT ; if Digit then. + JZ SAVE_I ; Save it. + CMP AL,'-' ; If '-' then. + JZ SAVE_I ; Save it. + CMP AL,'(' ; If '(' then. + JE RIG_BR_FLG ; Set flag. + CMP AL,')' ; If ')' then + JE BR_FLG_LEF ; Pad with spaces. + CALL IS_DELIM ; If a delimiter then. + JZ ADD_SPACE2 ; Pad with spaces. + JMP ERR_ID_PAR ; Else an error. + +SAVE_I: DEC CX ; Decrement counter. + CMP CX,0 ; If counter zero then. + JLE ERR_ID_PAR ; Error. + MOV DS:BYTE PTR [DI],AL ; Save char in table. + INC DI ; Increment pointer. + CALL GET_CHAR ; Get another char. + JZ ADD_SPACE2 ; Exit routine. + JMP NEXT_I ; Check char. + +ERR_ID_PAR: MOV ID_ERR_FLG,01H ; Set error falg on. + JMP ID_PAR_X ; Exit. + +BR_FLG_LEF: CMP RIGHT_FLAG,01H ; If left bracket was + JNE ERR_ID_PAR ; found and no previous + JMP ADD_SPACE2 ; Bracket found, then error + +RIG_BR_FLG: CMP RIGHT_FLAG,01H ; If more than one bracket + JE ERR_ID_PAR ; then error. + CMP CX,09 ; If '(' and already id + JB ERR_ID_PAR ; then error. + MOV RIGHT_FLAG,01H ; Set flag for. + CALL GET_CHAR ; Left brackets. + JZ ERR_ID_PAR ; If end of line,exit. + JMP NEXT_I ; Check character. + +ADD_SPACE2: DEC CX ; Check counter. + CMP CX,1 + JL ID_PAR_X ; Exit if already 8. + +LL2: MOV DS:BYTE PTR [DI],' ' ; Pad name with spaces. + INC DI ; Increment pointer. + LOOP LL2 ; Loop again. + +ID_PAR_X: RET + +ID_PARSE ENDP + +;******************************************************** +;** HWCP_PARMS : Scane for the hardware code page, and ** +;** parse it if found. Flag codes set to: ** +;** ERROR_FLAG = 0 - parsing completed. No error. ** +;** ERROR_FLAG = 1 - error found exit parse. ** +;** ERROR_FLAG = 2 - end of line found, exit parse. ** +;******************************************************** + + +HWCP_PARMS PROC + + MOV COMMA_FLAG,00H ; Set the comma flag off. + MOV ERROR_FLAG,00H ; Set the error flag off. + DEC SI ; Point at current char in Al. + CMP RIGHT_FLAG,01H ; If no left brackets then + JNE LEFT_BR ; Exit parse. + +HWCP_1: CALL GET_CHAR ; Load character in AL. + JZ LEFT_BR ; Exit, if end of line. + CALL IS_DIGIT ; Check if digit, then + JE HP1 ; Parse hwcp parms. + CMP AL,',' ; If a comma + JE COMMA_1 ; Jump to comma_1 + CMP AL,')' ; If a ')' then + JE RIGHT_BR ; end of current dev parms. + CMP AL,'(' ; If a '(' then + JE HWCP_2 ; There are multible hwcp. + CALL IS_DELIM ; Else, if not a delimiter + JNE EXIT_2 ; Then error, exit + JMP HWCP_1 ; Get another character. + +LEFT_BR: CMP RIGHT_FLAG,01H ; If no left bracket + JE EXIT_2 ; Then error, exit + JMP RB1 ; Jump to rb1 + +COMMA_1: CMP COMMA_FLAG,01H ; If comma flag set + JE COM_2_HC ; Then exit hwcp parse. + MOV COMMA_FLAG,01H ; Else set comma flag. +JMP HWCP_1 ; Get another character. + +HWCP_2: CMP RIGHT_FLAG,01H ; If left bracket not set + JNE EXIT_2 ; then error. + CALL MUL_HWCP ; else call multiple hwcp + ADD DI,02H ; routine. Increment DI + MOV TABLE_5,DI ; Desg. Table starts at end + CALL OFFSET_TABLE ; Update table of offsets. + JMP HP_X ; Exit. + +HP1: JMP HWCP ; Jump too long. + +COM_2_HC: MOV DI,TABLE_4 ; DI points at hwcp table + MOV DS:WORD PTR [DI],0000H ; Set number of pages to + MOV COMMA_FLAG,00H ; Zero and reset comma flag. + ADD DI,02H ; Increment DI. + MOV TABLE_5,DI ; Desg. Table starts at end + CALL OFFSET_TABLE ; Update table of offsets. + JMP HP_X ; of hwcp table. Exit. + +RIGHT_BR: CMP RIGHT_FLAG,01H ; If left brackets not + JNE EXIT_2 ; Found then error. +RB1: MOV ERROR_FLAG,02H ; Set end of line flag. + MOV BX,TABLE_4 ; Point at hwcp table + ADD BX,02H ; Adjust pointer to desg + MOV TABLE_5,BX ; table, and save in table_5 + MOV DI,TABLE_1 ; Point at table of offsets + ADD DI,08H ; Set at DESG offset + MOV DS:WORD PTR [DI],BX ; Update table. + JMP HP_X ; Exit + + + +EXIT_2: MOV ERROR_FLAG,01H ; Set error flag. + JMP HP_X ; and exit. + +HWCP: CMP RIGHT_FLAG,01H ; If left brackets not + JNE EXIT_2 ; Found then error. + CALL HWCP_PARSE ; Call parse one hwcp. + CMP ERROR_FLAG,01H ; If error flag set + JE HP_X ; Then exit, else + CALL OFFSET_TABLE ; Update table of offsets. + +HP_X: RET + +HWCP_PARMS ENDP + + +;******************************************************** +;** HWCP_PARSE : Parse the hardware code page page ** +;** number and change it from hex to binary. ** +;******************************************************** + +HWCP_PARSE PROC + + MOV DI,TABLE_4 ; Load address of hwcpages. + ADD DS:WORD PTR [DI],0001H ; Set count to 1 + + CALL GET_NUMBER ; Convert number to binary. + CMP ERROR_FLAG,01H ; If error then + JE HWCP_X ; Exit. + MOV DS:WORD PTR [DI+2],BX ; Else, save binary page number + ADD DI,04H ; Increment counter + MOV TABLE_5,DI ; Set pointer of designate num + +HWCP_X: RET + +HWCP_PARSE ENDP + + +;******************************************************** +;** MUL_HWCP : Parse multiple hardware code pages ** +;** and convert them from hex to binary numbers. ** +;******************************************************** + +MUL_HWCP PROC + + MOV DI,TABLE_4 ; Load offset of table_4 + MOV BX,DI ; in DI and Bx. + MOV HWCP_FLAG,00H ; Set hwcp flag off. + +MH1: CALL GET_CHAR ; Load character in AL. + JZ MH3 ; Exit if end of line. + CMP AL,')' ; If ')' then exit + JE MH2 ; end of parms. + CALL IS_DIGIT ; If a digit, then + JE MH4 ; Convert number to binary. + CALL IS_DELIM ; If not a delimiter + JNE MH3 ; then error, exit + JMP MH1 ; get another character. + +MH2: CALL GET_CHAR ; Get next character + JMP MH_X ; and exit. + +MH3: MOV ERROR_FLAG,01H ; Set error flag on. + JMP MH_X ; Exit. + +MH4: ADD HWCP_FLAG,01H ; Set hwcp flag on (0 off) + ADD DI,02H ; Increment table pointer + PUSH BX ; Save Bx + CALL GET_NUMBER ; Convert number to binary. + MOV DS:WORD PTR [DI],BX ; Add number to table + POP BX ; Restore BX. + CMP ERROR_FLAG,01H ; If error then + JE MH_X ; Exit. + ADD DS:WORD PTR [BX],01H ; Increment hwcp count. + DEC SI ; Point at character in AL + JMP MH1 ; (delimeter or ')'). +MH_X: RET + +MUL_HWCP ENDP + + + +;******************************************************** +;** DESG_PARMS : Scane for the designate numbers, and ** +;** parse it if found. Flag codes set to: ** +;** ERROR_FLAG = 0 - parsing completed. No error. ** +;** ERROR_FLAG = 1 - error found exit parse. ** +;** ERROR_FLAG = 2 - end of line found, exit parse. ** +;******************************************************** + + +DESG_PARMS PROC + + MOV DI,TABLE_1 ; Get offset of dev in DI + MOV BX,TABLE_5 ; & offset of desg. in BX. + ADD DI,08 ; Location of desg offset in table. + MOV DS:WORD PTR [DI],BX ; Update table. + MOV COMMA_FLAG,00H ; Set comma flag off. + + cmp al,'(' + je df + cmp al,')' + je right_br2 + + cmp al,',' + jne desg_parm1 + mov comma_flag,01h + +DESG_PARM1: CALL GET_CHAR ; Get character in AL. + JZ EXIT_3 ; Error, if end of line + CALL IS_DIGIT ; If character is a digit + JE DESG ; Then convert to binary. + CMP AL,')' ; If a ')', then + JE RIGHT_BR2 ; end of parameters. + CMP AL,'(' ; If a '(' then + JE DF ; parse desg and font. + CMP AL,',' ; If a comma then + JE DP3 ; set flag. + CALL IS_DELIM ; If not a delimiter + JNE EXIT_3 ; then error. + JMP DESG_PARM1 ; Get another character. + +RIGHT_BR2: CMP RIGHT_FLAG,01H ; IF no '(' encountered, + JNE EXIT_3 ; then error, exit + JMP DP_x ; Jump to DP1. + +EXIT_3: MOV ERROR_FLAG,01H ; Set error flag on + JMP DP_X ; Exit. + +DF: CMP RIGHT_FLAG,01H ; If no '(' encountered + JB EXIT_3 ; then error, exit + CALL DESG_FONT ; Parse desg and font. + JMP DP1 ; Jump to DP1. + +DP2: CALL FIND_RIGHT_BR ; Check for ')' + JMP DP_X ; Exit. + +DP3: CMP COMMA_FLAG,01H ; If comma flag set + JE DP2 ; then error + MOV COMMA_FLAG,01H ; Else set comma flag on. + JMP DESG_PARM1 ; Get another character. + +DESG: MOV ERROR_FLAG,00H ; Set error flag off. + CALL DESG_PARSE ; Parse desg. +DP1: CMP ERROR_FLAG,01H ; If error flag on then + JE DP_X ; Exit, + CALL FIND_RIGHT_BR ; Else check for ')' + CALL OFFSET_TABLE ; Update table + +DP_X: RET + +DESG_PARMS ENDP + + + +;******************************************************** +;** DESG_FONT : Parse the designate and font numbers & ** +;** change them from decimal to binary. ** +;******************************************************** + + +DESG_FONT PROC + + + MOV DI,TABLE_5 ; Get desg font table. + MOV COMMA_FLAG,00H ; Set comma flag off. +DF1: CALL GET_CHAR ; Load a character in AL. + JZ DF3 ; Error if end of line. + CMP AL,',' ; Check if a comma. + JE DF2 ; Set flag. + CALL IS_DIGIT ; If a digit, then + JE DF5 ; Convert number to binary. + CMP AL,')' ; If a ')' then + JE DF4 ; Exit. + CALL IS_DELIM ; If not a delimiter + JNE DF3 ; then error, exit + JMP DF1 ; Get another character. + +DF2: CMP COMMA_FLAG,01H ; If comma flag on + JE DF3 ; then error, exit + MOV COMMA_FLAG,01H ; Set comma flag on + ADD DS:WORD PTR [DI],01H ; Increment desg counter. + MOV DS:WORD PTR [DI+2],0FFFFH ; Load ffffh for desg empty + JMP DF1 ; field. + +DF3: MOV ERROR_FLAG,01H ; Set error flag on. + JMP DF_X ; Exit. + +DF4: CMP DESG_FLAG,00H ; If desg flag off + JE DF3 ; then error, exit + JMP DF_X ; Else exit. + +DF5: ADD DS:WORD PTR [DI],01H ; Increment desg font count. + CMP DESG_FLAG,01H ; If desg flag is on + JE DF6 ; then get font. + CMP COMMA_FLAG,01H ; if comma flag is on + JE DF6 ; then get font. + MOV DESG_FLAG,01H ; Set desg flag on + JMP DF7 ; Get desg number. + +DF6: ADD DI,02H ; adjust pointer to font. + MOV DESG_FLAG,02H ; Set desg and font flag. +DF7: CALL GET_NUMBER ; Get a number & convert to + CMP ERROR_FLAG,01H ; binary. + JE DF_X ; If error flag set, Exit. + MOV DS:WORD PTR [DI+2],BX ; Store number in table. + CMP DESG_FLAG,02H ; If desg and font flag + JNE DF1 ; not set, then get char. + CALL FIND_RIGHT_BR ; Check for right bracket. + +DF_X: RET + +DESG_FONT ENDP + + +;******************************************************** +;** DESG_PARSE : Parse the designate number and ** +;** change it from decimal to binary. ** +;******************************************************** + +DESG_PARSE PROC + + MOV DI,TABLE_5 ; Load designate location + ADD DS:WORD PTR [DI],0001H ; Update table count. + + CALL GET_NUMBER ; Get the ascii number and + CMP ERROR_FLAG,01H ; conver it to binary + JE DESG_X ; If error then exit + + MOV DS:WORD PTR [DI+2],BX ; Else, save desg number + + +DESG_X: RET + +DESG_PARSE ENDP + + +;******************************************************** +;** GET_NUMBER : Convert the number pointed to by SI ** +;** to a binary number and store it in BX ** +;******************************************************** + +GET_NUMBER PROC + + MOV CX,0AH ; Set multiplying factor + XOR BX,BX ; Clear DX + +NEXT_NUM: SUB AL,30H ; Conver number to binary + CBW ; Clear AH + XCHG AX,BX ; Switch ax and bx to mul + MUL CX ; already converted number by 10. + JO ERR_NUM ; On over flow jump to error. + ADD BX,AX ; Add number to total. + JC ERR_NUM ; On over flow jump to error. + XOR AX,AX ; Clear AX (clear if al=0a). + CALL GET_CHAR ; Get next character + JZ GET_NUM_X ; Exit, if end of line. + CALL IS_DIGIT ; Call is digit. + JNZ GET_NUM_X ; Exit if not a number. + JMP NEXT_NUM ; Loop. + +ERR_NUM: MOV ERROR_FLAG,01H ; Set error code to 1. + +GET_NUM_X: RET + +GET_NUMBER ENDP + + +;******************************************************** +;** UPDATE_TABLE : This routine set up pointers to the ** +;** different offsets of the different tables ** +;******************************************************** + +UPDATE_TABLE PROC + + MOV DS:WORD PTR [DI],BX ; Offset of offsets + MOV TABLE_1,BX ; Table_1 points at offsets + + MOV DI,BX ; + ADD BX,0CH ; + MOV DS:WORD PTR [DI+2],BX ; Offset of DEVICE name. + MOV TABLE_2,BX ; Table_2 point at device name. + + ADD BX,0AH ; + MOV DS:WORD PTR [DI+4],BX ; Offset of ID name. + MOV TABLE_3,BX ; Table_3 point at ID name. + + ADD BX,0AH ; + MOV DS:WORD PTR [DI+6],BX ; Offset of HWCP pages. + MOV TABLE_4,BX ; Table_4 point at HWCP pages. + + RET + +UPDATE_TABLE ENDP + + +;******************************************************** +;** OFFSET_TABLE : This routine set up pointers of ** +;** tables number one and two. ** +;******************************************************** + +OFFSET_TABLE PROC + + MOV DI,TABLE_1 ; Increment the number + ADD DS:WORD PTR [DI],01H ; of parms foun. (ie. id,hwcp + RET ; and desg) + +OFFSET_TABLE ENDP + + +;******************************************************** +;** FIND_RIGHT_BR :This routine scane the line for a ** +;** ')' if cannot find it turns error flag on ** +;******************************************************** + +FIND_RIGHT_BR PROC + +FBR1: CMP AL,')' ; If a right bracket + JE FBR_X ; then exit. + CMP AL,' ' ; If not a space + JNE FBR2 ; Then error. + CALL GET_CHAR ; Get a character + JZ FBR2 ; If end of line then exit. + JMP FBR1 ; Else get another character. + +FBR2: MOV ERROR_FLAG,01H ; Set error flag on +FBR_X: MOV AL,20H ; Erase character from AL. + RET + +FIND_RIGHT_BR ENDP + +;;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +;; +;; ++++++++++++++++++++++++ +;; ++ INIT Command ++ +;; ++++++++++++++++++++++++ +;; +;;==== Command Code 0 - Initialization ====== +;; +;; messages returned : +;; +;; msg_bad_syntax -- syntax error from parser, no driver installation +;; msg_no_init -- device cannot be initialised +;; msg_insuff_mem -- insufficient memory +;; +;; layout : the initialization is done in two stages : +;; +;; ++++++++++++++++++++++++ +;; ++ INIT Stage 1 ++ to examine and extract the +;; ++++++++++++++++++++++++ parameters defined for the +;; device_id in DEVICE command, +;; according to the printer +;; description table for the +;; device_id. +;; +;; ++++++++++++++++++++++++ +;; ++ INIT Stage 2 ++ to set the BUFfer for the LPTn +;; ++++++++++++++++++++++++ or PRN according to device_id's +;; parameters +;; +;; +;; +;;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + ;; +DEV_NUM dw ? ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Tables for the deivce_id parameters in the order of device_id in the +; PARSE table +; === the tables serves as the link between LPTn to be defined in the 2nd +; stage, and the device_id that is processed in the first stage. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; device ID indicators : + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +DID_MAX EQU 4 ;; device entris exepcted in PARSE +;; not more than 16. ;; table + ;; +DID_STATUS DW 0 ;; status of parsing device id + ;; = 0 : all Device-ID bad + ;; -- see DID_BIT + ;; +DID_MATCH DW 0 ;; this DID has device_name matched + ;; +DID_FAIL DW 0 ;; to fail the good DID_STATUS and + ;; the matched name. (due to + ;; inconsistency among the same LPTn + ;; or between PRN and LPT1.) + ;; +;; (DID_STATUS) AND (DID_MATCH) XOR (DID_FAIL) determines the success of DID + ;; initialization + ;; +DID_ONE EQU 00001H ;; first device-ID +DID_TWO EQU 00002H ;; second " +DID_THREE EQU 00004H ;; third " +DID_FOUR EQU 00008H ;; fourth " +;;maximun number of device_id = 16 ;; + ;; +DID_BIT LABEL WORD ;; + DW DID_ONE ;; + DW DID_TWO ;; + DW DID_THREE ;; + DW DID_FOUR ;; +;;maximun number of device_id = 16 ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; device paramters according to the + ;; device_id defined in DEVICE and the + ;; parameters defined for the device_id + ;; in the printer description table. + ;; +HRMAX LABEL word ;; number of hwcp+cart slots supported + DW 0 ;; did = 1 + DW 0 ;; did = 2 + DW 0 ;; did = 3 + DW 0 ;; did = 4 +;upto max DID_MAX ;; + ;; +CTMAX LABEL word ;; number of cart slots supported + DW 0 ;; did = 1 + DW 0 ;; did = 2 + DW 0 ;; did = 3 + DW 0 ;; did = 4 +;upto max DID_MAX ;; + ;; +RMMAX LABEL word ;; number of ram-slots supported + DW 0 ;; did = 1 + DW 0 ;; did = 2 + DW 0 ;; did = 3 + DW 0 ;; did = 4 +;upto max DID_MAX ;; + ;; +RBUMAX LABEL word ;; number of ram-designate slots + DW 0 ;; did = 1 + DW 0 ;; did = 2 + DW 0 ;; did = 3 + DW 0 ;; did = 4 +;upto max DID_MAX ;; + ;; +DESCO LABEL word ;; offset to the description table + ;; where the device_id is defined. + DW -1 ;; did = 1 + DW -1 ;; did = 2 + DW -1 ;; did = 3 + DW -1 ;; did = 4 +;upto max DID_MAX ;; + ;; +FSIZE LABEL word ;; font size of the device + DW 0 ;; did = 1 + DW 0 ;; did = 2 + DW 0 ;; did = 3 + DW 0 ;; did = 4 +;upto max DID_MAX ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Hard/RAM slots table in the order of DEVICE parameters +; +; number of entries in all HARD_SLn is determined by the max. {HSLOTS}, and +; number of entries in all RAM_SLn is determined by the max. {RSLOTS} +; +; -- they are initialized according to the device_id defined in the DEVICE. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +HARD_SLA LABEL word ;; index in the order of device in + DW OFFSET (HARD_SL1) ;; the PARSE-talbes + DW OFFSET (HARD_SL2) ;; + DW OFFSET (HARD_SL3) ;; + DW OFFSET (HARD_SL4) ;; +; up to DID_MAX ;; + ;; +RAM_SLA LABEL word ;; + DW OFFSET (RAM_SL1) ;; + DW OFFSET (RAM_SL2) ;; + DW OFFSET (RAM_SL3) ;; + DW OFFSET (RAM_SL4) ;; +; up to DID_MAX ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; ++++++++++++++++++++++++ +;; ++ INIT Command ++ +;; ++++++++++++++++++++++++ +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +INIT PROC NEAR ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; parse the initialization parameters in DEVICE command +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; + ;; + CMP BUF.BFLAG,BF_PRN ;; since PRN is the FIRST device header + JNE NOT_PRN ;; + ;; + ;; + MOV AX,OFFSET CODE_END ;; defined only once for each DEVICE + XOR CX,CX ;; + MOV CL,4 ;; + SHR AX,CL ;; + PUSH CS ;; + POP CX ;; + ADD AX,CX ;; + INC AX ;; leave 16 bytes,room for resident_end + MOV RESIDENT_END,AX ;; + ;; + CALL PARSER ;; call only once, for PRM + ;; + JMP PROCESS_TABLE ;; + ;; +NOT_PRN : ;; + CMP DEV_NUM,1 ;; + ;; + JNB PROCESS_TABLE ;; + ;; + JMP SYNTAX_ERROR ;; + ;; + ;; + ;; +;; +;;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +;; +;; ++++++++++++++++++++++++ +;; ++ INIT Stage 1 ++ +;; ++++++++++++++++++++++++ +;; +;; INIT - FIRST STAGE : +;; +;; == test and extract if the parameters on device-id is valid +;; == determine the DID_STATUS according to the validity of the parameters +;; == procedure(s) called -- DID_EXTRACT +;; +;;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + ;; +PROCESS_TABLE : ;; + ;; + PUSH CS ;; + POP ES ;; PSE points to Device offsets + MOV DI,OFFSET(table) ;; ES:[DI] + MOV DX,PSE.PAR_DEV_NUM ;; + MOV DEV_NUM,DX ;; + ;; + CMP DEV_NUM,0 ;; + JNZ NO_SYNTAX_ERR ;; + ;; + XOR AX,AX ;; + MOV AH,09H ;; + MOV DX,OFFSET MSG_BAD_SYNTAX;; + INT 21H ;; + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +SYNTAX_ERROR : ;; set the request header status + ;; according to the STATE + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + MOV AX, RESIDENT_END ;; + PUSH CS ;; + POP CX ;; CX=CS + SUB AX,Cx ;; additional segment required. +CS_LOOP1: ;; + CMP AX,1000H ;; + JB CS_LPEND1 ;; + ADD CX,1000H ;; + SUB AX,1000H ;; + JMP CS_LOOP1 ;; + ;; +CS_LPEND1: ;; + SHL AX,1 ;; + SHL AX,1 ;; + SHL AX,1 ;; + SHL AX,1 ;; + ;; + LES DI,dword ptr buf.rh_ptro ;; get Request Header address +; MOV RH.RH0_ENDO,AX ;; + MOV RH.RH0_ENDO,0 ;; + MOV RH.RH0_ENDS,CX ;; + MOV RH.RHC_STA,stat_cmderr ;; set status in request header + ;; + JMP INIT_RETurn ;; + ;; + ;; +NO_SYNTAX_ERR : ;; + ;; + CMP DX,DID_MAX ;; + JNA NEXT_DID ;; + ;; + MOV INIT_CHK,0001H ;; ERROR 0001 + JMP BAD_DID ;; more than supported no. of device + ;; +NEXT_DID: ;; + PUSH DI ;; pointer to PAR_OT (table 1) + AND DX,DX ;; + JNZ SCAN_DESC ;; + JMP END_DID ;; DI = offset to the 1st PARSE table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +SCAN_DESC: ;; + MOV DI,PSE.PAR_OFF ;; points to the nth device + ;; + ;; find the description for the + ;;device-id + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + MOV CX,PRINTER_DESC_NUM ;; + MOV SI, OFFSET(PRINTER_DESC_TBL); offset to the description table + PUSH CS ;; + POP DS ;; +; $SEARCH ;; +$$DO1: + PUSH CX ;; save device count + PUSH SI ;; pointer to printer-descn's offset + MOV SI,CS:WORD PTR[SI] ;; + AND CX,CX ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; $LEAVE Z ;; LEAVE if no more device description + JZ $$EN1 + PUSH DI ;; save offset to PAR_DEVOT + MOV DI,PSE.PAR_DIDO ;; + MOV CX,PSE.PAR_DIDL ;; length of parsed device name + LEA DI,PSE.PAR_DID ;; pointer to parse device name + ;; + PUSH SI ;; + LEA SI,[SI].TYPEID ;; offset to name of device-id + REPE CMPSB ;; + POP SI ;; + POP DI ;; get back offset to PAR_DEVOT + ;;;;;;;;;;;;;;;;;;;;;;;; +; $EXITIF Z ;; EXIT if name matched + JNZ $$IF1 + ;; + CALL DID_EXTRACT ;; get the parameters + ;; + POP SI ;; balance push-pop + POP CX ;; + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; $ORELSE ;; try next description : + JMP SHORT $$SR1 +$$IF1: + ;; + POP SI ;; of printer_descn offset table + INC SI ;; + INC SI ;; next offset to PRINTER_DESCn + ;; + POP CX ;; one description less + DEC CX ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; $ENDLOOP ;; DEVICE-ID not defined in + JMP SHORT $$DO1 +$$EN1: + ;; printer_desc; + ;; + MOV AX,INIT_CHK ;; + AND AX,AX ;; + JNZ UNCHANGED ;; + MOV INIT_CHK,0004H ;; ERROR 0004 +UNCHANGED: ;; + POP SI ;; balance push-pop + POP CX ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; $ENDSRCH ;; End of scanning printer_desc +$$SR1: +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + POP DI ;; + INC DI ;; + INC DI ;; points to next device in PART_OT + DEC DX ;; + ;; + JMP NEXT_DID ;; + ;; +END_DID : ;; + POP DI ;; +BAD_DID : ;; + ;; + MOV AX,DID_STATUS ;; + AND AX,AX ;; + JNZ DEF_BUFFER ;; + ;; + JMP END_LPT ;; + ;; +;;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +;; +;; ++++++++++++++++++++++++ +;; ++ INIT Stage 2 ++ +;; ++++++++++++++++++++++++ +;; +;; INIT -- SECOND STAGE : +;; +;; == match the device_name extracted in stage 1 with the name of PRN or +;; LPTn +;; +;; == if the PRN/LPTn has never been defined before, then set up the BUF +;; for the PRN/LPTn if the DID_STATUS is good; otherwise message will +;; be generated indicating it cannot be initilized. +;; +;; == if there is PRN, LPT1 is also setup, and vice vera. IF both PRN and +;; LPT1 are on the DEVICE command, or there are multiple entries for +;; the same LPTn, the consistency is checked. It they are inconsistent +;; the associated LPTn or PRN is forced to fail by : DID_FAIL. +;; +;; == if the device_name on the DEVICE command is not one of the supported +;; PRN or LPTn, then DID_MATCH bit will not be set. An error message +;; will be generated for the device_name indicating it cannot be +;; initialized. +;; +;; == procedure(s) called : CHK_DID .. check DID parameters for device +;; whose name matched. +;; DEV_CHECK .. if device-name duplicated, or +;; there are both PRN/LPT1 : check +;; for consistent parameters. +;; +;;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +DEF_BUFFER : ;; + PUSH CS ;; + POP ES ;; PSE points to Device offsets + MOV DI,OFFSET(table) ;; ES:[DI] + xor cx,cx ;; device order in parse table +;SEARCH ;; +$$DO7: + PUSH DI ;; pointer to PAR_OT + PUSH CX ;; save device count + MOV DI,PSE.PAR_OFF ;; " " PAR_DEVOT + cmp cx,dev_num ;; + ;; +;LEAVE NB ;; LEAVE if no more device entry + jb MORE_DEVICE ;; + JMP $$EN7 +MORE_DEVICE : ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; more parsed_device to be checked + PUSH DI ;; save offset to PAR_DEVOT + MOV DI,PSE.PAR_DNMO ;; + MOV CX,PSE.PAR_DNML ;; length of parsed device name + LEA DI,PSE.PAR_DNM ;; pointer to parse device name + ;; + LDS SI,DWORD PTR BUF.DEV_HDRO ; get the offset to device-n header + LEA SI,HP.DH_NAME ;; " offset to name of device-n + REPE CMPSB ;; + POP DI ;; get back offset to PAR_DEVOT + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;; +;EXITIF Z ;; EXIT if name matched + JZ NAME_MATCHED ;; + ;; + JMP MORE_PARSED_DEVICE ;; + ;; +NAME_MATCHED : ;; + ;; + POP CX ;; the DID order + PUSH BX ;; + MOV BX,CX ;; + ADD BX,BX ;; + MOV AX,DID_BIT[BX] ;; + OR DID_MATCH,AX ;; this DID matched + POP BX ;; + PUSH CX ;; + ;; + LEA SI,BUF.PAR_EXTRACTO ;; was the LPT1/PRN defined before ? + MOV AX,CS:[SI].PAR_DNMO ;; + CMP AX,0FFFFH ;; + ;; + JNE DEV_COMPARE ;; DI = PAR_DEVOT + ;;----------------------------------- + ;; + ;; no device previousely defined + MOV AX,PSE.PAR_DNMO ;; + MOV CS:[SI].PAR_DNMO,AX ;; define device parameters for LPTn + ;; + MOV AX,PSE.PAR_DIDO ;; + MOV CS:[SI].PAR_DIDO,AX ;; + ;; + MOV AX,PSE.PAR_HWCPO ;; + MOV CS:[SI].PAR_HWCPO,AX ;; + ;; + MOV AX,PSE.PAR_DESGO ;; + MOV CS:[SI].PAR_DESGO,AX ;; + ;; + MOV AX,PSE.PAR_PARMO ;; + MOV CS:[SI].PAR_PARMO,AX ;; + ;; + ;;--------------------------------- + CALL CHK_DID ;; define the STATE according to + ;; DID_STATUS + JMP MORE_PARSED_DEVICE ;; + ;; +DEV_COMPARE : ;;------------------------------- + ;; e.g. LPT1 and PRN shares one BUF. + ;; or duplicated device name + CALL DEV_CHECK ;; + ;; + CMP BUF.STATE,CPSW ;; + JNE DEV_COMPARE_FAIL ;; + ;; + JMP MORE_PARSED_DEVICE ;; + ;; +DEV_COMPARE_FAIL : ;; + ;; + POP CX ;; + POP DI ;; balance push-pop + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;$ORELSE ;; + JMP END_LPT + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +MORE_PARSED_DEVICE : ;; name does not match + ;; + POP CX ;; + INC CX ;; + POP DI ;; + INC DI ;; + INC DI ;; points to next device in PART_OT + ;; + jmp $$DO7 ;; +;$ENDLOOP ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +$$EN7: ;; no device found for LPTn + ;; + POP CX ;; + POP DI ;; balance push-pop + ;; + CMP BUF.STATE,CPSW ;; + JE END_LPT ;; for LPT1/PRN pair + ;; + MOV BUF.STATE,NORMAL ;; no device defined for the LPTn + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; End of defining LPTn Buffer + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;$ENDSRCH ;; +END_LPT : ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; set the request header status + ;; according to the STATE + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + MOV AX, RESIDENT_END ;; + PUSH CS ;; + POP CX ;; CX=CS + SUB AX,Cx ;; additional segment required. +CS_LOOP2: ;; + CMP AX,1000H ;; + JB CS_LPEND2 ;; + ADD CX,1000H ;; + SUB AX,1000H ;; + JMP CS_LOOP2 ;; + ;; +CS_LPEND2: ;; + SHL AX,1 ;; + SHL AX,1 ;; + SHL AX,1 ;; + SHL AX,1 ;; + ;; + LES DI,dword ptr buf.rh_ptro ;; get Request Header address + MOV RH.RH0_ENDO,AX ;; + MOV RH.RH0_ENDS,CX ;; + XOR AX,AX ;; clear error code to be returned + MOV CX,BUF.STATE ;; + CMP CX,CPSW ;; + JE MATCH_GOOD ;; + MOV AX,STAT_CMDERR ;; + ;; +MATCH_GOOD : ;; + MOV RH.RHC_STA,AX ;; set status in request header + ;; +BUF_END : ;; + ;; + CMP BUF.BFLAG,BF_LPT1 ;; + JNE BUF_MESSAGES ;; + ;; + CMP BUF.STATE,CPSW ;; + JNE BUF_MESSAGES ;; + ;; set PRN to the same setting as LPT1 + PUSH BX ;; + ;; + LEA SI,BUF.RNORMO ;; + LEA CX,BUF.BUFEND ;; + SUB CX,SI ;; + MOV BX,BUF.PRN_BUFO ;; where PRN buffer is + LEA DI,BUF.RNORMO ;; + PUSH CS ;; + POP ES ;; + PUSH CS ;; + POP DS ;; + REP MOVSB ;; + ;; + POP BX ;; + ;; +BUF_MESSAGES : ;; + CMP BUF.BFLAG,BF_LPT3 ;; generate error message is this is + je last_round ;; the last LPTn + Jmp INIT_RETURN ;; + ;; ERROR messages will be generated + ;; at the end of initialization of all + ;; the LPT devices +last_round : ;; + MOV AX,RESIDENT_END ;; + ADD AX,STACK_SIZE ;; + MOV RESIDENT_END,AX ;; + PUSH CS ;; + POP CX ;; CX=CS + SUB AX,Cx ;; additional segment required. +CS_LOOP3: ;; + CMP AX,1000H ;; + JB CS_LPEND3 ;; + ADD CX,1000H ;; + SUB AX,1000H ;; + JMP CS_LOOP3 ;; + ;; +CS_LPENd3: ;; + SHL AX,1 ;; + SHL AX,1 ;; + SHL AX,1 ;; + SHL AX,1 ;; + ;; + MOV RH.RH0_ENDO,AX ;; STACK !!!!! + MOV STACK_ALLOCATED,0 ;; from now on, internal stack is used + ;; + MOV AX,DID_STATUS ;; what is the DID combination ? + AND AX,DID_MATCH ;; + XOR AX,DID_FAIL ;; + ;; + AND AX,AX ;; + JNZ CODE_STAYED ;; +; MOV RH.RH0_ENDO,0 ;; none of the devices are good + ;; + ;; +CODE_STAYED : ;; + MOV DI,OFFSET TABLE ;; + push CS ;; + POP ES ;; + ;; + XOR CX,CX ;; +MSG_LOOP : ;; + CMP CX,DEV_NUM ;; + JNB INIT_RETURN ;; + SHR AX,1 ;; + JC MSG_NEXT ;; + ;; this device in parse table is bad + PUSH DI ;; + PUSH CX ;; + PUSH AX ;; + ;; + MOV DI,PSE.PAR_OFF ;; + MOV SI,PSE.PAR_DNMO ;; + ;; + PUSH CS ;; + POP ES ;; + PUSH CS ;; + POP DS ;; + ;; + MOV CX,8 ;; + LEA SI,[SI].PAR_DNM ;; + ;; + MOV DI,SI ;; + ADD DI,7 ;; skip backward the blanks + MOV AL,20H ;; + STD ;; + REPE SCASB ;; + CLD ;; + ;; + MOV DI, OFFSET MSG_NO_INIT_P;; + MOV DX,DI ;; for INT 21H + XOR AX,AX ;; + MOV AH,09H ;; + INT 21H ;; + ;; + ;; + MOV DI, OFFSET MSG_NO_INIT ;; + MOV DX,DI ;; for INT 21H + ;; + INC CX ;; + ;; + PUSH CX ;; remaining name that is non blank + MOV AX,CX ;; + MOV CX,8 ;; + SUB CX,AX ;; + ADD DI,CX ;; + MOV DX,DI ;; + POP CX ;; + REP MOVSB ;; + ;; + ;; + XOR AX,AX ;; + MOV AH,09H ;; + INT 21H ;; + ;; + POP AX ;; + POP CX ;; + POP DI ;; + ;; +MSG_NEXT : ;; + INC CX ;; + INC DI ;; + INC DI ;; + JMP MSG_LOOP ;; + ;; + ;; +INIT_RETURN : ;; + ;; + ;; + RET ;; + ;; +INIT ENDP ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Call by INIT to extract parameters for the deivce_id +;; +;; on rntry : +;; ES:[DI] PARSE Table 2, offsets of all parameters +;; DS:[SI] Printer Description table whose TYPEID matched +;; DX "inverse" order of devices in the PARSE tables +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +DID_EXTRACT PROC ;; + ;; + PUSH DX ;; + ;;----------------------------- + ;; define the DID_parameters + PUSH BX ;; + ;; + MOV BX,DEV_NUM ;; + SUB BX,DX ;; order in the Parse table + add bx,bx ;; double to index [bx] + MOV DX,BX ;; + ;; + MOV AX,DS:[SI].FONTSZ ;; + MOV FSIZE[BX],AX ;; size of font buffer to be created + ;; + MOV AX,DS:[SI].HSLOTS ;; + CMP AX,HARDSL_MAX ;; + JNA LESS_HARDSL ;; + MOV INIT_CHK, 0010H ;; ERROR 0010H + POP BX ;; + JMP END_MATCH_BAD ;; +LESS_HARDSL : ;; + CMP AX,DS:[SI].HWCPMIN ;; + JNB VALID_HARDSL ;; + MOV INIT_CHK, 0012H ;; ERROR 0012H + POP BX ;; + JMP END_MATCH_BAD ;; +VALID_HARDSL : ;; + MOV HRMAX[BX],AX ;; + MOV CTMAX[BX],AX ;; will be reduced by the no. of hwcp + ;; + MOV AX,DS:[SI].RSLOTS ;; + CMP AX,RAMSL_MAX ;; + JNA LESS_RAMSL ;; + MOV INIT_CHK, 0011H ;; ERROR 0011H + POP BX ;; + JMP END_MATCH_BAD ;; +LESS_RAMSL : ;; + MOV RMMAX[BX],AX ;; see also designate + ;; + MOV DESCO[BX],SI ;; + ;; + POP BX ;; + ;;---------------------------------- + ;; + PUSH CX ;; + ;; +HWCPgt: PUSH DI ;; get the hwcp + ;; + MOV DI,PSE.PAR_HWCPO ;; + MOV CX,PSE.PAR_HWCPL ;; no. of hwcp + AND CX,CX ;; + JNZ chk_hwcp ;; + push bx ;; + mov bx,dx ;; + MOV HRMAX[BX],CX ;; + MOV CX,DS:[SI].HWCPMIN ;; + SUB CTMAX[BX],CX ;; what is left becomes cartridge slot + pop bx ;; + JMP DESIGN ;; + ;; hwcp to be defined +chk_hwcp: MOV AX,DS:[SI].HSLOTS ;; defined in printer_desc + CMP CX,AX ;; + JA BAD_MATCH2 ;; + CMP CX,HARDSL_MAX ;; + JNA HWCP_GOOD ;; jump if system error + MOV INIT_CHK,0003H ;; ERROR 0003 + JMP END_MATCH ;; +BAD_MATCH2: ;; + MOV INIT_CHK,0002H ;; ERROR 0002 + JMP END_MATCH ;; + ;; +HWCP_GOOD: ;; there are sufficient hard-slot for + ;; HWCP + PUSH SI ;; printer description table of TYPEID + PUSH BX ;; + ;; + MOV BX,DX ;; + MOV AX,CTMAX[BX] ;; + ;; + PUSH CX ;; calculate what is left for cart_slot + CMP CX,DS:[SI].HWCPMIN ;; + JNB MORE_THAN_HWCPMIN ;; + MOV CX,DS:[SI].HWCPMIN ;; +MORE_THAN_HWCPMIN : ;; + SUB AX,CX ;; + POP CX ;; + mov HRMAX[BX],CX ;; + ;; + MOV CTMAX[BX],AX ;; no of cart-slot for designate + MOV SI,HARD_SLA[BX] ;; get the corresponding hard-slots + ;; + POP BX ;; + ;; + push bx ;; + push dx ;; + mov bx,si ;; + mov dx,cx ;; + mov reserved1,dx ;; IF THERE IS ANY REPETITIVE HWCP + mov reserved2,bx ;; IF THERE IS ANY REPETITIVE HWCP + ;; +FILL_HWCP: ;; + AND CX,CX ;; + JZ DESIGN_P ;; + INC DI ;; next code page in PARSE table + INC DI ;; + MOV AX,ES:[DI] ;; get code page value + ;; + ;; IF THERE IS ANY REPETITIVE HWCP + push dx ;; + push bx ;; +hwcp_norep : ;; + cmp ax,cs:[bx].slt_cp ;; + jne hwcp_repnext ;; + pop bx ;; + pop dx ;; + pop dx ;; + pop bx ;; + pop si ;; + jmp end_match ;; + ;; +hwcp_repnext: ;; + inc bx ;; + inc bx ;; + inc bx ;; + inc bx ;; + dec dx ;; + jnz hwcp_norep ;; + pop bx ;; + pop dx ;; + ;; + MOV CS:[SI].SLT_CP,AX ;; + MOV AX,CS:[SI].SLT_AT ;; get the attributes + OR AX,AT_OCC ;; occupied + OR AX,AT_HWCP ;; hwcp slot + MOV CS:[SI].SLT_AT,AX ;; + INC SI ;; + INC SI ;; next slot + INC SI ;; next slot + INC SI ;; next slot + DEC CX ;; + JMP FILL_HWCP ;; +DESIGN_P: ;; + pop dx ;; + pop bx ;; + POP SI ;; + ;;--------------------- +DESIGN: POP DI ;; get the designate no. + PUSH DI ;; + ;; + MOV DI,PSE.PAR_DESGO ;; + MOV AX,PSE.PAR_DESGL ;; + CMP AX,1 ;; + JA END_MATCH ;; there should have no font entry + AND AX,AX ;; + JZ DEF_RBUFMAX ;; + ;; + MOV AX,PSE.PAR_DESG ;; + AND AX,AX ;; + JZ DEF_RBUFMAX ;; + ;; + CMP CS:[SI].CLASS,1 ;; + JNE DESIG_NOt_CLASS1 ;; + ;; + PUSH BX ;; if there is any cartridge slot ? + PUSH AX ;; + MOV BX,DX ;; + MOV AX,ctmax[BX] ;; + AND AX,AX ;; + POP AX ;; + POP BX ;; + JZ END_MATCH ;; fail, as there is no physical RAM. + ;; + CMP AX,HARDSL_MAX ;; is the designate more than max ? + JA END_MATCH ;; + ;; + ;; + JMP DEF_RBUFMAX ;; + ;; + ;; + ;; +DESIG_NOT_CLASS1 : ;; + PUSH BX ;; if there is any physical RAM slot ? + PUSH AX ;; + MOV BX,DX ;; + MOV AX,RMMAX[BX] ;; + AND AX,AX ;; + POP AX ;; + POP BX ;; + JZ END_MATCH ;; fail, as there is no physical RAM. + ;; + ;; + CMP AX,RAMSL_MAX ;; is the designate more than max ? + JA END_MATCH ;; + ;; +DEF_RBUFMAX : ;; + PUSH BX ;; + MOV BX,DX ;; + MOV RBUMAX[BX],AX ;; + POP BX ;; + ;; + ;; +PARAM : ;; +;PARM: POP DI ;; +; PUSH DI ;; +;; MOV DI,PSE.PAR_PARMO ;; + ;; + ;,-------------------------- + ;; GOOD device_id parameters + shr dx,1 ;; + MOV AX,DID_ONE ;; + MOV CX,DX ;; + AND CX,CX ;; + JZ NO_SHL ;; + SHL AX,CL ;; +NO_SHL: OR DID_STATUS,AX ;; is defined + ;;------------------------- +END_MATCH: POP DI ;; end of extract + POP CX ;; +END_MATCH_BAD : ;; + POP DX ;; + ;; + RET ;; + ;; +DID_EXTRACT ENDP ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Called by INIT to define the STATE and BUF for the LPTn according to +;; the DID_STATUS. Create font buffer if requested through the "desi*nate" +;; +;; at entry : CX = device order in parse table +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +CHK_DID PROC ;; + ;; + push cx ;; + push di ;; + push dx ;; + ;; + MOV AX,DID_STATUS ;; + ;; + PUSH CX ;; order 0 to m + POP DI ;; + ADD DI,DI ;; indexing : [DI] + ;; + INC CX ;; + SHR AX,CL ;; is the device parameter valid ? + ;; + JC DEFINE_BUFFER ;; + JMP LPT_FAIL ;;-------------------------- + ;; +DEFINE_BUFFER : ;; + ;; good device parameters as determined + MOV AX,DESCO[DI] ;; + MOV BUF.PDESCO,AX ;; + ;; + PUSH DI ;; + MOV DI,AX ;; + MOV AX,CS:[DI].CLASS ;; + MOV BUF.PCLASS,AX ;; + POP DI ;; + ;; + MOV AX,HARD_SLA[DI] ;; in the DID_EXTRACT + MOV BUF.HARDSO,AX ;; + ;; + MOV AX,RAM_SLA[DI] ;; + MOV BUF.RAMSO,AX ;; + ;; + MOV AX,HRMAX[DI] ;; + MOV BUF.HARDMX,AX ;; + ;; + MOV AX,CTMAX[DI] ;; + MOV BUF.HCARMX,AX ;; + ;; + ADD AX,HRMAX[DI] ;; defore "designate" + MOV BUF.HSLMX,AX ;; + ;; + ;; + MOV AX,RMMAX[DI] ;; + MOV BUF.RAMMX,AX ;; + ;; + XOR AX,AX ;; + PUSH CX ;; calculate the max. length of control + MOV CX,2 ;; sequence that is allowed for the + CMP BUF.PCLASS,1 ;; room reserved for physical slots. + JNE CTL_LOOP ;; + MOV CX,1 ;; class 1 printer has one control seq. +CTL_LOOP : ;; + ADD AX,CTL_MAX ;; + DEC AX ;; leave one byte for the length + DEC CX ;; + JNZ CTL_LOOP ;; + MOV BUF.FSELMAX,AX ;; + POP CX ;; + ;; + MOV AX,FSIZE[DI] ;; + MOV BUF.FTSZPA,AX ;; FTSIZE in paragraph + ;; + PUSH AX ;; + ;; + MOV DX,4 ;; +FT_PARA: ;; + ADD AX,AX ;; + DEC DX ;; + JNZ FT_PARA ;; font size + MOV BUF.FTSIZE,AX ;; font size in bytes (used with.RBUFMX) + ;; + POP DX ;; FTSIZE in paragraph + ;; + MOV CX,RBUMAX[DI] ;; create font buffer per .RBUFMX and + MOV BUF.RBUFMX,CX ;; assume sufficient memory for all the + ;; "designate request" + PUSH CX ;; + ;; + CMP BUF.PCLASS,1 ;; always create font buffer for class1 + JNE CLASS_NOT_1 ;; + ;; + AND CX,CX ;; + JZ CLASS1_NOCX ;; + ADD CX,BUF.HARDMX ;; + MOV BUF.HSLMX,CX ;; + JMP CLASS_NOT_1 ;; + ;; +CLASS1_NOCX: ;; + MOV CX,BUF.HSLMX ;; + ;; +CLASS_NOT_1 : ;; + AND CX,CX ;; + JZ MULTIPLE_DONE ;; + MOV AX,RESIDENT_END ;; +MULTIPLE_FT : ;; + ADD AX,DX ;; allocate the font buffers at the end + DEC CX ;; of the resident codes + JNZ MULTIPLE_FT ;; + ;; + ;; + MOV CX,RESIDENT_END ;; + MOV BUF.FTSTART,CX ;; + MOV RESIDENT_END,AX ;; + ;; + ;; +MULTIPLE_DONE : ;; + POP CX ;; designate requested + ;; + CMP BUF.PCLASS,1 ;; + JNE DEF_RBUF ;; + ;; CLASS 1 + CMP BUF.HARDMX,0 ;; + JE DEFBUF_DONE ;; + ;; + PUSH CX ;; STACKS... + PUSH SI ;; + PUSH DS ;; + PUSH ES ;; + PUSH DI ;; + PUSH DX ;; + ;; + MOV DX,BUF.HARDMX ;; + PUSH DX ;; STACK +1 -- # of HWCP + ;; + PUSH CS ;; + POP DS ;; + MOV BUF.RBUFMX,0 ;; + MOV SI,BUF.PDESCO ;; + MOV SI,CS:[SI].SELH_O ;; + XOR CX,CX ;; + MOV CL,CS:BYTE PTR [SI] ;; + INC CX ;; including the length byte + ;; + MOV DI,BUF.FTSTART ;; control template +DEF_FTBUF: ;; fill the font buffer with the + PUSH DI ;; + POP ES ;; + XOR DI,DI ;; + ;; + PUSH CX ;; + PUSH SI ;; + REP MOVSB ;; + POP SI ;; + POP CX ;; + ;; + PUSH ES ;; + POP DI ;; + ADD DI,BUF.FTszpa ;; + DEC DX ;; + JNZ DEF_FTBUF ;; + ;; + POP DX ;; STACK -1 + ;; + MOV SI,BUF.HARDSO ;; + MOV DI,BUF.FTSTART ;; define the HWCP values +DEF_FThwcp : ;; + PUSH DI ;; + POP ES ;; + MOV DI,CTL5202_OFFS ;; offset to the HWCP words + ;; + MOV AX,CS:[SI].SLT_CP ;; + MOV ES:WORD PTR [DI],AX ;; + ;; + INC SI ;; + INC SI ;; + INC SI ;; + INC SI ;; + ;; + PUSH ES ;; + POP DI ;; + ADD DI,BUF.FTSZPA ;; + DEC DX ;; + JNZ DEF_FThwcp ;; + ;; + POP DX ;; + POP DI ;; + POP ES ;; + POP DS ;; + POP SI ;; + POP CX ;; + ;; + JMP DEFBUF_DONE ;; + ;; + ;; +DEF_RBUF : ;; + MOV BUF.RSLMX,CX ;; the no. of ram slots supported + CMP CX,RMMAX[DI] ;; + JNB DEFBUF_DONE ;; + MOV AX,RMMAX[DI] ;; + MOV BUF.RSLMX,AX ;; the max. of .RAMMX and .RBUFMX + ;; +DEFBUF_DONE : ;; + MOV BUF.STATE,CPSW ;; the LPTn is CPSW ----- STATE + ;; + CMP BUF.BFLAG,BF_PRN ;; + JNE RET_CHK_DID ;; + MOV AX,DID_BIT[DI] ;; + MOV BUF.DID_PRN,AX ;; + ;; + ;; + JMP RET_CHK_DID ;; + ;; +LPT_FAIL: ;; + ;; + MOV BUF.STATE,NORMAL ;; the LPTn is NORMAL --- STATE + ;; + ;; +RET_CHK_DID: ;; + ;; + pop dx ;; + pop di ;; + pop cx ;; + ;; + RET ;; + ;; +CHK_DID ENDP ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Called by INIT to check for consistency between duplicated device name and +;; between PRN and LPT1 +;; +;; at entry : DI = pointer to PAR_DEVOT +;; BUF.STATE = any state +;; CX = DID order +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +DEV_CHECK PROC ;; + ;; + LEA SI,BUF.PAR_EXTRACTO ;; + ;; + PUSH CX ;; + ;; + PUSH SI ;; compare device id + PUSH DI ;; + mov SI,[SI].PAR_DIDO ;; + MOV DI,PSE.PAR_DIDO ;; + MOV CX,PSE.PAR_DNML ;; + INC CX ;; including length + INC CX ;; + REPE CMPSB ;; + POP DI ;; + POP SI ;; + Jz hwcp_check ;; + mov init_chk,0021h ;; error 0021h + Jmp FORCE_LPT_BAD ;; + ;; +hwcp_check : ;; + PUSH SI ;; compare HWCP + PUSH DI ;; + mov SI,[SI].PAR_HWCPO ;; + MOV DI,PSE.PAR_HWCPO ;; + MOV AX,PSE.PAR_HWCPL ;; + MOV CX,2 ;; + SHL AX,CL ;; multiply by two + INC AX ;; including length + INC AX ;; + MOV CX,AX ;; + REPE CMPSB ;; + POP DI ;; + POP SI ;; + Jz desig_check ;; + mov init_chk,0022h ;; error 0022h + Jmp FORCE_LPT_BAD ;; + ;; +desig_check : ;; + PUSH SI ;; compare DESIGNATE + PUSH DI ;; + mov SI,[SI].PAR_DESGO ;; + MOV DI,PSE.PAR_DESGO ;; + MOV AX,PSE.PAR_DESGL ;; + MOV CX,2 ;; + SHL AX,CL ;; multiply by two + INC AX ;; including length + INC AX ;; + MOV CX,AX ;; + REPE CMPSB ;; + POP DI ;; + POP SI ;; + Jz param_check ;; + mov init_chk,0023h ;; error 0023h + Jmp FORCE_LPT_BAD ;; + ;; +param_check : ;; + PUSH SI ;; compare parameters + PUSH DI ;; + mov SI,[SI].PAR_PARMO ;; + MOV DI,PSE.PAR_PARMO ;; + MOV CX,PSE.PAR_PARML ;; + INC CX ;; including length + INC CX ;; + REPE CMPSB ;; + POP DI ;; + POP SI ;; + JZ M_END ;; + mov init_chk,0024h ;; error 0024h + ;; +FORCE_LPT_BAD : ;; the second set of parameters is + MOV BUF.STATE,NORMAL ;; bad + ;; + CMP BUF.BFLAG,BF_LPT1 ;; + JNE M_END ;; + ;; + ;; since LPT1 is bad, force PRN to bad + push bx ;; force prn to be bad too + mov bx,buf.prn_bufo ;; + MOV BUF.STATE,NORMAL ;; + pop bx ;; + ;; + mov AX,BUF.DID_PRN ;; if PRN was not good, DID_PRN = 0 + OR DID_FAIL,AX ;; + ;; + ;; +M_END: ;; force the good did_status to fail if + ;; STATE is bad + POP CX ;; + PUSH CX ;; order 0 to m + MOV AX,DID_STATUS ;; + ;; + INC CX ;; + SHR AX,CL ;; + POP CX ;; + JNC DEV_CHECK_RET ;; already failed + ;; + CMP BUF.STATE,CPSW ;; + JE DEV_CHECK_RET ;; + ;; + PUSH BX ;; + MOV BX,CX ;; + ADD BX,BX ;; + MOV AX,DID_BIT[BX] ;; + OR DID_FAIL,AX ;; force DID to fail + POP BX ;; + ;; + ;; +DEV_CHECK_RET : ;; + ;; + RET ;; + ;; + ;; +DEV_CHECK ENDP ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +CSEG ENDS + END diff --git a/v4.0/src/DEV/PRINTER/CPSPI07.ASM b/v4.0/src/DEV/PRINTER/CPSPI07.ASM new file mode 100644 index 0000000..740b136 --- /dev/null +++ b/v4.0/src/DEV/PRINTER/CPSPI07.ASM @@ -0,0 +1,1416 @@ + + PAGE ,132 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; FILENAME: CPS Printer Device Driver INIT module (CPSPInn) +;; MODULE NAME: +;; TYPE: Assemble file (non-resident code) +;; LINK PROCEDURE: Link CPSPMnn+CPSFONT+CPSPInn into .EXE format. CPSPM01 +;; must be first. CPSPInn must be last. Everything +;; before CPSPInn will be resident. +;; INCLUDE FILES: +;; CPSPEQU.INC +;; +;; LAYOUT : This file is divided into two main section : +;; ++++++++++++++++++++++++ +;; ++ DEVICE Parser ++ +;; ++++++++++++++++++++++++ +;; +;; ++++++++++++++++++++++++ +;; ++ INIT Command ++ +;; ++++++++++++++++++++++++ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +INCLUDE CPSPEQU.INC ;; +INT2F_LOW EQU (4*2FH) ;; WGR interrupt 2F vector location ;AN000; +INT2F_HI EQU (4*2FH)+2 ;; WGR ;AN000; + ;; +.XLIST ;; +INCLUDE SYSMSG.INC ;; WGR ;AN000; +.LIST ;; + ;; +MSG_UTILNAME ;; WGR ;AN000; + ;; +PUBLIC INIT ;; +PUBLIC CODE_END ;; for MAP listing only +PUBLIC RESIDENT_END ;; +PUBLIC STACK_ALLOCATED ;; + ;; + ;; +EXTRN PRINTER_DESC_NUM:WORD ;; +EXTRN PRINTER_DESC_TBL:WORD ;; +EXTRN INIT_CHK:WORD,TABLE:WORD ;; +EXTRN HARD_SL1:BYTE,RAM_SL1:BYTE ;; +EXTRN HARD_SL2:BYTE,RAM_SL2:BYTE ;; +EXTRN HARD_SL3:BYTE,RAM_SL3:BYTE ;; +EXTRN HARD_SL4:BYTE,RAM_SL4:BYTE ;; +EXTRN RESERVED1:WORD,RESERVED2:WORD ;; + ;; + ;; + ;; +CSEG SEGMENT PARA PUBLIC 'CODE' ;; + ASSUME CS:CSEG ;; + ;; + ;; +EXTRN PARSER:NEAR ;; WGR ;AN000; +EXTRN ROM_INT2F:WORD ;; WGR ;AN000; +EXTRN INT2F_COM:NEAR ;; WGR ;AN000; +EXTRN ABORT:BYTE ;; WGR ;AN000; + +CODE_END EQU $ ;; end of resident code + ;; + DW 0 ;; -- there are 16 bytes kept, + ;; including this word + ;; +RESIDENT_END DW 0FFFH ;; end of extended resident area +STACK_ALLOCATED DW -1 ;; end of extended resident area + ;; + DW 150 DUP(0) ;; need some space here. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; End of resident code +;; +;;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +;; +;; ++++++++++++++++++++++++ +;; ++ INIT Command ++ +;; ++++++++++++++++++++++++ +;; +;;==== Command Code 0 - Initialization ====== +;; +;; messages returned : +;; +;; msg_bad_syntax -- syntax error from parser, no driver installation +;; msg_no_init -- device cannot be initialised +;; msg_insuff_mem -- insufficient memory +;; +;; layout : the initialization is done in two stages : +;; +;; ++++++++++++++++++++++++ +;; ++ INIT Stage 1 ++ to examine and extract the +;; ++++++++++++++++++++++++ parameters defined for the +;; device_id in DEVICE command, +;; according to the printer +;; description table for the +;; device_id. +;; +;; ++++++++++++++++++++++++ +;; ++ INIT Stage 2 ++ to set the BUFfer for the LPTn +;; ++++++++++++++++++++++++ or PRN according to device_id's +;; parameters +;; +;; +;; +;;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + ;; +DEV_NUM dw ? ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Tables for the deivce_id parameters in the order of device_id in the +; PARSE table +; === the tables serves as the link between LPTn to be defined in the 2nd +; stage, and the device_id that is processed in the first stage. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; device ID indicators : + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +DID_MAX EQU 4 ;; device entris exepcted in PARSE +;; not more than 16. ;; table + ;; +DID_STATUS DW 0 ;; status of parsing device id + ;; = 0 : all Device-ID bad + ;; -- see DID_BIT + ;; +DID_MATCH DW 0 ;; this DID has device_name matched + ;; +DID_FAIL DW 0 ;; to fail the good DID_STATUS and + ;; the matched name. (due to + ;; inconsistency among the same LPTn + ;; or between PRN and LPT1.) + ;; +;; (DID_STATUS) AND (DID_MATCH) XOR (DID_FAIL) determines the success of DID + ;; initialization + ;; +DID_ONE EQU 00001H ;; first device-ID +DID_TWO EQU 00002H ;; second " +DID_THREE EQU 00004H ;; third " +DID_FOUR EQU 00008H ;; fourth " +;;maximun number of device_id = 16 ;; + ;; +DID_BIT LABEL WORD ;; + DW DID_ONE ;; + DW DID_TWO ;; + DW DID_THREE ;; + DW DID_FOUR ;; +;;maximun number of device_id = 16 ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; device paramters according to the + ;; device_id defined in DEVICE and the + ;; parameters defined for the device_id + ;; in the printer description table. + ;; +HRMAX LABEL word ;; number of hwcp+cart slots supported + DW 0 ;; did = 1 + DW 0 ;; did = 2 + DW 0 ;; did = 3 + DW 0 ;; did = 4 +;upto max DID_MAX ;; + ;; +CTMAX LABEL word ;; number of cart slots supported + DW 0 ;; did = 1 + DW 0 ;; did = 2 + DW 0 ;; did = 3 + DW 0 ;; did = 4 +;upto max DID_MAX ;; + ;; +RMMAX LABEL word ;; number of ram-slots supported + DW 0 ;; did = 1 + DW 0 ;; did = 2 + DW 0 ;; did = 3 + DW 0 ;; did = 4 +;upto max DID_MAX ;; + ;; +RBUMAX LABEL word ;; number of ram-designate slots + DW 0 ;; did = 1 + DW 0 ;; did = 2 + DW 0 ;; did = 3 + DW 0 ;; did = 4 +;upto max DID_MAX ;; + ;; +DESCO LABEL word ;; offset to the description table + ;; where the device_id is defined. + DW -1 ;; did = 1 + DW -1 ;; did = 2 + DW -1 ;; did = 3 + DW -1 ;; did = 4 +;upto max DID_MAX ;; + ;; +FSIZE LABEL word ;; font size of the device + DW 0 ;; did = 1 + DW 0 ;; did = 2 + DW 0 ;; did = 3 + DW 0 ;; did = 4 +;upto max DID_MAX ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Hard/RAM slots table in the order of DEVICE parameters +; +; number of entries in all HARD_SLn is determined by the max. {HSLOTS}, and +; number of entries in all RAM_SLn is determined by the max. {RSLOTS} +; +; -- they are initialized according to the device_id defined in the DEVICE. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +HARD_SLA LABEL word ;; index in the order of device in + DW OFFSET (HARD_SL1) ;; the PARSE-talbes + DW OFFSET (HARD_SL2) ;; + DW OFFSET (HARD_SL3) ;; + DW OFFSET (HARD_SL4) ;; +; up to DID_MAX ;; + ;; +RAM_SLA LABEL word ;; + DW OFFSET (RAM_SL1) ;; + DW OFFSET (RAM_SL2) ;; + DW OFFSET (RAM_SL3) ;; + DW OFFSET (RAM_SL4) ;; +; up to DID_MAX ;; + ;; +SUB_SIZE EQU 11 ;; WGR sublist size ;AN000; +LEFT_ASCIIZ EQU 00010000B ;; WGR left-aligned asciiz string ;AN000; +UNLIMITED EQU 0 ;; WGR unlimited message size. ;AN000; + ;; WGR ;AN000; +SUBLIST LABEL DWORD ;; WGR ;AN000; + DB SUB_SIZE ;; WGR ;AN000; + DB 0 ;; WGR ;AN000; +MSG_PTR DW ? ;; WGR ;AN000; +MSG_SEG DW SEG CSEG ;; WGR ;AN000; + DB 1 ;; WGR ;AN000; + DB LEFT_ASCIIZ ;; WGR ;AN000; + DB UNLIMITED ;; WGR ;AN000; + DB 1 ;; WGR ;AN000; + DB " " ;; WGR ;AN000; + ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; ++++++++++++++++++++++++ +;; ++ INIT Command ++ +;; ++++++++++++++++++++++++ +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +INIT PROC NEAR ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; parse the initialization parameters in DEVICE command +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; + PUSH BX ;; WGR ;AN000; + CALL SYSLOADMSG ;; WGR load messages ;AN000; + JNC CONT_1 ;; WGR if no error then continue ;AN000; + CALL SYSDISPMSG ;; WGR error (DOS version)..display ;AN000; + POP BX ;; WGR message.... ;AN000; + JMP SYNTAX_ERROR ;; WGR ...and exit with error code. ;AN000; + ;; WGR ;AN000; +CONT_1: ;; WGR ;AN000; + POP BX ;; WGR ;AN000; + CMP BUF.BFLAG,BF_PRN ;; since PRN is the FIRST device header + JNE NOT_PRN ;; + ;; + ;; + MOV AX,OFFSET CODE_END ;; defined only once for each DEVICE + XOR CX,CX ;; + MOV CL,4 ;; + SHR AX,CL ;; + PUSH CS ;; + POP CX ;; + ADD AX,CX ;; + INC AX ;; leave 16 bytes,room for resident_end + MOV RESIDENT_END,AX ;; + ;; + CALL PARSER ;; call only once, for PRM + ;; + JMP PROCESS_TABLE ;; + ;; +NOT_PRN : ;; + CMP DEV_NUM,1 ;; + ;; + JNB PROCESS_TABLE ;; + ;; + JMP SYNTAX_ERROR ;; + ;; + ;; + ;; +;; +;;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +;; +;; ++++++++++++++++++++++++ +;; ++ INIT Stage 1 ++ +;; ++++++++++++++++++++++++ +;; +;; INIT - FIRST STAGE : +;; +;; == test and extract if the parameters on device-id is valid +;; == determine the DID_STATUS according to the validity of the parameters +;; == procedure(s) called -- DID_EXTRACT +;; +;;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + ;; +PROCESS_TABLE : ;; + ;; + PUSH CS ;; + POP ES ;; PSE points to Device offsets + MOV DI,OFFSET(table) ;; ES:[DI] + MOV DX,PSE.PAR_DEV_NUM ;; + MOV DEV_NUM,DX ;; + ;; + CMP DEV_NUM,0 ;; + JNZ NO_SYNTAX_ERR ;; + ;; + ;; WGR ;AN000; + PUSH BX ;; WGR ;AN000; + MOV AX,BAD_SYNTAX_MSG ;; WGR 'bad syntax' message ;AN000; + MOV BX,STDERR ;; WGR to standard error ;AN000; + XOR CX,CX ;; WGR ;AN000; + XOR DL,DL ;; WGR ;AN000; + MOV DH,UTILITY_MSG_CLASS ;; WGR class = parse error ;AN000; + CALL SYSDISPMSG ;; WGR display message. ;AN000; + POP BX ;; WGR ;AN000; + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +SYNTAX_ERROR : ;; set the request header status + ;; according to the STATE + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + MOV AX, RESIDENT_END ;; + PUSH CS ;; + POP CX ;; CX=CS + SUB AX,Cx ;; additional segment required. +CS_LOOP1: ;; + CMP AX,1000H ;; + JB CS_LPEND1 ;; + ADD CX,1000H ;; + SUB AX,1000H ;; + JMP CS_LOOP1 ;; + ;; +CS_LPEND1: ;; + SHL AX,1 ;; + SHL AX,1 ;; + SHL AX,1 ;; + SHL AX,1 ;; + ;; + LES DI,dword ptr buf.rh_ptro ;; get Request Header address +; MOV RH.RH0_ENDO,AX ;; + MOV RH.RH0_ENDO,0 ;; + MOV RH.RH0_ENDS,CX ;; + mov rh.RH0_CONFIG_ERRMSG, -1 ;DCR D493 2/25/88 "Error in CONFIG.SYS..." msg flag. + MOV RH.RHC_STA,stat_cmderr ;; set status in request header + ;; + JMP INIT_RETurn ;; + ;; + ;; +NO_SYNTAX_ERR : ;; + ;; + CMP DX,DID_MAX ;; + JNA NEXT_DID ;; + ;; + MOV INIT_CHK,0001H ;; ERROR 0001 + JMP BAD_DID ;; more than supported no. of device + ;; +NEXT_DID: ;; + PUSH DI ;; pointer to PAR_OT (table 1) + AND DX,DX ;; + JNZ SCAN_DESC ;; + JMP END_DID ;; DI = offset to the 1st PARSE table +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +SCAN_DESC: ;; + MOV DI,PSE.PAR_OFF ;; points to the nth device + ;; + ;; find the description for the + ;;device-id + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + MOV CX,PRINTER_DESC_NUM ;; + MOV SI, OFFSET(PRINTER_DESC_TBL); offset to the description table + PUSH CS ;; + POP DS ;; +; $SEARCH ;; +$$DO1: + PUSH CX ;; save device count + PUSH SI ;; pointer to printer-descn's offset + MOV SI,CS:WORD PTR[SI] ;; + AND CX,CX ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; $LEAVE Z ;; LEAVE if no more device description + JZ $$EN1 + PUSH DI ;; save offset to PAR_DEVOT + MOV DI,PSE.PAR_DIDO ;; + MOV CX,PSE.PAR_DIDL ;; length of parsed device name + LEA DI,PSE.PAR_DID ;; pointer to parse device name + ;; + PUSH SI ;; + LEA SI,[SI].TYPEID ;; offset to name of device-id + REPE CMPSB ;; + POP SI ;; + POP DI ;; get back offset to PAR_DEVOT + ;;;;;;;;;;;;;;;;;;;;;;;; +; $EXITIF Z ;; EXIT if name matched + JNZ $$IF1 + ;; + CALL DID_EXTRACT ;; get the parameters + ;; + POP SI ;; balance push-pop + POP CX ;; + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; $ORELSE ;; try next description : + JMP SHORT $$SR1 +$$IF1: + ;; + POP SI ;; of printer_descn offset table + INC SI ;; + INC SI ;; next offset to PRINTER_DESCn + ;; + POP CX ;; one description less + DEC CX ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; $ENDLOOP ;; DEVICE-ID not defined in + JMP SHORT $$DO1 +$$EN1: + ;; printer_desc; + ;; + MOV AX,INIT_CHK ;; + AND AX,AX ;; + JNZ UNCHANGED ;; + MOV INIT_CHK,0004H ;; ERROR 0004 +UNCHANGED: ;; + POP SI ;; balance push-pop + POP CX ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; $ENDSRCH ;; End of scanning printer_desc +$$SR1: +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + POP DI ;; + INC DI ;; + INC DI ;; points to next device in PART_OT + DEC DX ;; + ;; + JMP NEXT_DID ;; + ;; +END_DID : ;; + POP DI ;; +BAD_DID : ;; + ;; + MOV AX,DID_STATUS ;; + AND AX,AX ;; + JNZ DEF_BUFFER ;; + ;; + JMP END_LPT ;; + ;; +;;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +;; +;; ++++++++++++++++++++++++ +;; ++ INIT Stage 2 ++ +;; ++++++++++++++++++++++++ +;; +;; INIT -- SECOND STAGE : +;; +;; == match the device_name extracted in stage 1 with the name of PRN or +;; LPTn +;; +;; == if the PRN/LPTn has never been defined before, then set up the BUF +;; for the PRN/LPTn if the DID_STATUS is good; otherwise message will +;; be generated indicating it cannot be initilized. +;; +;; == if there is PRN, LPT1 is also setup, and vice vera. IF both PRN and +;; LPT1 are on the DEVICE command, or there are multiple entries for +;; the same LPTn, the consistency is checked. It they are inconsistent +;; the associated LPTn or PRN is forced to fail by : DID_FAIL. +;; +;; == if the device_name on the DEVICE command is not one of the supported +;; PRN or LPTn, then DID_MATCH bit will not be set. An error message +;; will be generated for the device_name indicating it cannot be +;; initialized. +;; +;; == procedure(s) called : CHK_DID .. check DID parameters for device +;; whose name matched. +;; DEV_CHECK .. if device-name duplicated, or +;; there are both PRN/LPT1 : check +;; for consistent parameters. +;; +;;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +DEF_BUFFER : ;; + PUSH CS ;; + POP ES ;; PSE points to Device offsets + MOV DI,OFFSET(table) ;; ES:[DI] + xor cx,cx ;; device order in parse table +;SEARCH ;; +$$DO7: + PUSH DI ;; pointer to PAR_OT + PUSH CX ;; save device count + MOV DI,PSE.PAR_OFF ;; " " PAR_DEVOT + cmp cx,dev_num ;; + ;; +;LEAVE NB ;; LEAVE if no more device entry + jb MORE_DEVICE ;; + JMP $$EN7 +MORE_DEVICE : ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; more parsed_device to be checked + PUSH DI ;; save offset to PAR_DEVOT + MOV DI,PSE.PAR_DNMO ;; + MOV CX,PSE.PAR_DNML ;; length of parsed device name + LEA DI,PSE.PAR_DNM ;; pointer to parse device name + ;; + LDS SI,DWORD PTR BUF.DEV_HDRO ; get the offset to device-n header + LEA SI,HP.DH_NAME ;; " offset to name of device-n + REPE CMPSB ;; + POP DI ;; get back offset to PAR_DEVOT + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;; +;EXITIF Z ;; EXIT if name matched + JZ NAME_MATCHED ;; + ;; + JMP MORE_PARSED_DEVICE ;; + ;; +NAME_MATCHED : ;; + ;; + POP CX ;; the DID order + PUSH BX ;; + MOV BX,CX ;; + ADD BX,BX ;; + MOV AX,DID_BIT[BX] ;; + OR DID_MATCH,AX ;; this DID matched + POP BX ;; + PUSH CX ;; + ;; + LEA SI,BUF.PAR_EXTRACTO ;; was the LPT1/PRN defined before ? + MOV AX,CS:[SI].PAR_DNMO ;; + CMP AX,0FFFFH ;; + ;; + JNE DEV_COMPARE ;; DI = PAR_DEVOT + ;;----------------------------------- + ;; + ;; no device previousely defined + MOV AX,PSE.PAR_DNMO ;; + MOV CS:[SI].PAR_DNMO,AX ;; define device parameters for LPTn + ;; + MOV AX,PSE.PAR_DIDO ;; + MOV CS:[SI].PAR_DIDO,AX ;; + ;; + MOV AX,PSE.PAR_HWCPO ;; + MOV CS:[SI].PAR_HWCPO,AX ;; + ;; + MOV AX,PSE.PAR_DESGO ;; + MOV CS:[SI].PAR_DESGO,AX ;; + ;; + MOV AX,PSE.PAR_PARMO ;; + MOV CS:[SI].PAR_PARMO,AX ;; + ;; + ;;--------------------------------- + CALL CHK_DID ;; define the STATE according to + ;; DID_STATUS + JMP MORE_PARSED_DEVICE ;; + ;; +DEV_COMPARE : ;;------------------------------- + ;; e.g. LPT1 and PRN shares one BUF. + ;; or duplicated device name + CALL DEV_CHECK ;; + ;; + CMP BUF.STATE,CPSW ;; + JNE DEV_COMPARE_FAIL ;; + ;; + JMP MORE_PARSED_DEVICE ;; + ;; +DEV_COMPARE_FAIL : ;; + ;; + POP CX ;; + POP DI ;; balance push-pop + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;$ORELSE ;; + JMP END_LPT + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +MORE_PARSED_DEVICE : ;; name does not match + ;; + POP CX ;; + INC CX ;; + POP DI ;; + INC DI ;; + INC DI ;; points to next device in PART_OT + ;; + jmp $$DO7 ;; +;$ENDLOOP ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +$$EN7: ;; no device found for LPTn + ;; + POP CX ;; + POP DI ;; balance push-pop + ;; + CMP BUF.STATE,CPSW ;; + JE END_LPT ;; for LPT1/PRN pair + ;; + MOV BUF.STATE,NORMAL ;; no device defined for the LPTn + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; End of defining LPTn Buffer + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;$ENDSRCH ;; +END_LPT : ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; set the request header status + ;; according to the STATE + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + MOV AX, RESIDENT_END ;; + PUSH CS ;; + POP CX ;; CX=CS + SUB AX,Cx ;; additional segment required. +CS_LOOP2: ;; + CMP AX,1000H ;; + JB CS_LPEND2 ;; + ADD CX,1000H ;; + SUB AX,1000H ;; + JMP CS_LOOP2 ;; + ;; +CS_LPEND2: ;; + SHL AX,1 ;; + SHL AX,1 ;; + SHL AX,1 ;; + SHL AX,1 ;; + ;; + LES DI,dword ptr buf.rh_ptro ;; get Request Header address + MOV RH.RH0_ENDO,AX ;; + MOV RH.RH0_ENDS,CX ;; + XOR AX,AX ;; clear error code to be returned + MOV CX,BUF.STATE ;; + CMP CX,CPSW ;; + JE MATCH_GOOD ;; + MOV AX,STAT_CMDERR ;; + ;; +MATCH_GOOD : ;; + MOV RH.RHC_STA,AX ;; set status in request header + CALL LOAD_INT2F ;; WGR load INT2f handler ;AN000; + ;; +BUF_END : ;; + ;; + CMP BUF.BFLAG,BF_LPT1 ;; + JNE BUF_MESSAGES ;; + ;; + CMP BUF.STATE,CPSW ;; + JNE BUF_MESSAGES ;; + ;; set PRN to the same setting as LPT1 + PUSH BX ;; + ;; + LEA SI,BUF.RNORMO ;; + LEA CX,BUF.BUFEND ;; + SUB CX,SI ;; + MOV BX,BUF.PRN_BUFO ;; where PRN buffer is + LEA DI,BUF.RNORMO ;; + PUSH CS ;; + POP ES ;; + PUSH CS ;; + POP DS ;; + REP MOVSB ;; + ;; + POP BX ;; + ;; +BUF_MESSAGES : ;; + CMP BUF.BFLAG,BF_LPT3 ;; generate error message is this is + je last_round ;; the last LPTn + Jmp INIT_RETURN ;; + ;; ERROR messages will be generated + ;; at the end of initialization of all + ;; the LPT devices +last_round : ;; + MOV AX,RESIDENT_END ;; + ADD AX,STACK_SIZE ;; + MOV RESIDENT_END,AX ;; + PUSH CS ;; + POP CX ;; CX=CS + SUB AX,Cx ;; additional segment required. +CS_LOOP3: ;; + CMP AX,1000H ;; + JB CS_LPEND3 ;; + ADD CX,1000H ;; + SUB AX,1000H ;; + JMP CS_LOOP3 ;; + ;; +CS_LPENd3: ;; + SHL AX,1 ;; + SHL AX,1 ;; + SHL AX,1 ;; + SHL AX,1 ;; + ;; + MOV RH.RH0_ENDO,AX ;; STACK !!!!! + MOV STACK_ALLOCATED,0 ;; from now on, internal stack is used + ;; + MOV AX,DID_STATUS ;; what is the DID combination ? + AND AX,DID_MATCH ;; + XOR AX,DID_FAIL ;; + ;; + AND AX,AX ;; + JNZ CODE_STAYED ;; +; MOV RH.RH0_ENDO,0 ;; none of the devices are good + ;; + ;; +CODE_STAYED : ;; + MOV DI,OFFSET TABLE ;; + push CS ;; + POP ES ;; + ;; + XOR CX,CX ;; +MSG_LOOP : ;; + CMP CX,DEV_NUM ;; + JNB INIT_RETURN ;; + SHR AX,1 ;; + JC MSG_NEXT ;; + ;; this device in parse table is bad + PUSH DI ;; + PUSH CX ;; + PUSH AX ;; + PUSH BX ;; WGR ;AN000; + PUSH DX ;; WGR ;AN000; + ;; + MOV DI,PSE.PAR_OFF ;; + MOV SI,PSE.PAR_DNMO ;; + ;; + PUSH CS ;; + POP ES ;; + PUSH CS ;; + POP DS ;; + ;; + MOV CX,8 ;; + LEA SI,[SI].PAR_DNM ;; + MOV DI,SI ;; + MOV AL,' ' ;; WGR ;AN000; + CLD ;; WGR ;AN000; + REPNE SCASB ;; WGR ;AN000; + DEC DI ;; WGR ;AN000; + MOV BYTE PTR ES:[DI],ZERO ;; WGR ;AN000; + ;; WGR ;AN000; + MOV MSG_SEG,CS ;; WGR ;AN000; + MOV MSG_PTR,SI ;; WGR ;AN000; + MOV AX,BAD_DEVICE_MSG ;; WGR ;AN000; + MOV BX,STDERR ;; WGR ;AN000; + LEA SI,SUBLIST ;; WGR ;AN000; + MOV CX,ONE ;; WGR ;AN000; + XOR DL,DL ;; WGR ;AN000; + MOV DH,UTILITY_MSG_CLASS ;; WGR ;AN000; + CALL SYSDISPMSG ;; WGR ;AN000; + ;; ;AN000; + POP DX ;; WGR ;AN000; + POP BX ;; WGR ;AN000; + POP AX ;; + POP CX ;; + POP DI ;; + ;; +MSG_NEXT : ;; + INC CX ;; + INC DI ;; + INC DI ;; + JMP MSG_LOOP ;; + ;; + ;; +INIT_RETURN : ;; + ;; + ;; + RET ;; + ;; +INIT ENDP ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Call by INIT to extract parameters for the deivce_id +;; +;; on rntry : +;; ES:[DI] PARSE Table 2, offsets of all parameters +;; DS:[SI] Printer Description table whose TYPEID matched +;; DX "inverse" order of devices in the PARSE tables +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +DID_EXTRACT PROC ;; + ;; + PUSH DX ;; + ;;----------------------------- + ;; define the DID_parameters + PUSH BX ;; + ;; + MOV BX,DEV_NUM ;; + SUB BX,DX ;; order in the Parse table + add bx,bx ;; double to index [bx] + MOV DX,BX ;; + ;; + MOV AX,DS:[SI].FONTSZ ;; + MOV FSIZE[BX],AX ;; size of font buffer to be created + ;; + MOV AX,DS:[SI].HSLOTS ;; + CMP AX,HARDSL_MAX ;; + JNA LESS_HARDSL ;; + MOV INIT_CHK, 0010H ;; ERROR 0010H + POP BX ;; + JMP END_MATCH_BAD ;; +LESS_HARDSL : ;; + CMP AX,DS:[SI].HWCPMIN ;; + JNB VALID_HARDSL ;; + MOV INIT_CHK, 0012H ;; ERROR 0012H + POP BX ;; + JMP END_MATCH_BAD ;; +VALID_HARDSL : ;; + MOV HRMAX[BX],AX ;; + MOV CTMAX[BX],AX ;; will be reduced by the no. of hwcp + ;; + MOV AX,DS:[SI].RSLOTS ;; + CMP AX,RAMSL_MAX ;; + JNA LESS_RAMSL ;; + MOV INIT_CHK, 0011H ;; ERROR 0011H + POP BX ;; + JMP END_MATCH_BAD ;; +LESS_RAMSL : ;; + MOV RMMAX[BX],AX ;; see also designate + ;; + MOV DESCO[BX],SI ;; + ;; + POP BX ;; + ;;---------------------------------- + ;; + PUSH CX ;; + ;; +HWCPgt: PUSH DI ;; get the hwcp + ;; + MOV DI,PSE.PAR_HWCPO ;; + MOV CX,PSE.PAR_HWCPL ;; no. of hwcp + AND CX,CX ;; + JNZ chk_hwcp ;; + push bx ;; + mov bx,dx ;; + MOV HRMAX[BX],CX ;; + MOV CX,DS:[SI].HWCPMIN ;; + SUB CTMAX[BX],CX ;; what is left becomes cartridge slot + pop bx ;; + JMP DESIGN ;; + ;; hwcp to be defined +chk_hwcp: MOV AX,DS:[SI].HSLOTS ;; defined in printer_desc + CMP CX,AX ;; + JA BAD_MATCH2 ;; + CMP CX,HARDSL_MAX ;; + JNA HWCP_GOOD ;; jump if system error + MOV INIT_CHK,0003H ;; ERROR 0003 + JMP END_MATCH ;; +BAD_MATCH2: ;; + MOV INIT_CHK,0002H ;; ERROR 0002 + JMP END_MATCH ;; + ;; +HWCP_GOOD: ;; there are sufficient hard-slot for + ;; HWCP + PUSH SI ;; printer description table of TYPEID + PUSH BX ;; + ;; + MOV BX,DX ;; + MOV AX,CTMAX[BX] ;; + ;; + PUSH CX ;; calculate what is left for cart_slot + CMP CX,DS:[SI].HWCPMIN ;; + JNB MORE_THAN_HWCPMIN ;; + MOV CX,DS:[SI].HWCPMIN ;; +MORE_THAN_HWCPMIN : ;; + SUB AX,CX ;; + POP CX ;; + mov HRMAX[BX],CX ;; + ;; + MOV CTMAX[BX],AX ;; no of cart-slot for designate + MOV SI,HARD_SLA[BX] ;; get the corresponding hard-slots + ;; + POP BX ;; + ;; + push bx ;; + push dx ;; + mov bx,si ;; + mov dx,cx ;; + mov reserved1,dx ;; IF THERE IS ANY REPETITIVE HWCP + mov reserved2,bx ;; IF THERE IS ANY REPETITIVE HWCP + ;; +FILL_HWCP: ;; + AND CX,CX ;; + JZ DESIGN_P ;; + INC DI ;; next code page in PARSE table + INC DI ;; + MOV AX,ES:[DI] ;; get code page value + ;; + ;; IF THERE IS ANY REPETITIVE HWCP + push dx ;; + push bx ;; +hwcp_norep : ;; + cmp ax,cs:[bx].slt_cp ;; + jne hwcp_repnext ;; + pop bx ;; + pop dx ;; + pop dx ;; + pop bx ;; + pop si ;; + jmp end_match ;; + ;; +hwcp_repnext: ;; + inc bx ;; + inc bx ;; + inc bx ;; + inc bx ;; + dec dx ;; + jnz hwcp_norep ;; + pop bx ;; + pop dx ;; + ;; + MOV CS:[SI].SLT_CP,AX ;; + MOV AX,CS:[SI].SLT_AT ;; get the attributes + OR AX,AT_OCC ;; occupied + OR AX,AT_HWCP ;; hwcp slot + MOV CS:[SI].SLT_AT,AX ;; + INC SI ;; + INC SI ;; next slot + INC SI ;; next slot + INC SI ;; next slot + DEC CX ;; + JMP FILL_HWCP ;; +DESIGN_P: ;; + pop dx ;; + pop bx ;; + POP SI ;; + ;;--------------------- +DESIGN: POP DI ;; get the designate no. + PUSH DI ;; + ;; + MOV DI,PSE.PAR_DESGO ;; + MOV AX,PSE.PAR_DESGL ;; + CMP AX,1 ;; + JA END_MATCH ;; there should have no font entry + AND AX,AX ;; + JZ DEF_RBUFMAX ;; + ;; + MOV AX,PSE.PAR_DESG ;; + AND AX,AX ;; + JZ DEF_RBUFMAX ;; + ;; + CMP CS:[SI].CLASS,1 ;; + JNE DESIG_NOt_CLASS1 ;; + ;; + PUSH BX ;; if there is any cartridge slot ? + PUSH AX ;; + MOV BX,DX ;; + MOV AX,ctmax[BX] ;; + AND AX,AX ;; + POP AX ;; + POP BX ;; + JZ END_MATCH ;; fail, as there is no physical RAM. + ;; + CMP AX,HARDSL_MAX ;; is the designate more than max ? + JA END_MATCH ;; + ;; + ;; + JMP DEF_RBUFMAX ;; + ;; + ;; + ;; +DESIG_NOT_CLASS1 : ;; + PUSH BX ;; if there is any physical RAM slot ? + PUSH AX ;; + MOV BX,DX ;; + MOV AX,RMMAX[BX] ;; + AND AX,AX ;; + POP AX ;; + POP BX ;; + JZ END_MATCH ;; fail, as there is no physical RAM. + ;; + ;; + CMP AX,RAMSL_MAX ;; is the designate more than max ? + JA END_MATCH ;; + ;; +DEF_RBUFMAX : ;; + PUSH BX ;; + MOV BX,DX ;; + MOV RBUMAX[BX],AX ;; + POP BX ;; + ;; + ;; +PARAM : ;; +;PARM: POP DI ;; +; PUSH DI ;; +;; MOV DI,PSE.PAR_PARMO ;; + ;; + ;,-------------------------- + ;; GOOD device_id parameters + shr dx,1 ;; + MOV AX,DID_ONE ;; + MOV CX,DX ;; + AND CX,CX ;; + JZ NO_SHL ;; + SHL AX,CL ;; +NO_SHL: OR DID_STATUS,AX ;; is defined + ;;------------------------- +END_MATCH: POP DI ;; end of extract + POP CX ;; +END_MATCH_BAD : ;; + POP DX ;; + ;; + RET ;; + ;; +DID_EXTRACT ENDP ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Called by INIT to define the STATE and BUF for the LPTn according to +;; the DID_STATUS. Create font buffer if requested through the "desi*nate" +;; +;; at entry : CX = device order in parse table +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +CHK_DID PROC ;; + ;; + push cx ;; + push di ;; + push dx ;; + ;; + MOV AX,DID_STATUS ;; + ;; + PUSH CX ;; order 0 to m + POP DI ;; + ADD DI,DI ;; indexing : [DI] + ;; + INC CX ;; + SHR AX,CL ;; is the device parameter valid ? + ;; + JC DEFINE_BUFFER ;; + JMP LPT_FAIL ;;-------------------------- + ;; +DEFINE_BUFFER : ;; + ;; good device parameters as determined + MOV AX,DESCO[DI] ;; + MOV BUF.PDESCO,AX ;; + ;; + PUSH DI ;; + MOV DI,AX ;; + MOV AX,CS:[DI].CLASS ;; + MOV BUF.PCLASS,AX ;; + POP DI ;; + ;; + MOV AX,HARD_SLA[DI] ;; in the DID_EXTRACT + MOV BUF.HARDSO,AX ;; + ;; + MOV AX,RAM_SLA[DI] ;; + MOV BUF.RAMSO,AX ;; + ;; + MOV AX,HRMAX[DI] ;; + MOV BUF.HARDMX,AX ;; + ;; + MOV AX,CTMAX[DI] ;; + MOV BUF.HCARMX,AX ;; + ;; + ADD AX,HRMAX[DI] ;; defore "designate" + MOV BUF.HSLMX,AX ;; + ;; + ;; + MOV AX,RMMAX[DI] ;; + MOV BUF.RAMMX,AX ;; + ;; + XOR AX,AX ;; + PUSH CX ;; calculate the max. length of control + MOV CX,2 ;; sequence that is allowed for the + CMP BUF.PCLASS,1 ;; room reserved for physical slots. + JNE CTL_LOOP ;; + MOV CX,1 ;; class 1 printer has one control seq. +CTL_LOOP : ;; + ADD AX,CTL_MAX ;; + DEC AX ;; leave one byte for the length + DEC CX ;; + JNZ CTL_LOOP ;; + MOV BUF.FSELMAX,AX ;; + POP CX ;; + ;; + MOV AX,FSIZE[DI] ;; + MOV BUF.FTSZPA,AX ;; FTSIZE in paragraph + ;; + PUSH AX ;; + ;; + MOV DX,4 ;; +FT_PARA: ;; + ADD AX,AX ;; + DEC DX ;; + JNZ FT_PARA ;; font size + MOV BUF.FTSIZE,AX ;; font size in bytes (used with.RBUFMX) + ;; + POP DX ;; FTSIZE in paragraph + ;; + MOV CX,RBUMAX[DI] ;; create font buffer per .RBUFMX and + MOV BUF.RBUFMX,CX ;; assume sufficient memory for all the + ;; "designate request" + PUSH CX ;; + ;; + CMP BUF.PCLASS,1 ;; always create font buffer for class1 + JNE CLASS_NOT_1 ;; + ;; + AND CX,CX ;; + JZ CLASS1_NOCX ;; + ADD CX,BUF.HARDMX ;; + MOV BUF.HSLMX,CX ;; + JMP CLASS_NOT_1 ;; + ;; +CLASS1_NOCX: ;; + MOV CX,BUF.HSLMX ;; + ;; +CLASS_NOT_1 : ;; + AND CX,CX ;; + JZ MULTIPLE_DONE ;; + MOV AX,RESIDENT_END ;; +MULTIPLE_FT : ;; + ADD AX,DX ;; allocate the font buffers at the end + DEC CX ;; of the resident codes + JNZ MULTIPLE_FT ;; + ;; + ;; + MOV CX,RESIDENT_END ;; + MOV BUF.FTSTART,CX ;; + MOV RESIDENT_END,AX ;; + ;; + ;; +MULTIPLE_DONE : ;; + POP CX ;; designate requested + ;; + CMP BUF.PCLASS,1 ;; + JNE DEF_RBUF ;; + ;; CLASS 1 + CMP BUF.HARDMX,0 ;; + JE DEFBUF_DONE ;; + ;; + PUSH CX ;; STACKS... + PUSH SI ;; + PUSH DS ;; + PUSH ES ;; + PUSH DI ;; + PUSH DX ;; + ;; + MOV DX,BUF.HARDMX ;; + PUSH DX ;; STACK +1 -- # of HWCP + ;; + PUSH CS ;; + POP DS ;; + MOV BUF.RBUFMX,0 ;; + MOV SI,BUF.PDESCO ;; + MOV SI,CS:[SI].SELH_O ;; + XOR CX,CX ;; + MOV CL,CS:BYTE PTR [SI] ;; + INC CX ;; including the length byte + ;; + MOV DI,BUF.FTSTART ;; control template +DEF_FTBUF: ;; fill the font buffer with the + PUSH DI ;; + POP ES ;; + XOR DI,DI ;; + ;; + PUSH CX ;; + PUSH SI ;; + REP MOVSB ;; + POP SI ;; + POP CX ;; + ;; + PUSH ES ;; + POP DI ;; + ADD DI,BUF.FTszpa ;; + DEC DX ;; + JNZ DEF_FTBUF ;; + ;; + POP DX ;; STACK -1 + ;; + MOV SI,BUF.HARDSO ;; + MOV DI,BUF.FTSTART ;; define the HWCP values +DEF_FThwcp : ;; + PUSH DI ;; + POP ES ;; + MOV DI,CTL5202_OFFS ;; offset to the HWCP words + ;; + MOV AX,CS:[SI].SLT_CP ;; + MOV ES:WORD PTR [DI],AX ;; + ;; + INC SI ;; + INC SI ;; + INC SI ;; + INC SI ;; + ;; + PUSH ES ;; + POP DI ;; + ADD DI,BUF.FTSZPA ;; + DEC DX ;; + JNZ DEF_FThwcp ;; + ;; + POP DX ;; + POP DI ;; + POP ES ;; + POP DS ;; + POP SI ;; + POP CX ;; + ;; + JMP DEFBUF_DONE ;; + ;; + ;; +DEF_RBUF : ;; + MOV BUF.RSLMX,CX ;; the no. of ram slots supported + CMP CX,RMMAX[DI] ;; + JNB DEFBUF_DONE ;; + MOV AX,RMMAX[DI] ;; + MOV BUF.RSLMX,AX ;; the max. of .RAMMX and .RBUFMX + ;; +DEFBUF_DONE : ;; + MOV BUF.STATE,CPSW ;; the LPTn is CPSW ----- STATE + ;; + CMP BUF.BFLAG,BF_PRN ;; + JNE RET_CHK_DID ;; + MOV AX,DID_BIT[DI] ;; + MOV BUF.DID_PRN,AX ;; + ;; + ;; + JMP RET_CHK_DID ;; + ;; +LPT_FAIL: ;; + ;; + MOV BUF.STATE,NORMAL ;; the LPTn is NORMAL --- STATE + ;; + ;; +RET_CHK_DID: ;; + ;; + pop dx ;; + pop di ;; + pop cx ;; + ;; + RET ;; + ;; +CHK_DID ENDP ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Called by INIT to check for consistency between duplicated device name and +;; between PRN and LPT1 +;; +;; at entry : DI = pointer to PAR_DEVOT +;; BUF.STATE = any state +;; CX = DID order +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +DEV_CHECK PROC ;; + ;; + LEA SI,BUF.PAR_EXTRACTO ;; + ;; + PUSH CX ;; + ;; + PUSH SI ;; compare device id + PUSH DI ;; + mov SI,[SI].PAR_DIDO ;; + MOV DI,PSE.PAR_DIDO ;; + MOV CX,PSE.PAR_DNML ;; + INC CX ;; including length + INC CX ;; + REPE CMPSB ;; + POP DI ;; + POP SI ;; + Jz hwcp_check ;; + mov init_chk,0021h ;; error 0021h + Jmp FORCE_LPT_BAD ;; + ;; +hwcp_check : ;; + PUSH SI ;; compare HWCP + PUSH DI ;; + mov SI,[SI].PAR_HWCPO ;; + MOV DI,PSE.PAR_HWCPO ;; + MOV AX,PSE.PAR_HWCPL ;; + MOV CX,2 ;; + SHL AX,CL ;; multiply by two + INC AX ;; including length + INC AX ;; + MOV CX,AX ;; + REPE CMPSB ;; + POP DI ;; + POP SI ;; + Jz desig_check ;; + mov init_chk,0022h ;; error 0022h + Jmp FORCE_LPT_BAD ;; + ;; +desig_check : ;; + PUSH SI ;; compare DESIGNATE + PUSH DI ;; + mov SI,[SI].PAR_DESGO ;; + MOV DI,PSE.PAR_DESGO ;; + MOV AX,PSE.PAR_DESGL ;; + MOV CX,2 ;; + SHL AX,CL ;; multiply by two + INC AX ;; including length + INC AX ;; + MOV CX,AX ;; + REPE CMPSB ;; + POP DI ;; + POP SI ;; + Jz param_check ;; + mov init_chk,0023h ;; error 0023h + Jmp FORCE_LPT_BAD ;; + ;; +param_check : ;; + PUSH SI ;; compare parameters + PUSH DI ;; + mov SI,[SI].PAR_PARMO ;; + MOV DI,PSE.PAR_PARMO ;; + MOV CX,PSE.PAR_PARML ;; + INC CX ;; including length + INC CX ;; + REPE CMPSB ;; + POP DI ;; + POP SI ;; + JZ M_END ;; + mov init_chk,0024h ;; error 0024h + ;; +FORCE_LPT_BAD : ;; the second set of parameters is + MOV BUF.STATE,NORMAL ;; bad + ;; + CMP BUF.BFLAG,BF_LPT1 ;; + JNE M_END ;; + ;; + ;; since LPT1 is bad, force PRN to bad + push bx ;; force prn to be bad too + mov bx,buf.prn_bufo ;; + MOV BUF.STATE,NORMAL ;; + pop bx ;; + ;; + mov AX,BUF.DID_PRN ;; if PRN was not good, DID_PRN = 0 + OR DID_FAIL,AX ;; + ;; + ;; +M_END: ;; force the good did_status to fail if + ;; STATE is bad + POP CX ;; + PUSH CX ;; order 0 to m + MOV AX,DID_STATUS ;; + ;; + INC CX ;; + SHR AX,CL ;; + POP CX ;; + JNC DEV_CHECK_RET ;; already failed + ;; + CMP BUF.STATE,CPSW ;; + JE DEV_CHECK_RET ;; + ;; + PUSH BX ;; + MOV BX,CX ;; + ADD BX,BX ;; + MOV AX,DID_BIT[BX] ;; + OR DID_FAIL,AX ;; force DID to fail + POP BX ;; + ;; + ;; +DEV_CHECK_RET : ;; + ;; + RET ;; + ;; + ;; +DEV_CHECK ENDP ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: LOAD_INT2F +; +; FUNCTION: +; THIS PROCEDURE LOADS THE INTERRUPT HANDLER FOR INT2FH +; +; AT ENTRY: +; +; AT EXIT: +; NORMAL: INTERRUPT 2FH VECTOR POINTS TO INT2F_COM. OLD INT 2FH +; VECTOR STORED. +; +; ERROR: N/A +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +SEMAPHORE DB 0 ;AN000; + ;AN000; +LOAD_INT2F PROC NEAR ;AN000; + CMP CS:SEMAPHORE,0 ; already loaded? ;AN000; + JNE LI_1 ; yes.....exit ;AN000; + PUSH ES ; no...load. ;AN000; + PUSH CX ; ;AN000; + PUSH AX ; ;AN000; + XOR AX,AX ; point ES to low.. ;AN000; + MOV ES,AX ; memory. ;AN000; + MOV AX,ES:WORD PTR INT2F_LOW ; store original.. ;AN000; + MOV CS:ROM_INT2F,AX ; interrupt 2Fh.. ;AN000; + MOV CX,ES:WORD PTR INT2F_HI ; location.. ;AN000; + MOV CS:ROM_INT2F+2,CX ; ;AN000; + OR AX,CX ; check if old int2F.. ;AN000; + JNZ LI_0 ; is 0. ;AN000; + MOV AX,OFFSET ABORT ; yes....point to.. ;AN000; + MOV CS:ROM_INT2F,AX ; IRET. ;AN000; + MOV AX,CS ; ;AN000; + MOV CS:ROM_INT2F+2,AX ; ;AN000; +LI_0: ; ;AN000; + CLI ; ;AN000; + MOV ES:WORD PTR INT2F_LOW,OFFSET INT2F_COM ; replace vector.. ;AN000; + MOV ES:WORD PTR INT2F_HI,CS ; with our own.. ;AN000; + STI ; ;AN000; + POP AX ; ;AN000; + POP CX ; ;AN000; + POP ES ; ;AN000; + MOV CS:SEMAPHORE,1 ; now loaded. ;AN000; +LI_1: RET ; ;AN000; +LOAD_INT2F ENDP + +.XLIST +MSG_SERVICES ; WGR ;AN000; +MSG_SERVICES ; WGR ;AN000; +MSG_SERVICES ; WGR ;AN000; +MSG_SERVICES ; WGR ;AN000; +MSG_SERVICES ; WGR ;AN000; +.LIST + +include msgdcl.inc + +CSEG ENDS + END diff --git a/v4.0/src/DEV/PRINTER/CPSPM10.ASM b/v4.0/src/DEV/PRINTER/CPSPM10.ASM new file mode 100644 index 0000000..ea62b25 --- /dev/null +++ b/v4.0/src/DEV/PRINTER/CPSPM10.ASM @@ -0,0 +1,3851 @@ +PAGE ,132 +TITLE DOS - Code Page Switching - Printer Device Driver +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; FILENAME: CPS Printer Device Driver Main Code +;; MODULE NAME: +;; TYPE: Assemble file (resident code) +;; LINK PROCEDURE: Link CPSPMnn+CPSFONT+CPSPInn into .EXE format. CPSPM01 +;; must be first. CPSPInn must be last. Everything +;; before CPSPInn will be resident. +;; INCLUDE FILES: +;; CPSPEQU.INC +;; +;; +;; This routine is structured as a DOS Device Driver. +;; IE it is installed via the CONFIG.SYS command: +;; +;; The following device commands are supported: +;; +;; 0 - INIT +;; -------- +;; +;; 8 - OUTPUT +;; 9 - OUTPUT +;; -------- +;; Supported in between Designate-start and the Designate_end commands. +;; +;; +;; 12 - IOCTL OUTPUT +;; ----------------- +;; CPS Function request : Major function = 05 -- printer device +;; Minor functions = 4CH -- designate start +;; 4DH -- designate end +;; 4AH -- invoke +;; 6AH -- query-invoked +;; 6BH -- query-list +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;*Modification history ******************************************************** +;AN001; p2685 Long delay on CHCP before failure message 12/10/87 J.K. +;****************************************************************************** + ;; +INCLUDE CPSPEQU.INC ;; + ;; +PUBLIC PRINTER_DESC_NUM ;; +PUBLIC PRINTER_DESC_TBL ;; +PUBLIC INIT_CHK,TABLE,DEVICE_NUM ;; WGR ;AN000; +PUBLIC INVOKE ;; WGR ;AN000; +PUBLIC BUF0,BUF1,BUF2,BUF3 ;; WGR ;AN000; +PUBLIC HARD_SL1,RAM_SL1 ;; +PUBLIC HARD_SL2,RAM_SL2 ;; +PUBLIC HARD_SL3,RAM_SL3 ;; +PUBLIC HARD_SL4,RAM_SL4 ;; +PUBLIC RESERVED1,RESERVED2 ;; + ;; +EXTRN RESIDENT_END:WORD ;; +EXTRN STACK_ALLOCATED:WORD ;; +EXTRN FONT_PARSER:NEAR,FTABLE:WORD ;; +EXTRN INIT:NEAR ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +CSEG SEGMENT PARA PUBLIC 'CODE' ;; + ASSUME CS:CSEG ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; ************************************ +;; ** ** +;; ** Resident Code ** +;; ** ** +;; ************************************ +;; +;; +;; DEVICE HEADER - must be at offset zero within device driver +;; (DHS is defined according to this structure) +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +DEV_HDR0: DW OFFSET DEV_HDR1 ;; becomes pointer to next device header + DW 0 ;; must be zero for no link + DW 0e040H ;; attribute (Char device) + ;; supports IOCTL calls + DW OFFSET STRATEGY0 ;; pointer to device "strategy" routine + DW OFFSET INTERRUPT0 ;; pointer to device "interrupt handler" +DEV_NAME0: DB 'PRN ' ;; device name( length : NAME_LEN) + ;; +DEV_HDR1: DW OFFSET DEV_HDR2 ;; becomes pointer to next device header + DW 0 ;; must be zero for no link + DW 0e040H ;; attribute (Char device) + ;; supports IOCTL calls + DW OFFSET STRATEGY1 ;; pointer to device "strategy" routine + DW OFFSET INTERRUPT1 ;; pointer to device "interrupt handler" +DEV_NAME1: DB 'LPT1 ' ;; device name( length : NAME_LEN) + ;; +DEV_HDR2: DW OFFSET DEV_HDR3 ;; becomes pointer to next device header + DW 0 ;; must be zero for no link + DW 0e040H ;; attribute (Char device) + ;; supports IOCTL calls + DW OFFSET STRATEGY2 ;; pointer to device "strategy" routine + DW OFFSET INTERRUPT2 ;; pointer to device "interrupt handler" +DEV_NAME2: DB 'LPT2 ' ;; device name( length : NAME_LEN) + ;; + ;; +DEV_HDR3: DD -1 ;; becomes pointer to next device header + DW 0e040H ;; attribute (Char device) + ;; supports IOCTL calls + DW OFFSET STRATEGY3 ;; pointer to device "strategy" routine + DW OFFSET INTERRUPT3 ;; pointer to device "interrupt handler" +DEV_NAME3: DB 'LPT3 ' ;; device name( length : NAME_LEN) + ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ***************************** +;; ** Resident Data Areas ** +;; ***************************** +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PRN/LPTn printer data based on BUF +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +INIT_CHK DW 0 ;; internal flag : error loc. in INIT + ;; +BUF0: BUF_DATA <,,,,,,,,,,> ;; PRN + ;; +BUF1: BUF_DATA <,,,,,,,,,,> ;; LPT1 + ;; +BUF2: BUF_DATA <,,,,,,,,,,> ;; LPT2 + ;; +BUF3: BUF_DATA <,,,,,,,,,,> ;; LPT3 + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Hard/RAM slots table in the order of DEVICE parameters +; +; number of entries in all HARD_SLn is determined by the max. {HSLOTS} +; +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +HARD_SL1 : SLTS <,> ;; 1st hardware slots +HARD_SL1B: SLTS <,> ;; +HARD_SL1C: SLTS <,> ;; +HARD_SL1D: SLTS <,> ;; +HARD_SL1E: SLTS <,> ;; +HARD_SL1F: SLTS <,> ;; +HARD_SL1G: SLTS <,> ;; +HARD_SL1H: SLTS <,> ;; +HARD_SL1I: SLTS <,> ;; +HARD_SL1J: SLTS <,> ;; +HARD_SL1K: SLTS <,> ;; +HARD_SL1L: SLTS <,> ;; +HARD_SL1M: SLTS <,> ;; -- max. no. of code pages allowed +;;upto hardsl_max + 1 ;; + ;; +HARD_SL2 : SLTS <,> ;; 2nd hardware slots +HARD_SL2B: SLTS <,> ;; +HARD_SL2C: SLTS <,> ;; +HARD_SL2D: SLTS <,> ;; +HARD_SL2E: SLTS <,> ;; +HARD_SL2F: SLTS <,> ;; +HARD_SL2G: SLTS <,> ;; +HARD_SL2H: SLTS <,> ;; +HARD_SL2I: SLTS <,> ;; +HARD_SL2J: SLTS <,> ;; +HARD_SL2K: SLTS <,> ;; +HARD_SL2L: SLTS <,> ;; +HARD_SL2M: SLTS <,> ;; -- max. no. of code pages allowed +;;upto hardsl_max + 1 ;; + ;; +HARD_SL3 : SLTS <,> ;; 3rd hardware slots +HARD_SL3B: SLTS <,> ;; +HARD_SL3C: SLTS <,> ;; +HARD_SL3D: SLTS <,> ;; +HARD_SL3E: SLTS <,> ;; +HARD_SL3F: SLTS <,> ;; +HARD_SL3G: SLTS <,> ;; +HARD_SL3H: SLTS <,> ;; +HARD_SL3I: SLTS <,> ;; +HARD_SL3J: SLTS <,> ;; +HARD_SL3K: SLTS <,> ;; +HARD_SL3L: SLTS <,> ;; +HARD_SL3M: SLTS <,> ;; -- max. no. of code pages allowed +;;upto hardsl_max + 1 ;; + ;; +HARD_SL4 : SLTS <,> ;; 4TH hardware slots +HARD_SL4B: SLTS <,> ;; +HARD_SL4C: SLTS <,> ;; +HARD_SL4D: SLTS <,> ;; +HARD_SL4E: SLTS <,> ;; +HARD_SL4F: SLTS <,> ;; +HARD_SL4G: SLTS <,> ;; +HARD_SL4H: SLTS <,> ;; +HARD_SL4I: SLTS <,> ;; +HARD_SL4J: SLTS <,> ;; +HARD_SL4K: SLTS <,> ;; +HARD_SL4L: SLTS <,> ;; +HARD_SL4M: SLTS <,> ;; -- max. no. of code pages allowed +;;upto hardsl_max + 1 ;; + ;; + ;; +RAM_SL1 : SLTS <,> ;; 1st ram slots +RAM_SL1B: SLTS <,> ;; NOTE : must be only FOUR bytes for +RAM_SL1C: SLTS <,> ;; codepage positioning +RAM_SL1D: SLTS <,> ;; calculation as compared +RAM_SL1E: SLTS <,> ;; with each entry in FTDL_OFF +RAM_SL1F: SLTS <,> ;; +RAM_SL1G: SLTS <,> ;; +RAM_SL1H: SLTS <,> ;; +RAM_SL1I: SLTS <,> ;; +RAM_SL1J: SLTS <,> ;; +RAM_SL1K: SLTS <,> ;; +RAM_SL1L: SLTS <,> ;; -- max. no. of code pages allowed +;;upto ramsl_max, ;; + ;; +RAM_SL2 : SLTS <,> ;; 2nd ram slots +RAM_SL2B: SLTS <,> ;; +RAM_SL2C: SLTS <,> ;; +RAM_SL2D: SLTS <,> ;; +RAM_SL2E: SLTS <,> ;; +RAM_SL2F: SLTS <,> ;; +RAM_SL2G: SLTS <,> ;; +RAM_SL2H: SLTS <,> ;; +RAM_SL2I: SLTS <,> ;; +RAM_SL2J: SLTS <,> ;; +RAM_SL2K: SLTS <,> ;; +RAM_SL2L: SLTS <,> ;; -- max. no. of code pages allowed +;;upto ramsl_max, ;; + ;; +RAM_SL3 : SLTS <,> ;; 3rd ram slots +RAM_SL3B: SLTS <,> ;; +RAM_SL3C: SLTS <,> ;; +RAM_SL3D: SLTS <,> ;; +RAM_SL3E: SLTS <,> ;; +RAM_SL3F: SLTS <,> ;; +RAM_SL3G: SLTS <,> ;; +RAM_SL3H: SLTS <,> ;; +RAM_SL3I: SLTS <,> ;; +RAM_SL3J: SLTS <,> ;; +RAM_SL3K: SLTS <,> ;; +RAM_SL3L: SLTS <,> ;; -- max. no. of code pages allowed +;;upto ramsl_max, ;; + ;; +RAM_SL4 : SLTS <,> ;; 4th ram slots +RAM_SL4B: SLTS <,> ;; +RAM_SL4C: SLTS <,> ;; +RAM_SL4D: SLTS <,> ;; +RAM_SL4E: SLTS <,> ;; +RAM_SL4F: SLTS <,> ;; +RAM_SL4G: SLTS <,> ;; +RAM_SL4H: SLTS <,> ;; +RAM_SL4I: SLTS <,> ;; +RAM_SL4J: SLTS <,> ;; +RAM_SL4K: SLTS <,> ;; +RAM_SL4L: SLTS <,> ;; -- max. no. of code pages allowed +;;upto ramsl_max, ;; + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; hard/RAM buffered slots on codepages + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +HBUF_SL1 LABEL WORD ;; hardware slots' buffer for LPT1/PRN + DW 0FFFFH ;; ---- only for CART-SLOTS + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; +;;upto hardsl_max+1, there are as many HARD_SLn + ;; +HBUF_SL2 LABEL WORD ;; hardware slots' buffer for LPT2 + DW 0FFFFH ;; ---- only for CART-SLOTS + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; +;;upto hardsl_max+1, there are as many HARD_SLn + ;; +HBUF_SL3 LABEL WORD ;; hardware slots' buffer for LPT3 + DW 0FFFFH ;; ---- only for CART-SLOTS + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; +;;upto hardsl_max+1, there are as many HARD_SLn + ;; + ;; +RBUF_SL1 LABEL WORD ;; ram slots' buffer for LPT1/PRN + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; +;;upto ramsl_max, there are as many RAM_SLn + ;; +RBUF_SL2 LABEL WORD ;; ram slots' buffer for LPT2 + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; +;;upto ramsl_max, there are as many RAM_SLn + ;; +RBUF_SL3 LABEL WORD ;; ram slots' buffer for LPT3 + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; + DW 0FFFFH ;; +;;upto ramsl_max, there are as many RAM_SLn + ;; +FTDL_OFF1 LABEL WORD ;; offset of FTSTART for PRN/LPT1 + DW 0 ;; NOTE : must be only two bytes for + DW 0 ;; codepage positioning + DW 0 ;; calculation as compared + DW 0 ;; with each entry in RAM_SLOT + DW 0 ;; or CART_SLOT + DW 0 ;; + DW 0 ;; + DW 0 ;; + DW 0 ;; + DW 0 ;; + DW 0 ;; + DW 0 ;; + DW 0 ;; +;;upto the max. of {ramsl_max,hardsl_max} + ;; +FTDL_OFF2 LABEL WORD ;; offset of FTSTART for LPT2 + DW 0 ;; + DW 0 ;; + DW 0 ;; + DW 0 ;; + DW 0 ;; + DW 0 ;; + DW 0 ;; + DW 0 ;; + DW 0 ;; + DW 0 ;; + DW 0 ;; + DW 0 ;; + DW 0 ;; +;;upto the max. of {ramsl_max,hardsl_max} + ;; +FTDL_OFF3 LABEL WORD ;; offset of FTSTART for LPT3 + DW 0 ;; + DW 0 ;; + DW 0 ;; + DW 0 ;; + DW 0 ;; + DW 0 ;; + DW 0 ;; + DW 0 ;; + DW 0 ;; + DW 0 ;; + DW 0 ;; + DW 0 ;; + DW 0 ;; +;;upto the max. of {ramsl_max,hardsl_max} + ;; + ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Printer Description Tables +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +ESC_CHAR EQU 27 ;; + ;; +db 'PRINTER_DESC' ;; + ;; +PRINTER_DESC_NUM DW 3 ;; number of PRINTER_DESCn + ;; +PRINTER_DESC_TBL LABEL WORD ;; + DW OFFSET(PRINTER_DESC1) ;; + DW OFFSET(PRINTER_DESC2) ;; + DW OFFSET(PRINTER_DESC3) ;; + DW OFFSET(PRINTER_DESC4) ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Printer Description Table for Proprinter (4201) +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +PRINTER_DESC1 : ;; + ;; + PDSH <,'4201 ',,,0,212,1,1,1> ;; followed by the rest in PDS + ;; CLASS = 0 + ;; FTSZPA = 212 ==> 212 x 16=3008 bytes + ;; of font buffer + ;; HSLOTS = 1 (check CTL4201_B) + ;; HWCPMIN = 1 + ;; RSLOTS = 1 (check CTL4201_B) + ;; + DW OFFSET(CTL4201_H) + DW OFFSET(CTL4201_R) + DW OFFSET(CTL4201_B) + ;; (CTL_MAX = 32) + ;; (32 bytes for each control) + ;; (MUST BE ADJACENT...no blanks bet.:) +CTL4201_H : DB 5,ESC_CHAR,'I',0,ESC_CHAR,"6" ;; selection control 1 +CTL4201_R : DB 5,ESC_CHAR,'I',4,ESC_CHAR,"6" ;; selection control 2 + db 26 dup (0) ;; for CTL4201_H + db 26 dup (0) ;; for CTL4201_R + ;; +CTL4201_B DB CTL_MAX DUP (0) ;; max. two selection + DB CTL_MAX DUP (0) ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Printer Description Table for 5202 +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +PRINTER_DESC2 : ;; + PDSH <,'5202 ',,,1,2,2,1,0> ;; followed by the rest in PDS + ;; CLASS = 1 (font buffers allowed + ;; if there is cart-slot) + ;; FTSZPA = 2 ==> 2 x 16 = 32 bytes + ;; of font buffer + ;; HSLOTS = 2 (check CTL5202_B) + ;; HWCPMIN = 1 + ;; RSLOTS = 0 (check CTL5202_B) + ;; + DW OFFSET(CTL5202_H) + DW OFFSET(CTL5202_R) + DW OFFSET(CTL5202_B) + ;; + ;; (CTL_MAX = 32) + ;; (SEE CTL5202_OFFS) + ;; (32 bytes for each control) +CTL5202_H : DB 12,ESC_CHAR,91,84,5,0,00,00,0FFH,0FFH,00 ;; selection control 1 + dB ESC_CHAR,"6" ;; + DB 12,ESC_CHAR,91,84,5,0,00,00,0FFH,0FFH,00 ;; selection control 2 + dB ESC_CHAR,"6" ;; + db 19 dup (0) ;; for CTL5202_H selection 1 + db 19 dup (0) ;; for CTL5202_H selection 2 +CTL5202_R : DB 0 ;; + ;; +CTL5202_B DB CTL_MAX DUP (0) ;; max. two selection + DB CTL_MAX DUP (0) ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Printer Description Table for RESERVED PRINTER (res1) +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +PRINTER_DESC3 : ;; + ;; + PDSH <,'4208 ',,,1,2,2,1,0> ;; followed by the rest in PDS + ;; CLASS = 1 + ;; FTSZPA = 2 + ;; HSLOTS = 2 + ;; HWCPMIN = 1 + ;; RSLOTS = 0 + ;; + DW OFFSET(CTL4208_H) + DW OFFSET(CTL4208_R) + DW OFFSET(CTL4208_B) + ;; (CTL_MAX = 32) + ;; (32 bytes for each control) + ;; (MUST BE ADJACENT...no blanks bet.:) +CTL4208_H : DB 0Bh,ESC_CHAR,49h,0Ah ;; selection control 1 + DB ESC_CHAR,49h,03 + DB ESC_CHAR,49h,02 + DB ESC_CHAR,36h + db 20 dup (0) +CTL4208_R : DB 0Bh,ESC_CHAR,49h,0Eh ;; selection control 2 + DB ESC_CHAR,49h,7 + DB ESC_CHAR,49h,6 + DB ESC_CHAR,36h + db 20 dup (0) ;; for CTLres1_H and CTRLres1_R + ;; +CTL4208_B DB CTL_MAX DUP (0) ;; max. two selection + DB CTL_MAX DUP (0) ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Printer Description Table for RESERVED PRINTER (res2) +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +PRINTER_DESC4 : ;; + ;; + PDSH <,'nnnnnnnn',,,0,0,1,1,1> ;; followed by the rest in PDS + ;; CLASS = 0 + ;; FTSZPA = 0 + ;; HSLOTS = 1 + ;; HWCPMIN = 1 + ;; RSLOTS = 1 + ;; + DW OFFSET(CTLres2_H) + DW OFFSET(CTLres2_R) + DW OFFSET(CTLres2_B) + ;; (CTL_MAX = 32) + ;; (32 bytes for each control) + ;; (MUST BE ADJACENT...no blanks bet.:) +CTLres2_H : DB 0 ;; selection control 1 +CTLres2_R : DB 32 dup (0) ;; selection control 2 + db 32 dup (0) ;; for CTLres2_H and CTRLres2_R + ;; +CTLres2_B DB CTL_MAX DUP (0) ;; max. two selection + DB CTL_MAX DUP (0) ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +TEMP_SI DW ? ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; The request header for IOCTL call +;; to the Normal device driver +;; +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +REQ_NORM1 GIH <,,,,,> ;; for LPT1/PRN + GB2S <,> ;; +REQ_NORM2 GIH <,,,,,> ;; for LPT2 + GB2S <,> ;; +REQ_NORM3 GIH <,,,,,> ;; for LPT3 + GB2S <,> ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; +;; +;; PARSER'S TABLES +;; +;; -- TABLE is the first table of the results of the parsing. +;; The first word (number of devices) will be set to 0 if +;; syntax error is detected in the DEVICE command line. +;; +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; TABLE STRUCTURE FOR RETURNING VALUES TO THE INIT MODULE WGR +; (ADAPTED FROM VERSION 1.0 DISPLAY.SYS) WGR +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +TABLE LABEL BYTE ; table header ;AN000; +DEVICE_NUM DW ZERO ; initialized to zero devices ;AN000; + DW TABLE1_1 ; pointer to table 2 for device 1 ;AN000; + DW TABLE2_1 ; pointer to table 2 for device 2 ;AN000; + DW TABLE3_1 ; pointer to table 2 for device 3 ;AN000; + DW TABLE4_1 ; pointer to table 2 for device 4 ;AN000; + ;AN000; +TABLE1_1 LABEL WORD ;AN000; + DW FOUR ; 4 pointer follow ;AN000; + DW TABLE1_2 ; pointer to table 3 (device name) ;AN000; + DW TABLE1_3 ; pointer to table 4 (device id) ;AN000; + DW TABLE1_4 ; pointer to table 5 (hwcp's) ;AN000; + DW TABLE1_5 ; pointer to table 6 (num desg's and fonts) ;AN000; + DW -1 ; reserved ;AN000; + ;AN000; +TABLE1_2 LABEL WORD ; device name (ie. PRN) ;AN000; + DW ZERO ; length ;AN000; + DB " " ; value ;AN000; + ;AN000; +TABLE1_3 LABEL WORD ; device id. (eg. 4201,5202..) ;AN000; + DW ZERO ; length ;AN000; + DB " " ; value ;AN000; + ;AN000; +TABLE1_4 LABEL WORD ; hardware code pages (10 max.) ;AN000; + DW ZERO ; number ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + ;AN000; +TABLE1_5 LABEL WORD ; Designates and fonts ;AN000; + DW ZERO ; values given (0 - 2 valid) ;AN000; + DW -1 ; n value ;AN000; + DW -1 ; m value ;AN000; + ;AN000; +TABLE2_1 LABEL WORD ;AN000; + DW FOUR ; 4 pointer follow ;AN000; + DW TABLE2_2 ; pointer to table 3 (device name) ;AN000; + DW TABLE2_3 ; pointer to table 4 (device id) ;AN000; + DW TABLE2_4 ; pointer to table 5 (hwcp's) ;AN000; + DW TABLE2_5 ; pointer to table 6 (num desg's and fonts) ;AN000; + DW -1 ; reserved ;AN000; + ;AN000; +TABLE2_2 LABEL WORD ; device name (ie. PRN) ;AN000; + DW ZERO ; length ;AN000; + DB " " ; value ;AN000; + ;AN000; +TABLE2_3 LABEL WORD ; device id. (eg. 4201,5202..) ;AN000; + DW ZERO ; length ;AN000; + DB " " ; value ;AN000; + ;AN000; +TABLE2_4 LABEL WORD ; hardware code pages (10 max.) ;AN000; + DW ZERO ; number ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + ;AN000; +TABLE2_5 LABEL WORD ; Designates and fonts ;AN000; + DW ZERO ; values given (0 - 2 valid) ;AN000; + DW -1 ; n value ;AN000; + DW -1 ; m value ;AN000; + ;AN000; +TABLE3_1 LABEL WORD ;AN000; + DW FOUR ; 4 pointer follow ;AN000; + DW TABLE3_2 ; pointer to table 3 (device name) ;AN000; + DW TABLE3_3 ; pointer to table 4 (device id) ;AN000; + DW TABLE3_4 ; pointer to table 5 (hwcp's) ;AN000; + DW TABLE3_5 ; pointer to table 6 (num desg's and fonts) ;AN000; + DW -1 ; reserved ;AN000; + ;AN000; +TABLE3_2 LABEL WORD ; device name (ie. PRN) ;AN000; + DW ZERO ; length ;AN000; + DB " " ; value ;AN000; + ;AN000; +TABLE3_3 LABEL WORD ; device id. (eg. 4201,5202..) ;AN000; + DW ZERO ; length ;AN000; + DB " " ; value ;AN000; + ;AN000; +TABLE3_4 LABEL WORD ; hardware code pages (10 max.) ;AN000; + DW ZERO ; number ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + ;AN000; +TABLE3_5 LABEL WORD ; Designates and fonts ;AN000; + DW ZERO ; values given (0 - 2 valid) ;AN000; + DW 0 ; n value ;AN000; + DW 0 ; m value ;AN000; + ;AN000; +TABLE4_1 LABEL WORD ;AN000; + DW FOUR ; 4 pointer follow ;AN000; + DW TABLE4_2 ; pointer to table 3 (device name) ;AN000; + DW TABLE4_3 ; pointer to table 4 (device id) ;AN000; + DW TABLE4_4 ; pointer to table 5 (hwcp's) ;AN000; + DW TABLE4_5 ; pointer to table 6 (num desg's and fonts) ;AN000; + DW -1 ; reserved ;AN000; + ;AN000; +TABLE4_2 LABEL WORD ; device name (ie. PRN) ;AN000; + DW ZERO ; length ;AN000; + DB " " ; value ;AN000; + ;AN000; +TABLE4_3 LABEL WORD ; device id. (eg. 4201,5202..) ;AN000; + DW ZERO ; length ;AN000; + DB " " ; value ;AN000; + ;AN000; +TABLE4_4 LABEL WORD ; hardware code pages (10 max.) ;AN000; + DW ZERO ; number ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + DW -1 ; value ;AN000; + ;AN000; +TABLE4_5 LABEL WORD ; Designates and fonts ;AN000; + DW ZERO ; values given (0 - 2 valid) ;AN000; + DW 0 ; n value ;AN000; + DW 0 ; m value ;AN000; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +reserved1 DW ? ;; reserved for debugging used +reserved2 dw ? ;; + ;; +;;;;;;;;ASSUME DS:NOTHING ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; PRN Device "strategy" entry point +;; +;; Retain the Request Header address for use by Interrupt routine +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +STRATEGY0 PROC FAR ;; + PUSH BX ;; + PUSH BX ;; + LEA BX, BUF0 ;; BUF = BUF0 CS:[BX] + POP buf.RH_PTRO ;; offset of request header + MOV buf.RH_PTRS,ES ;; segment + POP BX ;; + RET ;; +STRATEGY0 ENDP ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; LPT1 Device "strategy" entry point +;; +;; Retain the Request Header address for use by Interrupt routine +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +STRATEGY1 PROC FAR ;; + PUSH BX ;; + PUSH BX ;; + LEA BX, BUF1 ;; BUF = BUF1 CS:[BX] + POP buf.RH_PTRO ;; offset of request header + MOV buf.RH_PTRS,ES ;; segment + POP BX ;; + RET ;; +STRATEGY1 ENDP ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; LPT2 Device "strategy" entry point +;; +;; Retain the Request Header address for use by Interrupt routine +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +STRATEGY2 PROC FAR ;; + PUSH BX ;; + PUSH BX ;; + LEA BX, BUF2 ;; BUF = BUF2 CS:[BX] + POP buf.RH_PTRO ;; offset of request header + MOV buf.RH_PTRS,ES ;; segment + POP BX ;; + RET ;; +STRATEGY2 ENDP ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; LPT3 Device "strategy" entry point +;; +;; Retain the Request Header address for use by Interrupt routine +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +STRATEGY3 PROC FAR ;; + PUSH BX ;; + PUSH BX ;; + LEA BX, BUF3 ;; BUF = BUF3 CS:[BX] + POP buf.RH_PTRO ;; offset of request header + MOV buf.RH_PTRS,ES ;; segment + POP BX ;; + RET ;; +STRATEGY3 ENDP ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Table of command / functions supported by LPTn +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; CMD_CODES code supported by LPTn + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +CMD_CODES LABEL BYTE ;; + DB CMD_INI ;; Initialization + DB CMD_WRT ;; output + DB 09 ;; output + DB 12 ;; output +CMD_INDX EQU ($-CMD_CODES) ;; number of entries in CMD_CODES + ;; + ;; Write (CMD_WRT) has exceptional + ;; support by LPTn + ;; + ;; Generic IOCTL (CMD_GIO) leads to + ;; GIO_CODES + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; GIO_CODES code supported by LPTn + ;; -- command = CMD_GIO and + ;; major function = MAF_PTR + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +GIO_CODES LABEL BYTE ;; minor GIO functions supported : + DB MIF_DST ;; - designate start + DB MIF_DEN ;; - designate end + DB MIF_IVK ;; - invoke + DB MIF_QIV ;; - query-invoked + DB MIF_QLS ;; - query-list +GIO_INDX EQU ($-GIO_CODES) ;; number of entries in GIO_CODES + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Cases supported by LPTn + ;; -- first section matched with + ;; CMD_CODES upto CMD_INDX + ;; + ;; -- 2nd section matched with + ;; GIO_CODES for GIO_INDEX more + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +CASES LABEL WORD ;; in CMD_CODES order + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW OFFSET INIT ;; 0 - Initialization + DW OFFSET WRITE ;; + DW OFFSET WRITE ;; + DW OFFSET WRITE ;; + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; in GIO_CODES order + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + DW OFFSET DESIGNATE_START ;; + DW OFFSET DESIGNATE_END ;; + DW OFFSET INVOKE ;; + DW OFFSET Q_INVOKED ;; + DW OFFSET Q_LIST ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; Memory Allocation +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; + ;; +MEM_REQUEST DW -1 ;; flag used for first time memory + ;; allocation for each device + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; PRN Device "interrupt" entry point +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +INTERRUPT0 PROC FAR ;; device interrupt entry point + ;; + PUSH DS ;; save all registers Revised + PUSH ES ;; + PUSH AX ;; + PUSH BX ;; + PUSH CX ;; + PUSH DX ;; + PUSH DI ;; + PUSH SI ;; + ;; BP isn't used, so it isn't saved + push cs ;; + pop ds ;; + ;; + CMP STACK_ALLOCATED,0AAH ;; + JNE PRN_NO_STACK ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; STACK RECODING SEPT 28/86 +; +; GORDON GIDDINGS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + MOV AX,STACK_SIZE ;G; + SHL AX,1 ;G; + SHL AX,1 ;G; + SHL AX,1 ;G; + SHL AX,1 ;G; + MOV CS:TEMP_SI,SI ;G; + MOV SI,RESIDENT_END ;G; + SUB SI,STACK_SIZE ;G; + ;G; + mov reserved1,AX ;G; + mov reserved2,SI ;G; + ;G; + CLI ;G; + MOV DX,SS ;G; + MOV CX,SP ;G; + MOV SS,SI ;G; + MOV SP,AX ;G; + STI ;G; + MOV SI,CS:TEMP_SI ;G; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + PUSH DX ;; SAVE OLD SS ONTO STACK + PUSH CX ;; " " SP " " + ;; +PRN_NO_STACK : ;; + ;; + ;; + MOV DI,OFFSET IRPT_CMD_EXIT ;; return addr from command processor + ;; + PUSH DI ;; push return address onto stack + ;; command routine issues "RET" + ;; + LEA BX, BUF0 ;; PRN BUF = BUF0 , CS:BX + ;; + MOV MEM_REQUEST,-1 ;; to be set to zero only once + ;; + CMP BUF.BFLAG,-1 ;; + JNE PRN_INITED ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + MOV BUF.BFLAG,BF_PRN ;; INITIALIZE PRN BUFFER + ;; + MOV DI,OFFSET DEV_HDR0 ;; PRN Device header + MOV BUF.DEV_HDRO,DI ;; + MOV BUF.DEV_HDRS,CS ;; must be CS + ;; + MOV DI,OFFSET HBUF_SL1 ;; PRN/LPT1 buffer for Hardware-slots + MOV BUF.HRBUFO,DI ;; + ;; + MOV DI,OFFSET RBUF_SL1 ;; PRN/LPT1 buffer for RAM-slots + MOV BUF.RMBUFO,DI ;; + ;; + MOV DI,OFFSET FTDL_OFF1 ;; + MOV BUF.FTDLO,DI ;; + ;; + MOV DI,OFFSET REQ_NORM1 ;; PRN/LPT1 request header + MOV BUF.RNORMO,DI ;; + ;; + MOV BUF.FSELEN,0 ;; selection control length + ;; + mov buf.prn_bufo,offset buf0;; + ;; + JMP COMMON_INTR ;; common interrupt handler + ;; +PRN_INITED : ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; FONT BUFFER TO BE CREATED ? + CMP BUF.BFLAG,BF_PRN ;; + JNE PRN_MEM_DONE ;; + ;; + OR BUF.BFLAG,BF_MEM_DONE ;; do it only once. + ;; + CMP BUF.STATE,CPSW ;; + JNE PRN_MEM_DONE ;; create only if state is CPSW + ;; +PRN_MEM_CREATE : ;; + XOR AX,AX ;; THEN CREATE + MOV MEM_REQUEST,AX ;; to set to zero only once for each + ;; LPTn or PRN +PRN_MEM_DONE : ;; + JMP COMMON_INTR ;; common interrupt handler + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; LPT1 Device "interrupt" entry point +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +INTERRUPT1 PROC FAR ;; device interrupt entry point + ;; + PUSH DS ;; save all registers Revised + PUSH ES ;; + PUSH AX ;; + PUSH BX ;; + PUSH CX ;; + PUSH DX ;; + PUSH DI ;; + PUSH SI ;; + ;; BP isn't used, so it isn't saved + push cs ;; + pop ds ;; + ;; + CMP STACK_ALLOCATED,0AAH ;; + JNE LPT1_NO_STACK ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; STACK RECODING SEPT 28/86 +; +; GORDON GIDDINGS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + MOV AX,STACK_SIZE ;G; + SHL AX,1 ;G; + SHL AX,1 ;G; + SHL AX,1 ;G; + SHL AX,1 ;G; + MOV CS:TEMP_SI,SI ;G; + MOV SI,RESIDENT_END ;G; + SUB SI,STACK_SIZE ;G; + ;G; + mov reserved1,AX ;G; + mov reserved2,SI ;G; + ;G; + CLI ;G; + MOV DX,SS ;G; + MOV CX,SP ;G; + MOV SS,SI ;G; + MOV SP,AX ;G; + STI ;G; + MOV SI,CS:TEMP_SI ;G; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + PUSH DX ;; SAVE OLD SS ONTO STACK + PUSH CX ;; " " SP " " + ;; +LPT1_NO_STACK : ;; + ;; + MOV DI,OFFSET IRPT_CMD_EXIT ;; return addr from command processor + ;; + PUSH DI ;; push return address onto stack + ;; command routine issues "RET" + LEA BX, BUF1 ;; LPT1 BUF = BUF1 , CS:BX + ;; + MOV MEM_REQUEST,-1 ;; to be set to zero only once + ;; + CMP BUF.BFLAG,-1 ;; + JNE LPT1_INITED ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + MOV BUF.BFLAG,BF_LPT1 ;; INITIALIZE LPT1 BUFFER + ;; + MOV DI,OFFSET DEV_HDR1 ;; LPT1 Device header + MOV BUF.DEV_HDRO,DI ;; + MOV BUF.DEV_HDRS,CS ;; must be CS + ;;.................................... + LEA DI,BUF.RNORMO ;; duplicate common infor. between + PUSH CS ;; PRN and LPT1 + POP ES ;; + LEA CX,BUF.BUFEND ;; + SUB CX,DI ;; + LEA SI, BUF0 ;; + LEA SI,[SI].RNORMO ;; + REP MOVS ES:BYTE PTR[DI],CS:[SI] + ;; + JMP COMMON_INTR ;; common interrupt handler + ;; +LPT1_INITED : ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; FONT MEMORY TO BE CREATED ? + CMP BUF.BFLAG,BF_LPT1 ;; + JNE LPT1_MEM_DONE ;; + ;; + OR BUF.BFLAG,BF_MEM_DONE ;; no more next time + ;; + CMP BUF.STATE,CPSW ;; + JNE LPT1_MEM_DONE ;; do it only if state is CPSW + ;; +LPT1_MEM_CREATE : ;; + XOR AX,AX ;; THEN CREATE MEMORY + MOV MEM_REQUEST,AX ;; to set to zero only once for each + ;; +LPT1_MEM_DONE : ;; + ;; + JMP COMMON_INTR ;; common interrupt handler + ;; +INTERRUPT1 ENDP ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; LPT2 Device "interrupt" entry point +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +INTERRUPT2 PROC FAR ;; device interrupt entry point + ;; + PUSH DS ;; save all registers Revised + PUSH ES ;; + PUSH AX ;; + PUSH BX ;; + PUSH CX ;; + PUSH DX ;; + PUSH DI ;; + PUSH SI ;; + ;; BP isn't used, so it isn't saved + push cs ;; + pop ds ;; + ;; + CMP STACK_ALLOCATED,0AAH ;; + JNE LPT2_NO_STACK ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; STACK RECODING SEPT 28/86 +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + MOV AX,STACK_SIZE ;G; + SHL AX,1 ;G; + SHL AX,1 ;G; + SHL AX,1 ;G; + SHL AX,1 ;G; + MOV CS:TEMP_SI,SI ;G; + MOV SI,RESIDENT_END ;G; + SUB SI,STACK_SIZE ;G; + ;G; + mov reserved1,AX ;G; + mov reserved2,SI ;G; + ;G; + CLI ;G; + MOV DX,SS ;G; + MOV CX,SP ;G; + MOV SS,SI ;G; + MOV SP,AX ;G; + STI ;G; + MOV SI,CS:TEMP_SI ;G; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + PUSH DX ;; SAVE OLD SS ONTO STACK + PUSH CX ;; " " SP " " + ;; +LPT2_NO_STACK : ;; + ;; + MOV DI,OFFSET IRPT_CMD_EXIT ;; return addr from command processor + ;; + PUSH DI ;; push return address onto stack + ;; command routine issues "RET" + ;; + LEA BX, BUF2 ;; LPT2 BUF = BUF2 , CS:BX + ;; + MOV MEM_REQUEST,-1 ;; to be set to zero only once + ;; + CMP BUF.BFLAG,-1 ;; + JNE LPT2_INITED ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + MOV BUF.BFLAG,BF_LPT2 ;; initialise LPT2 buffer + ;; + MOV DI,OFFSET DEV_HDR2 ;; LPT2 Device header + MOV BUF.DEV_HDRO,DI ;; + MOV BUF.DEV_HDRS,CS ;; must be CS + ;; + MOV DI,OFFSET HBUF_SL2 ;; LPT2 buffer for Hardware-slots + MOV BUF.HRBUFO,DI ;; + ;; + MOV DI,OFFSET RBUF_SL2 ;; LPT2 buffer for RAM-slots + MOV BUF.RMBUFO,DI ;; + ;; + MOV DI,OFFSET FTDL_OFF2 ;; + MOV BUF.FTDLO,DI ;; + ;; + ;; + MOV DI,OFFSET REQ_NORM2 ;; LPT2 request header + MOV BUF.RNORMO,DI ;; + ;; + MOV BUF.FSELEN,0 ;; selection control length + ;; + mov buf.prn_bufo,offset buf2;; + ;; + JMP COMMON_INTR ;; common interrupt handler + ;; +LPT2_INITED : ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; FONT BUFFER TO BE CREATED ? + CMP BUF.BFLAG,BF_LPT2 ;; + JNE LPT2_MEM_DONE ;; + ;; + OR BUF.BFLAG,BF_MEM_DONE ;; + ;; + CMP BUF.STATE,CPSW ;; + JNE LPT2_MEM_DONE ;; + ;; + XOR AX,AX ;; + MOV MEM_REQUEST,AX ;; to set to zero only once for each + ;; LPTn or PRN +LPT2_MEM_DONE : ;; + ;; + JMP COMMON_INTR ;; common interrupt handler + ;; +INTERRUPT2 ENDP ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; LPT3 Device "interrupt" entry point +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +INTERRUPT3 PROC FAR ;; device interrupt entry point + ;; + PUSH DS ;; save all registers Revised + PUSH ES ;; + PUSH AX ;; + PUSH BX ;; + PUSH CX ;; + PUSH DX ;; + PUSH DI ;; + PUSH SI ;; + ;; BP isn't used, so it isn't saved + push cs ;; + pop ds ;; + ;; + CMP STACK_ALLOCATED,0AAH ;; + JNE LPT3_NO_STACK ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; STACK RECODING SEPT 28/86 +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + MOV AX,STACK_SIZE ;G; + SHL AX,1 ;G; + SHL AX,1 ;G; + SHL AX,1 ;G; + SHL AX,1 ;G; + MOV CS:TEMP_SI,SI ;G; + MOV SI,RESIDENT_END ;G; + SUB SI,STACK_SIZE ;G; + ;G; + mov reserved1,AX ;G; + mov reserved2,SI ;G; + ;G; + CLI ;G; + MOV DX,SS ;G; + MOV CX,SP ;G; + MOV SS,SI ;G; + MOV SP,AX ;G; + STI ;G; + MOV SI,CS:TEMP_SI ;G; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + PUSH DX ;; SAVE OLD SS ONTO STACK + PUSH CX ;; " " SP " " + ;; +LPT3_NO_STACK : ;; + ;; + MOV DI,OFFSET IRPT_CMD_EXIT ;; return addr from command processor + ;; + PUSH DI ;; push return address onto stack + ;; command routine issues "RET" + ;; + LEA BX, BUF3 ;; LPT3 BUF = BUF3 , CS:BX + ;; + MOV MEM_REQUEST,-1 ;; to be set to zero only once + ;; + CMP BUF.BFLAG,-1 ;; + JNE LPT3_INITED ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + MOV BUF.BFLAG,BF_LPT3 ;; INITIALIZE LPT3 BUFFER + ;; + MOV DI,OFFSET DEV_HDR3 ;; LPT3 Device header + MOV BUF.DEV_HDRO,DI ;; + MOV BUF.DEV_HDRS,CS ;; must be CS + ;; + MOV DI,OFFSET HBUF_SL3 ;; LPT3 buffer for Hardware-slots + MOV BUF.HRBUFO,DI ;; + ;; + MOV DI,OFFSET RBUF_SL3 ;; LPT3 buffer for RAM-slots + MOV BUF.RMBUFO,DI ;; + ;; + MOV DI,OFFSET FTDL_OFF3 ;; + MOV BUF.FTDLO,DI ;; + ;; + ;; + MOV DI,OFFSET REQ_NORM3 ;; LPT3 request header + MOV BUF.RNORMO,DI ;; + ;; + MOV BUF.FSELEN,0 ;; selection control length + ;; + mov buf.prn_bufo,offset buf3;; + ;; + JMP COMMON_INTR ;; common interrupt handler + ;; +LPT3_INITED : ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; FONT BUFFER TO BE CREATED ? + CMP BUF.BFLAG,BF_LPT3 ;; + JNE LPT3_MEM_DONE ;; + ;; + OR BUF.BFLAG,BF_MEM_DONE ;; no more next time + ;; + CMP BUF.STATE,CPSW ;; + JNE LPT3_MEM_DONE ;; + ;; + XOR AX,AX ;; + MOV MEM_REQUEST,AX ;; to set to zero only once for each + ;; LPTn or PRN +LPT3_MEM_DONE : ;; + ;; + JMP COMMON_INTR ;; common interrupt handler + ;; +INTERRUPT3 ENDP ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Common interrupt entry : +; at entry, BUFn (CS:BX) of LPTn is defined +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +COMMON_INTR : ;; + CLD ;; all moves forward +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Check if header link has to be set +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + LDS SI,DWORD PTR BUF.DEV_HDRO ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; device header : DS:[SI] + CMP BUF.LPT_STRAO, -1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + JNE DOSLPT_FOUND ;; has been linked to DOS LPTn + CMP BUF.LPT_STRAS, -1 ;; + JNE DOSLPT_FOUND ;; has been linked to DOS LPTn + LDS SI,DWORD PTR BUF.DEV_HDRO ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; next device header : ES:[DI] + LES DI,DWORD PTR HP.DH_NEXTO ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + PUSH ES ;; + POP AX ;; + AND AX,AX ;; + JNZ L1 ;; + JMP DOSLPT_FOUND ;; link not yet set up + ;; +;$SEARCH WHILE ;; pointer to next device header is NOT +L1: + PUSH ES ;; -1 + POP AX ;; + CMP AX,-1 ;; +;$LEAVE E, AND ;; leave if both offset and segment are + JNE NOT0FFFF + + CMP DI,-1 ;; 0FFFFH +;$LEAVE E ;; + JE L2 + +NOT0FFFF: ;; + PUSH DI ;; + PUSH SI ;; + MOV CX,NAME_LEN ;; + LEA DI,NHD.DH_NAME ;; + LEA SI,HP.DH_NAME ;; + REPE CMPSB ;; + POP SI ;; + POP DI ;; + AND CX,CX ;; + +;$EXITIF Z ;; exit if name is found in linked hd. + JNZ L3 ;; name is not found + ;; + ;; name is found in the linked header + MOV AX,NHD.DH_STRAO ;; get the STRATEGY address +; ADD AX,DI ;; + MOV BUF.LPT_STRAO,AX ;; + MOV AX,ES ;; +; JNC X1 ;; +; ADD AX,1000H ;; carrier overflow +X1: MOV BUF.LPT_STRAS,AX ;; + ;; + MOV AX,NHD.DH_INTRO ;; get the INTERRUPT address +; ADD AX,DI ;; + MOV BUF.LPT_INTRO,AX ;; + MOV AX,ES ;; +; JNC X2 ;; +; ADD AX,1000H ;; carrier overflow +X2: MOV BUF.LPT_INTRS,AX ;; + ;; + ;; +;$ORELSE ;; find next header to have the same + ;; device name + JMP L4 ;; +L3: ;; + LES DI,DWORD PTR NHD.DH_NEXTO ; + ;; +;$ENDLOOP ;; + JMP L1 ;; +L2: ;; +;$ENDSRCH ;; +L4: ;; + ;; +DOSLPT_FOUND : ;; device header link has been + ;; established + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; COMMAND REQUEST +; ES:DI Request Header , and +; +; CMD_CODES, GIO_CODES +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; + LES DI,dword ptr buf.rh_ptro ;; get RH address passed to + ;; + MOV AL,RH.RHC_CMD ;; + CMP AL,CMD_GIO ;; + JE GIO_COMMAND ;; + ;; + PUSH CS ;; non-GIO command + POP ES ;; + MOV DI,OFFSET CMD_CODES ;; + MOV CX,CMD_INDX ;; + ;; find if command is in CMD_CODES ? + REPNE SCASB ;; + JNE UN_SUP ;; + MOV SI,CMD_INDX ;; the command is supported : + SUB SI,CX ;; + DEC SI ;; index to CASES + JMP SUPPORTED ;; + ;; +UN_SUP: JMP NORM_DRIVER ;; to be handled by DOS normal driver + ;; +GIO_COMMAND : ;; Check if it is valid GIO + ;; +GIO_CASES : ;; supported GIO command + MOV AL,RH.GIH_MIF ;; + ;; use minor function to locate + PUSH CS ;; + POP ES ;; + MOV DI,OFFSET GIO_CODES ;; + MOV CX,GIO_INDX ;; + ;; find if command is in GIO_CODES ? + REPNE SCASB ;; + JNE NORM_DRIVER ;; + MOV SI,GIO_INDX ;; the command is supported : + SUB SI,CX ;; + DEC SI ;; index to CASES + ADD SI,CMD_INDX ;; + ;; +SUPPORTED : ;; command/functions supported by LPTn + ;; + ADD SI,SI ;; double to index to WORD-offset + ;; + XOR AX,AX ;; initialize return to "no error" + ;; + LES DI,dword ptr buf.rh_ptro ;; get RH address again + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; At entry to command processing routine: +; +; ES:DI = Request Header address +; CS:BX = Buffer for lptn +; CS = code segment address +; AX = 0 +; +; top of stack is return address, IRPT_CMD_EXIT +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + JMP CS:CASES[SI] ;; call routine to handle the command + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +IRPT_CMD_EXIT: ;; return from command routine + ;; AX = value to OR into status word + LES DI,dword ptr buf.rh_ptro ;; restore ES:DI as Request Header ptr + MOV AX,RH.RHC_STA ;; + OR AH,STAT_DONE ;; add "done" bit to status word + MOV RH.RHC_STA,AX ;; store status into request header + ;; + ;; + ;; *** USING INTERNATL STACK ? *** + ;; + CMP STACK_ALLOCATED,-1 ;; + JE RET0_NO_STACK ;; + ;; + CMP STACK_ALLOCATED,0 ;; + JNE RET0_IN_STACK ;; + ;; + MOV STACK_ALLOCATED,0AAH ;; NEXT interrupt will start using + JMP RET0_NO_STACK ;; internal STACK + ;; +RET0_IN_STACK : ;; use internal STACK !!!! + POP CX ;get old SP from stack + POP DX ;get old SS from stack + CLI ;disable interrupts while changing SS:SP + MOV SS,DX ;restore stack segment register + MOV SP,CX ;restore stack pointer register + STI ;enable interrupts + ;; + ;; +RET0_NO_STACK : ;; + ;; + POP SI ;; restore registers + POP DI ;; + POP DX ;; + POP CX ;; + POP BX ;; + POP AX ;; + POP ES ;; + POP DS ;; + RET ;; + ;; +INTERRUPT0 ENDP ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;==== Command not supported by CPSW device driver +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +NORM_DRIVER PROC ;; LPT OUTPUT to the DOS LPTn + ;; + PUSH BX ;; **** BUF. is changed **** + PUSH BX ;; + POP SI ;; + LES BX,DWORD PTR BUF.RH_PTRO ;; pass the request header to the + CALL DWORD PTR CS:[SI].LPT_STRAO ;; LPTn strategy routine. + ;; + POP BX ;; + CALL DWORD PTR BUF.LPT_INTRO ;; interrupt the DOS LPTn + RET ;; + ;; +NORM_DRIVER ENDP ;; + ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;==== Command Code - lpt_output ======= +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +WRITE PROC ;; LPT OUTPUT to the DOS LPTn + ;; + ;; + ;; + LES DI,dword ptr buf.rh_ptro ;; restore ES:DI as Request Header ptr + ;; + MOV AX,BUF.STATE ;; + CMP AX,NORMAL ;; + JNE WRT_NOT_NORMAL ;; + JMP WRT_NORMAL ;; + ;; +WRT_NOT_NORMAL : ;; + CMP AX,DESG_END ;; + JNE WRT_FONT ;; + JMP NO_MORE_FTBLK ;; ignore the write + ;; +WRT_FONT : ;; + CMP AX,DESG_WR ;; + JE WRT_DESIGNATE ;; + JMP WRT_NORMAL ;; + ;;------------------------- +WRT_DESIGNATE : ;; DESIGNATE WRITE + MOV AX,BUF.STATUS ;; + AND AX,FAIL ;; + JZ WRT_DESG_GOOD ;; + JMP WRT_IGNORE ;; already failed + ;; +WRT_DESG_GOOD : ;; + MOV SI,OFFSET FTABLE ;; + PUSH CS ;; + POP DS ;; + ;; + MOV DS:[SI].FLAG,0 ;; no restart + MOV AX,RH.RH3_CNT ;; + MOV DS:[SI].BUFFER_LEN,AX ;; length of request packet + ;; + PUSH SI ;; + LEA SI,[SI].BUFFER_ADDR ;; packet address + MOV AX,RH.RH3_DTAO ;; + MOV DS:[SI],AX ;; + INC SI ;; + INC SI ;; + MOV AX,RH.RH3_DTAS ;; + MOV DS:[SI],AX ;; + POP SI ;; + ;; +FP_CALL : ;; ************************** + CALL FONT_PARSER ;; ** Parse the Font File ** +FP_RETURN : ;; ************************** + ;; + ;; -- only for the RAM slot -- + ;; + ;; PROCESS THE RETURNED FONT : + ;; SI = FTABLE + MOV ES,BUF.FTSTART ;; ES = the start of the font buffer, + ;; its entry corresponds to the + ;; positioning of codepage in slot + MOV DI,BUF.FTSLOTO ;; DI = start of the slot of codepages + ;; CX = slot size of the font downloaded + MOV CX,BUF.RBUFMX ;; --- if there is no designate + MOV AX,BUF.STATUS ;; + AND AX,DSF_CARTCP ;; + JZ CHECK_RETURN ;; + MOV CX,BUF.HSLMX ;; -- with/without designate, <>0 + ;; +CHECK_RETURN : ;; + ;; + MOV DX,CS:[SI].NUM_FTBLK ;; DX = number fo code pages loaded + ;; + ADD SI,TYPE FBUFS ;; SI = points to FTBLK + ;;................................... +PARSE_FTBLK : ;; **** LOOP **** + ;; + ;; + AND DX,DX ;; + JNZ SKIP_SLOT ;; + JMP NO_MORE_FTBLK ;; **** LOOP EXIT (FTBLK end) **** + ;;................................... + ;; **** LOOP (on each FTBLK) **** + ;; + ;; skip on the slot until the codepage +SKIP_SLOT : ;; is one of the downloaded. + AND CX,CX ;; + JNZ LOCATE_SLOT ;; + XOR AX,AX ;; + PUSH AX ;; + POP ES ;; ES = 0, no font storage(less buffer) + JMP SLOT_FOUND ;; + ;; +LOCATE_SLOT: ;; + MOV AX,CS:[DI].SLT_AT ;; + AND AX,AT_load ;; + Jnz SLOT_FOUND ;; + INC DI ;;######## NEXT SLOT ############ + INC DI ;; + INC DI ;; + INC DI ;; next slot + PUSH ES ;; + POP AX ;; + ADD AX,BUF.FTSZPA ;; + PUSH AX ;; + POP ES ;; next buffer + DEC CX ;;#################################### + JMP SKIP_SLOT ;; + ;; +SLOT_FOUND : ;; + MOV AX,CS:[SI].FTB_STATUS ;; + CMP AX,0FFF0H ;; + JNB CHECK_FSTAT ;; + ;; + OR BUF.STATUS,FAIL ;; + ;; + LES DI,dword ptr buf.rh_ptro ;; + MOV RH.RHC_STA,AX ;; + JMP WRITE_RET ;; **** LOOP EXIT (fail) **** + ;; +CHECK_FSTAT : ;; + CMP AX,FSTAT_FONT ;; + JNE NEXT_FTBLK ;; + ;; + MOV AX,CS:[SI].FTB_DLEN ;; + AND AX,AX ;; + JNZ FONT_RETURNED ;; + ;; +NEXT_FTBLK : ;; **** NEXT IN LOOP **** + ;; + ADD SI,TYPE FTBLK ;; SI = points to FTBLK + DEC DX ;; + INC DI ;;######## NEXT SLOT ############ + INC DI ;; + INC DI ;; + INC DI ;; next slot + PUSH ES ;; + POP AX ;; + ADD AX,BUF.FTSZPA ;; + PUSH AX ;; + POP ES ;; next buffer + DEC CX ;;#################################### + JMP PARSE_FTBLK ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +FONT_RETURNED : ;; + ;; ********************************* + ;; * ANY SELECTION CONTROL TO BE * + ;; * STORED ? * + ;; ********************************* + ;; + ;; + ;; SI = points to FTBLK + ;; ES = font buffer segment / 0 + ;; BX = LPT buffer + ;; DI = SLOT pointer + PUSH CX ;; + ;; + ;; + MOV AX,CS:[SI].FTB_SELECT ;; + AND AX,AX ;; + JNZ SELECT_NOT0 ;; + CMP BUF.PCLASS,1 ;; + JNE SELECT_0 ;; + JMP SELECT_BAD ;; CLASS 1 printer CANNOT have SELECT=0 + ;; +SELECT_0: ;; + ;; + POP CX ;; + JMP STORE_FONT ;; + ;; +SELECT_NOT0 : ;; + ;; + CMP BUF.PCLASS,1 ;; + JNE NOT_CLASS1 ;; + JMP SELECT_CLASS1 ;; + ;; +not_class1 : ;; + MOV AX,CS:[SI].FTB_SELLEN ;; has this FTBLK already passed the + AND AX,AX ;; select ? + JNZ SELECT_NOT_PASSED ;; + ;; + POP CX ;; + JMP STORE_FONT ;; + ;; +SELECT_NOT_PASSED : ;; + CMP AX,BUF.FSELMAX ;; + JNA SELECT_NOT_LONG ;; + JMP SELECT_BAD ;; cannot be more than buffer size + ;; + ;; +SELECT_NOT_LONG : ;; + MOV AX,CS:[SI].FTB_SELECT ;; + CMP AX,1 ;; + JE SELECT_1 ;; + JMP SELECT_BAD ;; + ;; +SELECT_1 : ;; + MOV CX,BUF.FSELEN ;; +++ SELECT = 1 +++ + AND CX,CX ;; + JZ CTL_NOT_COPIED ;; + MOV AX,CS:[DI].SLT_AT ;; == copy control only from one FTBLK + AND AX,AT_SELECT ;; + JNZ CTL_NOT_COPIED ;; + JMP SKIP_SELECT ;; + ;; +CTL_NOT_COPIED : ;; + ;; + OR CS:[DI].SLT_AT,AT_SELECT;; the FTBLK where control is copied + ;; from + ;; + MOV CX,CS:[SI].FTB_SELLEN ;; + CMP CX,CS:[SI].FTB_DLEN ;; + JNA STORE_SELECT ;; + ;; + MOV CX,CS:[SI].FTB_DLEN ;; + ;; +STORE_SELECT: ;; + PUSH CX ;; CX is the length to be copied. + ;; + PUSH ES ;; + PUSH DS ;; + PUSH SI ;; + PUSH DI ;; + ;; + MOV AX,CS:[SI].FTB_DAHI ;; + PUSH AX ;; + POP DS ;; + MOV SI,CS:[SI].FTB_DALO ;; + ;; + PUSH CS ;; + POP ES ;; + ;; + MOV DI,BUF.PDESCO ;; + MOV DI,CS:[DI].SELB_O ;; + ADD DI,BUF.FSELEN ;; + ;; + REP MOVSB ;; + ;; + ;; + POP DI ;; + POP SI ;; + POP DS ;; + POP ES ;; + ;; + POP CX ;; + SUB CS:[SI].FTB_DLEN,CX ;; + SUB CS:[SI].FTB_SELLEN,CX ;; == less control bytes to be copied + ADD CS:[SI].FTB_DALO,CX ;; + ADD BUF.FSELEN,CX ;; + ;; + POP CX ;; + ;; + ;; any data left for font ? + CMP BUF.PCLASS,1 ;; + JNE MORE_FONT ;; + ;; + JMP NEXT_FTBLK ;; == CLASS 1 printer ingnores fonts + ;; +MORE_FONT : ;; more font data ? + ;; + JMP STORE_FONT ;; + ;; +SELECT_CLASS1: ;; +++ PRINTER CLASS = 1 + ;; + MOV AX,CS:[SI].FTB_SELECT ;; + CMP AX,2 ;; + JE GOOD_CLASS1 ;; + JMP SELECT_BAD ;; + ;; select type = 2 only +GOOD_CLASS1 : ;; + POP CX ;; + ;; + PUSH ES ;; STACKS... + PUSH DX ;; + PUSH DI ;; + MOV AX,DI ;; + SUB AX,BUF.FTSLOTO ;; + SHR AX,1 ;; + PUSH AX ;; stack 1 -- offest + MOV DI,BUF.FTDLO ;; + ADD DI,AX ;; + ;; + MOV AX,CS:WORD PTR [DI] ;; length copied to font buffer + ;; + POP DX ;; stack -1 + SHR DX,1 ;; + PUSH DI ;; STACK +1 -- to font buffer length + MOV DI,BUF.FTSTART ;; +CTL_ADDR : ;; + AND DX,DX ;; + JZ CTL_LOCATED ;; + ADD DI,BUF.FTSZPA ;; + DEC DX ;; + JNZ CTL_ADDR ;; + ;; +CTL_LOCATED : ;; + PUSH DI ;; + POP ES ;; + XOR DI,DI ;; start of the font buffer + MOV CX,CS:[SI].FTB_SELLEN ;; + AND AX,AX ;; + JNZ HASBEEN_COPIED ;; + MOV ES:BYTE PTR [DI],CL ;; 1st byte is the length + INC AX ;; + ;; +HASBEEN_COPIED : ;; + ;; + ADD DI,AX ;; + DEC AX ;; + CMP AX,CX ;; all copied ? + JB COPY_SELECT ;; + ;; + POP DI ;; STACK -1 + ;; + POP DI ;; STACKS... + POP DX ;; + POP ES ;; + MOV CX,CS:[SI].FTB_DLEN ;; all font data for this code page is + SUB CS:[SI].FTB_DLEN,CX ;; discarded + ADD CS:[SI].FTB_DALO,CX ;; + ;; + JMP NEXT_FTBLK ;; + ;; +COPY_SELECT : ;; + ;; + SUB CX,AX ;; + CMP CX,CS:[SI].FTB_DLEN ;; + JNA FONT_SELECT ;; + ;; + MOV CX,CS:[SI].FTB_DLEN ;; + ;; +FONT_SELECT : ;; + ;; + PUSH CX ;; STACK +2 + ;; + PUSH DS ;; STACK +3 + PUSH SI ;; STACK +4 + ;; + MOV AX,CS:[SI].FTB_DAHI ;; + PUSH AX ;; + POP DS ;; + MOV SI,CS:[SI].FTB_DALO ;; + ;; + PUSH DI ;; STACK +5 + ;; + REP MOVSB ;; + ;; + POP DI ;; STACK -5 + POP SI ;; STACK -4 + POP DS ;; STACK -3 + ;; + POP CX ;; STACK -2 + ADD CX,DI ;; + POP DI ;; STACK -1 + MOV CS:WORD PTR [DI],CX ;; + ;; + MOV CX,CS:[SI].FTB_DLEN ;; all font data for this code page is + SUB CS:[SI].FTB_DLEN,CX ;; discarded + ADD CS:[SI].FTB_DALO,CX ;; + ;; + POP DI ;; + POP DX ;; + POP ES ;; + ;; + JMP NEXT_FTBLK ;; + ;; + ;; +SKIP_SELECT : ;; ++ SKIP SELECT ++ + ;; + MOV CX,CS:[SI].FTB_SELLEN ;; + CMP CX,CS:[SI].FTB_DLEN ;; + JNA SKIP_ALL_SELLEN ;; + MOV CX,CS:[SI].FTB_DLEN ;; + ;; +SKIP_ALL_SELLEN : ;; + SUB CS:[SI].FTB_DLEN,CX ;; + SUB CS:[SI].FTB_SELLEN,CX ;; == less control bytes to be skipped + ADD CS:[SI].FTB_DALO,CX ;; + ;; + POP CX ;; + JMP STORE_FONT ;; + ;; +SELECT_BAD : ;; ++ BAD SELECT ++ + ;; + POP CX ;; + ;; + LES DI,dword ptr buf.rh_ptro ;; + MOV RH.RHC_STA,STAT_BADATA ;; + ;; + OR BUF.STATUS,FAIL ;; + ;; + JMP WRITE_RET ;; + ;; + ;; + ;; ************************************* + ;; * FONT TO BE STORED OR DOWNLOADED ? * + ;; ************************************* + ;; + ;; SI = points to FTBLK + ;; ES = font buffer segment / 0 + ;; BX = LPT buffer + ;; DI = SLOT pointer +STORE_FONT : ;; + ;; + CMP CS:[SI].FTB_DLEN,0 ;; any font data left ? + JNZ HAS_FONT_DATA ;; + JMP NEXT_FTBLK ;; + ;; +HAS_FONT_DATA : ;; + PUSH ES ;; + POP AX ;; + AND AX,AX ;; + JNZ STORE_FONT_BUFFER ;; + JMP FONT_DOWNLOAD ;; + ;; + ;; + ;; +STORE_FONT_BUFFER : ;; ***************************** + PUSH DI ;; ** STORE TO FONT BUFFER ** + ;; ***************************** + PUSH CX ;; + PUSH DS ;; ES = font buffer segment + ;; + ;; -- determine where is the infor : + MOV AX,DI ;; + SUB AX,BUF.FTSLOTO ;; relative to the start of the slot + SHR AX,1 ;; '' '' '' " of FTDL_OFF + ;; + ;; + ADD AX,BUF.FTDLO ;; + MOV DI,AX ;; + ;; + ;;................................... + MOV CX,CS:[SI].FTB_DLEN ;; length of font data + ;; + MOV AX,CS:WORD PTR [DI] ;; current destination + ;; + ADD AX,CX ;; + PUSH AX ;; STACK A (next destination) + ;; + ADD AX,CS:[SI].FTB_DLEFT ;; enough room in font buffer ? + CMP AX,BUF.FTSIZE ;; + JNA ROOM_FOR_FONT ;; + ;; + POP AX ;; STACK A + POP DS ;; + POP CX ;; **** LOOP EXIT (no room) **** + POP DI ;; + ;; + LES DI,dword ptr buf.rh_ptro ;; + MOV RH.RHC_STA,STAT_BADATA ;; + ;; + OR BUF.STATUS,FAIL ;; + ;; + JMP WRITE_RET ;; + ;; +ROOM_FOR_FONT : ;; + ;; + PUSH DI ;; STACK B + ;; + MOV DI,CS:WORD PTR [DI] ;; current destination + ;; + PUSH SI ;; STACK C + PUSH DS ;; STACK D + ;; + MOV AX,CS:[SI].FTB_DAHI ;; + PUSH AX ;; + POP DS ;; source : FTB_DA + MOV SI,CS:[SI].FTB_DALO ;; + ;; + REP MOVSB ;; + ;; + POP DS ;; STACK D + POP SI ;; STACK C + POP DI ;; STACK B + POP AX ;; STACK A + MOV CS:WORD PTR [DI],AX ;; next detination/current length + ;; + POP DS ;; + POP CX ;; + POP DI ;; + ;; + OR CS:[DI].SLT_AT,AT_FONT ;; font buffer has been overwritten + ;; + JMP NEXT_FTBLK ;; + ;; +FONT_DOWNLOAD : ;; *********************************** + ;; * DOWNLOAD FONT TO THE DEVICE : * + PUSH ES ;; *********************************** + PUSH DI ;; + LES DI,dword ptr buf.rh_ptro ;; -- the logic can only support one + ;; physical device slot that can be + ;; downloaded.) + MOV AX,CS:[SI].FTB_DLEN ;; + MOV RH.RH3_CNT,AX ;; + MOV AX,CS:[SI].FTB_DALO ;; + MOV RH.RH3_DTAO,AX ;; + MOV AX,CS:[SI].FTB_DAHI ;; + MOV RH.RH3_DTAS,AX ;; + ;; + MOV RH.RHC_CMD,CMD_WRT ;; 06/25 MODE.COM + ;; + PUSH SI ;; + PUSH ES ;; + PUSH BX ;; **** BUF. is changed **** + PUSH BX ;; + POP SI ;; + LES BX,DWORD PTR BUF.RH_PTRO ;; pass the request header to the + ;; +FDL_CALL_STR : ;; + CALL DWORD PTR CS:[SI].LPT_STRAO ;; LPTn strategy routine. + POP BX ;; + POP ES ;; + POP SI ;; + ;; +FDL_CALL_ITR : ;; + CALL DWORD PTR BUF.LPT_INTRO ;; interrupt the DOS LPTn + ;; +FDL_ITR_RETURN : ;; + MOV AX,rh.RHC_STA ;; + ;; + and ax,stat_error ;; + jz fdl_good1 ;; + mov ax,stat_deverr ;; + mov rh.rhc_sta,ax ;; + ;; +fdl_good1 : ;; + POP DI ;; + POP ES ;; + ;; + AND AX,STAT_ERROR ;; any error returned by normal device? + JNZ FDL_BAD ;; + OR CS:[DI].SLT_AT,AT_RAM1 ;; + JMP NEXT_FTBLK ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +FDL_BAD : ;; **** LOOP EXIT (bad) **** + OR BUF.STATUS,FAIL ;; + ;; + JMP WRITE_RET ;; + ;; +WRT_NORMAL : ;; + ;; + JMP NORM_DRIVER ;; + ;; +WRT_ignore : ;; + ;; + LES DI,dword ptr buf.rh_ptro ;; + MOV RH.RHC_STA,STAT_DEVERR ;; + JMP WRITE_RET ;; + ;; +NO_MORE_FTBLK : ;; + ;; + LES DI,dword ptr buf.rh_ptro ;; + MOV RH.RHC_STA,0 ;; + ;; +WRITE_RET : ;; + RET ;; + ;; +WRITE ENDP ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;==== Generic IOCTL Designate Start ====== +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +DESIGNATE_START PROC ;; + MOV AX,BUF.STATE ;; + CMP AX,NORMAL ;; + JNE DS_00 ;G; ALL OF THESE EXTRA JUMPS ARE + JMP DST_NORMAL ;; DUE TO SIZE OF FOLLOWING CODE!!!!! +DS_00: CMP AX,CPSW ;; WGR ;AN000; + JE DS_01 ;G; + CMP AX,LOCKED ;; WGR ;AN000; + JE DS_03 ;; WGR ;AN000; + JMP DST_CMDERR ;G; + +DS_01: CALL CHECK_PRINT_ACTIVE ;G; THIS WILL FIND OUT IF THE + JNC DS_02 ;G; +DS_03: ;; WGR ;AN000; + JMP DST_DEVERR ;G; PRINT.COM IS ACTIVE, CY=1 MEANS YES + ;G; +DS_02: LDS SI,RH.GIH_GBA ;; GIOB = DS:[SI] + MOV AX,GIOB.GB1_FLAG ;; + AND AX,DSF_CARTCP ;; + JNZ dst_deverr ;; DO NOT SUPPORT CARTRIDGE FLAG !!!! + ;; + ;; ****************************** + ;; ** DESIGNATE / REFRESH ? ** + ;; ****************************** + ;; check the LENGTH in BUFFER1 + ;; + MOV CX,GIOB.GB1_LEN ;; + AND CX,CX ;; + JNZ DST_NOT_NULL ;; + ;; + mov cs:init_chk,0fefeh ;; + ;; + JMP DST_REFRESH ;; null lenght ==> refresh + ;; +DST_NOT_NULL : ;; + MOV AX,CX ;; + SHR AX,1 ;; divide by 2 + MOV CX,AX ;; + MOV AX,STAT_CMDERR ;; error if LEN < 2 + AND CX,CX ;; + JZ DST_RET ;; + DEC CX ;; + JNZ NO_REFRESH ;; + ;; + MOV AX,GIOB.GB1_NUM ;; + AND AX,AX ;; + MOV AX,STAT_BADATA ;; + JNZ DST_RET ;; error, as no code pages followed + ;; + mov cs:init_chk,0ffeeh ;; + ;; + ;; + JMP DST_REFRESH ;; null length => REFRESH font from + ;; font buffer to device + ;; ********************************* + ;; ** DESIGNATE FOR CARTRIDGE ? ** +NO_REFRESH : ;; ********************************* + ;; CX = number of codepages designated + CMP BUF.PCLASS,1 ;; CLASS 1 Printer ? + JNE DST_RAM ;; + JMP DST_CART ;; + ;; +DST_RAM : ;; + ;; + MOV AX,DSF_CARTCP ;; RAM-code pages + NOT AX ;; + AND BUF.STATUS,AX ;; not CARTCP + MOV DI,BUF.RMBUFO ;; DI + MOV DX,BUF.RSLMX ;; DX = number of designate allowed + ;; (limited by available slots) + MOV AX,STAT_TOMANY ;; + CMP CX,DX ;; more codepages than supported ? + JA DST_RET ;; + ;; + JMP DST_DESIGNATE ;; + ;; +DST_NORMAL : ;; + push cs ;; + pop ds ;; + JMP NORM_DRIVER ;; + ;; +DST_DEVERR : ;; + MOV AX,STAT_DEVERR ;; + JMP DST_RET ;G; + ;; +DST_CMDERR : ;G; + MOV AX,STAT_CMDERR ;G; +DST_RET : ;; + JMP DST_RETURN ;; + ;; +DST_CART: ;; + MOV AX,DSF_CARTCP ;; Hardware code pages + OR BUF.STATUS,AX ;; + MOV DI,BUF.HRBUFO ;; DI + MOV DX,BUF.HSLMX ;; DX = number of slots available + MOV AX,DX ;; + SUB AX,BUF.HARDMX ;; no. of designate allowed + ;; + CMP CX,AX ;; more codepages than supported ? + MOV AX,STAT_TOMANY ;; + JA DST_RET ;; +;;--------------------------------------------------------------------------- + ;; ************************************* +DST_DESIGNATE : ;; * any duplicated codepages in MODE ?* + ;; * define the slot-buffer * + ;; ************************************* + ;; + ;; -- Use the buffer to hold the code + ;; page value in the MODE with the + ;; position correspondence : + ;; 1. reset the buffer to all 0FFFFH + ;; 2. if the code page in MODE does not + ;; replicate with any in the buffer, + ;; then store the code page value in + ;; the buffer. + ;; 3. proceed to the next code page in + ;; the MODE to check with what is + ;; already copied to the buffer. + ;; 4. designate will fail if there is a + ;; replication : i.e. a repetition + ;; in the MODE command. + ;; 5. skip the buffer corresponding to + ;; HWCP codepages + ;;------------------------------------- + ;; + PUSH DI ;; (the start of RAM/Hardware buffer) + PUSH DX ;; count of buffer size + MOV AX,0FFFFH ;; +RESET_BUF: ;; + MOV CS:[DI],AX ;; reset all buffer to 0FFFFH + INC DI ;; + INC DI ;; + DEC DX ;; + JNZ RESET_BUF ;; + POP DX ;; + POP DI ;; + ;; + PUSH BX ;; + PUSH DI ;; (the start of RAM/Hardware buffer) + PUSH DX ;; count of buffer size + PUSH SI ;; first code page in GB1 + PUSH CX ;; number of codepages in GB1 + ;; + PUSH SI ;; + ;; + MOV AX,BUF.STATUS ;; + AND AX,DSF_CARTCP ;; + JZ FILL_BUFFER ;; + ;; for cartridge designation + MOV SI,BUF.HARDSO ;; +SKIP_HWCP: ;; + MOV AX,CS:[SI].SLT_AT ;; + AND AX,AT_HWCP ;; + JZ FILL_BUFFER ;; + INC SI ;; skip the hwcp slots, they cannot be + INC SI ;; designated + INC SI ;; + INC SI ;; + INC DI ;; + INC DI ;; + JMP SKIP_HWCP ;; + ;; +FILL_BUFFER : ;; + ;; + POP SI ;; + ;; + PUSH DI ;; + POP BX ;; BX = the positioned buffer + ;; +DST_BUFLP : ;; **** LOOP **** + MOV AX,GIOB.GB1_CP ;; (use GIOB only for codepages) + CMP AX,0FFFFH ;; + JZ DST_BUFNXT ;; + ;; + PUSH CX ;; + ;; compare code page with SLOT-BUFFER + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; SCAN THE BUFFER FOR DUPLICATION + PUSH DX ;; + POP CX ;; no. of buffer entries + ;; + PUSH ES ;; + PUSH DI ;; + PUSH CS ;; + POP ES ;; + REPNE SCASW ;; scan codepage vs. buffer + POP DI ;; + POP ES ;; + ;; + POP CX ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + JNE BUF_DEFINE ;; + ;; + ;; **** EXIT FROM LOOP **** + ;; + POP CX ;; number of codepages in GB1 + POP SI ;; first code page in GB1 + POP DX ;; count of buffer size + POP DI ;; (the start of RAM/Hardware buffer) + POP BX ;; + ;; + MOV AX,STAT_DUPLCP ;; Duplicated code page + JMP DST_RETURN ;; + ;; + ;; +BUF_DEFINE : ;; + MOV CS:[BX],AX ;; no duplicated cp in MODE list + ;; + ;; + ;; **** NEXT IN LOOP **** +DST_BUFNXT: ;; + INC SI ;; (use GIOB only for codepages) + INC SI ;; + INC BX ;; + INC BX ;; + XOR AX,AX ;; + DEC CX ;; + JNZ DST_BUFLP ;; + ;; + ;; + POP CX ;; number of codepages in GB1 + POP SI ;; first code page in GB1 + POP DX ;; count of buffer size + POP DI ;; (the start of RAM/Hardware buffer) + POP BX ;; + ;; + ;; +;;----------------------------------------------------------------------------- + ;;************************************* + ;;* any duplicated codepages bet MODE * + ;;* and code pages in the slot ? * + ;;************************************* + ;; -- for each code page in the slot, + ;; check for any duplication to + ;; code pages in buffer, if the code + ;; page in the slot is not to be + ;; replaced. + ;; -- the designate fails if there is + ;; duplication. + ;; -- copy the codepage in the slot to + ;; the buffer if is not to be + ;; replaced. Mark the slot to be + ;; AT_OLD. + ;; -- if the code page is tobe replaced + ;; mark the STATUS with REPLX. + ;;------------------------------------- + ;; + MOV CX,DX ;; both slots & buffer of same size + ;; --exclude the hwcp which is not + ;; designatable + MOV SI,BUF.HARDSO ;; SI = hardware slot + ;; + MOV AX,BUF.STATUS ;; + AND AX,DSF_CARTCP ;; + JNZ CMP_CP ;; + MOV SI,BUF.RAMSO ;; SI = RAM slot +CMP_CP: ;; + MOV BUF.FTSLOTO,SI ;; + ;; + PUSH DI ;; (the start of RAM/Hardware buffer) + PUSH DX ;; count of buffer size + PUSH SI ;; first entry in RAM/hardware slot + PUSH CX ;; slot size + PUSH BX ;; + ;; + PUSH DI ;; + POP BX ;; BX = the positioned buffer +DST_SLTLP : ;; + ;; **** LOOP **** + ;; + MOV AX,AT_OLD ;; =**= + NOT AX ;; assumed the codepage in slot is new, + AND CS:[SI].SLT_AT,AX ;; to be downloaded if buffer <> 0FFFFH + ;; + AND CS:[SI].SLT_AT,AT_NO_LOAD; -- codepage not to be loaded + AND CS:[SI].SLT_AT,AT_NO_font; -- no font has been loaded + ;; + MOV AX,CS:[SI].SLT_CP ;; + CMP AX,0FFFFH ;; + JZ DST_SLTNXT ;; + ;; + PUSH CX ;; + MOV CX,CS:[BX] ;; + CMP CX,0FFFFH ;; if this slot to be replaced ? + POP CX ;; + JNZ DST_SLTREPLACED ;; YES, the buffer is not empty + ;; + ;; compare code page with SLOT-BUFFER + PUSH CX ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; SCAN THE BUFFER FOR DUPLICATION + PUSH DX ;; + POP CX ;; no. of buffer entries + ;; + PUSH ES ;; + PUSH DI ;; + PUSH CS ;; + POP ES ;; + REPNE SCASW ;; scan codepage vs. buffer + POP DI ;; + POP ES ;; + ;; + POP CX ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + JNE SLT_BUF_DEF ;; + ;; + ;; **** LOOP EXIT **** + ;; + POP BX ;; + POP CX ;; number of codepages in slots + POP SI ;; first entry in RAM/hardware slots + POP DX ;; count of buffer size + POP DI ;; (the start of RAM/Hardware buffer) + ;; + MOV AX,STAT_DUPLCP ;; Duplicated code page + JMP DST_RETURN ;; + ;; + ;; +SLT_BUF_DEF: ;; + MOV CS:[BX],AX ;; no duplicated cp, there was no cp in + ;; =**= + OR CS:[SI].SLT_AT,AT_OLD ;; mark old so as no new font download + ;; + JMP DST_SLTNXT ;; the MODE command for this position + ;; +DST_SLTREPLACED : ;; + PUSH BX ;; + POP AX ;; save the buffer slot-position + POP BX ;; + OR BUF.STATUS,REPLX ;; there are codepage in slots replaced + PUSH BX ;; + PUSH AX ;; + POP BX ;; gets back the buffer position + ;; + ;; **** NEXT IN LOOP **** + ;; +DST_SLTNXT: ;; + INC SI ;; will take whatever is in buffer + INC SI ;; + INC SI ;; + INC SI ;; + INC BX ;; position slot in buffer + INC BX ;; + XOR AX,AX ;; + DEC CX ;; + JNZ DST_SLTLP ;; + ;; + ;; + POP BX ;; + POP CX ;; slot size + POP SI ;; first entry in RAM/hardware slots + POP DX ;; count of buffer size + POP DI ;; (the start of RAM/Hardware buffer) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;;************************************ + ;;* prepare the FTABLE * + ;;************************************ + ;; + ;; -- CX slot / buffer size + ;; SI slot + ;; DI buffer + ;;------------------------------------ + PUSH BX ;; STACK +1 + PUSH SI ;; STACK +2 + ;; =**= + MOV AX,FAIL ;; + NOT AX ;; + AND BUF.STATUS,AX ;; assume it is successful + ;; + ;; +PREPARE_FTB : ;; Prepare for Font Parser + LEA BX,FTABLE ;; + MOV CS:[BX].FLAG,FLAG_RESTART; + MOV CS:[BX].BUFFER_LEN,0 ;; no data packet + MOV CS:[BX].NUM_FTBLK,0 ;; + ;; + ADD BX,TYPE FBUFS ;; points to the first FTBLK. + XOR DX,DX ;; DX = FTBLK entries (no code page yet) + ;; + ;; +GET_CODEPAGE : ;; **** LOOP **** + AND CX,CX ;; + JZ NO_MORE_SLOT ;; + MOV AX,CS:[SI].SLT_AT ;; + AND AX,AT_OLD ;; + JZ NEW_CODEPAGE ;; + ;; + MOV AX,CS:[SI].SLT_AT ;; + AND AX,AT_HWCP ;; + JZ GET_NEXT ;; not NEW and not HWCP + AND CS:[SI].SLT_AT, NOT AT_OLD ;; also load for HWCP + ;; +NEW_CODEPAGE : ;; + MOV AX,CS:[DI] ;; -- SLOT_AT is not old + ;; -- code page in buffer is not 0FFFFH + CMP AX,0FFFFH ;; + JE GET_NEXT ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + INC DX ;; LOAD FONT as : + MOV AX,CS:[DI] ;; codepage in buffer is new code page + ;; + OR CS:[SI].SLT_AT,AT_LOAD ;; set the attribute indicating load + ;; + MOV CS:[BX].FTB_CP,AX ;; + ;; + ADD BX,type ftblk ;; next FTBLK + ;; + ;; +GET_NEXT : ;; **** NEXT IN LOOP **** + INC DI ;; + INC DI ;; next in buffer + INC SI ;; + INC SI ;; + INC SI ;; + INC SI ;; next in slot + DEC CX ;; + JMP GET_CODEPAGE ;; + ;; +NO_MORE_SLOT : ;; **** EXIT LOOP **** + AND DX,DX ;; + JNZ DEFINE_DID ;; + JMP NO_FONT_DOWNL ;; + ;; + ;; ********************************** + ;; ** NEXT STATE = DESIGNATE_WRITE ** + ;; ********************************** + ;; +DEFINE_DID : ;; + POP SI ;; STACK -2 + POP BX ;; STACK -1 + ;; + PUSH BX ;; STACK +1 + PUSH SI ;; STACK +2 + ;; + PUSH DI ;; STACK +3 + PUSH CX ;; STACK +4 + PUSH ES ;; STACK +5 + PUSH DS ;; STACK +6 + ;; + PUSH CS ;; + POP ES ;; + PUSH CS ;; + POP DS ;; + ;; + MOV SI,BX ;; GET THE DEVICE_ID FROM LPTn BUFFER + LEA SI,[SI].PAR_EXTRACTO ;; + MOV SI,CS:[SI].PAR_DIDO ;; + LEA SI,[SI].PAR_DID ;; + ;; + LEA DI,FTABLE ;; + MOV CS:[DI].NUM_FTBLK,DX ;; + ;; + ADD DI,TYPE FBUFS ;; + LEA DI,[DI].FTB_TID ;; + ;; +SET_DID : ;; + MOV CX,8 ;; + PUSH SI ;; + PUSH DI ;; + ;; + REP MOVSB ;; + ;; + POP DI ;; + POP SI ;; + ;; + ADD DI,TYPE FTBLK ;; next DID + DEC DX ;; + JNZ SET_DID ;; + ;; + POP DS ;; STACK -6 + POP ES ;; STACK -5 + POP CX ;; STACK -4 + POP DI ;; STACK -3 + ;; + CALL FONT_PARSER ;; restart font parser + ;; + LEA BX,FTABLE ;; + ADD BX,TYPE FBUFS ;; + CMP CS:[BX].FTB_STATUS,FSTAT_SEARCH + ;; + JE FONT_DOWNL ;; + MOV AX,STAT_DEVERR ;; + POP SI ;; STACK -2 + POP BX ;; STACK -1 + JMP DST_RETURN ;; there is no designate_end if fails + ;; +FONT_DOWNL : ;; + POP SI ;; STACK -2 + POP BX ;; STACK -1 + MOV BUF.STATE,DESG_WR ;; enter DESIGNATE_WRITE state + MOV BUF.FSELEN,0 ;; for font selection control loading + ;; + PUSH CX ;; init the font buffer address of + PUSH DI ;; each codepage + PUSH SI ;; + MOV DI,BUF.FTDLO ;; + ;; + MOV CX,BUF.RSLMX ;; + MOV AX,BUF.STATUS ;; + AND AX,DSF_CARTCP ;; + JZ FTDL_LOOP ;; + MOV CX,BUF.HSLMX ;; + ;; +FTDL_LOOP : ;; + AND CX,CX ;; + JZ FTDL_DONE ;; + mov ax,cs:[si].slt_at ;; + and ax,at_load ;; + jz ftdl_next ;; + ;; + MOV CS:WORD PTR[DI],0 ;; the font length in font buffer is 0 + ;; +ftdl_next : ;; + INC SI ;; + INC SI ;; + INC SI ;; + INC SI ;; + INC DI ;; + INC DI ;; + DEC CX ;; + JMP FTDL_LOOP ;; +FTDL_DONE : ;; + POP SI ;; + POP DI ;; + POP CX ;; + ;; + JMP CHECK_OTHER ;; + ;; + ;; ******************************* + ;; ** NEXT STATE = DSIGNATE_END ** + ;; ******************************* +NO_FONT_DOWNL : ;; + POP SI ;; STACK -2 + POP BX ;; STACK -1 + MOV BUF.STATE,DESG_END ;; proper designate end, ignore write + ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +CHECK_OTHER : ;; + ;; + MOV DX,BUF.STATUS ;; + MOV AX,REPLX ;; + NOT AX ;; + AND AX,DX ;; reset the bit for "replaced" + MOV BUF.STATUS,AX ;; + ;; + XOR AX,AX ;; + AND DX,REPLX ;; + JMP DST_RETURN ;; + ;; only for the FIFO + JMP DST_RETURN ;; + ;; + ;; +DST_REFRESH: ;; ****************************** + ;; ** REFRESH FONT TO DEVICE ** + ;; ****************************** + ;; -- if there is RAM buffer on device + ;; -- if there is font assumed to be + ;; on the device, then + ;; -- load the font to the device, + ;; but no change in slot attributes + ;; + OR BUF.STATUS,REFRESH ;; -- STATE = CPSW (for Designate_end) + ;; + MOV CX,BUF.RSLMX ;; + AND CX,CX ;; + JNZ DST_CHECK_FBUFFER ;; + JMP DST_REF_INVK ;; invoke any active code page + ;; +DST_CHECK_FBUFFER: ;; + MOV DI,BUF.RAMSO ;; + ;; +DST_RAMLP: ;; + MOV AX,CS:[DI].SLT_AT ;; + AND AX,AT_RAM1 ;; + JNZ DST_RAM_LOCATED ;; + INC DI ;; + INC DI ;; + INC DI ;; + INC DI ;; + DEC CX ;; + JNZ DST_RAMLP ;; + JMP DST_REF_INVK ;; there was no font loaded + ;; +DST_RAM_LOCATED: ;; + CMP BUF.RBUFMX,0 ;; ANY FONT BUFFER TO BE COPIED FROM ? + JA DST_HAS_BUFFER ;; + MOV AX,STAT_NOBUFF ;; + mov cs:init_chk,ax ;; + JMP DST_RETURN ;; ERROR !!! + ;; +DST_HAS_BUFFER : ;; + SUB DI,BUF.RAMSO ;; relative to .RAMSO + SHR DI,1 ;; relative to .FTLDO + PUSH DI ;; + ;; + SHR DI,1 ;; the nth + MOV CX,DI ;; + MOV AX,BUF.FTSTART ;; + ;; +DST_LOCATE_FT: ;; + AND CX,CX ;; + JZ DST_FT_LOCATED ;; + ADD AX,BUF.FTSZPA ;; + DEC CX ;; + JNZ DST_LOCATE_FT ;; + ;; +DST_FT_LOCATED: ;; + ;; + POP DI ;; + ADD DI,BUF.FTDLO ;; + MOV CX,CS:WORD PTR [DI] ;; + ;;.................................... + ;; DOWNLOAD THE FONT TO DEVICE + MOV SI,BUF.RNORMO ;; + MOV CS:[SI].RHC_LEN,20 ;; + MOV CS:[SI].RHC_CMD,CMD_WRT ;; + MOV CS:[SI].RH3_CNT,CX ;; + MOV CS:[SI].RH3_DTAO,0 ;; + MOV CS:[SI].RH3_DTAS,AX ;; + ;; + PUSH BX ;; + ;; + PUSH BX ;; + POP DI ;; save BX in DI + PUSH CS ;; + POP ES ;; + MOV BX,SI ;; ES:BX = REQ_NORMn (CS:[SI]) + ;; + CALL DWORD PTR CS:[DI].LPT_STRAO + ;; + CALL DWORD PTR CS:[DI].LPT_INTRO + ;; + POP BX ;; + ;; + MOV AX,CS:[SI].RHC_STA ;; + ;; + and ax,stat_error ;; + jz fdl_good2 ;; + mov ax,stat_deverr ;; + ;; +fdl_good2 : ;; + PUSH AX ;; + AND AX,STAT_ERROR ;; + POP AX ;; + JZ DST_REF_INVK ;; + ;; + ;; +DST_RETURN : ;; + LES DI,dword ptr buf.rh_ptro ;; + MOV RH.RHC_STA,AX ;; + ;; + push cs ;; + pop ds ;; + ;; + RET ;; + ;; + ;; +DST_REF_INVK : ;; INVOKE FOR REFRESH + ;; + ;; ************************************ + ;; * INVOKE HIERIECHY : RAM, HARDWARE * + ;; ************************************ + ;; + MOV DI,BUF.RAMSO ;; check with the ram-slots (DI) + MOV CX,BUF.RSLMX ;; CX = size + AND CX,CX ;; + JZ DST_HWCP_CHK ;; + ;; +DST_RAM_CMP: ;; there are RAM-slots +DST_RAM_LP: ;; + MOV AX,CS:[DI].SLT_AT ;; + AND AX,AT_ACT ;; + JNZ DST_IVK_CP ;; + INC DI ;; + INC DI ;; + INC DI ;; + INC DI ;; + DEC CX ;; + JNZ DST_RAM_LP ;; + ;; +DST_HWCP_CHK : ;; + MOV DI,BUF.HARDSO ;; check with the HWCP-slots (DI) + MOV CX,BUF.Hslmx ;; CX = size + AND CX,CX ;; + JNZ dst_HWCP_cmp ;; + JMP DST_NO_IVK ;; + ;; +DST_HWCP_CMP : ;; +DST_HWCP_LP: ;; + MOV AX,CS:[DI].SLT_AT ;; + AND AX,AT_ACT ;; + JZ DST_HWCP_NEXT ;; + JMP DST_IVK_CP ;; + ;; +DST_HWCP_NEXT : ;; + INC DI ;; + INC DI ;; + INC DI ;; + INC DI ;; + DEC CX ;; + JNZ DST_HWCP_LP ;; + ;; +DST_NO_IVK: ;; + XOR AX,AX ;; + JMP DST_RETURN ;; + ;; +DST_IVK_CP : ;; + PUSH SI ;; + ;; + MOV SI,BUF.RNORMO ;; + MOV AX,SI ;; + ADD AX,TYPE GIH ;; points to buffer + ;; + PUSH AX ;; + LEA SI,[SI].GIH_GBA ;; + MOV CS:WORD PTR [SI],AX + INC SI ;; + INC SI ;; + MOV CS:WORD PTR [SI],CS ;; + POP SI ;; + MOV CS:[SI].GB2_LEN,2 ;; + MOV AX,CS:[DI].SLT_CP ;; + MOV CS:[SI].GB2_CP,AX ;; + ;; + POP SI ;; + PUSH CS ;; define RH = ES:[DI] + POP ES ;; + MOV DI,BUF.RNORMO ;; + ;; + push cs ;; + pop ds ;; + ;; + JMP INVOKE ;; + ;; +DESIGNATE_START ENDP ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;==== Generic IOCTL Designate End ====== +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +DESIGNATE_END PROC ;; + ;; + MOV AX,BUF.STATE ;; + CMP AX,LOCKED ;; WGR ;AN000; + JNE DE_01 ;; WGR ;AN000; + MOV AX,STAT_BADDEN ;; WGR ;AN000; + JMP DE_11 ;; WGR ;AN000; +DE_01: ;; WGR ;AN000; + CMP AX,CPSW ;; + JNE DEN_NOT_CPSW ;; + MOV AX,BUF.STATUS ;; any refresh ? + AND AX,REFRESH ;; + JNZ DEN_REFRESH ;; + MOV AX,STAT_BADDEN ;; + JMP DEN_FAIL ;; + ;; +DEN_REFRESH : ;; + AND BUF.STATUS,NOT REFRESH ;; + XOR AX,AX ;; + JMP DEN_RET ;; + ;; +DEN_NOT_CPSW : ;; + CMP AX,NORMAL ;; + JNE den_NOT_NORMAL ;; + JMP NORM_DRIVER ;; not in the code page switching stage + ;; +den_NOT_NORMAL : ;; + CMP AX,DESG_END ;; + JNE den_other ;; + JMP den_ENDED ;; end with no error check + ;; +den_other : ;; + CMP AX,DESG_WR ;; + JE den_write ;; + MOV AX,STAT_BADDEN ;; + JMP DEN_FAIL ;; no designate start + ;;------------------------- +den_write : ;; DESIGNATE WRITE ended + ;; + MOV AX,BUF.STATUS ;; + AND AX,FAIL ;; + JZ DEN_FTABLE ;; failed in the middle of desig-write + XOR AX,AX ;; + JMP DEN_FAIL ;; ignore the DEN + ;; +DEN_FTABLE : ;; + ;; + LEA DI,FTABLE ;; + ADD DI,TYPE FBUFS ;; + MOV AX,CS:[DI].FTB_STATUS ;; + CMP AX,FSTAT_COMPLETE ;; + JE DEN_ENDED ;; + ;; + CMP AX,FSTAT_FONT ;; + JE DEN_FONT ;; + MOV AX,STAT_bffDEN ;; bad font file + JMP DEN_FAIL ;; the font data was not complete + ;; +DEN_FONT : ;; + MOV AX,CS:[DI].FTB_DLEFT ;; + AND AX,AX ;; + JZ DEN_ENDED ;; + MOV AX,STAT_BffDEN ;; + JMP DEN_FAIL ;; + ;; +DEN_ENDED : ;; good designate-end + ;; + MOV DI,BUF.HARDSO ;; to hardware slot + MOV SI,BUF.HRBUFO ;; to hardware-buffer +HARD_HWCPE: ;; + MOV AX,CS:[DI].SLT_AT ;; skip the HWCP + AND AX,AT_HWCP ;; + JZ HARD_CARTE ;; + INC DI ;; + INC DI ;; + INC DI ;; + INC DI ;; + INC SI ;; + INC SI ;; + JMP HARD_HWCPE ;; +HARD_CARTE: ;; + MOV CX,BUF.HSLMX ;; size of both hardware slot/buffer + SUB CX,BUF.HARDMX ;; slots that can be designated???????? + MOV AX,BUF.STATUS ;; + AND AX,DSF_CARTCP ;; + JZ ASSIGN_RAM ;; + ;; + ;; + MOV AX,STAT_TOMANY ;; + AND CX,CX ;; any cart-slot to be designated ? + JNZ ASSIGN_CP_CART ;; + JMP DEN_FAIL ;; + ;; + ;; +ASSIGN_CP_CART : ;; + JMP ASSIGN_CP ;; + ;; +ASSIGN_RAM: ;; + MOV DI,BUF.RAMSO ;; to RAM slot + MOV SI,BUF.RMBUFO ;; to RAM-buffer + MOV CX,BUF.RSLMX ;; size of both RAM slot/buffer + ;; + MOV AX,STAT_TOMANY ;; + AND CX,CX ;; any cart-slot to be designated ? + JNZ ASSIGN_CP ;; + JMP DEN_FAIL ;; + ;; +ASSIGN_CP: ;; + MOV AX,AT_LOAD ;; + OR AX,AT_FONT ;; + OR AX,AT_SELECT ;; + NOT AX ;; + AND CS:[DI].SLT_AT,AX ;; reset load, font, select attributes + ;; + MOV AX,CS:[SI] ;; code page assigned + MOV CS:[DI].SLT_CP,AX ;; + ;; + CMP AX,0FFFFH ;; + JNE SLOT_OCC ;; + MOV AX,AT_OCC ;; + NOT AX ;; empty + AND CS:[DI].SLT_AT,AX ;; + JMP ASSIGN_NEXT ;; +SLOT_OCC: ;; + OR CS:[DI].SLT_AT,AT_OCC ;; occupied + ;; + MOV AX,CS:[DI].SLT_AT ;; + AND AX,AT_OLD ;; + JNZ ASSIGN_NEXT ;; + ;; +NOT_ACTIVE: ;; this newly designated is not active + MOV AX,AT_ACT ;; + NOT AX ;; + AND CS:[DI].SLT_AT,AX ;; not active + CMP BUF.RBUFMX,0 ;; + JE ASSIGN_NEXT ;; + AND CS:[DI].SLT_AT,NOT AT_RAM1;; not loaded to physical RAM until + ;; the code page is selected +ASSIGN_NEXT : ;; + INC DI ;; + INC DI ;; + INC DI ;; + INC DI ;; + INC SI ;; + INC SI ;; + DEC CX ;; + AND CX,CX ;; + JNE ASSIGN_CP ;; + ;; + MOV CX,BUF.FSELEN ;; COPY SELECT-CONTROL for CLASS 0 + AND CX,CX ;; + JZ DEN_NO_SELECT ;; + ;; + PUSH ES ;; + PUSH DS ;; + PUSH SI ;; + PUSH DI ;; + ;; + PUSH CS ;; + POP ES ;; + PUSH CS ;; + POP DS ;; + ;; + PUSH DX ;; + MOV DI,BUF.PDESCO ;; + MOV SI,CS:[DI].SELB_O ;; + PUSH DI ;; + MOV DI,CS:[DI].SELH_O ;; + XOR DX,DX ;; + MOV DL,CS:BYTE PTR [SI] ;; + ADD DX,DI ;; + INC DX ;; of the length byte + ;; + REP MOVSB ;; + ;; + POP DI ;; + MOV CS:[DI].SELR_O,DX ;; + POP DX ;; + ;; + POP DI ;; + POP SI ;; + POP DS ;; + POP ES ;; + ;; + MOV BUF.FSELEN,0 ;; + ;; +DEN_NO_SELECT : ;; + XOR AX,AX ;; clear status + JMP DEN_RET ;; + ;; +DEN_FAIL : ;;------------------------------------ + PUSH AX ;; ANY FONT BUFFER DESTROYED ? + ;; + MOV AX,BUF.STATUS ;; + AND AX,DSF_CARTCP ;; + JZ DEN_RAM_FAIL ;; + ;; + MOV DI,BUF.FTSLOTO ;; + MOV CX,BUF.HSLMX ;; + JMP DEN_FAIL_LOOP ;; + ;; +DEN_RAM_FAIL : ;; + MOV DI,BUF.RAMSO ;; to RAM slot + MOV CX,BUF.RSLMX ;; size of both RAM slot/buffer + MOV DX,BUF.RBUFMX ;; + ;; + AND DX,DX ;; + JZ DEN_FAIL_RET ;; + ;; +DEN_FAIL_LOOP : ;; + AND CX,CX ;; + JZ DEN_FAIL_RET ;; + ;; + MOV AX,CS:[DI].SLT_AT ;; + AND AX,AT_LOAD ;; + JZ DEN_FAIL_NEXT ;; + ;; + MOV AX,CS:[DI].SLT_AT ;; + AND AX,AT_HWCP ;; + JNZ DEN_FAIL_NEXT ;; + ;; + MOV CS:[DI].SLT_CP,0FFFFH ;; those slot whose font has been or + MOV CS:[DI].SLT_AT,0 ;; to be loaded will be wiped out by + ;; a failing designate +DEN_FAIL_NEXT : ;; + ;; + INC DI ;; + INC DI ;; + INC DI ;; + INC DI ;; + DEC CX ;; + JNE DEN_FAIL_LOOP ;; + ;; +DEN_FAIL_RET : ;; + ;; + POP AX ;; + ;; + MOV BUF.FSELEN,0 ;; + ;; + ;;------------------------------------- +DEN_RET : ;; + MOV BUF.STATE,CPSW ;; end of designate cycle + ;; +DE_11: ;; WGR ;AN000; + LES DI,dword ptr buf.rh_ptro ;; + MOV RH.RHC_STA,AX ;; + ;; + RET ;; + ;; +DESIGNATE_END ENDP ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;==== Generic IOCTL Invoke ========== +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +INVOKE PROC ;; ALSO JUMP FROM REFRESH + ;; + MOV AX,BUF.STATE ;; + CMP AX,CPSW ;; + JE IVK_PROCESS ;; + CMP AX,LOCKED ;; WGR ;AN000; + JE IVK_PROCESS ;; WGR ;AN000; + JMP IVK_CMDERR ;G; +IVK_PROCESS: ;;------------------------- + ;G; + CALL CHECK_PRINT_ACTIVE ;G; THIS WILL FIND OUT IF THE + JNC IVK_PROCESS_CONT ;G; PRINT.COM IS PRESENTLY ACTIVE! + JMP IVK_DEVERR ;G; If so, THEN DEVICE_ERROR + ;G; +IVK_PROCESS_CONT: ;G; + push ds ;; + LDS SI,RH.GIH_GBA ;; + MOV CX,GIOB.GB2_LEN ;; + MOV AX,STAT_CMDERR ;; + CMP CX,2 ;; + JE IVK_GOODN ;; + pop ds ;; + JMP IVK_RET ;; +IVK_GOODN: ;; + MOV DX,GIOB.GB2_CP ;; DX = the codepage to be invoked + CMP DX,0FFFFH ;; + JNE IVK_GOODCP ;; + pop ds ;; + JMP IVK_RET ;; +IVK_GOODCP: ;; + ;; ************************************ + ;; * INVOKE HIERIECHY : RAM, HARDWARE * + ;; ************************************ + pop ds ;; + ;; + MOV DI,BUF.RAMSO ;; check with the ram-slots (DI) + MOV CX,BUF.RSLMX ;; CX = size + AND CX,CX ;; + JZ HWCP_CHK ;; + ;; +RAM_CMP: ;; there are RAM-slots + PUSH CX ;; stack 1 = size + PUSH DI ;; + POP SI ;; start of the slot compared with (SI) +RAM_LP: ;; + MOV AX,CS:[DI].SLT_CP ;; + CMP AX,DX ;; + JE IVK_RAMCP ;; + INC DI ;; + INC DI ;; + INC DI ;; + INC DI ;; + DEC CX ;; + JNZ RAM_LP ;; + ;; + POP CX ;; stack -1 + ;; code page not found in ram-slots +HWCP_CHK : ;; + MOV DI,BUF.HARDSO ;; check with the HWCP-slots (DI) + MOV CX,BUF.Hslmx ;; CX = size + AND CX,CX ;; + JNZ HWCP_cmp ;; + JMP NO_INVOKE ;; + ;; +HWCP_CMP : ;; + PUSH CX ;; stack 1 = size of HWCP + PUSH DI ;; + POP SI ;; start of the slot compared with (SI) +HWCP_LP: ;; + MOV AX,CS:[DI].SLT_CP ;; + CMP AX,DX ;; + JNE HWCP_NEXT ;; + JMP IVK_HWCPCP ;; + ;; +HWCP_NEXT : ;; + INC DI ;; + INC DI ;; + INC DI ;; + INC DI ;; + DEC CX ;; + JNZ HWCP_LP ;; + POP CX ;; stack -1 + ;; + JMP NO_INVOKE ;; + ;; ********************************** + ;; ** RAM CODEPAGE TO BE INVOKED ** + ;; ********************************** + ;; -- determine if any font to be + ;; downloaded for the first time + ;; select of the font. + ;; -- send selection control to invoke + ;; + ;; CX = inverse order of slot cp found +IVK_RAMCP : ;; code page found in RAM slots + ;; set up the pointer to first controls + ;; DI = where slot found + ;; + ;;------------------------------------- + ;; **** LOAD THE FONT FIRST if **** + ;; -- there are font buffers created + ;; -- the slot's font has not been + ;; loaded + CMP CS:[BX].STATE,LOCKED ;; WGR are we locked? ;AN000; + JNE IR_0 ;; WGR no..continue ;AN000; + MOV CS:[BX].SAVED_CP,DX ;; WGR yes...save the code page ;AN000; + CMP BX,OFFSET BUF1 ;; WGR if this is lpt1..then ;AN000; + JNE NEXT_1 ;; WGR ;AN000; + LEA SI,BUF0 ;; WGR copy to PRN buffer. ;AN000; + MOV CS:[SI].SAVED_CP,DX ;; WGR ;AN000; + JMP ALL_RESET ;; WGR ;AN000; +NEXT_1: ;; WGR ;AN000; + CMP BX,OFFSET BUF0 ;; WGR if this is PRN..then.. ;AN000; + JNE NEXT_2 ;; WGR ;AN000; + LEA SI,BUF1 ;; WGR copy to lpt1 buffer. ;AN000; + MOV CS:[SI].SAVED_CP,DX ;; WGR ;AN000; +NEXT_2: ;; WGR ;AN000; + JMP ALL_RESET ;; WGR exit invoke with good status ;AN000; +IR_0: ;; WGR ;AN000; +; test cs:[di].SLT_AT, AT_ACT ;AN001;If it is currently active, then do nothing +; jnz Next_2 ;AN001; + CMP BUF.RBUFMX,0 ;; + JE INVK_RAM_PHYSICAL ;; + ;; + MOV AX,CS:[DI].SLT_AT ;; + AND AX,AT_RAM1 ;; supports only ONE physical ram + JNZ INVK_RAM_PHYSICAL ;; + ;; + OR BUF.STATUS,LOADED ;; font has not been loaded + ;; + ;; + POP DX ;; stack -1 + PUSH DX ;; stack 1 (size) + ;; + ;; + PUSH CX ;; + PUSH SI ;; + PUSH DI ;; + ;; + SUB DX,CX ;; + MOV AX,BUF.FTSTART ;; +LOCATE_FONT : ;; + AND DX,DX ;; + JZ FONT_LOCATED ;; + ADD AX,BUF.FTSZPA ;; + DEC DX ;; + JMP LOCATE_FONT ;; + ;; +FONT_LOCATED : ;; + ;; AX = FONT LOCATION (AX:0) + SUB DI,BUF.RAMSO ;; + SHR DI,1 ;; offset to the start of .FTDLEN + ;; + add DI,buf.ftdlo ;; length of font data + mov cx,cs:word ptr [di] ;; + + +;Before sending data, let's check the status of the printer + call Prt_status_check ;AN001;Check the printer status + jz Send_Ram_Data ;AN001;O.K.? + pop di ;AN001;Balance the stack + pop si ;AN001; + pop cx ;AN001; + jmp Ram_Prt_Status_Err ;AN001;return with error. +Send_Ram_Data: + MOV SI,BUF.RNORMO ;; + MOV CS:[SI].RHC_LEN,20 ;; + MOV CS:[SI].RHC_CMD,CMD_WRT ;; + MOV CS:[SI].RH3_CNT,CX ;; + MOV CS:[SI].RH3_DTAO,0 ;; + MOV CS:[SI].RH3_DTAS,AX ;; + ;; + PUSH BX ;; + ;; + PUSH BX ;; + POP DI ;; save BX in DI + PUSH CS ;; + POP ES ;; + MOV BX,SI ;; ES:BX = REQ_NORMn (CS:[SI]) + ;; + CALL DWORD PTR CS:[DI].LPT_STRAO + ;; + CALL DWORD PTR CS:[DI].LPT_INTRO + ;; + POP BX ;; + ;; + MOV AX,CS:[SI].RHC_STA ;; + ;; + POP DI ;; + POP SI ;; + POP CX ;; + ;; + AND AX,STAT_ERROR ;; any error returned by normal device? + JZ INVK_RAM_PHYSICAL ;; + ;; +Ram_Prt_Status_err: + POP CX ;; stack -1 + JMP IVK_DEVERR ;; + ;;------------------------------------- + ;; **** SEND THE SELECTION CONTROL **** + ;; +INVK_RAM_PHYSICAL : ;; + ;; + POP DX ;; stack -1 + PUSH DX ;; stack 1 (size) + ;; + PUSH DI ;; stack 2 + PUSH SI ;; stack 3 + PUSH ES ;; stack 4 + ;; + ;; + ;; **** SUPPORT ONLY ONE PHYSICAL RAM + ;; + MOV DI,BUF.PDESCO ;; + MOV DI,CS:[DI].SELR_O ;; the RAM-select controls + XOR AX,AX ;; + JMP CTL_DEF ;; + ;; + ;; ******************************* + ;; ** INVOKE HARDWARE CODEPAGE ** + ;; ******************************* + ;; -- check if it is CLASS 1 device, + ;; If so then send slection control + ;; from the font buffer at FTSTART + ;; + ;; CX=inverse order of slot cp found +IVK_HWCPCP: ;; code page found in HWCP slots + ;; set up the pointer to first controls + CMP CS:[BX].STATE,LOCKED ;; WGR are we locked? ;AN000; + JNE IR_1 ;; WGR no..continue ;AN000; + MOV CS:[BX].SAVED_CP,DX ;; WGR yes...save the code page ;AN000; + CMP BX,OFFSET BUF1 ;; WGR if this is lpt1..then ;AN000; + JNE NEXT_3 ;; WGR ;AN000; + LEA SI,BUF0 ;; WGR copy to PRN buffer. ;AN000; + MOV CS:[SI].SAVED_CP,DX ;; WGR ;AN000; + JMP ALL_RESET ;; WGR ;AN000; +NEXT_3: ;; WGR ;AN000; + CMP BX,OFFSET BUF0 ;; WGR if this is PRN..then.. ;AN000; + JNE NEXT_4 ;; WGR ;AN000; + LEA SI,BUF1 ;; WGR copy to lpt1 buffer. ;AN000; + MOV CS:[SI].SAVED_CP,DX ;; WGR ;AN000; +NEXT_4: ;; WGR ;AN000; + JMP ALL_RESET ;; WGR exit invoke with good status ;AN000; +IR_1: ;; WGR ;AN000; +; test cs:[di].SLT_AT, AT_ACT ;AN001;If it is currently active, then do nothing +; jnz Next_4 ;AN001; + POP DX ;; stack -1 + PUSH DX ;; stack 1 (size) + ;; + PUSH DI ;; stack 2 + PUSH SI ;; stack 3 + PUSH ES ;; stack 4 + ;; + SUB DX,CX ;; the slot's order in HWCP-slots(0-n) + ;; + CMP BUF.PCLASS,1 ;; + JNE SELECT_SLOT ;; + ;; + MOV AX,BUF.FTSTART ;; ***** CLASS 1 CODEPAGE SELECT **** + AND DX,DX ;; + JZ ADJUST_DI ;; + ;; +SELECTCP_LP : ;; + ADD AX,BUF.FTSZPA ;; + ;; + DEC DX ;; + JNZ SELECTCP_LP ;; + ;; +ADJUST_DI : ;; + mov DI,AX ;; + PUSH CS ;; + POP AX ;; + SUB DI,AX ;; + SHL DI,1 ;; + SHL DI,1 ;; + SHL DI,1 ;; + SHL DI,1 ;; + JMP CTL_DEF ;; + ;; + ;; ** SELECT HARDWARE PHYSICAL SLOT ** +SELECT_SLOT : ;; + MOV DI,BUF.PDESCO ;; + MOV DI,CS:[DI].SELH_O ;; the HARDWARE-select controls + XOR AX,AX ;; + JMP RCTL_NXT ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +RCTL_NXT: ;; locate the right control sequence + AND DX,DX ;; + JZ CTL_DEF ;; + MOV AL,CS:[DI] ;; + ADD DI,AX ;; + DEC DX ;; + JMP RCTL_NXT ;; + ;; + ;; ******************************** + ;; ** SEND OUT SELECTION CONTROL ** + ;; ******************************** + ;; + ;; code page is to be invoked +CTL_DEF : ;; DI points to the control sequence +;Check the status of the printer before writing. + call Prt_status_check ;AN001;Check the printer status + jz Ctl_Def_Send ;AN001;O.K.? + jmp Ctl_Dev_Err ;AN001;Error. + +Ctl_Def_Send: + MOV SI,BUF.RNORMO ;; + MOV CS:[SI].RHC_LEN,20 ;; + MOV CS:[SI].RHC_CMD,CMD_WRT ;; + ;; + XOR CX,CX ;; + MOV CL,CS:[DI] ;; + ;; +CTL_NEXT_BYTE : ;; + ;; + CMP BUF.PCLASS,1 ;; + JE CTL_CLASS1 ;; + ;; + MOV CS:[SI].RH3_CNT,CX ;; send all at once + MOV CX,1 ;; sent only once. + JMP CTL_COMMON ;; + ;; +CTL_CLASS1 : ;; sent byte by byte to overcome + MOV CS:[SI].RH3_CNT,1 ;; DOS timeout on kingman printer +CTL_COMMON : ;; + INC DI ;; + MOV CS:[SI].RH3_DTAO,DI ;; + PUSH CS ;; + POP AX ;; + MOV CS:[SI].RH3_DTAS,AX ;; + ;; + PUSH DI ;; + PUSH BX ;; + ;; + PUSH BX ;; + POP DI ;; save BX in DI + PUSH CS ;; + POP ES ;; + MOV BX,SI ;; ES:BX = REQ_NORMn (CS:[SI]) + ;; + CALL DWORD PTR CS:[DI].LPT_STRAO + ;; + CALL DWORD PTR CS:[DI].LPT_INTRO + ;; + POP BX ;; + POP DI ;; + ;; + MOV AX,CS:[SI].RHC_STA ;; + ;; + AND AX,STAT_ERROR ;; any error returned by normal device? + JNZ CTL_DEV_ERR ;; + DEC CX ;; + JNZ CTL_NEXT_BYTE ;; + ;; + POP ES ;; stack -4 + POP SI ;; stack -3 + POP DI ;; stack -2 + JMP IVK_CP ;; + ;; +CTL_DEV_ERR : ;; + POP ES ;; stack -4 + POP SI ;; stack -3 + POP DI ;; stack -2 + POP CX ;; stack -1 + JMP IVK_DEVERR ;; + ;; + ;; ********************************** + ;; ** ADJUST WHICH CODEPAGE TO BE ** + ;; ** ACTIVE ** + ;; ********************************** + ;; + ;; -- set the attribute bit of the + ;; slot (SLT_AT) to active for + ;; the code page just invoked. + ;; -- reset others to non-active. + ;; + ;; +IVK_CP: ;; SI = start of the slots compared + ;; DI = where code page was found + POP CX ;; stack -1 + PUSH SI ;; stack 1 = start of slots compared + mov AX,BUF.STATUS ;; + AND AX,LOADED ;; + MOV AX,AT_ACT ;; + JZ NO_LOAD ;; + OR AX,AT_RAM1 ;; reset loaded to physical RAM #1, + ;; this is reset only when there is + ;; font loading in this round of invoke +NO_LOAD: ;; (for RAM codepages only) + NOT AX ;; +NXT_CP: ;; + AND CS:[SI].SLT_AT,AX ;; not active (and not loaded) + INC SI ;; + INC SI ;; + INC SI ;; + INC SI ;; + DEC CX ;; + JNZ NXT_CP ;; + OR CS:[DI].SLT_AT,AT_ACT ;; the codepage found becomes active + MOV AX,BUF.STATUS ;; + AND AX,LOADED ;; + JZ HWCP_RESET ;; + OR CS:[DI].SLT_AT,AT_RAM1 ;; the font has just been loaded + AND BUF.STATUS,NOT LOADED ;; + ;; +HWCP_RESET : ;; + ;; + POP SI ;; stack -1 (slot : ATs adjusted ) + PUSH SI ;; stack 1 = start of slots compared + ;; + MOV DI,BUF.HARDSO ;; + CMP SI,DI ;; + JE RAM_RESET ;; + ;; HWCP's AT to be reset + MOV CX,BUF.HSLMX ;; + AND CX,CX ;; + JZ RAM_RESET ;; + MOV AX,AT_ACT ;; + NOT AX ;; +RESET_HWCP : ;; + AND CS:[DI].SLT_AT,AX ;; HWCP is not active + INC DI ;; + INC DI ;; + INC DI ;; + INC DI ;; + DEC CX ;; + JNZ RESET_HWCP ;; + ;; + ;; +RAM_RESET: ;; + ;; + POP SI ;; stack -1 (slot : ATs adjusted ) + PUSH SI ;; stack 1 = start of slots compared + ;; + MOV DI,BUF.RAMSO ;; + CMP SI,DI ;; + JE ALL_RESET ;; + ;; HWCP's AT to be reset + MOV CX,BUF.RSLMX ;; + AND CX,CX ;; HWCP's no. + JZ ALL_RESET ;; + MOV AX,AT_ACT ;; + NOT AX ;; +RESET_RAM : ;; + AND CS:[DI].SLT_AT,AX ;; HWCP is not active + INC DI ;; + INC DI ;; + INC DI ;; + INC DI ;; + DEC CX ;; + JNZ RESET_RAM ;; + ;; +ALL_RESET : ;; + POP SI ;; stack -1 + ;; + XOR AX,AX ;; + JMP IVK_RET ;; + ;; +NO_INVOKE : ;; + ;; + MOV AX,STAT_NOCPIV ;; + JMP IVK_RET ;; + ;; +IVK_DEVERR : ;; + MOV AX,STAT_DEVERR ;; + JMP IVK_RET ;G; + ;; +IVK_CMDERR : ;G; + MOV AX,STAT_CMDERR ;G; + ;; +IVK_RET : ;; + LES DI,dword ptr buf.rh_ptro;; + MOV RH.RHC_STA,AX ;; + ;; + RET ;; + ;; +INVOKE ENDP ;; + ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +Prt_Status_Check proc near ;AN001; +;Check the printer device status +;Out) if Zero flag set - Ok. +; All registers saved. + + push es ;AN001; + push si ;AN001; + + mov si, BUF.RNORMO ;AN001; + mov cs:[si].RHC_LEN, 13 ;AN001; + mov cs:[si].RHC_CMD, 10 ;AN001;device driver status check + + push di ;AN001; + push bx ;AN001; + + push bx ;AN001; + pop di ;AN001; + push cs ;AN001; + pop es ;AN001;ES:BX -> REQ_NORMn (was cs:si) + mov bx, si ;AN001; + + call dword ptr cs:[di].LPT_STRAO ;AN001;Strategy + call dword ptr cs:[di].LPT_INTRO ;AN001;Intrrupt + test cs:[si].RHC_STA, STAT_ERROR ;AN001; + pop bx ;AN001; + pop di ;AN001; + + pop si ;AN001; + pop es ;AN001; + ret ;AN001; +Prt_Status_Check endp ;AN001; + + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;==== Generic IOCTL Query Invoked ======= +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; +Q_INVOKED PROC ;; + push ds ;; + ;; + MOV AX,BUF.STATE ;; ??????????????? + CMP AX,LOCKED ;; WGR ;AN000; + JNE QI_0 ;; WGR ;AN000; + MOV AX,BUF.SAVED_CP ;; WGR ;AN000; + LDS SI,RH.GIH_GBA ;; WGR ;AN000; + CMP AX,-1 ;; WGR ;AN000; + JE QIV_NOACT ;; WGR ;AN000; + JMP QI_1 ;; WGR ;AN000; +QI_0: ;; WGR ;AN000; + CMP AX,CPSW ;; reject only in NORMAL !!!! + JNE QIV_CMDERR ;G; + ;;------------------------- + LDS SI,RH.GIH_GBA ;; + ;; + MOV DI,BUF.RAMSO ;; + MOV CX,BUF.RSLMX ;; + AND CX,CX ;; + JZ QIV_HARD ;; + ;; +QIV_RAMLP : ;; + MOV AX,CS:[DI].SLT_AT ;; check the RAM slots + AND AX,AT_ACT ;; + JNZ QIV_FOUND ;; + INC DI ;; + INC DI ;; + INC DI ;; + INC DI ;; + DEC CX ;; + JNZ QIV_RAMLP ;; + ;; +QIV_HARD : ;; + MOV DI,BUF.HARDSO ;; + MOV CX,BUF.HSLMX ;; + AND CX,CX ;; + JZ QIV_NOACT ;; + ;; +QIV_HARDLP : ;; + MOV AX,CS:[DI].SLT_AT ;; check the RAM slots + AND AX,AT_ACT ;; + JNZ QIV_FOUND ;; + INC DI ;; + INC DI ;; + INC DI ;; + INC DI ;; + DEC CX ;; + JNZ QIV_HARDLP ;; + ;; +QIV_NOACT : ;; + ;; + MOV AX,STAT_NOCPIV ;; + JMP QIV_RET ;; + ;; + ;; +QIV_FOUND : ;; + MOV AX,CS:[DI].SLT_CP ;; +QI_1: ;; WGR ;AN000; + MOV GIOB.GB2_LEN,2 ;; + MOV GIOB.GB2_CP,AX ;; + ;; + XOR AX,AX ;; + JMP QIV_RET ;; + ;; +QIV_DEVERR : ;; + MOV AX,STAT_DEVERR ;; + JMP QIV_RET ;G; + ;; +QIV_CMDERR : ;G; + MOV AX,STAT_CMDERR ;G; + ;; +QIV_RET : ;; + LES DI,dword ptr buf.rh_ptro ;; + MOV RH.RHC_STA,AX ;; + ;; + pop ds ;; + ;; + RET ;; + ;; +Q_INVOKED ENDP ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;==== Generic IOCTL Query List ======= +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +Q_LIST PROC ;; + ;; + push ds ;; + ;; + MOV AX,BUF.STATE ;; ???????????????? + CMP AX,CPSW ;; reject only in NORMAL + JE QLS_CPSW ;; + CMP AX,LOCKED ;; WGR ;AN000; + JE QLS_CPSW ;; WGR ;AN000; + JMP QLS_CMDERR ;G; +QLS_CPSW : ;;------------------------- + LDS SI,RH.GIH_GBA ;; + PUSH SI ;; stack 1 -- GB3 (SI) + ;; + MOV DI,BUF.HARDSO ;; + MOV CX,BUF.HARDMX ;; + MOV DX,BUF.HSLMX ;; DX = number of entries + LEA SI,[SI].GB3_GBL ;; + MOV GIOB.GBL_LEN,CX ;; + ;; +QL_HARDLP: ;; + AND CX,CX ;; + JZ QL_PREPARE ;; + MOV AX,CS:[DI].SLT_CP ;; + MOV GIOB.GBL_CP,AX ;; + INC DI ;; + INC DI ;; + INC DI ;; + INC DI ;; + INC SI ;; + INC SI ;; + DEC CX ;; + JMP QL_HARDLP ;; + ;; +QL_PREPARE: ;; + MOV CX,BUF.HSLMX ;; + SUB CX,BUF.HARDMX ;; less the no. of HWCP + MOV DX,BUF.RSLMX ;; + ADD DX,CX ;; DX = total number of entries + INC SI ;; + INC SI ;; + MOV GIOB.GBL_LEN,DX ;; +QL_CARTLP: ;; + AND CX,CX ;; + JZ QL_RAM_PREP ;; + MOV AX,CS:[DI].SLT_CP ;; + MOV GIOB.GBL_CP,AX ;; + INC DI ;; + INC DI ;; + INC DI ;; + INC DI ;; + INC SI ;; + INC SI ;; + DEC CX ;; + JMP QL_CARTLP ;; + ;; + ;; +QL_RAM_PREP: ;; + MOV DI,BUF.RAMSO ;; + MOV CX,BUF.RSLMX ;; + ;; +QL_RAMLP : ;; + AND CX,CX ;; + JZ QL_DONE ;; + MOV AX,CS:[DI].SLT_CP ;; + MOV GIOB.GBL_CP,AX ;; + INC DI ;; + INC DI ;; + INC DI ;; + INC DI ;; + INC SI ;; + INC SI ;; + DEC CX ;; + JMP QL_RAMLP ;; + ;; +QL_DONE: ;; + POP SI ;; stack -1 + mov dx,buf.hslmx ;; + add DX,BUF.RSLMX ;; + INC DX ;; + INC DX ;; + MOV CX,1 ;; + SHL DX,CL ;; + MOV GIOB.GB3_LEN,DX ;; + ;; + XOR AX,AX ;; + CMP DX,GB3_MINILEN ;; min. GBL length + JA QLS_RET ;; + MOV AX,STAT_NOCP ;; + JMP QLS_RET ;; + ;; +QLS_DEVERR : ;; + MOV AX,STAT_DEVERR ;; + JMP QLS_RET ;G; + ;; +QLS_CMDERR : ;G; + MOV AX,STAT_CMDERR ;G; + ;; +QLS_RET : ;; + LES DI,dword ptr buf.rh_ptro ;; + MOV RH.RHC_STA,AX ;; + ;; + pop ds ;; + RET ;; + ;; +Q_LIST ENDP ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; CHECK_PRINT_ACTIVE +; +; THIS ROUTINE IS CALLED BEFORE THE INVOKE, DESIGNATE +; COMMANDS ARE OPERATED ON. THIS IS TO PREVENT CONFLICT +; BETWEEN THE BACKGROUND PRINTING AND THE DOWNLOAD SEQUENCE. +; +; INPUT: +; CS:[BX].DEV_HDRO OFFSET AND SEGMENT OF ACTIVE DEVICE +; CS:[BX].DEV_HDRS +; +; WARNING: IF ANOTHER DEVICE DRIVER IS TO TAKE THE LPTx, THEN +; THIS WILL not FIND OUT THAT THE PRINTER.SYS IS ACTIVE. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +CHECK_PRINT_ACTIVE PROC ;G; + PUSH AX ;G; SAVE THE REGISTERS............ + PUSH SI ;G; + PUSH DI ;G; + PUSH DS ;G; + PUSH ES ;G; + ;G; + MOV DI,BUF.DEV_HDRS ;G; SETUP ES: = ACTIVE DEVICE SEGMENT + MOV ES,DI ;G; & + MOV DI,BUF.DEV_HDRO ;G; SETUP DI: = ACTIVE DEVICE OFFSET + ;G; + MOV AX,0106H ;G; PRINT (GET LIST DEVICE) + CLC ;G; + JNC CPA_5 ;G; CY=0 IF NOT LOADED/NOT ACTIVE + ;G; + CMP SI,DI ;G; ES:DI POINTS TO THE ACTIVE DEVICE + JNE CPA_5 ;G; + MOV SI,DS ;G; + MOV DI,ES ;G; + CMP SI,DI ;G; + JNE CPA_5 ;G; + STC ;G; OTHERWISE, THIS DEVICE IS PRESENTLY + JMP CPA_6 ;G; UNDER PRINT!!! PREVENT DATASTREAM + ;G; CONFLICT IN THIS CASE. + ;G; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;G; PRINT.COM IS ASLEEP OR IS NOT + ;G; PRESENTLY LOADED. THE PRINTER.SYS +CPA_5: CLC ;G; CAN CONTINUE IT PROCESS! +CPA_6: POP ES ;G; RESTORE REGISTERS..... + POP DS ;G; + POP DI ;G; + POP SI ;G; + POP AX ;G; + RET ;G; +CHECK_PRINT_ACTIVE ENDP ;G; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + + +CSEG ENDS + END diff --git a/v4.0/src/DEV/PRINTER/MAKEFILE b/v4.0/src/DEV/PRINTER/MAKEFILE new file mode 100644 index 0000000..2f14f1a --- /dev/null +++ b/v4.0/src/DEV/PRINTER/MAKEFILE @@ -0,0 +1,40 @@ +#************************* Makefile for Printer *************************** + +inc =..\..\inc +msg =..\..\messages +dos =..\..\dos +hinc =..\..\h +make =nmake + +# +######################## Dependencies Begin Here ########################## +# + +all: printer.sys 5202.cpi + +printer.ctl: printer.skl $(msg)\$(COUNTRY).msg + +cpspm10.obj: cpspm10.asm cpspequ.inc + +cpsfont3.obj: cpsfont3.asm cpspequ.inc + +prtint2f.obj: prtint2f.asm cpspequ.inc $(inc)\struc.inc + +cpspi07.obj: cpspi07.asm cpspequ.inc \ + $(inc)\sysmsg.inc printer.ctl \ + $(inc)\versiona.inc + +parser.obj: parser.asm cpspequ.inc $(inc)\parse.asm \ + $(inc)\struc.inc + +printer.sys: cpspm10.obj cpsfont3.obj parser.obj cpspi07.obj prtint2f.obj + link @printer.lnk + exe2bin printer.exe printer.sys < zero.dat + del printer.exe + +5202.cpi: + cd 5202 + $(make) + cd .. + + diff --git a/v4.0/src/DEV/PRINTER/PARSE4E.ASM b/v4.0/src/DEV/PRINTER/PARSE4E.ASM new file mode 100644 index 0000000..872a458 --- /dev/null +++ b/v4.0/src/DEV/PRINTER/PARSE4E.ASM @@ -0,0 +1,1106 @@ +;*************************************************************** +;** ** +;** ******** ** ** ******* ** +;** ** ** ** ** ** +;** ** ******* ***** ** +;** ** ** ** ** ** +;** ** ** ** ******* ** +;** ** +;** ****** * ****** ****** ******* ****** ** +;** ** ** ** ** ** ** ** ** ** ** ** +;** ****** ******* ****** ***** ****** ****** ** +;** ** ** ** ** ** ** ** ** ** ** +;** ** ** ** ** ** ****** ******* ** ** ** +;** ** +;*************************************************************** +; +; File Name: PARSE.ASM +; ---------- +; +; Description: A command parser for DEVICE command in the CONFIG.SYS file. +; ------------ +; +; Procedures contained in the file: +; --------------------------------- +; PARSER: Main routine for command processing. +; GET_CHAR: Gets a character from command line. +; IS_ALPH: Checks if character is an alpha character. +; IS_DIGIT: Checks if character is a digit. +; IS_DELIM: Checks if character is a DOS delimiter. +; DEVICE_PARSE: Pulls device name from command line and +; inserts in table. +; ID_PARSE: Pulls id name from command line and insers in table +; HWCP_PARMS: Extract HWCP number, converts it to binary and +; inserts it in table. +; HWCP_PARSE: Extracts HWCP number if only one number is given. +; MUL_HWCP: Extracts multiple HWCP's numbers, if they are given +; in a list. +; DESG_PARMS: Extracts designate number, converts it to binary +; and inserts it in table. +; DESG_FONT: Extracts the designate and the font if both were +; given in command line. +; DESG_PARSE: Pulls designate number if it is the only one given. +; GET_NUMBER: Converts a number to binary. +; OFFSET_TABLE: Updates the counter in table #1. +; FIND_RIGHT_BR: Looks for a right bracket. +; +; +; Change history: +; --------------- +; +; +;LOGIC: +;------ +; Establish addressability to parameters. +; Skip until end of path and file name -first delimiter +; +; Loop: +; Isolate the first non-delimiter or non delimeter characters. +; If End_of_Line_Delimiter then +; return an error_code +; Else +; If first non-delimiter is ALPHA then +; (assume a device name) +; Extracts device name +; Update offset counter +; +; Isolate the first non-delimiter characters after id name. +; If End_of_Line_Delimiter then +; return an error_code +; Else +; If first non-delimiter is ALPHA-NUMARIC or +; If character is '(' then +; (assume an id name) +; Extracts id name +; Update offset counter +; +; Pull out HWCP +; If error flag is set then exit +; Else if end of line flag is set then exit +; +; Pull out DESG parms +; If error_flag is set then exit. +; Else if end of line flag is set then exit +; Else if Number of devices is four then Exit +; Else Loop +; +; +;Subroutines Logic: +;------------------ +; +; GET_CHAR: +; --------- +; Load character in AL +; If character less than 20h then +; turn Z-flag on +; +; IS_ALPHA: +; --------- +; Save character +; 'Convert character to upper case' +; If character >=A and <=Z then +; turn Z-flag on +; exit +; Else +; Restore character +; exit. +; +; IS_DIGIT: +; --------- If Character >=0 and <=9 then +; turn Z-flag on +; +; IS_DELIMITER: +; ------------- +; If character a dos delimiter (' ','=',',',';',TAB) +; then turn Z-flag on +; +; DEVICE_PARSE: +; ------------- +; Set device name length counter. +; Loop +; If a dos delimiter then +; add spaces to name (if require) +; Else if char is ALPHA-NUM then +; save in table +; If name >8 character thne +; error; exit +; Else +; error; exit +; +; ID_PARSE: +; --------- Set id name length counter. +; Loop +; If a dos delimiter then +; add spaces to name (if require) +; Else if char is ALPHA-NUM then +; save in table +; If name >8 character then +; error; exit +; Else if char is ')' or '(' then +; set flags +; Else +; error; exit +; +; HWCP_PARMS: +; ----------- +; Loop: Set flags off +; If char is a DIGIT then +; convert number to binary +; update table +; Else if char is ',' then +; no HWCP was given +; exit +; Else if char is '(' then +; assume multiple HWCP +; Else if char is ')' then +; end of parms, exit +; Else if not a delimiter then +; error, exit set carry flag set carry flag +; Loop +; +; HWCP_PARSE: +; ----------- Increment counter +; Get number and convert to binary +; Update the table +; Set table_5 pointer +; +; MUL_HWCP: +; --------- +; Loop: If char is ')' then +; end of list, exit +; If char is a DIGIT +; Get number and convert to binary +; Update table. +; If char is not a delimiter then +; error, exit set carry flag +; Loop +; +; DESG_PARMS: +; ----------- +; Loop: If char is a DIGIT then +; Get number and convert to binary +; Update table. +; If char is a ')' then +; end of parms, exit +; If char is a '(' then +; assume given desg. and font +; If char is a ',' then +; no desg ginven +; scane for ')' +; If char is not a delimiter then +; error, exit set carry flag +; Loop +; +; DESG_FONT: +; ---------- +; Loop: If char is a ',' then +; no desg number was given +; update table +; If char is a ')' then +; end of desg-font pair, exit +; If char is a DIGIT then +; Get number and convert to binary +; Update table +; If char not a delimiter then +; error, exit set carry flag +; Loop +; +; DESG_PARSE: +; ----------- Get number and conver to binary +; Update table +; +; GET_NUMBER: +; ----------- Get ASCII number from parms +; conver to binary +; add to total +; +; OFFSET_TABLE: +; ------------- +; Increment the number of parms +; +; FIND_RIGHT_BR: +; -------------- +; Loop: If char is ')' then +; found bracket exit +; If char is not ' ' then +; error, exit set carry flag +; Loop +; END +;------------------------------------------------------ +; +; The following is the table structure of the parser. All fields are +; two bytes field (accept for the device and id name) +; +; TABLE HEADER : +; +; Ŀ +; N = Number of devices. +; Ĵ +; Device # 1 offset >Ŀ +; Ĵ +; Device # 2 offset Table_1 (a) +; Ĵ +; Device # 3 offset +; Ĵ +; Device # 4 offset +; +; +; +; N = 1,2,3 or 4. A two bytes number indicating the number of device specified. +; DEVICE # N OFFSET : a two bytes offset address to table_1. (ie. Device #1 offset +; is a pointer to table_1 (a). Device #2 offset is a pointer to table_1 +; (b)...etc.). If an error was detected in the command N is set to zero. +; +; +; +; TABLE_1 : +; +; +; Ŀ Ŀ +; N = Number of Offsets. +; Ĵ ij Table_2 (a) +; Device Name offset +; Ĵ +; Device Id offset Ŀ +; Ĵ Ŀ +; Device HWCP offset Ŀ +; Ĵ ij Table_3 (a) +; Device Desg offset Ŀ +; Ĵ +; "Reserved" +; Ŀ +; +; ij Table_4 (a) +; +; +; Ŀ +; +; ij Table_5 (a) +; +; +; +; +; N=Length of table_1, or the number of offsets contained in table_1. +; The offsets are pointers (two bytes) to the parameters value of the device. +; "Reserved" : a two byte memory reserved for future use of the "PARMS" option. +; +; +; TABLE_2 : +; +; +; Ŀ +; N = Length of devices name +; Ĵ +; Device name +; +; +; N = Length of device name. Device length is always 8 byte long. +; Device Name : the name of the device (eg. LPT1, CON, PRN). The name +; is paded with spaces to make up the rest of the 8 characters. +; +; +; +; TABLE_3 : +; +; +; Ŀ +; N = Length of Id name. +; Ĵ +; Id Name +; +; +; N = Length of id name. Id name length is always 8 byte long. +; Id Name : the name of the id (eg. EGA, VGA, 3812). The name +; is paded with spaces to make up the rest of the 8 character. +; +; +; +; TABLE_4 : +; +; +; Ŀ +; N = Length of table. +; Ĵ +; HWCP # 1 +; Ĵ +; HWCP # 2 +; Ĵ +; . +; . +; . +; Ĵ +; HWCP # 10 +; +; +; +; N = Length of table in words. Or the number of HWCP's. +; HWCP # N : a hardware code page number converted to binary. The maximum +; number of pages allowed is 10. +; +; +; +; TABLE_5 : +; +; +; Ŀ +; N = Length of table. +; Ĵ +; Designate +; Ĵ +; Font +; +; +; N = Lenght of table. 0 - nothing was specified +; 1 - Only a designate was specified. +; 2 - Designate and font were given. If the Desg field +; was left empty in the DEVICE command then the +; Designate field is filled with 0FFFFH. +; Designate, Font : Are the Desg. and Font binary numbers. +; +;------------------------------------------------------ +; + +PROGRAM SEGMENT + + ASSUME CS:PROGRAM + ASSUME DS:PROGRAM + ASSUME ES:PROGRAM + + ORG 100H + +START: + JMP NOW + +;RESERVED MEMORY: +TABLE_1 DW ? ; Pointer at offsets. +TABLE_2 DW ? ; Pointer at device name. +TABLE_3 DW ? ; Pointer at id name. +TABLE_4 DW ? ; Pointer at hwcp. +TABLE_5 DW ? ; Pointer at desg and font. +TABLE DB 290 DUP (?) ; Table of parsed parms. Max 4 devices. +DEVNUM DW ? ; Counter to number of devices. +RIGHT_FLAG DB ? ; Flag to indicate a left bracket. +DEV_ERR_FLG DB ? ; Device name error flag. +ID_ERR_FLG DB ? ; Id name error flag. +ERROR_FLAG DB ? ; Error flag_terminate program if set to 1. +COMMA_FLAG DB ? ; Indicate the number of commas incounterd. +HWCP_FLAG DB ? ; Flag for multiple hwcps. +DESG_FLAG DB ? ; Flag indicates desg. and font. + +;Main part of program-links different sumbroutines together +NOW: + CALL PARSER + INT 20H ;Exit DOS. + +PARSER PROC + + PUSH AX ; ;;;;;;;;;;;;;;;;;; + PUSH BX ; ; + PUSH CX ; ; SAVE + PUSH DX ; ; ALL + PUSH DS ; ; REGISTERS. + PUSH ES ; ; + PUSH DI ; ; + PUSH SI ; ;;;;;;;;;;;;;;;;;; + + ;LES SI,RH.RH0_BPBA ; Point at all after DEVICE= + ; in the CONFIG.SYS file. + + mov di,81h ; ;;;;;;;;;;;;;;;;;;;;;;;;; + mov cl,cs:byte ptr [di-1] ; ; ;; + xor ch,ch ; ; ERASE THIS ;; + add di,cx ; ;;;;;;;; CODE IN ;; + mov ds:word ptr[di],0a0dh ; ; CPS ;; + ; ;;;;;;;; ;; + MOV SI,0081h ; ;Set SI at parameters. ;; + ; ;;;;;;;;;;;;;;;;;;;;;;;;; + +;Skip to end of file name, to the first DOS delimiter. + + MOV DEVNUM,02H ; Number of devices counter. + +GET_PARMS_A: CALL GET_CHAR ; Get command character in AL . + JZ EXIT_B ; No parms found. + CALL IS_DELIM ; If not a delimiter then. + JNE GET_PARMS_A ; Check next character. + + MOV DI,OFFSET TABLE ; Get the table address. + ADD DI,02H ; Point at devices offsets. + MOV BX,DI ; + ADD BX,08H ; Point BX at parms offsets. +TAB2: CALL UPDATE_TABLE ; Update table pointers value. + +CLR_DELIM: CALL GET_CHAR ; Get character into AL. + JZ EXIT_B ; No parms found. + CALL IS_ALPHA ; If alpha then assume. + JZ DEVICE ; A device name. + CALL IS_DELIM ; Is it a delimiter + JNE EXIT_A ; If not then error. + JMP CLR_DELIM ; Get next character. + +DEVICE: MOV DEV_ERR_FLG,00H ; Set device error flag off; + CALL DEVICE_PARSE ; Call routine to parse device name. + CMP DEV_ERR_FLG,01H ; If error flag is + JZ EXIT_A ; set then exit. + CALL OFFSET_TABLE ; Update table. + +ID_PARMS: CALL GET_CHAR ; Load a character in AL. + JZ EXIT_A ; Exit if end of line (error). + CMP AL,'(' ; If AL is a '(' then + JE ID ; Parse ID name. + CALL IS_ALPHA ; If an Alpha + JE ID ; Then parse ID name. + CALL IS_DIGIT ; If a digit + JE ID ; Then parse ID name. + CALL IS_DELIM ; If not a delimiter + JNE EXIT_A ; Then error, exit + JMP ID_PARMS ; Get another number + +EXIT_B: CMP DEVNUM,02H ; If device number above 2 then + JA EXIT_C ; Exit parse. + JMP EXIT_A ; Else error, exit + +ID: MOV ID_ERR_FLG,00H ; Set id error flag off. + CALL ID_PARSE ; Parse ID name. + CMP ID_ERR_FLG,01H ; Was error flag set, then + JE EXIT_A ; Print error message. + CALL OFFSET_TABLE ; Update table of offsets. + + CALL HWCP_PARMS ; Get code page number + CMP ERROR_FLAG,01H ; If error, then + JE EXIT_A ; Print error message and exit + CMP ERROR_FLAG,02H ; If end of string + JE EXIT_H ; Then exit. + + CALL DESG_PARMS ; Get designate number + CMP ERROR_FLAG,01H ; If error, then + JE EXIT_A ; Print error message and exit + JMP EXIT_H ; Then exit. + +EXIT_A: MOV DI,OFFSET TABLE ; Load table offset + MOV DS:WORD PTR [DI],00H ; Set error to on. + STC ; Set carry flag + JMP EXIT_P ; Exit parse. + +EXIT_H: MOV DI,OFFSET TABLE ; Load table offset. + ADD DS:WORD PTR [DI],01H ; Increment number of devices. + CMP DEVNUM,08H ; If 4 devices loaded + JE EXIT_C ; Then exit parse. + ADD DEVNUM,02H ; Increment the number of devices + ADD DI,DEVNUM ; Point at next devices offset. + MOV BX,TABLE_5 ; BX point at + ADD BX,06H ; end of previous table. + JMP TAB2 ; Get next device. + +EXIT_C: CLC + +EXIT_P: POP SI ; ;;;;;;;;;;;;;;;;;; + POP DI ; ; + POP ES ; ; RESTORE + POP DS ; ; ALL + POP DX ; ; REGISTERS. + POP CX ; ; + POP BX ; ; + POP AX ; ;;;;;;;;;;;;;;;;;; + RET + +PARSER ENDP + + +;******************************************************** +;** GET_CHAR : a routine to get next character pointed ** +;** to by ES:SI into AL. ** +;******************************************************** + +GET_CHAR PROC + + MOV AL,ES:BYTE PTR [SI] ; Load character pointed to + CMP AL,09H ; by ES:[SI] in AL. + JE ZOFF ; If tab then O.K + CMP AL,20H ; Turn Z-flag on + JL TURN_Z_ON ; if character +ZOFF: INC SI ; is below + JMP GET_CHAR_X ; 20h. + ; ( End of line +TURN_Z_ON: CMP AL,AL ; delimiters ). +GET_CHAR_X: RET + +GET_CHAR ENDP + + +;******************************************************** +;** IS_ALPHA : a routine to check the character in ** +;** AL if it is an alpha character (a...z,A...Z). ** +;** If character is lower case, convert to upper case. ** +;******************************************************** + +IS_ALPHA PROC + + PUSH AX ; Save value of AL + AND AL,0DFH ; Convert to upper case + CMP AL,'A' ; If <'A', then + JB IS_ALPHA_X ; NZ-flag is set, exit + CMP AL,'Z' ; If >'Z', then + JA IS_ALPHA_X ; NZ-flag is set, exit + CMP AL,AL ; Force Z-flag + POP DX ; Discard lower case. + JMP IA_X ; Exit. +IS_ALPHA_X: POP AX ; Restore value of AL +IA_X: RET + +IS_ALPHA ENDP + + +;******************************************************** +;** IS_DIGIT : a routine to check if the character in ** +;** AL register is a digit (i.e. 1..9). ** +;******************************************************** + +IS_DIGIT PROC + + CMP AL,'0' ; If < '0' then + JB IS_NUM_X ; NZ-flag is set, exit + CMP AL,'9' ; If > '9' then + JA IS_NUM_X ; NZ-flag is set, exit + CMP AL,AL ; Set Z-flag to indecate digit +IS_NUM_X: RET + +IS_DIGIT ENDP + + +;******************************************************** +;** IS_DELIM : This routine check if the character in ** +;** AL is a delimiter. ('+',' ',';',',','=',tab) ** +;******************************************************** + +IS_DELIM PROC + + CMP AL,' ' ; Test for space. + JE IS_DELIM_X ; Z-flag is set, exit + CMP AL,',' ; Test for comma. + JE IS_DELIM_X ; Z-flag is set, exit + CMP AL,';' ; Test for semicolon. + JE IS_DELIM_X ; Z-flag is set, exit + CMP AL,'=' ; Test for equal sign. + JE IS_DELIM_X ; Z-flag is set, exit + CMP AL,09h ; Test for TAB. + +IS_DELIM_X: RET ; Exit + +IS_DELIM ENDP + + +;******************************************************** +;** DEVICE_PARSE : Parse the device driver name and ** +;** store in table. Update offset. ** +;******************************************************** + +DEVICE_PARSE PROC + + MOV DI,TABLE_2 + MOV DS:WORD PTR [DI],0008H ; Save dev name size. + ADD DI,02H ; Increment DI. + MOV CX,9 ; Set counter. +NEXT_C: CALL IS_ALPHA ; if Check then. + JZ SAVE_C ; Save it. + CALL IS_DIGIT ; if Digit then. + JZ SAVE_C ; Save it. + CMP AL,'-' ; If '-' then. + JZ SAVE_C ; Save it. + CALL IS_DELIM ; If a delimiter then. + JZ ADD_SPACE1 ; Pad with spaces. + CMP AL,':' ; If a colon + JE ADD_SPACE1 ; then end device parse + JMP ERR_DEV_PAR ; Else an error. + +SAVE_C: DEC CX ; Decrement counter. + CMP CX,0 ; If counter zero then. + JE ERR_DEV_PAR ; Error. + MOV DS:BYTE PTR [DI],AL ; Save char in table. + INC DI ; Increment pointer. + CALL GET_CHAR ; Get another char. + JZ ERR_DEV_PAR + JMP NEXT_C ; Check char. + +ERR_DEV_PAR: MOV DEV_ERR_FLG,01H ; Set error flag. + JMP DEV_PAR_X ; Exit. + +ADD_SPACE1: DEC CX ; Check counter. + CMP CX,1 + JL DEV_PAR_X ; Exit if already 8. +LL1: MOV DS:BYTE PTR [DI],' ' ; Pad name with spaces. + INC DI ; Increment pointer. + LOOP LL1 ; Loop again. +DEV_PAR_X: RET + +DEVICE_PARSE ENDP + + +;******************************************************** +;** ID_PARSE : Parse the id driver name and ** +;** store in table. Update offset. ** +;******************************************************** + +ID_PARSE PROC + + MOV DI,TABLE_3 + MOV DS:WORD PTR [DI],0008H ; Save dev name size. + ADD DI,02H ; Increment DI. + MOV RIGHT_FLAG,00H ; Clear flag. + MOV CX,9 ; Set counter. + +NEXT_I: CALL IS_ALPHA ; If Check then. + JZ SAVE_I ; Save it. + CALL IS_DIGIT ; if Digit then. + JZ SAVE_I ; Save it. + CMP AL,'-' ; If '-' then. + JZ SAVE_I ; Save it. + CMP AL,'(' ; If '(' then. + JE RIG_BR_FLG ; Set flag. + CMP AL,')' ; If ')' then + JE BR_FLG_LEF ; Pad with spaces. + CALL IS_DELIM ; If a delimiter then. + JZ ADD_SPACE2 ; Pad with spaces. + JMP ERR_ID_PAR ; Else an error. + +SAVE_I: DEC CX ; Decrement counter. + CMP CX,0 ; If counter zero then. + JLE ERR_ID_PAR ; Error. + MOV DS:BYTE PTR [DI],AL ; Save char in table. + INC DI ; Increment pointer. + CALL GET_CHAR ; Get another char. + JZ ADD_SPACE2 ; Exit routine. + JMP NEXT_I ; Check char. + +ERR_ID_PAR: MOV ID_ERR_FLG,01H ; Set error falg on. + JMP ID_PAR_X ; Exit. + +BR_FLG_LEF: CMP RIGHT_FLAG,01H ; If left bracket was + JNE ERR_ID_PAR ; found and no previous + JMP ADD_SPACE2 ; Bracket found, then error + +RIG_BR_FLG: CMP RIGHT_FLAG,01H ; If more than one bracket + JE ERR_ID_PAR ; then error. + CMP CX,09 ; If '(' and already id + JB ERR_ID_PAR ; then error. + MOV RIGHT_FLAG,01H ; Set flag for. + CALL GET_CHAR ; Left brackets. + JZ ERR_ID_PAR ; If end of line,exit. + JMP NEXT_I ; Check character. + +ADD_SPACE2: DEC CX ; Check counter. + CMP CX,1 + JL ID_PAR_X ; Exit if already 8. + +LL2: MOV DS:BYTE PTR [DI],' ' ; Pad name with spaces. + INC DI ; Increment pointer. + LOOP LL2 ; Loop again. + +ID_PAR_X: RET + +ID_PARSE ENDP + +;******************************************************** +;** HWCP_PARMS : Scane for the hardware code page, and ** +;** parse it if found. Flag codes set to: ** +;** ERROR_FLAG = 0 - parsing completed. No error. ** +;** ERROR_FLAG = 1 - error found exit parse. ** +;** ERROR_FLAG = 2 - end of line found, exit parse. ** +;******************************************************** + + +HWCP_PARMS PROC + + MOV COMMA_FLAG,00H ; Set the comma flag off. + MOV ERROR_FLAG,00H ; Set the error flag off. + DEC SI ; Point at current char in Al. + CMP RIGHT_FLAG,01H ; If no left brackets then + JNE LEFT_BR ; Exit parse. + +HWCP_1: CALL GET_CHAR ; Load character in AL. + JZ LEFT_BR ; Exit, if end of line. + CALL IS_DIGIT ; Check if digit, then + JE HP1 ; Parse hwcp parms. + CMP AL,',' ; If a comma + JE COMMA_1 ; Jump to comma_1 + CMP AL,')' ; If a ')' then + JE RIGHT_BR ; end of current dev parms. + CMP AL,'(' ; If a '(' then + JE HWCP_2 ; There are multible hwcp. + CALL IS_DELIM ; Else, if not a delimiter + JNE EXIT_2 ; Then error, exit + JMP HWCP_1 ; Get another character. + +LEFT_BR: CMP RIGHT_FLAG,01H ; If no left bracket + JE EXIT_2 ; Then error, exit + JMP RB1 ; Jump to rb1 + +COMMA_1: CMP COMMA_FLAG,01H ; If comma flag set + JE COM_2_HC ; Then exit hwcp parse. + MOV COMMA_FLAG,01H ; Else set comma flag. +JMP HWCP_1 ; Get another character. + +HWCP_2: CMP RIGHT_FLAG,01H ; If left bracket not set + JNE EXIT_2 ; then error. + CALL MUL_HWCP ; else call multiple hwcp + ADD DI,02H ; routine. Increment DI + MOV TABLE_5,DI ; Desg. Table starts at end + CALL OFFSET_TABLE ; Update table of offsets. + JMP HP_X ; Exit. + +HP1: JMP HWCP ; Jump too long. + +COM_2_HC: MOV DI,TABLE_4 ; DI points at hwcp table + MOV DS:WORD PTR [DI],0000H ; Set number of pages to + MOV COMMA_FLAG,00H ; Zero and reset comma flag. + ADD DI,02H ; Increment DI. + MOV TABLE_5,DI ; Desg. Table starts at end + CALL OFFSET_TABLE ; Update table of offsets. + JMP HP_X ; of hwcp table. Exit. + +RIGHT_BR: CMP RIGHT_FLAG,01H ; If left brackets not + JNE EXIT_2 ; Found then error. +RB1: MOV ERROR_FLAG,02H ; Set end of line flag. + MOV BX,TABLE_4 ; Point at hwcp table + ADD BX,02H ; Adjust pointer to desg + MOV TABLE_5,BX ; table, and save in table_5 + MOV DI,TABLE_1 ; Point at table of offsets + ADD DI,08H ; Set at DESG offset + MOV DS:WORD PTR [DI],BX ; Update table. + JMP HP_X ; Exit + + + +EXIT_2: MOV ERROR_FLAG,01H ; Set error flag. + JMP HP_X ; and exit. + +HWCP: CMP RIGHT_FLAG,01H ; If left brackets not + JNE EXIT_2 ; Found then error. + CALL HWCP_PARSE ; Call parse one hwcp. + CMP ERROR_FLAG,01H ; If error flag set + JE HP_X ; Then exit, else + CALL OFFSET_TABLE ; Update table of offsets. + +HP_X: RET + +HWCP_PARMS ENDP + + +;******************************************************** +;** HWCP_PARSE : Parse the hardware code page page ** +;** number and change it from hex to binary. ** +;******************************************************** + +HWCP_PARSE PROC + + MOV DI,TABLE_4 ; Load address of hwcpages. + ADD DS:WORD PTR [DI],0001H ; Set count to 1 + + CALL GET_NUMBER ; Convert number to binary. + CMP ERROR_FLAG,01H ; If error then + JE HWCP_X ; Exit. + MOV DS:WORD PTR [DI+2],BX ; Else, save binary page number + ADD DI,04H ; Increment counter + MOV TABLE_5,DI ; Set pointer of designate num + +HWCP_X: RET + +HWCP_PARSE ENDP + + +;******************************************************** +;** MUL_HWCP : Parse multiple hardware code pages ** +;** and convert them from hex to binary numbers. ** +;******************************************************** + +MUL_HWCP PROC + + MOV DI,TABLE_4 ; Load offset of table_4 + MOV BX,DI ; in DI and Bx. + MOV HWCP_FLAG,00H ; Set hwcp flag off. + +MH1: CALL GET_CHAR ; Load character in AL. + JZ MH3 ; Exit if end of line. + CMP AL,')' ; If ')' then exit + JE MH2 ; end of parms. + CALL IS_DIGIT ; If a digit, then + JE MH4 ; Convert number to binary. + CALL IS_DELIM ; If not a delimiter + JNE MH3 ; then error, exit + JMP MH1 ; get another character. + +MH2: CALL GET_CHAR ; Get next character + JMP MH_X ; and exit. + +MH3: MOV ERROR_FLAG,01H ; Set error flag on. + JMP MH_X ; Exit. + +MH4: ADD HWCP_FLAG,01H ; Set hwcp flag on (0 off) + ADD DI,02H ; Increment table pointer + PUSH BX ; Save Bx + CALL GET_NUMBER ; Convert number to binary. + MOV DS:WORD PTR [DI],BX ; Add number to table + POP BX ; Restore BX. + CMP ERROR_FLAG,01H ; If error then + JE MH_X ; Exit. + ADD DS:WORD PTR [BX],01H ; Increment hwcp count. + DEC SI ; Point at character in AL + JMP MH1 ; (delimeter or ')'). +MH_X: RET + +MUL_HWCP ENDP + + + +;******************************************************** +;** DESG_PARMS : Scane for the designate numbers, and ** +;** parse it if found. Flag codes set to: ** +;** ERROR_FLAG = 0 - parsing completed. No error. ** +;** ERROR_FLAG = 1 - error found exit parse. ** +;** ERROR_FLAG = 2 - end of line found, exit parse. ** +;******************************************************** + + +DESG_PARMS PROC + + MOV DI,TABLE_1 ; Get offset of dev in DI + MOV BX,TABLE_5 ; & offset of desg. in BX. + ADD DI,08 ; Location of desg offset in table. + MOV DS:WORD PTR [DI],BX ; Update table. + MOV COMMA_FLAG,00H ; Set comma flag off. + + cmp al,'(' + je df + cmp al,')' + je right_br2 + + cmp al,',' + jne desg_parm1 + mov comma_flag,01h + +DESG_PARM1: CALL GET_CHAR ; Get character in AL. + JZ EXIT_3 ; Error, if end of line + CALL IS_DIGIT ; If character is a digit + JE DESG ; Then convert to binary. + CMP AL,')' ; If a ')', then + JE RIGHT_BR2 ; end of parameters. + CMP AL,'(' ; If a '(' then + JE DF ; parse desg and font. + CMP AL,',' ; If a comma then + JE DP3 ; set flag. + CALL IS_DELIM ; If not a delimiter + JNE EXIT_3 ; then error. + JMP DESG_PARM1 ; Get another character. + +RIGHT_BR2: CMP RIGHT_FLAG,01H ; IF no '(' encountered, + JNE EXIT_3 ; then error, exit + JMP DP_x ; Jump to DP1. + +EXIT_3: MOV ERROR_FLAG,01H ; Set error flag on + JMP DP_X ; Exit. + +DF: CMP RIGHT_FLAG,01H ; If no '(' encountered + JB EXIT_3 ; then error, exit + CALL DESG_FONT ; Parse desg and font. + JMP DP1 ; Jump to DP1. + +DP2: CALL FIND_RIGHT_BR ; Check for ')' + JMP DP_X ; Exit. + +DP3: CMP COMMA_FLAG,01H ; If comma flag set + JE DP2 ; then error + MOV COMMA_FLAG,01H ; Else set comma flag on. + JMP DESG_PARM1 ; Get another character. + +DESG: MOV ERROR_FLAG,00H ; Set error flag off. + CALL DESG_PARSE ; Parse desg. +DP1: CMP ERROR_FLAG,01H ; If error flag on then + JE DP_X ; Exit, + CALL FIND_RIGHT_BR ; Else check for ')' + CALL OFFSET_TABLE ; Update table + +DP_X: RET + +DESG_PARMS ENDP + + + +;******************************************************** +;** DESG_FONT : Parse the designate and font numbers & ** +;** change them from decimal to binary. ** +;******************************************************** + + +DESG_FONT PROC + + + MOV DI,TABLE_5 ; Get desg font table. + MOV COMMA_FLAG,00H ; Set comma flag off. +DF1: CALL GET_CHAR ; Load a character in AL. + JZ DF3 ; Error if end of line. + CMP AL,',' ; Check if a comma. + JE DF2 ; Set flag. + CALL IS_DIGIT ; If a digit, then + JE DF5 ; Convert number to binary. + CMP AL,')' ; If a ')' then + JE DF4 ; Exit. + CALL IS_DELIM ; If not a delimiter + JNE DF3 ; then error, exit + JMP DF1 ; Get another character. + +DF2: CMP COMMA_FLAG,01H ; If comma flag on + JE DF3 ; then error, exit + MOV COMMA_FLAG,01H ; Set comma flag on + ADD DS:WORD PTR [DI],01H ; Increment desg counter. + MOV DS:WORD PTR [DI+2],0FFFFH ; Load ffffh for desg empty + JMP DF1 ; field. + +DF3: MOV ERROR_FLAG,01H ; Set error flag on. + JMP DF_X ; Exit. + +DF4: CMP DESG_FLAG,00H ; If desg flag off + JE DF3 ; then error, exit + JMP DF_X ; Else exit. + +DF5: ADD DS:WORD PTR [DI],01H ; Increment desg font count. + CMP DESG_FLAG,01H ; If desg flag is on + JE DF6 ; then get font. + CMP COMMA_FLAG,01H ; if comma flag is on + JE DF6 ; then get font. + MOV DESG_FLAG,01H ; Set desg flag on + JMP DF7 ; Get desg number. + +DF6: ADD DI,02H ; adjust pointer to font. + MOV DESG_FLAG,02H ; Set desg and font flag. +DF7: CALL GET_NUMBER ; Get a number & convert to + CMP ERROR_FLAG,01H ; binary. + JE DF_X ; If error flag set, Exit. + MOV DS:WORD PTR [DI+2],BX ; Store number in table. + CMP DESG_FLAG,02H ; If desg and font flag + JNE DF1 ; not set, then get char. + CALL FIND_RIGHT_BR ; Check for right bracket. + +DF_X: RET + +DESG_FONT ENDP + + +;******************************************************** +;** DESG_PARSE : Parse the designate number and ** +;** change it from decimal to binary. ** +;******************************************************** + +DESG_PARSE PROC + + MOV DI,TABLE_5 ; Load designate location + ADD DS:WORD PTR [DI],0001H ; Update table count. + + CALL GET_NUMBER ; Get the ascii number and + CMP ERROR_FLAG,01H ; conver it to binary + JE DESG_X ; If error then exit + + MOV DS:WORD PTR [DI+2],BX ; Else, save desg number + + +DESG_X: RET + +DESG_PARSE ENDP + + +;******************************************************** +;** GET_NUMBER : Convert the number pointed to by SI ** +;** to a binary number and store it in BX ** +;******************************************************** + +GET_NUMBER PROC + + MOV CX,0AH ; Set multiplying factor + XOR BX,BX ; Clear DX + +NEXT_NUM: SUB AL,30H ; Conver number to binary + CBW ; Clear AH + XCHG AX,BX ; Switch ax and bx to mul + MUL CX ; already converted number by 10. + JO ERR_NUM ; On over flow jump to error. + ADD BX,AX ; Add number to total. + JC ERR_NUM ; On over flow jump to error. + XOR AX,AX ; Clear AX (clear if al=0a). + CALL GET_CHAR ; Get next character + JZ GET_NUM_X ; Exit, if end of line. + CALL IS_DIGIT ; Call is digit. + JNZ GET_NUM_X ; Exit if not a number. + JMP NEXT_NUM ; Loop. + +ERR_NUM: MOV ERROR_FLAG,01H ; Set error code to 1. + +GET_NUM_X: RET + +GET_NUMBER ENDP + + +;******************************************************** +;** UPDATE_TABLE : This routine set up pointers to the ** +;** different offsets of the different tables ** +;******************************************************** + +UPDATE_TABLE PROC + + MOV DS:WORD PTR [DI],BX ; Offset of offsets + MOV TABLE_1,BX ; Table_1 points at offsets + + MOV DI,BX ; + ADD BX,0CH ; + MOV DS:WORD PTR [DI+2],BX ; Offset of DEVICE name. + MOV TABLE_2,BX ; Table_2 point at device name. + + ADD BX,0AH ; + MOV DS:WORD PTR [DI+4],BX ; Offset of ID name. + MOV TABLE_3,BX ; Table_3 point at ID name. + + ADD BX,0AH ; + MOV DS:WORD PTR [DI+6],BX ; Offset of HWCP pages. + MOV TABLE_4,BX ; Table_4 point at HWCP pages. + + RET + +UPDATE_TABLE ENDP + + +;******************************************************** +;** OFFSET_TABLE : This routine set up pointers of ** +;** tables number one and two. ** +;******************************************************** + +OFFSET_TABLE PROC + + MOV DI,TABLE_1 ; Increment the number + ADD DS:WORD PTR [DI],01H ; of parms foun. (ie. id,hwcp + RET ; and desg) + +OFFSET_TABLE ENDP + + +;******************************************************** +;** FIND_RIGHT_BR :This routine scane the line for a ** +;** ')' if cannot find it turns error flag on ** +;******************************************************** + +FIND_RIGHT_BR PROC + +FBR1: CMP AL,')' ; If a right bracket + JE FBR_X ; then exit. + CMP AL,' ' ; If not a space + JNE FBR2 ; Then error. + CALL GET_CHAR ; Get a character + JZ FBR2 ; If end of line then exit. + JMP FBR1 ; Else get another character. + +FBR2: MOV ERROR_FLAG,01H ; Set error flag on +FBR_X: MOV AL,20H ; Erase character from AL. + RET + +FIND_RIGHT_BR ENDP + + +PROGRAM ENDS + END START diff --git a/v4.0/src/DEV/PRINTER/PARSER.ASM b/v4.0/src/DEV/PRINTER/PARSER.ASM new file mode 100644 index 0000000..f299838 --- /dev/null +++ b/v4.0/src/DEV/PRINTER/PARSER.ASM @@ -0,0 +1,668 @@ +PAGE ,132 +TITLE PARSE CODE AND CONTROL BLOCKS FOR PRINTER.SYS + +;****************** START OF SPECIFICATIONS ************************** +; +; MODULE NAME: PARSER.ASM +; +; DESCRIPTIVE NAME: PARSES THE DEVICE= STATEMENT IN CONFIG.SYS FOR +; PRINTER.SYS +; +; FUNCTION: THE COMMAND LINE PASSED TO PRINTER.SYS IN THE CONFIG.SYS +; STATEMENT IS PARSED TO CHECK FOR CORRECT SYNTAX. A TABLE +; IS SETUP CONTAINING THE VALUES FOUND. +; +; ENTRY POINT: PARSER +; +; INPUT: ES:DI POINTS TO REQUEST HEADER +; +; AT EXIT: +; NORMAL: TABLE SET UP WITH VALUES FOUND. +; +; ERROR: 0 RETURNED IN FIRST WORD OF TABLE. +; +; INTERNAL REFERENCES: +; +; ROUTINES: SYSPARSE - PARSING CODE +; +; DATA AREAS: PARMSx - PARSE CONTROL BLOCK FOR SYSPARSE +; +; EXTERNAL REFERENCES: +; +; ROUTINES: N/A +; +; DATA AREAS: TABLE - TO CONTAIN VALUES FOUND IN DEVICE= LINE +; +; NOTES: +; +; REVISION HISTORY: +; AN000; - DOS Version 4.00 +; AN001 - GHG Changes had to made for P897. The PARSER was +; changed to need the '=' in the keywords. +; +; Label: "DOS DISPLAY.SYS Device Driver" +; "Version 4.00 (C) Copyright 1988 Microsoft +; "Licensed Material - Program Property of Microsoft" +; +; +;****************** END OF SPECIFICATIONS **************************** +;*Modification history ******************************************************** +;AN001; p1482 - PRINTER.SYS refused to initialize 10/6/87 J.K. +;AN002; p2686 No range checking on n parameter for printer.sys 12/11/87 J.K. +;****************************************************************************** + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; The following is the table structure of the parser. All fields are +; two bytes field (accept for the device and id name) +; +; TABLE HEADER : +; +; Ŀ +; N = Number of devices. +; Ĵ +; Device # 1 offset >Ŀ +; Ĵ +; Device # 2 offset Table_1 (a) +; Ĵ +; Device # 3 offset +; Ĵ +; Device # 4 offset +; +; +; +; N = 1,2,3 or 4. A two bytes number indicating the number of device specified. +; DEVICE # N OFFSET : a two bytes offset address to table_1. (ie. Device #1 offset +; is a pointer to table_1 (a). Device #2 offset is a pointer to table_1 +; (b)...etc.). If an error was detected in the command N is set to zero. +; +; +; +; TABLE_1 : +; +; +; Ŀ Ŀ +; N = Number of Offsets. +; Ĵ ij Table_2 (a) +; Device Name offset +; Ĵ +; Device Id offset Ŀ +; Ĵ Ŀ +; Device HWCP offset Ŀ +; Ĵ ij Table_3 (a) +; Device Desg offset Ŀ +; Ĵ +; "Reserved" +; Ŀ +; +; ij Table_4 (a) +; +; +; Ŀ +; +; ij Table_5 (a) +; +; +; +; +; N=Length of table_1, or the number of offsets contained in table_1. +; The offsets are pointers (two bytes) to the parameters value of the device. +; "Reserved" : a two byte memory reserved for future use of the "PARMS" option. +; +; +; TABLE_2 : +; +; +; Ŀ +; N = Length of devices name +; Ĵ +; Device name +; +; +; N = Length of device name. Device length is always 8 byte long. +; Device Name : the name of the device (eg. LPT1, CON, PRN). The name +; is paded with spaces to make up the rest of the 8 characters. +; +; +; +; TABLE_3 : +; +; +; Ŀ +; N = Length of Id name. +; Ĵ +; Id Name +; +; +; N = Length of id name. Id name length is always 8 byte long. +; Id Name : the name of the id (eg. EGA, VGA). The name +; is paded with spaces to make up the rest of the 8 character. +; +; +; +; TABLE_4 : +; +; +; Ŀ +; N = Length of table. +; Ĵ +; HWCP # 1 +; Ĵ +; HWCP # 2 +; Ĵ +; . +; . +; . +; Ĵ +; HWCP # 10 +; +; +; +; N = Length of table in words. Or the number of HWCP's. +; HWCP # N : a hardware code page number converted to binary. The maximum +; number of pages allowed is 10. +; +; +; +; TABLE_5 : +; +; +; Ŀ +; N = Length of table. +; Ĵ +; Designate +; Ĵ +; Font +; +; +; N = Lenght of table. 0 - nothing was specified +; 1 - Only a designate was specified. +; 2 - Designate and font were given. If the Desg field +; was left empty in the DEVICE command then the +; Designate field is filled with 0FFFFH. +; Designate, Font : Are the Desg. and Font binary numbers. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + +.XLIST +INCLUDE STRUC.INC ; Structured macros ;AN000; +.LIST + +INCLUDE CPSPEQU.INC ;AN000; + +PUBLIC PARSER ; near procedure for parsing DEVICE= statement ;AN000; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Set assemble switches for parse code +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +DateSW EQU 0 ;AN000; +DrvSW EQU 0 ;AN000; +SwSW EQU 0 ;AN000; +Val1SW EQU 1 ;;AN002; ;AN000; +Val2SW EQU 0 ;AN000; +Val3SW EQU 0 ;AN000; + + +CSEG SEGMENT PARA PUBLIC 'CODE' ;AN000; + ASSUME CS:CSEG,DS:NOTHING,ES:NOTHING ;AN000; + + +EXTRN TABLE:WORD ; table for variable storage used by INIT module. ;AN000; +EXTRN DEVICE_NUM:WORD ;AN000; + +.XLIST +INCLUDE PARSE.ASM ; Parsing code ;AN000; +.LIST + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PARM control block for parsing PRINTER.SYS - DEVICE= command statement. +; Command line looks like: +; +; DEVICE=[d:][path]PRINTER.SYS LPT#[:]=(type[,[hwcp][,n]]) +; or +; DEVICE=[d:][path]PRINTER.SYS LPT#[:]=(type[,[(hwcp1,hwcp2,...)][,n]]) +; +; The command line will be parsed from left to right, taking care of the +; nesting of complex lists as they occur. +; +; The first level of control blocks is shown below. +; Complex list control blocks follow. +; Null VALUE LIST and RESULT BUFFER are placed after all other PARSE control +; blocks. +; +; d:\path\PRINTER.SYS lpt#=(complex list) +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +PARMS1 LABEL WORD ;AN000; + DW PARMSX1 ;AN000; + DB 0 ; no extra delimeters or EOLs. ;AN000; + +PARMSX1 LABEL BYTE ;AN000; + DB 1,1 ; min,max positional operands ;AN000; + DW D_NAME ; pointer to control block ;AN000; + DB 0 ; no switches ;AN000; + DB 1 ; 1 or more keywords ;AN000; + DW PRT_LIST ; pointer to control block ;AN000; + +D_NAME LABEL WORD ;AN000; + DW 0200H ; file spec ;AN000; + DW 0001H ; cap result by file table ;AN000; + DW RESULT_BUF ; result ;AN000; + DW NOVALS ; no value checking done ;AN000; + DB 0 ; no keyword/switch synonyms ;AN000; + +PRT_LIST LABEL WORD ;AN000; + DW 0402H ; complex list, repeats allowed ;AN000; + DW 0002H ; cap result by char table ;AN000; + DW RESULT_BUF ; result ;AN000; + DW NOVALS ; no value checking done ;AN000; + DB 8 ; 4 keywords ;AN000; + DB "PRN=",0 ;GHG Ŀ ;AN001; + DB "LPT1=",0 ;GHG 4 possible keywords ;AN001; + DB "LPT2=",0 ;GHG ;AN001; + DB "LPT3=",0 ;GHG ;AN001; + DB "PRN:=",0 ;GHG Ŀ ;AN001; + DB "LPT1:=",0 ;GHG 4 possible keywords ;AN001; + DB "LPT2:=",0 ;GHG with colon ;AN001; + DB "LPT3:=",0 ;GHG ;AN001; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PARM control block for second level of nesting. +; ie. complex list from first level of nesting +; +; (type, hwcp or complex list, n) +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +PARMS2 LABEL WORD ;AN000; + DW PARMSX2 ;AN000; + DB 0 ; no extra delimeters or EOLs. ;AN000; + +PARMSX2 LABEL BYTE ;AN000; + DB 1,3 ; min,max positional operands ;AN000; + DW PRT_TYPE ; pointer to control block ;AN000; + DW HWCP ; pointer to control block ;AN000; + DW CP_PREPS ; pointer to control block ;AN000; + DB 0 ; no switches ;AN000; + DB 0 ; no keywords ;AN000; + +PRT_TYPE LABEL BYTE ;AN000; + DW 2000H ; sstring ;AN000; + DW 0002H ; cap by char table ;AN000; + DW RESULT_BUF ; result ;AN000; + DW NOVALS ; value list ;AN000; + DB 0 ; no keyword/switch synonyms ;AN000; + +HWCP LABEL BYTE ;AN000; + DW 8401H ; numeric or complex list (optional) ;AN000; + DW 0 ; no functions ;AN000; + DW RESULT_BUF ; result ;AN000; + DW NOVALS ; no value checking done ;AN000; + DB 0 ; no keyword/switch synonyms ;AN000; + +CP_PREPS LABEL BYTE ;AN000; + DW 8001H ; numeric (optional) ;AN000; + DW 0 ; no functions ;AN000; + DW RESULT_BUF ; result ;AN000; + DW N_Val_Range ;AN002; value list ;AN000; + DB 0 ; no keyword/switch synonyms ;AN000; + + +N_Val_Range label byte + db 1 ;AN002; Range defintion + db 1 ;AN002; Number of ranges + db 1 ;AN002; item tag + dd 0, 12 ;AN002; 0 - 12 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PARM control block for third level of nesting. +; ie. complex list from second nesting level +; +; (hwcp1,hwcp2,...) +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +PARMS3 LABEL WORD ;AN000; + DW PARMSX3 ;AN000; + DB 0 ; no extra delimeters or EOLs. ;AN000; + +PARMSX3 LABEL BYTE ;AN000; + DB 1,1 ; min,max positional operands ;AN000; + DW HWCPS ; pointer to control block ;AN000; + DB 0 ; no switches ;AN000; + DB 0 ; no keywords ;AN000; + +HWCPS LABEL BYTE ;AN000; + DW 8003H ; numeric, repeats allowed ;AN000; + DW 0 ; no functions ;AN000; + DW RESULT_BUF ; result ;AN000; + DW NOVALS ; no value checking done ;AN000; + DB 0 ; no keyword/switch synonyms ;AN000; + + +; Null VALUE LIST and RESULT BUFFER for all PARSE control blocks + + +NOVALS LABEL BYTE ;AN000; + DB 0 ; no value checking done ;AN000; + +RESULT_BUF LABEL BYTE ;AN000; +RESULT_TYPE DB ? ; type returned (number, string, etc.) ;AN000; + DB ? ; matched item tag (if applicable) ;AN000; +SYN_PTR DW ? ; synonym ptr (if applicable) ;AN000; +RESULT_VAL DD ? ; value ;AN000; + + +OK_FLAG DB ON ; FLAG INDICATING PARSE STATUS ;AN000; +NUM_LOOP DB ZERO ;AN000; + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: PARSER +; +; FUNCTION: +; THIS PROCEDURE PARSES THE DEVICE= PARAMETERS FROM THE INIT REQUEST +; BLOCK. +; +; AT ENTRY: ES:DI POINTS TO REQUEST HEADER +; +; AT EXIT: +; NORMAL: TABLE SET UP WITH VALUES FOUND +; +; ERROR: 0 LOADED IN FIRST WORD OF TABLE +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +PARSER PROC NEAR ;AN000; + PUSH DX ;AN000; + PUSH DI ;AN000; + PUSH ES ;AN000; + PUSH BX ;AN000; + PUSH DS ; ;AN000; + PUSH SI ; ;AN000; + CLD ; ;AN000; + LDS SI,RH.RH0_BPBA ; ;AN000; + PUSH CS ; establish ES .. ;AN000; + POP ES ; addressability to data ;AN000; + LEA DI,PARMS1 ; point to PARMS control block ;AN000; + XOR CX,CX ; clear both CX and DX for ;AN000; + XOR DX,DX ; SYSPARSE ;AN000; + CALL SYSPARSE ; move pointer past file spec ;AN000; + CALL SYSPARSE ; do first parse ;AN000; + LEA BX,TABLE ; ;AN000; + .WHILE AND ; EOL?...then end parse...and.. ;AN000; + .WHILE ; make sure that flag still ok.. ;AN000; + .IF ; parse error? ;AN000; + MOV OK_FLAG,OFF ; yes...reset flag ;AN000; + .ELSE ; ;AN000; + .SELECT ; ;AN000; + .WHEN ; complex string found? ;AN000; + INC DEVICE_NUM ; increment count ;AN000; + INC BX ; point to next device table ;AN000; + INC BX ; ;AN000; + .IF ; more than one? ;AN000; + MOV OK_FLAG,OFF ; yes....we have an error ;AN000; + .ELSE ; no .. ;AN000; + PUSH BX ; ;AN000; + MOV BX,CS:[BX] ; ;AN000; + CALL COPY_NAME ; ;AN000; + MOV NUM_LOOP,ZERO ; ;AN000; + CALL PARSE_MAIN ; process complex string.. ;AN000; + POP BX ; ;AN000; + .ENDIF ; ;AN000; + .OTHERWISE ; not a complex string so.. ;AN000; + MOV OK_FLAG,OFF ; we have a problem...reset flag ;AN000; + .ENDSELECT ; ;AN000; + .ENDIF ; ;AN000; + PUSH BX ; ;AN000; + CALL SYSPARSE ; continue parsing.. ;AN000; + POP BX ; ;AN000; + .ENDWHILE ; ;AN000; + .IF ; flag indicating error? ;AN000; + MOV DEVICE_NUM,ZERO ; yes...set device number to 0 ;AN000; + STC ; ;AN000; + .ELSE ; ;AN000; + CLC ; ;AN000; + .ENDIF ; ;AN000; + POP SI ; ;AN000; + POP DS ; ;AN000; + POP BX ; ;AN000; + POP ES ; ;AN000; + POP DI ; ;AN000; + POP DX ; ;AN000; + RET ; ;AN000; +PARSER ENDP ;AN000; + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: PARSE_MAIN +; +; FUNCTION: +; THIS PROCEDURE PARSES THE LPT=( ) COMPLEX LIST DEVICE= LINE FOUND +; IN CONFIG.SYS +; +; AT ENTRY: RESULT BUFFER CONTAINS POINTER TO COMPLEX STRING +; +; AT EXIT: +; NORMAL: TABLE SET UP WITH VALUES FOUND +; +; ERROR: OK_FLAG = 0 +; +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +PARSE_MAIN PROC NEAR ;AN000; + PUSH BX ; ;AN000; + PUSH DI ; setup to parse the nested.. ;AN000; + PUSH DS ; complex string...but save.. ;AN000; + PUSH SI ; current parsing status. ;AN000; + PUSH CX ; ;AN000; + XOR CX,CX ; ;AN000; + LEA DI,PARMS2 ; next control block.. ;AN000; + LDS SI,RESULT_VAL ; point to stored string ;AN000; + PUSH BX ; ;AN000; + CALL SYSPARSE ; ;AN000; + POP BX ; ;AN000; + .WHILE AND ; not EOL? and.. ;AN000; + .WHILE ; error flag still ok? ;AN000; + INC NUM_LOOP ; ;AN000; + .IF ; check for parse errors ;AN000; + MOV OK_FLAG,OFF ; yes....reset error flag ;AN000; + .ELSE ; no...process ;AN000; + PUSH BX ; ;AN000; + .SELECT ; ;AN000; + .WHEN ; simple string ;AN000; + MOV BX,CS:[BX].DI_OFFSET ; ;AN000; + CALL PARSE_STR ; yes...process ;AN000; + .WHEN ; number?.. ;AN000; + .IF ; ;AN000; + MOV BX,CS:[BX].DCP_OFFSET ;AN000; + .ELSE ; ;AN000; + MOV BX,CS:[BX].DD_OFFSET ;AN000; + .ENDIF ; ;AN000; + MOV AX,WORD PTR RESULT_VAL ; get value into word form ;AN000; + .IF ;AN000; + INC WORD PTR CS:[BX] ; ;AN000; + MOV WORD PTR CS:[BX+2],AX ; load that value. ;AN000; + .ENDIF ;AN000; + .WHEN ; complex string? ;AN000; + MOV BX,CS:[BX].DCP_OFFSET ; ;AN000; + CALL PARSE_COMP ; yes...process ;AN000; + .OTHERWISE ; anything else is.. ;AN000; + MOV OK_FLAG,OFF ; an error...reset flag. ;AN000; + .ENDSELECT ; ;AN000; + CALL SYSPARSE ; continue parsing ;AN000; + POP BX ; ;AN000; + .ENDIF ; ;AN000; + .ENDWHILE ; ;AN000; + POP CX ; restore original parse.. ;AN000; + POP SI ; registers. ;AN000; + POP DS ; ;AN000; + POP DI ; ;AN000; + POP BX ; ;AN000; + RET ; ;AN000; +PARSE_MAIN ENDP ;AN000; + ;AN000; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: PARSE_COMP +; +; FUNCTION: +; THIS PROCEDURE PARSES A COMPLEX LIST FOUND WITHIN THE LPT=( ) +; COMPLEX LIST. +; +; AT ENTRY: RESULT BUFFER CONTAINS POINTER TO COMPLEX STRING +; +; AT EXIT: +; NORMAL: TABLE SET UP WITH VALUES FOUND +; +; ERROR: OK_FLAG = 0 +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +PARSE_COMP PROC NEAR ;AN000; + PUSH DI ; setup ro parse the nested.. ;AN000; + PUSH DS ; complex string..saving the.. ;AN000; + PUSH SI ; current parse status. ;AN000; + PUSH CX ; ;AN000; + MOV DI,BX ; ;AN000; + PUSH DI ; ;AN000; + XOR CX,CX ; ;AN000; + LEA DI,PARMS3 ; next control block ;AN000; + LDS SI,RESULT_VAL ; point to stored string. ;AN000; + PUSH BX ; ;AN000; + CALL SYSPARSE ; ;AN000; + POP BX ; ;AN000; + .WHILE AND ; not EOL?...and.. ;AN000; + .WHILE AND ; error flag still okay? ;AN000; + .WHILE ; ;AN000; + .IF ; parse error?...or.. ;AN000; + MOV OK_FLAG,OFF ; found?....yes..reset flag. ;AN000; + .ELSE ; no...process.. ;AN000; + INC WORD PTR CS:[BX] ; increment counter ;AN000; + .IF < LE TEN> ;AN000; + POP DI ; ;AN000; + MOV AX,WORD PTR RESULT_VAL ; get numeric value into word ;AN000; + MOV WORD PTR CS:[DI+2],AX ; ;AN000; + INC DI ; ;AN000; + INC DI ; ;AN000; + PUSH DI ; ;AN000; + PUSH BX ; ;AN000; + LEA DI,PARMS3 ; ;AN000; + CALL SYSPARSE ; continue parsing ;AN000; + POP BX ; ;AN000; + .ELSE ; ;AN000; + MOV OK_FLAG,OFF ; ;AN000; + .ENDIF ; ;AN000; + .ENDIF ; ;AN000; + .ENDWHILE ; ;AN000; + POP DI ; ;AN000; + POP CX ; restore previous parse.. ;AN000; + POP SI ; registers. ;AN000; + POP DS ; ;AN000; + POP DI ; ;AN000; + RET ; ;AN000; +PARSE_COMP ENDP ;AN000; + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: PARSE_STR +; +; FUNCTION: +; THIS PROCEDURE PARSES A STRING FOUND WITHIN THE LPT=( ) STATEMENT +; +; AT ENTRY: RESULT BUFFER POINTS TO ASCIIZ STRING +; +; AT EXIT: +; NORMAL: TABLE SET UP WITH VALUES FOUND +; +; ERROR: STRING > 8 - OK_FLAG SET OFF +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +PARSE_STR PROC NEAR ;AN000; + PUSH DI ; get source and.. ;AN000; + PUSH DS ; destination registers.. ;AN000; + PUSH SI ; setup. ;AN000; + PUSH CX ; ;AN000; + LDS SI,RESULT_VAL ; ;AN000; + MOV DI,BX ; ;AN000; + MOV CS:[DI].N_LENGTH,EIGHT ; ;AN000; + INC DI ; ;AN000; + INC DI ; ;AN000; + MOV CX,EIGHT ; ;AN000; + LODSB ; load first character. ;AN000; + .WHILE AND ; while not at end of ASCIIZ do.. ;AN000; + .WHILE ; ;AN000; + STOSB ; store.. ;AN000; + LODSB ; load next character.. ;AN000; + DEC CX ; ;AN000; + .ENDWHILE ; ;AN000; + .IF ;AN000; + MOV OK_FLAG,OFF ;AN000; + .ENDIF ;AN000; + POP CX ; value found. ;AN000; + POP SI ; restore registers. ;AN000; + POP DS ; ;AN000; + POP DI ; ;AN000; + RET ;AN000; +PARSE_STR ENDP ;AN000; + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: COPY_NAME +; +; FUNCTION: +; THIS PROCEDURE COPIES THE FOUND STRING VALUE INTO THE TABLE. +; +; AT ENTRY: N/A +; +; AT EXIT: +; NORMAL: TABLE UPDATED +; +; ERROR: N/A +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +COPY_NAME PROC NEAR ;AN000; + PUSH DI ; get source and.. ;AN000; + PUSH DS ; destination registers.. ;AN000; + PUSH SI ; setup. ;AN000; + PUSH CS ; ;AN000; + POP DS ; ;AN000; + MOV SI,SYN_PTR ; ;AN000; + MOV DI,CS:[BX].DN_OFFSET ; ;AN000; + MOV CS:[DI].N_LENGTH,EIGHT ; ;AN000; + INC DI ; ;AN000; + INC DI ; ;AN000; + LODSB ; load first character. ;AN000; + .WHILE ; while not at end of ASCIIZ do.. ;AN000; + .IF AND ;ignore colon ;AN001; + .IF ; is this for PRINTER? ;AN000; + JMP DWORD PTR CS:ROM_INT2F ; no....jump to old INT2F ;AN000; + .ENDIF ; ;AN000; + PUSH AX ; ;AN000; + PUSH BP ; ;AN000; + PUSH BX ; s r ;AN000; + PUSH CX ; a e ;AN000; + PUSH DX ; v g ;AN000; + PUSH DI ; e s ;AN000; + PUSH SI ; ;AN000; + PUSH DS ; ;AN000; + PUSH ES ; ;AN000; + MOV CS:COPY_BUF0,ZERO ; ;AN000; + MOV CS:CODE_SEGB,CS ; ;AN000; + MOV BP,BX ; move req. cp to bp ;AN000; + .SELECT ; depending on the lptx.. ;AN000; + .WHEN ; point to the appropriate ;AN000; + LEA BX,BUF1 ; buffer.. ;AN000; + LEA SI,BUF0 ; ;AN000; + MOV CS:COPY_BUF0,SI ; ;AN000; + .WHEN ; ;AN000; + LEA BX,BUF2 ; ;AN000; + .WHEN ; ;AN000; + LEA BX,BUF3 ; ;AN000; + .OTHERWISE ; ;AN000; + STC ; not a valid lptx..set flag ;AN000; + .ENDSELECT ; ;AN000; + .IF NC ; process ;AN000; + .IF ; if unlock requested ;AN000; + CALL UNLOCK_CP ; unlock code page. ;AN000; + .ELSE ; must be a lock request.. ;AN000; + CALL LOCK_CP ; ;AN000; + .ENDIF ; ;AN000; + .ENDIF ; ;AN000; + MOV SI,CS:COPY_BUF0 ; ;AN000; + PUSHF ; ;AN000; + .IF ; if this is lpt1... ;AN000; + MOV AX,CS:[BX].STATE ; copy data into prn ;AN000; + MOV CS:[SI].STATE,AX ; buffer as well. ;AN000; + MOV AX,CS:[BX].SAVED_CP ; ;AN000; + MOV CS:[SI].SAVED_CP,AX ; ;AN000; + .ENDIF ; ;AN000; + POPF ; ;AN000; + POP ES ; ;AN000; + POP DS ; restore ;AN000; + POP SI ; ;AN000; + POP DI ; registers ;AN000; + POP DX ; ;AN000; + POP CX ; ;AN000; + POP BX ; ;AN000; + MOV BP,SP ; ;AN000; + MOV AX,[BP+8] ; load flag onto.. ;AN000; + .IF NC ; ;AN000; + AND AX,NOT_CY ; ;AN000; + .ELSE ; stack flags ;AN000; + OR AX,CY ; ;AN000; + .ENDIF ; ;AN000; + MOV [BP+8],AX ; ;AN000; + POP BP ; ;AN000; + POP AX ; ;AN000; + XCHG AH,AL ; exchange ah and al to show that.. ;AN000; +ABORT: IRET ; printer.sys is present. ;AN000; +INT2F_COM ENDP ;AN000; + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: UNLOCK_CP +; +; FUNCTION: +; THIS FUNCTION UNLOCKS THE DEVICE THAT IS LOCKED. +; +; AT ENTRY: +; BX - POINTS TO LPTx BUFFER +; +; +; AT EXIT: +; NORMAL: CARRY CLEAR - DEVICE UNLOCKED. +; +; ERROR: CARRY SET - ERROR DURING UNLOCK, ACTIVE CODE PAGE SET TO INACTIVE +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +UNLOCK_CP PROC NEAR ;AN000; + .IF NEAR ; is device locked? ;AN000; + MOV CS:[BX].STATE,CPSW ; change status to unlocked.. ;AN000; + MOV BP,CS:[BX].SAVED_CP ; get saved code page ;AN000; + .IF ; valid?..... ;AN000; + XOR AX,AX ; ;AN000; + CALL FIND_ACTIVE_CP ; find the active code page. ;AN000; + .IF ; are they the same..? ;AN000; + MOV CS:REQ_CP,BP ; no...invoke the saved code page ;AN000; + PUSH CS ; ;AN000; + POP ES ; ;AN000; + LEA DI,INVOKE_BLOCK ; ;AN000; + MOV CS:[BX].RH_PTRO,DI ; ;AN000; + MOV CS:[BX].RH_PTRS,ES ; ;AN000; + CALL INVOKE ; ;AN000; + .IF ; error on invoke? ;AN000; + MOV AX,ONE ; yes...change the active.. ;AN000; + CALL FIND_ACTIVE_CP ; to inactive. ;AN000; + .IF ; do likewise to PRN if this ;AN000; + PUSH BX ; is lpt1. ;AN000; + MOV BX,CS:COPY_BUF0 ; ;AN000; + CALL FIND_ACTIVE_CP ; ;AN000; + POP BX ; ;AN000; + .ENDIF ; ;AN000; + STC ; set error flag. ;AN000; + .ELSE ; ;AN000; + CLC ; invoke ok...clear error flag ;AN000; + .ENDIF ; ;AN000; + .ELSE ; ;AN000; + CLC ; active = saved ..no invoke... ;AN000; + .ENDIF ; clear error ;AN000; + .ELSE ; ;AN000; + MOV AX,ONE ; saved cp was inactive...change..;AN000; + CALL FIND_ACTIVE_CP ; active to inactive. ;AN000; + .IF ; do likewise to PRN if this ;AN000; + PUSH BX ; is lpt1. ;AN000; + MOV BX,CS:COPY_BUF0 ; ;AN000; + CALL FIND_ACTIVE_CP ; ;AN000; + POP BX ; ;AN000; + .ENDIF ; ;AN000; + CLC ; ;AN000; + .ENDIF ; ;AN000; + MOV CS:[BX].SAVED_CP,UNDEFINED; reset the saved cp ;AN000; + .ENDIF ; ;AN000; + RET ;AN000; +UNLOCK_CP ENDP ;AN000; + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: LOCK_CP +; +; FUNCTION: +; THIS FUNCTION LOCKS THE DEVICE WITH THE CODE PAGE REQUESTED. +; +; AT ENTRY: BP - REQUESTED CODE PAGE +; BX - POINTS TO LPTx BUFFER +; +; +; AT EXIT: +; NORMAL: CARRY CLEAR - DEVICE LOCKED. +; +; ERROR: CARRY SET - ERROR, CODE PAGE NOT LOCKED. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +LOCK_CP PROC NEAR ;AN000; + .IF ; if this was previously locked.. ;AN000; + MOV CS:PREV_LOCK,ON ; then...set flag and... ;AN000; + MOV CS:[BX].STATE,CPSW ; change to unlock for this proc ;AN000; + .ELSEIF ; if this is unlocked... ;AN000; + MOV CS:PREV_LOCK,OFF ; then set flag off. ;AN000; + .ELSE ; ;AN000; + STC ; neither...set error ;AN000; + .ENDIF ; ;AN000; + .IF NC ; ;AN000; + CALL CHECK_FOR_CP ; yes..see if req cp is available. ;AN000; + .IF NC ; yes... ;AN000; + XOR AX,AX ; ;AN000; + CALL FIND_ACTIVE_CP ; find the active code page ;AN000; + .IF ; is it the same as requested?.. ;AN000; + MOV CS:REQ_CP,BP ; no..invoke the requested cp ;AN000; + PUSH CS ; ;AN000; + POP ES ; ;AN000; + LEA DI,INVOKE_BLOCK ; ;AN000; + MOV CS:[BX].RH_PTRO,DI ; ;AN000; + MOV CS:[BX].RH_PTRS,ES ; ;AN000; + PUSH DX ; ;AN000; + CALL INVOKE ; ;AN000; + POP DX ; ;AN000; + .IF ; error on invoke? ;AN000; + STC ; yes...set error flag. ;AN000; + .ELSE ; ;AN000; + MOV CS:[BX].STATE,LOCKED ; no, 'lock' the printer device ;AN000; + .IF ; if we were not locked.. ;AN000; + MOV CS:[BX].SAVED_CP,DX ; and..save the old code page. ;AN000; + .ENDIF ; ;AN000; + CLC ; clear error flag. ;AN000; + .ENDIF ; ;AN000; + .ELSE ; ;AN000; + MOV CS:[BX].STATE,LOCKED ; 'lock' the printer device ;AN000; + .IF ; if we were not locked.. ;AN000; + MOV CS:[BX].SAVED_CP,DX ; and..save the old code page. ;AN000; + .ENDIF ; ;AN000; + CLC ; clear the error flag ;AN000; + .ENDIF ; ;AN000; + .ENDIF ; ;AN000; + .ENDIF ; ;AN000; + RET ;AN000; +LOCK_CP ENDP ;AN000; + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: CHECK_FOR_CP +; +; FUNCTION: +; THIS FUNCTION SEARCHES FOR THE CODE PAGE REQUESTED TO SEE IF IT HAS +; BEEN PREPARED OR IS A HARDWARE CODE PAGE +; +; +; AT ENTRY: BP = CODE PAGE REQUESTED +; BX - POINTS TO LPTx BUFFER +; +; +; AT EXIT: +; NORMAL: CARRY CLEAR - CODE PAGE IS VALID. +; +; ERROR: CARRY SET - CODE PAGE NOT AVAILABLE. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + +CHECK_FOR_CP PROC NEAR ;AN000; + PUSH DX ;AN000; + MOV DX,NOT_FOUND ; initialize flag ;AN000; + MOV CX,CS:[BX].RSLMX ; load number of RAM slots ;AN000; + MOV DI,CS:[BX].RAMSO ; load DI with table offset ;AN000; + .WHILE AND ; whil not found and.... ;AN000; + .WHILE ; while still slots to check.. ;AN000; + .IF ; is it this one?? ;AN000; + MOV DX,FOUND ; yes....set flag ;AN000; + .ELSE ; ;AN000; + ADD DI,TYPE SLTS ; no..point to next entry ;AN000; + DEC CX ; decrement the count ;AN000; + .ENDIF ; ;AN000; + .ENDWHILE ; ;AN000; + .IF ; if we didn't find it then.. ;AN000; + MOV CX,CS:[BX].HSLMX ; check hardware ;AN000; + MOV DI,CS:[BX].HARDSO ; load regs as before. ;AN000; + .WHILE AND ; while not found and.. ;AN000; + .WHILE ; still have slots to check.. ;AN000; + .IF ; is it this one? ;AN000; + MOV DX,FOUND ; yes...set flag. ;AN000; + .ELSE ; ;AN000; + ADD DI,TYPE SLTS ; no ..point to next entry ;AN000; + DEC CX ; and decrement count. ;AN000; + .ENDIF ; ;AN000; + .ENDWHILE ; ;AN000; + .ENDIF ; ;AN000; + .IF ; ;AN000; + STC ; set flag appropriately ;AN000; + .ELSE ; ;AN000; + CLC ; ;AN000; + .ENDIF ; ;AN000; + POP DX ; ;AN000; + RET ; ;AN000; +CHECK_FOR_CP ENDP ;AN000; + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; PROCEDURE_NAME: FIND_ACTIVE_CP +; +; FUNCTION: +; THIS FUNCTION SEARCHES FOR THE ACTIVE CODE PAGE. IF REQUESTED, THE +; CODE PAGE IS MADE INACTIVE. +; +; +; AT ENTRY: +; BX - POINTS TO LPTx BUFFER +; AX = 0 - LEAVE AS ACTIVE +; AX = 1 - DE-ACTIVATE +; +; +; AT EXIT: +; NORMAL: DX - ACTIVE CODE PAGE. (NO ACTIVE = -1) +; +; ERROR: N/A +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + +FIND_ACTIVE_CP PROC NEAR ;AN000; + MOV DX,UNDEFINED ; initialize register ;AN000; + MOV CX,CS:[BX].RSLMX ; load number of RAM slots ;AN000; + MOV DI,CS:[BX].RAMSO ; load DI with table offset ;AN000; + .WHILE AND ; whil not found and.... ;AN000; + .WHILE ; while still slots to check.. ;AN000; + .IF ; is it this one?? ;AN000; + MOV DX,CS:[DI].SLT_CP ; yes....load value ;AN000; + .IF ; is deactivate requested? ;AN000; + MOV CS:[DI].SLT_AT,AT_OCC; yes...change attrib. to occupied ;AN000; + .ENDIF ; ;AN000; + .ELSE ; ;AN000; + ADD DI,TYPE SLTS ; no..point to next entry ;AN000; + DEC CX ; decrement the count ;AN000; + .ENDIF ; ;AN000; + .ENDWHILE ; ;AN000; + .IF ; if we didn't find it then.. ;AN000; + MOV CX,CS:[BX].HSLMX ; check hardware ;AN000; + MOV DI,CS:[BX].HARDSO ; load regs as before. ;AN000; + .WHILE AND ; while not found and.. ;AN000; + .WHILE ; still have slots to check.. ;AN000; + .IF ; is it this one?? ;AN000; + MOV DX,CS:[DI].SLT_CP ; yes....load value ;AN000; + .IF ; is deactivate requested? ;AN000; + MOV CS:[DI].SLT_AT,AT_OCC; yes...change attrib to occupied;AN000; + .ENDIF ; ;AN000; + .ELSE ; ;AN000; + ADD DI,TYPE SLTS ; no ..point to next entry ;AN000; + DEC CX ; and decrement count. ;AN000; + .ENDIF ; ;AN000; + .ENDWHILE ; ;AN000; + .ENDIF ; ;AN000; + RET ; ;AN000; +FIND_ACTIVE_CP ENDP ;AN000; + +CSEG ENDS + END diff --git a/v4.0/src/DEV/PRINTER/PTRMSG.ASM b/v4.0/src/DEV/PRINTER/PTRMSG.ASM new file mode 100644 index 0000000..59e3299 --- /dev/null +++ b/v4.0/src/DEV/PRINTER/PTRMSG.ASM @@ -0,0 +1,41 @@ + + PAGE ,132 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; FILENAME: CPS Device Driver -- Message File +;; MODULE NAME: PTRMSG1 +;; TYPE: Message External File +;; LINK PROCEDURE: see CPSPMNN.ASM +;; +;; INCLUDE FILES: +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; +CSEG SEGMENT PUBLIC 'CODE' ;; + ASSUME CS:CSEG ;; + ASSUME DS:NOTHING ;; + ;; +PUBLIC msg_no_init_p ;; +PUBLIC msg_no_init ;; +PUBLIC msg_bad_syntax ;; +PUBLIC msg_insuff_mem ;; + ;; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; ************************************ +;; ** ** +;; ** Resident Code ** +;; ** ** +;; ************************************ +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +INCLUDE PTRMSG.INC + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +CSEG ENDS + END + \ No newline at end of file diff --git a/v4.0/src/DEV/PRINTER/ZERO.DAT b/v4.0/src/DEV/PRINTER/ZERO.DAT new file mode 100644 index 0000000..573541a --- /dev/null +++ b/v4.0/src/DEV/PRINTER/ZERO.DAT @@ -0,0 +1 @@ +0 diff --git a/v4.0/src/DEV/RAMDRIVE/ABOVE.INC b/v4.0/src/DEV/RAMDRIVE/ABOVE.INC new file mode 100644 index 0000000..52878c8 --- /dev/null +++ b/v4.0/src/DEV/RAMDRIVE/ABOVE.INC @@ -0,0 +1,61 @@ +BREAK + +; +; Assorted equates for use with Intel Above Board +; + +; +; EMM INT 67H Function codes +; +ABOVE_STATUS EQU 40H +ABOVE_GET_SEG EQU 41H +ABOVE_GET_FREE EQU 42H +ABOVE_ALLOC EQU 43H +ABOVE_MAP EQU 44H +ABOVE_DEALLOC EQU 45H +ABOVE_GET_VERSION EQU 46H +ABOVE_SAVE_MAP_PID EQU 47H +ABOVE_RESTORE_MAP_PID EQU 48H + +; +; NEW call not implemented in version 1.00 Above Board +; +ABOVE_GETSET_MAP EQU 4EH +; +; 4EH AX equates for subfunctions +; +ABOVE_GETSET_GET EQU 4E00H +ABOVE_GETSET_SET EQU 4E01H +ABOVE_GETSET_GETSET EQU 4E02H + + +; +; "Maintenance" calls +; +ABOVE_GET_IOPORT EQU 49H +ABOVE_GET_MAP_ARRAY EQU 4AH +ABOVE_GET_PIDS EQU 4BH +ABOVE_GET_PAGES EQU 4CH +ABOVE_GET_ALLOC EQU 4DH + + +; +; EMM INT 67H AH return values +; +ABOVE_SUCCESSFUL EQU 0 +ABOVE_ERROR_SOFTWARE EQU 80H +ABOVE_ERROR_HARDWARE EQU 81H +ABOVE_ERROR_BUSY EQU 82H +ABOVE_ERROR_BAD_PID EQU 83H +ABOVE_ERROR_BAD_FUNC EQU 84H +ABOVE_ERROR_OUT_OF_PIDS EQU 85H +ABOVE_ERROR_MAP_CNTXT EQU 86H +ABOVE_ERROR_INSUFF_MEM EQU 87H +ABOVE_ERROR_INSUFF_FREE EQU 88H +ABOVE_ERROR_ALLOC_ZERO EQU 89H +ABOVE_ERROR_LOG_INVALID EQU 8AH +ABOVE_ERROR_PHYS_INVALID EQU 8BH +ABOVE_ERROR_CNTXT_NO_STACK EQU 8CH +ABOVE_ERROR_SECOND_SAVE EQU 8DH +ABOVE_ERROR_NO_CNTXT EQU 8EH +ABOVE_ERROR_BAD_PARM EQU 8FH diff --git a/v4.0/src/DEV/RAMDRIVE/AB_MACRO.INC b/v4.0/src/DEV/RAMDRIVE/AB_MACRO.INC new file mode 100644 index 0000000..10fb733 --- /dev/null +++ b/v4.0/src/DEV/RAMDRIVE/AB_MACRO.INC @@ -0,0 +1,180 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; MACRO definitions for expanded memory manager +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; 1. MACRO to save mapping context in case somebody else has +; mapped the page registers. +; +save_mapping_context macro +local save_agn_m,save_err_m,save_ok_m,save_exit_m +; +; the save mapping call for the above board --> +; +; mov ah,47h +; mov dx,handle +; int 67h +; +; on return ax = 0 signifies success +; +; + push ax ; save registers + push dx +; +; set up emm registers and execute call to save mapping context +; +save_agn_m: + mov dx,cs:[above_pid] ; get emm handle + mov ah,above_save_map_pid ; save map call + int 67h ; call the manager + or ah,ah ; is there an error? + jz save_ok_m ; if not we are done +; +; error in saving mapping context, check for error +; + cmp ah,above_error_busy ; if the emm manager was busy + jz save_agn_m ; we would like to try again +; +; unrecoverable error, indicate error type in al +; + pop dx + pop dx ; pop the regs off the stack +; + mov al,02h ; drive not ready + cmp ah,above_error_cntxt_no_stack ; + jz save_err_m + cmp ah,above_error_second_save ; + ja save_err_m + mov al,0ch ; general failure +save_err_m: + stc + jmp short save_exit_m +save_ok_m: + clc + pop dx + pop ax ; restore registers +save_exit_m: + endm +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; 2. MACRO to restore the mapping context saved earlier +; +restore_mapping_context macro +local rest_agn_m, rest_ok_m, rest_exit_m +; +; the restore above map call --> +; +; mov ah,48h +; mov dx,handle +; int 67h +; ah = 0 is success +; +; + push ax + pushf +; +rest_agn_m: + mov dx,cs:[above_pid] ; get emm handle + mov ah,above_restore_map_pid ; restore map call + int 67h ; call manager + or ah,ah ; is there any error + jz rest_ok_m ; if not go to finish up +; +; error condition, check for recoverable error +; + cmp ah,above_error_busy ; if manager was busy + jz rest_agn_m ; we sure can try again + cmp ah,above_error_no_cntxt ; + jz rest_ok_m ; ignore invalid pid error +; +; unrecoverable error +; + pop dx + pop dx + mov al,0ch ; general failure + stc + jmp short rest_exit_m +; +rest_ok_m: + popf + pop ax +rest_exit_m: +; + endm +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; 3. MACRO to map a page in the physical page map onto a logical +; page. +; +; the map above page requires +; mov ah,44h +; mov dx,handle +; mov al,physical_page# (0-3) +; mov bx,logical_page# +; int 67H +; ah = 0 success and this routine zaps ax,dx and bx +; +map_page macro +local map_agn_m,map_exit_m,map_fin_m +; + mov ah,above_map ; function map page + mov dx,cs:[above_pid] ; get emm handle +; + push ax +; +map_agn_m: + pop ax + push ax + push bx + push dx ; "damn call above_map zaps these registers" +; + int 67h ; map call + pop dx + pop bx +; + or ah,ah ; is there an error? + jz map_fin_m ; if not go to finish up +; +; error condition - check for recoverable error +; + cmp ah,above_error_busy ; if manager was busy + jz map_agn_m ; we sure can try again +; +; unrecoverable error +; + pop ax + mov al,02h ; device not ready error + stc + jmp short map_exit_m +; +; exit point +; +map_fin_m: + clc + pop ax +map_exit_m: +; + endm +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; OTHER MACROS +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; 1) MACRO to switch es:di with ds:si +; +src_dest_switch macro +; + push ds + push es + push si + mov si,di + pop di + pop ds + pop es +; + endm +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/v4.0/src/DEV/RAMDRIVE/DEVSYM.INC b/v4.0/src/DEV/RAMDRIVE/DEVSYM.INC new file mode 100644 index 0000000..44a1ab8 --- /dev/null +++ b/v4.0/src/DEV/RAMDRIVE/DEVSYM.INC @@ -0,0 +1,128 @@ +BREAK + +; The device table list has the form: +SYSDEV STRUC +SDEVNEXT DD ? ;Pointer to next device header +SDEVATT DW ? ;Attributes of the device +SDEVSTRAT DW ? ;Strategy entry point +SDEVINT DW ? ;Interrupt entry point +SDEVNAME DB 8 DUP (?) ;Name of device (only first byte used for block) +SYSDEV ENDS + +; +; Attribute bit masks +; +; Character devices: +; +; Bit 15 -> must be 1 +; 14 -> 1 if the device understands IOCTL control strings +; 13 -> 1 if the device supports output-until-busy +; 12 -> unused +; 11 -> 1 if the device understands Open/Close +; 10 -> must be 0 +; 9 -> must be 0 +; 8 -> unused +; 7 -> unused +; 6 -> unused +; 5 -> unused +; 4 -> 1 if device is recipient of INT 29h +; 3 -> 1 if device is clock device +; 2 -> 1 if device is null device +; 1 -> 1 if device is console output +; 0 -> 1 if device is console input +; +; Block devices: +; +; Bit 15 -> must be 0 +; 14 -> 1 if the device understands IOCTL control strings +; 13 -> 1 if the device determines media by examining the FAT ID byte. +; This requires the first sector of the fat to *always* reside in +; the same place. +; 12 -> unused +; 11 -> 1 if the device understands Open/Close/removable media +; 10 -> must be 0 +; 9 -> must be 0 +; 8 -> unused +; 7 -> unused +; 6 -> unused +; 5 -> unused +; 4 -> unused +; 3 -> unused +; 2 -> unused +; 1 -> unused +; 0 -> unused + +DevTyp EQU 8000H ; Bit 15 - 1 if Char, 0 if block +CharDev EQU 8000H +DevIOCtl EQU 4000H ; Bit 14 - CONTROL mode bit +ISFATBYDEV EQU 2000H ; Bit 13 - Device uses FAT ID bytes, + ; comp media. +OutTilBusy EQU 2000h ; Output until busy is enabled +ISNET EQU 1000H ; Bit 12 - 1 if a NET device, 0 if + ; not. Currently block only. +DEVOPCL EQU 0800H ; Bit 11 - 1 if this device has + ; OPEN,CLOSE and REMOVABLE MEDIA + ; entry points, 0 if not + +EXTENTBIT EQU 0400H ; Bit 10 - Currently 0 on all devs + ; This bit is reserved for future use + ; to extend the device header beyond + ; its current form. + +; NOTE Bit 9 is currently used on IBM systems to indicate "drive is shared". +; See IOCTL function 9. THIS USE IS NOT DOCUMENTED, it is used by some +; of the utilities which are supposed to FAIL on shared drives on server +; machines (FORMAT,CHKDSK,RECOVER,..). + +ISSPEC EQU 0010H ;Bit 4 - This device is special +ISCLOCK EQU 0008H ;Bit 3 - This device is the clock device. +ISNULL EQU 0004H ;Bit 2 - This device is the null device. +ISCOUT EQU 0002H ;Bit 1 - This device is the console output. +ISCIN EQU 0001H ;Bit 0 - This device is the console input. + +;Static Request Header +SRHEAD STRUC +REQLEN DB ? ;Length in bytes of request block +REQUNIT DB ? ;Device unit number +REQFUNC DB ? ;Type of request +REQSTAT DW ? ;Status Word + DB 8 DUP(?) ;Reserved for queue links +SRHEAD ENDS + +;Status word masks +STERR EQU 8000H ;Bit 15 - Error +STBUI EQU 0200H ;Bit 9 - Buisy +STDON EQU 0100H ;Bit 8 - Done +STECODE EQU 00FFH ;Error code + +;Function codes +DEVINIT EQU 0 ;Initialization +DINITHL EQU 26 ;Size of init header +DEVMDCH EQU 1 ;Media check +DMEDHL EQU 15 ;Size of media check header +DEVBPB EQU 2 ;Get BPB +DEVRDIOCTL EQU 3 ;IOCTL read +DBPBHL EQU 22 ;Size of Get BPB header +DEVRD EQU 4 ;Read +DRDWRHL EQU 22 ;Size of RD/WR header +DEVRDND EQU 5 ;Non destructive read no wait (character devs) +DRDNDHL EQU 14 ;Size of non destructive read header +DEVIST EQU 6 ;Input status +DSTATHL EQU 13 ;Size of status header +DEVIFL EQU 7 ;Input flush +DFLSHL EQU 15 ;Size of flush header +DEVWRT EQU 8 ;Write +DEVWRTV EQU 9 ;Write with verify +DEVOST EQU 10 ;Output status +DEVOFL EQU 11 ;Output flush +DEVWRIOCTL EQU 12 ;IOCTL write +DEVOPN EQU 13 ;Device open +DEVCLS EQU 14 ;Device close +DOPCLHL EQU 13 ;Size of OPEN/CLOSE header +DEVRMD EQU 15 ;Removable media +REMHL EQU 13 ;Size of Removable media header + +DevOUT EQU 16 ; output until busy. +DevOutL EQU DevWrt ; length of output until busy + +SUBTTL diff --git a/v4.0/src/DEV/RAMDRIVE/DIRENT.INC b/v4.0/src/DEV/RAMDRIVE/DIRENT.INC new file mode 100644 index 0000000..e7150c8 --- /dev/null +++ b/v4.0/src/DEV/RAMDRIVE/DIRENT.INC @@ -0,0 +1,56 @@ +Break + +; +; +---------------------------+ +; | (12 BYTE) filename/ext | 0 0 +; +---------------------------+ +; | (BYTE) attributes | 11 B +; +---------------------------+ +; | (10 BYTE) reserved | 12 C +; +---------------------------+ +; | (WORD) time of last write | 22 16 +; +---------------------------+ +; | (WORD) date of last write | 24 18 +; +---------------------------+ +; | (WORD) First cluster | 26 1A +; +---------------------------+ +; | (DWORD) file size | 28 1C +; +---------------------------+ +; +; First byte of filename = E5 -> free directory entry +; = 00 -> end of allocated directory +; Time: Bits 0-4=seconds/2, bits 5-10=minute, 11-15=hour +; Date: Bits 0-4=day, bits 5-8=month, bits 9-15=year-1980 +; + +dir_entry STRUC +dir_name DB 11 DUP (?) ; file name +dir_attr DB ? ; attribute bits +dir_pad DB 10 DUP (?) ; reserved for expansion +dir_time DW ? ; time of last write +dir_date DW ? ; date of last write +dir_first DW ? ; first allocation unit of file +dir_size_l DW ? ; low 16 bits of file size +dir_size_h DW ? ; high 16 bits of file size +dir_entry ENDS + +attr_read_only EQU 1h +attr_hidden EQU 2h +attr_system EQU 4h +attr_volume_id EQU 8h +attr_directory EQU 10h +attr_archive EQU 20h +attr_device EQU 40h ; This is a VERY special bit. + ; NO directory entry on a disk EVER + ; has this bit set. It is set non-zero + ; when a device is found by GETPATH + +attr_all EQU attr_hidden+attr_system+attr_directory + ; OR of hard attributes for FINDENTRY + +attr_ignore EQU attr_read_only+attr_archive+attr_device + ; ignore this(ese) attribute(s) during + ; search first/next + +attr_changeable EQU attr_read_only+attr_hidden+attr_system+attr_archive + ; changeable via CHMOD diff --git a/v4.0/src/DEV/RAMDRIVE/EMM.INC b/v4.0/src/DEV/RAMDRIVE/EMM.INC new file mode 100644 index 0000000..ff61ab0 --- /dev/null +++ b/v4.0/src/DEV/RAMDRIVE/EMM.INC @@ -0,0 +1,223 @@ +BREAK + +; +; The EMM control sector is a 1024 byte record which ALWAYS occupies the +; very first 1024 bytes of "extra" memory that needs to be managed. Its +; function is to provide a method to allocate available "extra" memory +; to programs which desire to use it and avoid program conflicts that +; would occur if two different programs attempted to use the same piece +; of "extra" memory. +; + +; +; The EMM_CTRL structure defines the offsets into the 1024 byte control +; sector of the various fields. The EMM_REC structure defines a sub-structure +; contained within the EMM_CTRL structure which represents a particular +; piece of allocated "extra" memory (an allocation record). +; + +; Layout of each EMM record. + +EMM_REC STRUC +EMM_FLAGS DW 0 +EMM_SYSTEM DW 0 +EMM_BASE DD ? ; 24 bit address of start of region +EMM_KSIZE DW ? ; Size of region in kbytes +EMM_REC ENDS + +; EMM_FLAGS Bits +EMM_ALLOC EQU 0000000000000001B ; Zero -> record is free +EMM_ISDRIVER EQU 0000000000000010B ; 1 -> driver is installed + ; for this region + +; EMM_SYSTEM Values +EMM_EMM EQU 0 ; Allocated to EMM +EMM_MSDOS EQU 1 +EMM_XENIX EQU 2 +EMM_APPLICATION EQU 3 + +; Layout of EMM control 1024 byte record + +EMM_CTRL STRUC +EMM_VER DB 50 DUP(?) +EMM_TOTALK DW ? ; EXCLUDING the 1k of this record +EMM_AVAILK DW ? ; Amount of above NOT allocated + DB SIZE EMM_REC DUP(?) ; NULL (0th) RECORD +EMM_RECORD DB (1024 - 50 - 4 - 10 - (SIZE EMM_REC)) DUP(?) + ; EMM_REC structures +EMM_TAIL_SIG DB 10 DUP(?) +EMM_CTRL ENDS + +EMM_NUMREC EQU (1024 - 50 - 4 - 10 - (SIZE EMM_REC)) / (SIZE EMM_REC) + + +; +; The current initial (no "extra" memory allocated) EMM_CTRL sector is +; +; EMM_CONTROL LABEL BYTE +; DB "MICROSOFT EMM CTRL VERSION 1.00 CONTROL BLOCK " +; DW EXTMEM_TOTALK - 1 +; DW EXTMEM_TOTALK - 1 +; ; NULL 0th record +; DW EMM_ALLOC + EMM_ISDRIVER +; DW EMM_EMM +; DW EXTMEM_LOW + 1024 +; DW EXTMEM_HIGH +; DW 0 +; ;** +; DB 950 DUP(0) +; DB "ARRARRARRA" +; +; Where EXTMEM_LOW:EXTMEM_HIGH is the 32 bit address of the first byte +; of the EMM_CTRL sector (first byte of "extra" memory) and EXTMEM_TOTALK +; is the size in K of the available "extra" memory. One is subtracted +; from EXTMEM_TOTALK because the sizes in the EMM_CTRL record DO NOT +; include the 1k taken up by the EMM_CTRL sector. +; +; The reason for the existance of the NULL 0th record is to facilitate +; the computation of EMM_BASE for the first EMM_REC allocation record +; created. +; +; The EMM_REC structures CANNOT be sparse. In other words if one sets +; up a scan of the EMM_REC structures in the EMM_CTRL sector, as soon as +; an EMM_REC structure WITHOUT the EMM_ALLOC bit set in its flag word +; is encountered it is not necessary to scan further because it IS KNOWN +; that all of the EMM_REC structures after the first one with EMM_ALLOC +; clear also have EMM_ALLOC clear. What this means is that EMM_CTRL +; memory CANNOT BE deallocated. Once an EMM_REC structure has its +; EMM_ALLOC bit set, there is NO correct program operation which +; can clear the bit UNLESS it IS KNOWN that the next EMM_REC structure +; has its EMM_ALLOC bit clear or the EMM_REC structure is the last one. +; +; +; USING THE EMM_CTRL SECTOR: +; +; A program which wishes to use the EMM_CTRL sector to access "extra" +; memory should work as follows: +; +; Figure out how much memory you wish to allocate +; +; Figure out the location and size of the "extra" memory in the system +; +; IF (the first 1024 bytes of "extra" memory DO NOT contain a valid +; EMM_CTRL record determined by checking for the existence of the +; correct EMM_VER and EMM_TAIL_SIG strings) +; Write a correct initial EMM_CTRL sector to the first 1024 +; bytes of extra memory. Be sure to fill in EMM_TOTALK, +; EMM_AVAILK and EMM_BASE in the 0th record. +; +; Set up a scan of the EMM_REC structures in the EMM_CTRL sector. +; NOTE: You can skip the NULL 0th record if you want since it has +; known value. +; +; FOR (i=0;i= EMM_NUMREC) +; ERROR no free EMM_REC structures +; +; +; You can now see why we need that NUL 0th EMM_REC structure. In order to +; perform this step +; +; EMM_BASE = EMM_BASE of PREVIOUS EMM_REC + +; (1024 * EMM_KSIZE of PREVIOUS EMM_REC) +; +; when the very first EMM_REC is allocated we must have a "previous EMM_REC" +; structure to point at. +; +; The above code is rather simplistic in that all it does is do a simple +; allocation. The EMM_ISDRIVER bit allows us to do some more sophisticated +; things. In particular in the case of a RAMDrive type of program it is +; desirable to "re-find" the same RAMDrive area in "extra" memory when the +; system is re-booted. The EMM_ISDRIVER bit is used to help us do this. +; +; The EMM_ISDRIVER bit means "there is presently a piece of code in the +; system which is using this memory". If we find an EMM_REC structure +; which has its EMM_ALLOC bit set, but the EMM_ISDRIVER bit is clear +; it means that the piece of code that originally allocated +; the memory is gone and we may want to "re-find" this memory by +; setting the EMM_ISDRIVER bit again. A RAMDrive program would have +; slightly different code than the above: +; +; FOR (i=0;i + +DEF_ACCESS EQU 92H +DEF_LIMIT EQU 0FFFFH + +SEGREG_DESCRIPTOR STRUC +SEG_BASE DW ? + DB ? +SEG_ACCESS DB DEF_ACCESS +SEG_LIMIT DW DEF_LIMIT +SEGREG_DESCRIPTOR ENDS + +DTR_DESCRIPTOR STRUC +DTR_BASE DW ? + DB ? + DB 0 +DTR_LIMIT DW ? +DTR_DESCRIPTOR ENDS +; +; 386 Descriptor template +; +desc struc +lim_0_15 dw 0 ; limit bits (0..15) +bas_0_15 dw 0 ; base bits (0..15) +bas_16_23 db 0 ; base bits (16..23) +access db 0 ; access byte +gran db 0 ; granularity byte +bas_24_31 db 0 ; base bits (24..31) +desc ends + +gdt_descriptor struc +gdt_limit dw ? +gdt_base_0 dw ? +gdt_base_2 dw ? +gdt_descriptor ends diff --git a/v4.0/src/DEV/RAMDRIVE/MAKEFILE b/v4.0/src/DEV/RAMDRIVE/MAKEFILE new file mode 100644 index 0000000..c61e83e --- /dev/null +++ b/v4.0/src/DEV/RAMDRIVE/MAKEFILE @@ -0,0 +1,36 @@ +#** makefile for Ramdrive + +DEST = ramdrive +MSG = messages + +# Definitions for assembler + +ASM = masm +AFLAGS = -Mx -t +AINC = -I../../inc + +# Definitions for C compiler + +CC = cl +CFLAGS = -Ox -X -Zlp +CINC = -I../../h + +# Definitions for linker + +LINK = link + +# Dependencies follow + +all: ramdrive.sys + +ramdrive.obj: ramdrive.asm above.inc loadall.inc emm.inc mi.inc \ + dirent.inc syscall.inc devsym.inc + masm $(AFLAGS) $(AINC) ramdrive; + +messages.obj: messages.asm + masm $(AFLAGS) $(AINC) messages; + +ramdrive.sys: ramdrive.obj messages.obj + link @ramdrive.lnk + exe2bin ramdrive ramdrive.sys + del ramdrive.exe diff --git a/v4.0/src/DEV/RAMDRIVE/MESSAGES.ASM b/v4.0/src/DEV/RAMDRIVE/MESSAGES.ASM new file mode 100644 index 0000000..66c528b --- /dev/null +++ b/v4.0/src/DEV/RAMDRIVE/MESSAGES.ASM @@ -0,0 +1,82 @@ + TITLE MESSAGE MODULE FOR RAMDRIVE.ASM +; +; WRITTEN BY S. P. 3/3/87 +; +PAGE 58,132 + +BREAK MACRO subtitle + SUBTTL subtitle + PAGE +ENDM + +BREAK + +RAMCODE SEGMENT +ASSUME CS:RAMCODE,DS:RAMCODE,ES:NOTHING,SS:NOTHING + +;** Message texts and common data +; +; Init data. This data is disposed of after initialization. +; it is mostly texts of all of the messages +; +; COMMON to TYPE 1,2,3 and 4 drivers +; +; THIS IS THE START OF DATA SUBJECT TO TRANSLATION + + PUBLIC NO_ABOVE,BAD_ABOVE,BAD_AT,NO_MEM,ERRMSG1,ERRMSG2 + PUBLIC ERRMSG2,INIT_IO_ERR,BADVERMES + PUBLIC HEADERMES,PATCH2X,DOS_DRV + PUBLIC STATMES1,STATMES2,STATMES3,STATMES4,STATMES4,STATMES5 + +NO_ABOVE db "RAMDrive: Expanded Memory Manager not present",13,10,"$" +BAD_ABOVE db "RAMDrive: Expanded Memory Status shows error",13,10,"$" +BAD_AT db "RAMDrive: Computer must be PC-AT, or PC-AT compatible",13,10,"$" +NO_MEM db "RAMDrive: No extended memory available",13,10,"$" +ERRMSG1 db "RAMDrive: Invalid parameter",13,10,"$" +ERRMSG2 db "RAMDrive: Insufficient memory",13,10,"$" +INIT_IO_ERR db "RAMDrive: I/O error accessing drive memory",13,10,"$" +BADVERMES db 13,10,"RAMDrive: Incorrect DOS version",13,10,"$" + +; +; This is the Ramdrive header message. THE MESSAGE IS DYNAMICALLY +; PATCHED AT RUNTIME. The DOS drive letter of the RAMDRIVE +; is patched in at DOS_DRV for DOS versions >= 3.00. For +; DOS versions < 3.00 the three bytes 13,10,"$" are placed +; at the label PATCH2X eliminating the drive specifier since +; this information cannot be determined on 2.X DOS. +; NO PART OF THIS MESSAGE WHICH MUST BE PRINTED ON ALL VERSIONS +; OF DOS CAN BE PLACED AFTER THE LABEL PATCH2X. This may cause +; translation problems for some languages, if this is so +; the only solution is to eliminate the drive letter part of +; the message totally for ALL DOS versions: +; +; HEADERMES db 13,10,"Microsoft RAMDrive version 1.17 " +; PATCH2X db 13,10,"$" +; DOS_DRV db "A" +; +; +HEADERMES db 13,10,"Microsoft RAMDrive version 2.12 " +PATCH2X db "virtual disk " +DOS_DRV db "A" + db ":",13,10,"$" + +; +; This is the status message used to display RAMDRIVE configuration +; it is: +; +; STATMES1STATMES2STATMES3 +; STATMES4 +; STATMES5 +; +; It is up to translator to move the message text around the numbers +; so that the message is printed correctly when translated +; +STATMES1 db " Disk size: $" +STATMES2 db "k",13,10," Sector size: $" +STATMES3 db " bytes",13,10," Allocation unit: $" +STATMES4 db " sectors",13,10," Directory entries: $" +STATMES5 db 13,10,"$" + + +RAMCODE ENDS + END diff --git a/v4.0/src/DEV/RAMDRIVE/MI.INC b/v4.0/src/DEV/RAMDRIVE/MI.INC new file mode 100644 index 0000000..9d8efed --- /dev/null +++ b/v4.0/src/DEV/RAMDRIVE/MI.INC @@ -0,0 +1,18 @@ +BREAK + +mi_INT EQU 0CDh +mi_Long_JMP EQU 0EAh +mi_Long_CALL EQU 09Ah +mi_Long_RET EQU 0CBh +mi_Near_RET EQU 0C3h + +; xxxxoditszxaxpxc +f_Overflow EQU 0000100000000000B +f_Direction EQU 0000010000000000B +f_Interrupt EQU 0000001000000000B +f_Trace EQU 0000000100000000B +f_Sign EQU 0000000010000000B +f_Zero EQU 0000000001000000B +f_Aux EQU 0000000000010000B +f_Parity EQU 0000000000000100B +f_Carry EQU 0000000000000001B diff --git a/v4.0/src/DEV/RAMDRIVE/RAMDRIVE.ASM b/v4.0/src/DEV/RAMDRIVE/RAMDRIVE.ASM new file mode 100644 index 0000000..7874042 --- /dev/null +++ b/v4.0/src/DEV/RAMDRIVE/RAMDRIVE.ASM @@ -0,0 +1,6218 @@ + TITLE EXTENDED MEMORY RAMDRIVE + +PAGE 58,132 + +; +; Will use IBM extended memory on PC-AT or +; use Above Board on PC, XT, or AT or +; use main memory on PC, XT, or AT +; +; +; device = ramdrive.sys [bbbb] [ssss] [dddd] [/E | /A] +; +; bbbb First numeric argument, if present, is disk size +; in K bytes. Default value is 64. Min is 16. Max +; is 4096 (4 Meg). +; +; ssss Second numeric argument, if present, is sector size +; in bytes. Default value is 512. Allowed values are +; 128, 256, 512, 1024. +; NOTE: In the case of IBM PC DOS the MAX value is 512. +; If 1024 is specified the device will not be installed. +; This "error" is detected by DOS and is not due to +; the code in RAMDrive. +; The 1024 byte size is included for those MS-DOS systems +; where it might be allowed. +; +; dddd Third numeric argument, if present, is the number of +; root directory entries. Default is 64. Min is 2 +; max is 1024. The value is rounded up to the nearest +; sector size boundary. +; NOTE: In the event that there is not enough memory +; to create the RAMDrive volume, RAMDrive will try to make +; a DOS volume with 16 directory entries. This may +; result in a volume with a different number of directory +; entries than the dddd parameter specifies. +; +; /E Specifies that PC AT Extended Memory is to be used. +; It is an error if /E is specified on a machine other +; than an IBM PC AT. +; NOTE: Information on RAMDrive drives in PC AT extended memory +; will be lost at system re-boot (warm or cold). This is +; due to the fact that the IBM PC AT ROM bootstrap code +; zeroes all of memory. +; NOTE: There is 1k of RAMDrive overhead. That is to say, +; if there are 512k bytes of extended memory, there +; will be 511k bytes available for assignment to RAMDrive +; drives. This 1k overhead is fixed and does not depend +; on the number of RAMDrive drives installed. +; +; /A Specifies that Above Board memory is to be used. It +; is an error if the above board device driver is not +; present. +; NOTE: Information on RAMDrive drives in Above Board memory +; will be lost at system re-boot (warm or cold). This is +; due to the fact that the EMM device driver performs a +; destructive test when it is installed which zeros all +; of the Above Board memory. +; +; Neither /A or /E Specifies drive is to be set up below the +; 640K boundary in main memory. +; The RAMDRIVE.SYS program looks for memory to assign to the RAMDrive +; drives by looking for functioning system RAM between the +; "end of memory" as determined by the INT 12H ROM BIOS +; function, and the start of the video RAM (0A000:0H). +; If RAM is found by the above scan, it is assigned to +; RAMDrive and managed in the same way as extended memory +; is when the /E switch is used. As with /E there is +; 1k of RAMDrive overhead. That is to say, if there are 256k +; bytes of memory above the INT 12 memory size, there +; will be 255k bytes available for assignment to RAMDrive +; drives. This 1k overhead is fixed and does not depend +; on the number of RAMDrive drives installed. +; Information on such RAMDrive drives will NOT be lost on +; a "warm boot" (INT 19H or Ctrl-Alt-DEL). +; If RAM is NOT found by the above scan, RAMDrive will attempt +; to allocate memory for the device AS PART OF THE DEVICE. +; In other words the device starts immediately after the +; RAMDrive resident code. +; Information on such RAMDrive drives WILL BE lost on +; a "warm boot" (INT 19H or Ctrl-Alt-DEL). +; +; +; +; MODIFICATION HISTORY +; +; 1.00 5/30/85 ARR Initial version. +; +; 1.01 6/03/85 ARR Added CSIZE home code in INIDRV. Does a better +; job of computing good CSIZE value. +; +; 1.10 6/05/85 ARR Changed name of program from VDISK to RAMDRIVE +; +; 1.11 6/06/85 ARR Changed BAD_AT message +; +; 1.12 6/06/85 ARR Fixed bug in /A BLKMOV code. Was forgetting +; to save and restore page mapping context +; +; 1.13 6/14/85 ARR Was using 32 bit shifts to do div/mul by +; powers of two. As it turns out, using the +; DIV or MUL instruction is faster. This is +; so even for small numbers like 16. This is +; due to the fact that the LOOP involved in +; doing a 32 bit shift is expensive. +; +; 1.14 6/14/85 ARR dddd param minimum changed from 4 to 2 +; to be IBM compatible. Code added to round +; up to sector size boundaries. +; +; 1.15 6/24/85 ARR Assorted clean up, mostly in Above Board +; code. +; +; 1.16 7/09/85 ARR Align code more closely to the G.L. +; coding standard. +; +; Changed ITOA routine. Smaller and will print any +; 16 bit value. +; +; DISK_ABORT would run through EMM_CTRL reset code +; on a RESMEM_SPECIAL driver. Added code +; to skip if this type of driver. +; +; Added check in CHECK_DOS_VOL in event valid BPB +; is found to make sure SSIZE and DIRNUM values +; match. If you edit DEVICE = to change these +; values on an existing drive and re-boot +; RAMDrive would ignore you and suck up old +; values. +; +; 11/12/85 ARR DEBUG EQU added and some RESMEM debug code +; stuck in to discover that the HP Vectra is +; not as AT compatible as HP thinks. +; +; 02/11/86 ARR Message area identified by "TRANSLATION" +; and translation notes added to several +; messages +; +; 04/03/86 ARR Changed use of SIDT to set GDT descriptor +; in /E init code to SGDT. Previous masm wouldn't +; assemble SGDT, new one works OK. +; +; 1.17 5/26/86 ARR New version for "above" insignificgant changes. And +; fixed major oops in /e RESET_SYSTEM code which would +; hang the system if an interrupt occured at the wrong +; time. +; +; 1.19 3/4/87 SP Fixed CSIZ homing oscillation bug. Shifted Ramdriv +; configuration display code before relocation code +; to facilitate creation of message module. Shifted +; translatable messages to message module. +; +; 2.00 8/23/87 sp 386 support ( both prot mode transfer and int15 ) +; 286 loadall kludge +; new int15 allocation +; new above_blkmov routine (to handle overlapping +; transfers in above board memory +; olivetti support +; removed int 9 trapping +; reset code different for extended memory +; +; 2.01 9/28/87 sp Fixed bug in parsing for /u option +; +; 2.02 3/02/88 sp Extended PS2 model 80 recognition to more than +; one sub-model +; 2.03 5/13/88 SP extended version check to include dos 4.00 +; +; 2.04 5/23/88 SP reworked messages to mention expanded memory +; +; 2.10 6/13/88 CHIPA Merged in HP Vectra stuff +; 11/20/87 RCP Fixed a20 enabling/disabling problems on +; Vectra machines. +; +; 2.12 7/26/88 SP Ramdrives installed between int12 and A000 are +; no longer attempted. + +BREAK MACRO subtitle + SUBTTL subtitle + PAGE +ENDM + +.286p ; Use some 286 instructions in /E code + +DEBUG EQU 0 + +IF1 + IF DEBUG + %out DEBUG VERSION!!!!!! + ENDIF +ENDIF + +.xlist + include devsym.inc + include syscall.inc + include dirent.inc + include mi.inc +.list + +; The RAMDrive device driver has 4 basic configurations. +; +; TYPE 1 - /E configuration using PC-AT extended memory and the LOADALL +; instruction. +; +; TYPE 2 - /A configuration using Above Board memory and EMM device +; driver. +; +; TYPE 3 - Neither /A or /E (RESMEM) configuration using main memory +; and normal 8086 addressing, RAMDrive memory is located +; somewhere AFTER the "end of memory" as indicated by the +; INT 12H memory size. +; +; TYPE 4 - RESMEM configuration as TYPE 3 EXCEPT that the RAMDrive +; memory is part of the RAMDrive device driver. +; +; The TYPE 2 driver uses the Above Board EMM device driver via INT 67H +; to control access to, and to access the available memory. +; +; The TYPE 4 driver needs no external help to control access to the available +; memory since the RAMDrive memory is part of the device driver and +; immediately follows the RAMDrive code in memory. +; +; The TYPE 1 and TYPE 3 configurations use the EMM control sector to +; control access to the available memory + + include emm.inc + + include loadall.inc + + include above.inc + + include ab_macro.inc + +BREAK + +; +; Define I/O packet offsets for useful values. +; +; SEE ALSO +; MS-DOS Technical Reference manual section on Installable Device Drivers +; +; MACHINE ID EQUATES +S_OLIVETTI EQU 01H ; Olivetti 6300 PLUS machine +S_VECTRA EQU 02H ; Vectra PC machine + +; READ/WRITE PACKET OFFSETS +RW_COUNT EQU WORD PTR (SIZE SRHEAD) + 5 +RW_TRANS EQU DWORD PTR (SIZE SRHEAD) + 1 +RW_START EQU WORD PTR (SIZE SRHEAD) + 7 + +; MEDIA CHECK PACKET OFFSETS +MCH_RETVAL EQU BYTE PTR (SIZE SRHEAD) + 1 +MCH_MEDIA EQU BYTE PTR (SIZE SRHEAD) + 0 + +; BUILD BPB PACKET OFFSETS +BPB_BUFFER EQU DWORD PTR (SIZE SRHEAD) + 1 +BPB_MEDIA EQU BYTE PTR (SIZE SRHEAD) + 0 +BPB_BPB EQU DWORD PTR (SIZE SRHEAD) + 5 + +; INIT PACKET OFFSETS +INIT_NUM EQU BYTE PTR (SIZE SRHEAD) + 0 +INIT_BREAK EQU DWORD PTR (SIZE SRHEAD) + 1 +INIT_BPB EQU DWORD PTR (SIZE SRHEAD) + 5 +INIT_DOSDEV EQU BYTE PTR (SIZE SRHEAD) + 9 + +BREAK + +;; In order to address memory above 1 MB on the AT&T 6300 PLUS, it is +;; necessary to use the special OS-MERGE hardware to activate lines +;; A20 to A23. However, these lines can be disabled only by resetting +;; the processor. The return address offset and segment can be found +;; at 40:a2, noted here as RealLoc1. +;; +BiosSeg segment at 40h ;; Used to locate 6300 PLUS reset address + org 00a2h +RealLoc1 dd 0 +BiosSeg ends +; +R_Mode_IDT segment at 0h +R_mode_IDT ends +; + +BREAK + +RAMCODE SEGMENT +ASSUME CS:RAMCODE,DS:NOTHING,ES:NOTHING,SS:NOTHING + +;** +; +; RAMDRIVE DEVICE HEADER +; +; COMMON TO TYPE 1, 2, 3, 4 drivers +; +; SEE ALSO +; MS-DOS Technical Reference manual section on +; Installable Device Drivers +; + +RAMDEV LABEL WORD + DW -1,-1 +DEVATS DW DEVOPCL + DW STRATEGY + DW RAM$IN + DB 1 ;1 RAMDRIVE + + +BREAK + +;** +; +; This is the device driver command dispatch table. +; +; The first byte indicates the size of the table and therefore defines +; which device function codes are valid. +; +; The entries in the table are NEAR word addresses of the appropriate +; device routine. Thus the address of the routine to handle device function +; 3 is: +; WORD at ((RAMTBL + 1) + (2 * 3)) +; +; COMMON TO TYPE 1, 2, 3, 4 drivers +; +; + +RAMTBL LABEL WORD + DB 15 ; Max allowed command code + DW RAM$INIT + DW MEDIA$CHK + DW GET$BPB + DW CMDERR + DW RAM$READ + DW DEVEXIT + DW DEVEXIT + DW DEVEXIT + DW RAM$WRIT + DW RAM$WRIT + DW DEVEXIT + DW DEVEXIT + DW DEVEXIT + DW DEVEXIT + DW DEVEXIT + DW RAM$REM + + +BREAK + +;** RAMDRIVE BIOS PARAMETER BLOCK AND BOGUS BOOT SECTOR +; +; This region is a valid DOS 2.X 3.X "boot sector" which contains +; the BPB. This is used for signiture verification of a valid +; RAMDrive as well as for storage of the relevant BPB parameters. +; +; The BOOT_START code is a very simple stub which does nothing +; except go into an infinite loop. THIS "CODE" SHOULD NEVER +; BE EXECUTED BY ANYONE. +; +; COMMON TO TYPE 1, 2, 3, 4 drivers +; +; + +BOOT_SECTOR LABEL BYTE + JMP BOOT_START + DB "RDV 1.20" + +RDRIVEBPB: +SSIZE DW 512 ; Physical sector size in bytes +CSIZE DB 0 ; Sectors/allocation unit +RESSEC DW 1 ; Reserved sectors for DOS +FATNUM DB 1 ; No. allocation tables +DIRNUM DW 64 ; Number directory entries +SECLIM DW 0 ; Number sectors + DB 0F8H ; Media descriptor +FATSEC DW 1 ; Number of FAT sectors + DW 1 ; Number of sectors per track + DW 1 ; Number of heads + DW 0 ; Number of hidden sectors + +SEC_SHFT DB 8 ; Shifting number of + ; sectors LEFT by this + ; many bits yields #words + ; in that many sectors. + ; 128 6 + ; 256 7 + ; 512 8 + ; 1024 9 + +BOOT_START: + JMP BOOT_START + +BOOT_SIG LABEL BYTE + DB (128 - (OFFSET BOOT_SIG - OFFSET BOOT_SECTOR)) DUP ("A") + +; +; The following label is used to determine the size of the boot record +; OFFSET BOOT_END - OFFSET BOOT_SECTOR +; +BOOT_END LABEL BYTE + +BREAK + +; RAMDRIVE DEVICE ENTRY POINTS - STRATEGY, RAM$IN +; +; This code is standard DOS device driver function dispatch +; code. STRATEGY is the device driver strategy routine, RAM$IN +; is the driver interrupt routine. +; +; RAM$IN uses RAMTBL to dispatch to the appropriate handler +; for each device function. It also does standard packet +; unpacking. +; +; SEE ALSO +; MS-DOS Technical Reference manual section on +; Installable Device Drivers +; + +ASSUME CS:RAMCODE,DS:NOTHING,ES:NOTHING,SS:NOTHING + +PTRSAV DD 0 ; Storage location for packet addr + +;** STRATEGY - Device strategy routine +; +; Standard DOS 2.X 3.X device driver strategy routine. All it does +; is save the packet address in PTRSAV. +; +; ENTRY ES:BX -> Device packet +; EXIT NONE +; USES NONE +; +; COMMON TO TYPE 1, 2, 3, 4 drivers +; +; + +STRATP PROC FAR + +STRATEGY: + MOV WORD PTR [PTRSAV],BX ; Save packet addr + MOV WORD PTR [PTRSAV+2],ES + RET + +STRATP ENDP + +;** RAM$IN - Device interrupt routine +; +; Standard DOS 2.X 3.X device driver interrupt routine. +; +; +; ENTRY PTRSAV has packet address saved by previous STRATEGY call. +; EXIT Dispatch to appropriate function handler +; CX = Packet RW_COUNT +; DX = Packet RW_START +; ES:DI = Packet RW_TRANS +; DS = RAMCODE +; STACK has saved values of all regs but FLAGS +; All function handlers must return through one of +; the standard exit points +; USES FLAGS +; +; COMMON TO TYPE 1, 2, 3, 4 drivers +; +; + +RAM$IN: + PUSH SI + PUSH AX + PUSH CX + PUSH DX + PUSH DI + PUSH BP + PUSH DS + PUSH ES + PUSH BX + + LDS BX,[PTRSAV] ;GET POINTER TO I/O PACKET + ; + ; Set up registers for READ or WRITE since this is the most common case + ; + MOV CX,DS:[BX.RW_COUNT] ;CX = COUNT + MOV DX,DS:[BX.RW_START] ;DX = START SECTOR + MOV AL,DS:[BX.REQFUNC] ; Command code + MOV AH,BYTE PTR [RAMTBL] ; Valid range + CMP AL,AH + JA CMDERR ; Out of range command code + MOV SI,OFFSET RAMTBL + 1 ; Table of routines + CBW ; Make command code a word + ADD SI,AX ; Add it twice since one word in + ADD SI,AX ; table per command. + + LES DI,DS:[BX.RW_TRANS] ; ES:DI transfer address + + PUSH CS + POP DS + +ASSUME DS:RAMCODE + + JMP WORD PTR [SI] ; GO DO COMMAND + +;** EXIT - ALL ROUTINES RETURN THROUGH ONE OF THESE PATHS +; +; Exit code entry points: +; +; SEE ALSO +; MS-DOS Technical Reference manual section on +; Installable Device Drivers +; +; GENERAL ENTRY for all entry points +; All packet values appropriate to the specific device function +; filled in except for the status word in the static request +; header. +; +; CMDERR - Used when an invalid device command is detected +; +; ENTRY Stack has frame set up by RAM$IN +; EXIT Standard Device driver with error 3 +; USES FLAGS +; +; ERR$CNT - Used when READ or WRITE wants to return with error code. +; The packet RW_COUNT field is zeroed +; +; ENTRY AL is error code for low byte of packet status word +; Stack has frame set up by RAM$IN +; EXIT Standard Device driver with error AL +; USES FLAGS +; +; ERR$EXIT - Used when a function other that READ or WRITE wants to +; return an error +; +; ENTRY AL is error code for low byte of packet status word +; Stack has frame set up by RAM$IN +; EXIT Standard Device driver with error AL +; USES FLAGS +; +; DEVEXIT - Used when a function wants to return with no error +; +; ENTRY AL is value for low byte of packet status word +; NOTE: Typically there is no meaningful value +; in the AL register when EXITing through here. +; This is OK as the low 8 bits of the status word +; have no meaning unless an error occured. +; Stack has frame set up by RAM$IN +; EXIT Standard Device driver with no error +; USES FLAGS +; +; ERR1 - Used when a function wants to return with a value +; for the whole status word +; +; ENTRY AX is value for packet status word +; Stack has frame set up by RAM$IN +; EXIT Standard Device driver with or without error +; USES FLAGS +; +; COMMON TO TYPE 1, 2, 3, 4 drivers +; +; + +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING + +CMDERR: + MOV AL,3 ;UNKNOWN COMMAND ERROR + JMP SHORT ERR$EXIT + +ERR$CNT: + LDS BX,[PTRSAV] + MOV [BX.RW_COUNT],0 ; NO sectors transferred +ERR$EXIT: ; Error in AL + MOV AH,(STERR + STDON) SHR 8 ;MARK ERROR RETURN + JMP SHORT ERR1 + +EXITP PROC FAR + +DEVEXIT: + MOV AH,STDON SHR 8 +ERR1: + LDS BX,[PTRSAV] + MOV [BX.REQSTAT],AX ; Set return status + + POP BX + POP ES + POP DS + POP BP + POP DI + POP DX + POP CX + POP AX + POP SI + RET ;RESTORE REGS AND RETURN +EXITP ENDP + + +;** MEDIA$CHK - Device Driver Media check routine +; +; RAMDRIVE Media check routine. ALWAYS returns media not changed +; +; SEE ALSO +; MS-DOS Technical Reference manual section on +; Installable Device Drivers +; +; ENTRY from RAM$IN +; EXIT through DEVEXIT +; USES DS,BX +; +; COMMON TO TYPE 1, 2, 3, 4 drivers +; + +MEDIA$CHK: +ASSUME DS:RAMCODE,ES:NOTHING,SS:NOTHING + LDS BX,[PTRSAV] +ASSUME DS:NOTHING + MOV [BX.MCH_RETVAL],1 ; ALWAYS NOT CHANGED + JMP DEVEXIT + +;** GET$BPB - Device Driver Build BPB routine +; +; RAMDRIVE Build BPB routine. Returns pointer to BPB at RDRIVEBPB +; +; SEE ALSO +; MS-DOS Technical Reference manual section on +; Installable Device Drivers +; +; ENTRY from RAM$IN +; EXIT through DEVEXIT +; USES DS,BX +; +; COMMON TO TYPE 1, 2, 3, 4 drivers +; + +GET$BPB: +ASSUME DS:RAMCODE,ES:NOTHING,SS:NOTHING + LDS BX,[PTRSAV] +ASSUME DS:NOTHING + MOV WORD PTR [BX.BPB_BPB],OFFSET RDRIVEBPB + MOV WORD PTR [BX.BPB_BPB + 2],CS + JMP DEVEXIT + +;** RAM$REM - Device Driver Removable Media routine +; +; RAMDRIVE Removable Media routine. ALWAYS returns media not removable +; NOTE: This routine is never called if running on DOS 2.X +; +; SEE ALSO +; MS-DOS Technical Reference manual section on +; Installable Device Drivers +; +; ENTRY from RAM$IN +; EXIT through ERR1 +; USES AX +; +; COMMON TO TYPE 1, 2, 3, 4 drivers +; + +RAM$REM: +ASSUME DS:RAMCODE,ES:NOTHING,SS:NOTHING + MOV AX,STBUI + STDON ; Media NOT removable + JMP ERR1 + +;** RAM$READ - Device Driver READ routine +; +; RAMDRIVE READ routine. Perform device READ by calling MEMIO +; +; SEE ALSO +; MS-DOS Technical Reference manual section on +; Installable Device Drivers +; +; DO_OP entry point used by RAM$WRITE +; +; ENTRY from RAM$IN +; ES:DI is transfer address +; CX is sector transfer count +; DX is start sector number +; EXIT through DEVEXIT or ERR$CNT +; USES ALL +; +; COMMON TO TYPE 1, 2, 3, 4 drivers +; + +RAM$READ: +ASSUME DS:RAMCODE,ES:NOTHING,SS:NOTHING + XOR BH,BH +DO_OP: + CALL MEMIO + JC T_ERR + JMP DEVEXIT + +T_ERR: ; AL has error number + JMP ERR$CNT + +;** RAM$WRITE - Device Driver WRITE routine +; +; RAMDRIVE WRITE routine. Perform device WRITE by calling MEMIO +; +; SEE ALSO +; MS-DOS Technical Reference manual section on +; Installable Device Drivers +; +; ENTRY from RAM$IN +; ES:DI is transfer address +; CX is sector transfer count +; DX is start sector number +; EXIT Jump to DO_OP to call MEMIO with BH = 1 (WRITE) +; USES BH +; +; COMMON TO TYPE 1, 2, 3, 4 drivers +; + +RAM$WRIT: +ASSUME DS:RAMCODE,ES:NOTHING,SS:NOTHING + MOV BH,1 + JMP DO_OP + +;** MEMIO - Perform READ or WRITE to RAMDrive +; +; This routine performs common pre-amble code for the BLKMOV +; routine which is the one which does the real work. It checks +; the I/O parameters for validity and sets up the inputs to +; BLKMOV. What it does is convert the sector count in CX to +; the number of words in that many sectors or 8000H which ever +; is less. It also converts the start sector number in DX into +; a 32 bit byte offset equal to that many sectors. +; +; NOTE that we convert the number of sectors to transfer +; to a number of words to transfer. +; Sector size is always a power of two, therefore a multiple +; of two so there are no "half word" problems. +; DOS NEVER asks for a transfer larger than 64K bytes except +; in one case where we can ignore the extra anyway. +; +; ENTRY: +; ES:DI is packet transfer address. +; CX is number of sectors to transfer. +; DX is starting sector number +; BH is 1 for WRITE, 0 for READ +; EXIT: +; If error detected +; Carry Set +; Error on operation, AL is error number +; else +; through BLKMOV +; ES:DI is packet transfer address. +; CX is number of words to transfer. +; DX:AX is 32 bit start byte offset (0 = sector 0 of RAMDrive drive) +; BH is 1 for WRITE, 0 for READ +; USES: +; AX, DX, CX, FLAGS +; +; COMMON TO TYPE 1, 2, 3, 4 drivers +; + +SEC_NOT_FOUND: + MOV AL,8 ; Sector not found error + STC + RET + +MEMIO: +ASSUME DS:RAMCODE,ES:NOTHING,SS:NOTHING + CMP DX,[SECLIM] ; Check for valid I/O + JAE SEC_NOT_FOUND ; Start is beyond end + MOV AX,DX + ADD AX,CX + CMP AX,[SECLIM] + JA SEC_NOT_FOUND ; End is beyond end + ; + ; Convert sector count to word count + ; + MOV AX,CX + MOV CL,[SEC_SHFT] + SHL AX,CL ; AX is # words to move + JNC CNT_SET ; Overflow??? + MOV AX,8000H ; Limit to 64K bytes +CNT_SET: + MOV CX,AX + ; + ; Now compute start offset of I/O + ; + MOV AX,DX + MUL [SSIZE] ; DX:AX is byte offset of start + JMP BLKMOV ; Perform I/O + +BREAK + +S5_FLAG DB 0 ;; S_OLIVETTI means 6300 PLUS machine + ;; S_VECTRA means Vectra machine + +A20On dw 0DF90h +A20Off dw 0DD00h + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Unfortunately the code in ramdrive is very machine dependent +; necessitating the use of a system flag to store the machine +; configuration. The system flag is initialised during init time +; and used when the caching services are requested. One bit which +; is set and tested during caching is the state of the a20 line +; when the cache code is entered. This is used because there are +; applications which enable the a20 line and leave it enabled +; throughout the duration of execution. Since ramdrive is a device +; driver it shouldn't change the state of the environment. +; +; The system flag bit assignments are: +; +; ------------------------------------------------- +; | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | +; ------------------------------------------------- +; |-----| | | | | | | +; | | | | | | -----286 (and AT) +; | | | | | -----------386 (later than B0) +; not | | | -----------------PS/2 machine +; used | | -----------------------Olivetti (not used) +; | -----------------------------A20 state (enabled ?) +; -----------------------------------DOS 3.x >= 3.3 + +; The Olivetti guys have defined a flag of their own. This should be removed +; and the bit assigned out here for them should be used. +; +sys_flg db ? +; +; equates used for the system flag +; +M_286 equ 00000001B +M_386 equ 00000010B +M_PS2 equ 00000100B +M_OLI equ 00001000B +A20_ST equ 00010000B +DOS_33 equ 00100000B +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; A20 address line state determination addresses +; +low_mem label dword + dw 20h*4 + dw 0 + +high_mem label dword + dw 20h*4 + 10h + dw 0ffffh + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; A20 PS2 equates +; +PS2_PORTA equ 0092h +GATE_A20 equ 010b + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; 386 working areas +start_gdt label byte +nul_des desc <> +cs_des desc <0FFFFh,0,0,09Fh,0,0> +ss_des desc <0FFFFh,0,0,093h,0,0> +ds_des desc <0FFFFh,0,0,093h,0,0> +es_des desc <0FFFFh,0,0,093h,0,0> +end_gdt label byte + +emm_gdt gdt_descriptor +; +; int 15 gdt +; +int15_gdt label byte + desc <> ;dummy descriptor + desc <> ;descriptor for gdt itself +src desc <0ffffh,,,93h,,> +tgt desc <0ffffh,,,93h,,> + desc <> ;bios cs descriptor + desc <> ;stack segment descriptor + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +BREAK + +; +; The following label defines the start of the I/O code which is driver type +; specific. +; +; THE TYPE 2 driver must REPLACE this code with code appropriate +; to the driver type. +; + EVEN ; Force start of drive code to word boundary + +DRIVE_CODE LABEL WORD + +EXTMEM_LOW EQU 0000H ; 24 bit addr of start of extended memory +EXTMEM_HIGH EQU 0010H + +;** BASE_ADDR data element +; +; The next value defines the 24 bit address of the start of the memory for +; the cache. It is equal to the EMM_BASE value in the +; EMM_REC structure for the cache. +; +; NOTE THAT IT IS INITIALIZED TO THE START OF EXTENDED MEMORY. This is +; because BLKMOV is used to read the EMM_CTRL sector during initialization +; of a TYPE 1 driver. +; +; NOTE: This data element is shared by TYPE 1, 2 drivers, but +; its meaning and correct initial value are driver type specific. +; + +;; NOTE: The value at BASE_ADDR is patched during initialization when +;; loading a RAMDrive into upper extended memory on a PLUS +;; +BASE_ADDR LABEL DWORD ; 24 bit address of start of this RAMDRV + DW EXTMEM_LOW + DW EXTMEM_HIGH +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;** BLKMOV - Perform transfer for TYPE 1 driver +; +; This routine is the transfer routine for moving bytes +; to and from the AT extended memory in real mode using +; the LOADALL instruction. The LOADALL instruction is used +; to set up a segment descriptor which has a 24 bit address. +; During the time the LOADALL 24 bit segment descriptor is +; in effect we must have interrupts disabled. If a real mode +; 8086 interrupt handler was given control it might perform +; a segment register operation which would destroy the special +; segment descriptor set up by LOADALL. This is prevented by +; doing a CLI during the "LOADALL time". +; +; WARNING NUMBER ONE: +; THIS CODE WILL NOT WORK ON ANY 80286 MACHINE WHERE THE NMI +; INTERRUPT IS ANYTHING BUT A FATAL, SYSTEM HALTING ERROR. +; +; Since it is bad to leave interrupts disabled for a long +; time, the I/O is performed 256 words at a time enabling +; interrupts between each 256 word piece. This keeps the time +; interrupts are disabled down to a reasonable figure in the 100mSec +; range. +; +; To use the LOADALL instruction 102 bytes at location 80:0 must +; be used. INT13 copies the contents of 80:0 into its own buffer, +; copies in the LOADALL info, performs the LOADALL, and then copies +; back the previous contents of 80:0. These operations are all +; performed during the time interrupts are disabled for each 256 word +; block. This must be done with interrupts disabled because this area +; on DOS 2.X and 3.X contains variable BIOS data. +; +; In order to gain full 24 bit addressing it is also required +; that address line 20 be enabled. This effects 8086 compatibility +; on 80286 systems. This code leaves address line 20 enabled +; for the ENTIRE duration of the I/O because it is too time +; expensive to disable/enable it for each 256 word block. +; +; WARNING NUMBER TWO: +; IF A MULTITASKING PRE-EMPTIVE SYSTEM SCHEDULES AND RUNS +; AN APPLICATION WHICH RELIES ON THE 1 MEG ADDRESS WRAP +; PROPERTY OF THE 8086 AND 8088 DURING THE TIME INT13 +; IS IN THE MIDDLE OF DOING AN I/O WITH ADDRESS LINE 20 ENABLED, +; THE APPLICATION WILL NOT RUN PROPERLY AND MAY DESTRUCT THE +; INT13 MEMORY. +; +; METHOD: +; Perform various LOADALL setup operations +; Enable address line 20 +; While there is I/O to perform +; Do "per 256 word block" LOADALL setup operations +; Set up copy of 80:0 to INT13 buffer +; CLI +; copy 80:0 to INT13 buffer +; copy LOADALL info to 80:0 +; LOADALL +; do 256 word transfer +; copy INT13 80:0 buffer back to 80:0 +; STI +; Disable address line 20 +; +; SEE ALSO +; INTEL special documentation of LOADALL instruction +; +; ENTRY: +; ES:DI is packet transfer address. +; CX is number of words to transfer. +; DX:AX is 32 bit start byte offset (0 = start of cache) +; BH is 1 for WRITE, 0 for READ +; +; BASE_ADDR set to point to start of cache memory +; This "input" is not the responsibility of the caller. It +; is up to the initialization code to set it up when the +; device is installed +; +; EXIT: +; Carry Clear +; OK, operation performed successfully +; Carry Set +; Error during operation, AL is error number (INT 13 error) +; +; USES: +; ALL +; +; This routine is specific to TYPE 1 driver +; +; sunilp - incorporated blkmov_386 (thanks to gregh) +; incorporated loadall_286 trick (thanks to scottra) +; added new a20 functionality +; ideally the code should be all relocatable abd the 386 +; blkmov should be relocated on the 286 blkmov for the +; 386 case. Also the A20 routines for the Olivetti or PS/2 +; should also ideally be relocated on top of the normal A20 + +BLKMOV: +ASSUME DS:ramcode,ES:NOTHING,SS:NOTHING + test [sys_flg],M_386 + je blkmov_286 + jmp blkmov_386 + ; + ; Compute 32 bit address of start of I/O + ; +blkmov_286: + ADD AX,WORD PTR [BASE_ADDR] + ADC DX,WORD PTR [BASE_ADDR + 2] + ; + ; Dispatch on function + ; + OR BH,BH + JZ READ_IT + ; + ; Write + ; + MOV WORD PTR [ESDES.SEG_BASE],AX + MOV BYTE PTR [ESDES.SEG_BASE + 2],DL +; MOV [LSI],DI + mov [lbx],di ;sp + MOV [LDI],0 + MOV SI,OFFSET DSDES + JMP SHORT SET_TRANS + +READ_IT: + MOV WORD PTR [DSDES.SEG_BASE],AX + MOV BYTE PTR [DSDES.SEG_BASE + 2],DL + MOV [LDI],DI +; MOV [LSI],0 ;sp + mov [lbx],0 + MOV SI,OFFSET ESDES +SET_TRANS: + MOV AX,ES + CALL SEG_SET ; Set ES or DS segreg + ; + ; Set stack descriptor + ; + MOV AX,SS + MOV [LSSS],AX + MOV SI,OFFSET SSDES + CALL SEG_SET + MOV [LSP],SP +; SUB [LSP],2 ; CX is on stack at LOADALL +; +; the loadall kludge +; + mov ax,cs ;sp + inc ax ;sp + mov [lcss],ax ;sp + mov si,offset CSDES ;sp + mov ax,cs ;sp + call seg_set ;sp + ; + ; Set Other LOADALL stuff + ; + SMSW [LDSW] + SIDT FWORD PTR [IDTDES] + SGDT FWORD PTR [GDTDES] + ; + ; NOW The damn SXXX instructions store the desriptors in a + ; different order than LOADALL wants + ; + MOV SI,OFFSET IDTDES + CALL FIX_DESCRIPTOR + MOV SI,OFFSET GDTDES + CALL FIX_DESCRIPTOR + ; + ; Enable address line 20 + ; + +;; +;; Enable address line 20 on the PC AT or activate A20-A23 on the 6300 PLUS. +;; The former can be done by placing 0dfh in AH and activating the keyboard +;; processor. On the PLUS, 90h goes in AL and the port at 03f20h is written. +;; So the combined value of 0df90h can be used for both machines with +;; appropriate coding of the called routine A20. +;; + +;; MOV AH,0DFH + mov ax,cs:[A20On] ;; set up for PLUS or AT + CALL A20 + Jc NR_ERR +; JMP SHORT IO_START ;sp + jmp short move_main_loop ;sp + +NR_ERR: + MOV AL,02 ; Drive not ready error + STC + RET +io_donej: jmp io_done +;IOLOOP: ;sp +; PUSH CX ;sp + +move_main_loop: ;sp +assume ds:nothing ;sp + jcxz io_donej ;sp + mov cs:[ldx],cx ;sp + MOV AX,80H + MOV DS,AX + PUSH CS + POP ES + XOR SI,SI + MOV DI,OFFSET cs:[SWAP_80] + MOV CX,102/2 + mov cs:[ssSave],ss + CLD + CLI ; Un interruptable + test [sys_flg],dos_33 ; is it dos 3.3 or above + jne mml$1 ; if so we don't need to store contents + ; of 80:0 + REP MOVSW ; Save contents of 80:0 +mml$1: + PUSH DS + PUSH ES + POP DS + POP ES + XOR DI,DI + MOV SI,OFFSET cs:LOADALL_TBL + MOV CX,102/2 + REP MOVSW ; Transfer in LOADALL info + DW 050FH ; LOADALL INSTRUCTION +AFTER_LOADALL: +; set up stack for moving 80:0 information back again +; + xor bp,bp + mov ss,ax + mov si,offset cs:[swap_80] + mov cx,102/2 + test [sys_flg],dos_33 + jne mml$2 +move_loop: + lods word ptr cs:[si] + mov ss:[bp],ax + inc bp + inc bp + loop move_loop +mml$2: + mov ss,cs:[ssSave] + mov cx,dx + mov si,bx +;critical code + sti + rep movsw + cli ; bugfix sunilp + mov ax,cs + dec ax + push ax + mov ax,offset io_done + push ax + db 0cbh +; + db 16 dup (0fah) ; bugfix sunilp + mov ax,cs + dec ax + push ax + mov ax,offset resume_int + push ax + db 0cbh +; +resume_int: + mov cs:[ldi],di + mov cs:[lbx],si + jmp move_main_loop + +; REP MOVSW ; Move data +;IO_START: +; JCXZ IODN +; MOV WORD PTR [LCX],256 ; ASSUME full block +; SUB CX,256 +; JNC IOLOOP ; OK +; ADD [LCX],CX ; OOPs, partial block +; XOR CX,CX ; This is the last block +; JMP IOLOOP + +;IODN: +io_done: + sti ; bugfix sunilp + MOV CX,800H ; Retry this many times +OFFLP: + +;; +;; Reset of line A20 on the PC AT requires writing 0ddh to the keyboard +;; processor. On the PLUS, the appropriate value is 00. +;; + +;; MOV AH,0DDH + mov ax,cs:[A20Off] ;; setup for PLUS or AT. ah for IBM, al for PLUS + CALL A20 ; Disable address line 20 + jnc dis_done + LOOP OFFLP +dis_done: + CLC + RET + +;** A20 - ENABLE/DISABLE ADDRESS LINE 20 ON IBM PC-AT +; +; This routine enables/disables address line 20 by twiddling bits +; in one of the keyboard controller registers. +; +; SEE ALSO +; IBM Technical Reference Personal Computer AT Manual #1502243 +; Page 5-155 +; +; ENTRY +; AH = 0DDH to disable A20 +; AH = 0DFH to enable A20 +; EXIT +; CY Failed +; NC Succeeded +; USES +; AL, FLAGS +; +; WARNING If this routine is called in a CLI state this routine has +; the side effect of enabling interrupts. +; +; This routine is specific to TYPE 1 driver +; + +A20: +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING +;; CS override needed on S5_FLAG to avoid phase errors on +;; forward declaration of this variable. + cmp cs:[S5_FLAG],S_OLIVETTI ;; test for 6300 PLUS + jne test_vec ;; yes, do this code + jmp a20s5 +test_vec: + cmp cs:[S5_FLAG],S_VECTRA + jne test_ps2 + jmp VecA20 +test_ps2: + test cs:[sys_flg],M_PS2 ; is it a ps2 machine + jne a20ps2 ; if yes it has separate a20 routine +old_a20: + CLI + call check_a20 ; check to see if it can be enb /disb + jc a20suc ; no it may not be toggled + CALL E_8042 + JNZ a20err + MOV AL,0D1H + OUT 64H,AL + CALL E_8042 + JNZ a20err + MOV AL,AH + OUT 60H,AL + CALL E_8042 + JNZ a20err + ; + ; We must wait for the a20 line to settle down, which (on an AT) + ; may not happen until up to 20 usec after the 8042 has accepted + ; the command. We make use of the fact that the 8042 will not + ; accept another command until it is finished with the last one. + ; The 0FFh command does a NULL 'Pulse Output Port'. Total execution + ; time is on the order of 30 usec, easily satisfying the IBM 8042 + ; settling requirement. (Thanks, CW!) + ; + mov al,0FFh ;* Pulse Output Port (pulse no lines) + out 64H,al ;* send cmd to 8042 + CALL E_8042 ;* wait for 8042 to accept cmd + jnz A20Err + +A20Suc: sti + clc + RET +A20Err: sti + stc + ret +; +; Helper routine for A20. It waits for the keyboard controller to be "ready". +; +E_8042: +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING + PUSH CX + XOR CX,CX +E_LOOP: + IN AL,64H + AND AL,2 + LOOPNZ E_LOOP + POP CX + RET +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; A20 status checking. If request is to enable a20 we must check to +; see if it is already enabled. If so we just set the sys_flg to +; indicate this. On disabling the routine checks to see if disabling +; is allowed +; +check_a20: +assume ds:nothing,es:nothing,ss:nothing + cmp ah,0ddh ; is it a disable operation + jne check_a20_enable +; +; check if a20 disabling allowed +; + test cs:[sys_flg],a20_st + jne no_toggle +toggle: clc + ret +; +; a20 enabling, check if allowed +; +check_a20_enable: + and cs:[sys_flg], not A20_ST + push cx + push ds + push si + push es + push di + lds si,cs:low_mem + les di,cs:high_mem + mov cx,3 + cld +repe cmpsw + pop di + pop es + pop si + pop ds + jcxz not_enabled + pop cx + or cs:[sys_flg],A20_ST +no_toggle: + stc + ret +not_enabled: + pop cx + clc + ret + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; A20 routine for PS2s. The PS2 A20 hardware has shifted and toggling +; a bit in the system port is all that is required. +A20PS2: +assume ds:nothing,es:nothing,ss:nothing + cli +; +; first separate disable operation from enable operation +; + cmp ah,0ddh + je disbl_PS2 +; +; enabling the a20 +; + and cs:[sys_flg],not A20_ST + in al,PS2_PORTA ; input a20 status + test al,GATE_A20 ; is the a20 line set + je set_it ; + or cs:[sys_flg],A20_ST ; indicate that it was already set +ps2a20suc: + clc + sti + ret + +set_it: push cx + xor cx,cx + or al,GATE_A20 + out PS2_PORTA,al ; set it +see_agn: + in al,PS2_PORTA ; read status again + test al,GATE_A20 + loopz see_agn + pop cx + jz ps2err + clc + sti + ret +; +; disabling the ps2 +; +disbl_PS2: + test cs:[sys_flg],A20_ST + jne ps2a20suc +; + push cx + xor cx,cx + in al,PS2_PORTA + and al,not GATE_A20 + out PS2_PORTA,al +see_agn1: + in al,PS2_PORTA + test al,GATE_A20 + loopnz see_agn1 + pop cx + jnz ps2err + clc + sti + ret +; +ps2err: + stc + sti + ret + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;* VECA20 - Address enable/disable routine for Vectra family computers +;; +;; This routine does the same function as A20 for Vectra machines. +;; Vectra machines require writing single byte as opposed to +;; double byte commands to the 8041. This is due to a bug +;; in older versions in the Vectra 8041 controllers. IBM +;; machines must use double byte commands due to lack of +;; implementation of single byte commands in some of their machines. +;; +;; Uses al, flags +;; Has same results as A20 +;; +VecA20: + CLI + call check_a20 + jc VecA20Suc + call E_8042 + jnz VecA20Err + mov al,ah ;sigle byte command is code passed + out 64H,al + call E_8042 + jnz VecA20Err +; +; See A20 for a description of the following code. It simply makes +; sure that the previous command has been completed. We cannot +; pulse the command reg since there is a bug in some Vectra 8041s +; instead we write the command again knowing that when the second +; command is accepted the first was already processed. + mov al,ah ; send command again + out 64H,al + call E_8042 + jnz VecA20Err +VecA20Suc: + sti + clc + ret +VecA20Err: + sti + stc + ret + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;* A20S5 - Address enable/disable routine for the 6300 PLUS. +;; +;; This routine enables lines A20-A23 on the PLUS by writing +;; to port 03f20h. Bit 7 turns the lines on, and bit 4 sets +;; the power-up bit. To disable the lines, the processor +;; must be reset. This is done by saving the world and +;; jumping to the ROM 80286 reset code. Since the power-up bit +;; is set, the data segment is set to the BiosSeg at 40h +;; and a jump is then made to the address at RealLoc1. +;; At RealLoc1, one can find the CS:IP where the code +;; is to continue. +;; +;; Uses ax, flags. +;; Returns with zero flag set. +;; +A20S5: +; test [reboot_flg],0ffh ;; sunilp +; jne a20s5boot ;; sunilp + cli + or al,al ;; if zero, then resetting processor + jnz A20S5Next + call RSet ;; must return with entry value of ax +A20S5Next: + push dx ;; set/reset port + mov dx,3f20h + out dx,al + pop dx + clc ;; sunilp modification cy flag now important + STI + RET + +;;* a20S5BOOT - This code bypasses the processor reset on a reboot +;; of the 6300 PLUS. Otherwise the machine hangs. +a20s5BOOT: ;; use this code before reboot + cli + jmp short a20s5next + +OldStackSeg dw 0 ;; used during PLUS processor reset + ;; to save the stack segment + +;;* Rset - Reset the 80286 in order to turn off the address lines +;; on the 6300 PLUS. Only way to do this on the +;; current hardware. The processor itself can be +;; reset by reading or writing prot 03f00h +;; +;; Uses flags. +;; +RSet: + pusha ;; save world + push ds ;; save segments + push es + mov ax,BiosSeg ;; point to the bios segment + mov ds,ax ;; ds -> 40h +assume ds:BiosSeg + push word ptr [RealLoc1] ;; save what might have been here + push word ptr [RealLoc1+2] + mov word ptr [RealLoc1],cs:[offset ReturnBack] ;; load our return address + mov word ptr [RealLoc1+2],cs +assume ds:nothing + mov [OldStackSeg],ss ;; save the stack segment, too + mov dx,03f00h ;; reset the processor + in ax,dx + nop + nop + nop + cli + hlt ;; should never get here +ReturnBack: + mov ss,[OldStackSeg] ;; start the recovery +assume ds:BiosSeg + pop word ptr [RealLoc1+2] + pop word ptr [RealLoc1] + pop es + pop ds + popa + ret +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +blkmov_386: ;_protect: +assume ds:ramcode,es:nothing,ss:nothing +; +; Compute 32 bit address of start of I/O +; + add ax,word ptr [base_addr] + adc dx,word ptr [base_addr + 2] +; + push cx +; +; Are we in virtual mode +; + smsw cx + test cx,01B ; is the pe bit set + je pr_mode_tran + + jmp int_15_tran +; +; Dispatch on function +; +pr_mode_tran: + or bh,bh + jz read_it_1 +; +; Write +; +; Update ES descriptor with address of track in cache +; + mov si,offset es_des + mov [si].bas_0_15,ax + mov [si].bas_16_23,dl + mov [si].bas_24_31,dh +; +; Update DS descriptor with transfer address +; + mov ax,es + mov cx,16 + mul cx + mov si,offset ds_des + mov [si].bas_0_15,ax + mov [si].bas_16_23,dl + mov [si].bas_24_31,dh + + +; Switch SI and DI for write transfer + + mov si,di + xor di,di + + jmp short set_trans_1 + +read_it_1: +; +; Update DS descriptor with address of track in cache +; + mov si,offset ds_des + mov [si].bas_0_15,ax + mov [si].bas_16_23,dl + mov [si].bas_24_31,dh +; +; Update ES descriptor with transfer address +; + mov ax,es + mov cx,16 + mul cx + mov si,offset es_des + mov [si].bas_0_15,ax + mov [si].bas_16_23,dl + mov [si].bas_24_31,dh +; +; Keep SI and DI the same for read transfer +; + xor si,si + +set_trans_1: +; +; Restore Transfer Count +; + pop cx + +; + mov ax,cs:[A20On] + call A20 + jc nr_err_1 +; +; we shall do the transfer 1024 words at a time +; + db 66h + push ax + mov bx,cx +assume ds:nothing +pr_io_agn_1: + mov cx,1024 + cmp bx,cx + ja pr_strt_1 + mov cx,bx +pr_strt_1: + sub bx,cx + cli ; Un interruptable + cld + lgdt fword ptr emm_gdt + + +; +; Switch to protected mode +; + db 66h,0Fh, 20h, 0 ;mov eax,cr0 + or ax,1 + db 66h,0Fh,22h, 0 ;mov cr0,eax +; +; Clear prefetch queue +; + db 0eah ; far jump + dw offset flush_prefetch + dw cs_des - start_gdt +; +flush_prefetch: + assume cs:nothing +; +; Initialize segment registers +; + mov ax,ds_des - start_gdt + mov ds,ax + assume ds:nothing + mov ax,es_des - start_gdt + mov es,ax + assume es:nothing + shr cx,1 ; convert word count into dword count + db 0f3h,066h,0a5h ; rep movsd +; rep movsw ; Move data +; +; +; Return to Real Mode +; +; + db 66h,0Fh, 20h, 0 ; mov eax,cr0 + and ax,0FFFEh + db 66h,0Fh, 22h, 0 ; mov cr0,eax +; +; Flush Prefetch Queue +; + db 0EAh ; Far jump + dw offset flushcs +cod_seg dw ? ; Fixed up at initialization time + assume cs:ramcode +flushcs: +; + sti +; see if transfer done else go to do next block +; + or bx,bx + jne pr_io_agn_1 +; + db 66h + pop ax + mov ax,cs + mov es,ax + assume es:nothing + mov ds,ax + assume ds:ramcode + + mov cx,800h ; Retry this many times +offlp_1: + mov ax,cs:[A20Off] + call A20 ; Disable address line 20 + jnc offlp1_out + loop offlp_1 +offlp1_out: + clc + ret + +nr_err_1: + + mov al,02 ; Drive not ready error + stc + ret +; +int_15_tran: +assume ds:ramcode,es:nothing,ss:nothing + or bh,bh + jz read_it_2 +; +; Write +; +; Update tgt descriptor with address of track in cache +; + mov si,offset tgt + mov [si].bas_0_15,ax + mov [si].bas_16_23,dl + mov [si].bas_24_31,dh +; +; Update src descriptor with transfer address +; + mov ax,es + mov cx,16 + mul cx + add ax,di + adc dx,0 + mov si,offset src + mov [si].bas_0_15,ax + mov [si].bas_16_23,dl + mov [si].bas_24_31,dh +; + jmp short set_trans_2 + +read_it_2: +; +; Update src descriptor with address of track in cache +; + mov si,offset src + mov [si].bas_0_15,ax + mov [si].bas_16_23,dl + mov [si].bas_24_31,dh +; +; Update tgt descriptor with transfer address +; + mov ax,es + mov cx,16 + mul cx + add ax,di + adc dx,0 + mov si,offset tgt + mov [si].bas_0_15,ax + mov [si].bas_16_23,dl + mov [si].bas_24_31,dh +; +set_trans_2: +; +; Restore Transfer Count +; + pop bx + +; +; we shall do the transfer 1024 words at a time +; +pr_io_agn_2: + mov cx,1024 + cmp bx,cx + ja pr_strt_2 + mov cx,bx +pr_strt_2: + sub bx,cx + push cs + pop es + mov si,offset int15_gdt + mov ax,emm_blkm shl 8 + int emm_int + jc nr_err_1 +; +; +; see if transfer done else fo to do next block +; + or bx,bx + je io_exit +; + add [src.bas_0_15],2048 + adc [src.bas_16_23],0 + adc [src.bas_24_31],0 +; + add [tgt.bas_0_15],2048 + adc [tgt.bas_16_23],0 + adc [tgt.bas_24_31],0 +; + jmp pr_io_agn_2 +io_exit: + clc + ret +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;** SEG_SET - Set up a LOADALL segment descriptor as in REAL mode +; +; This routine sets the BASE value in the segment descriptor +; pointed to by DS:SI with the segment value in AX as the 80286 +; does in REAL mode. This routine is used to set a descriptor +; which DOES NOT have an extended 24 bit address. +; +; SEE ALSO +; INTEL special documentation of LOADALL instruction +; +; ENTRY: +; DS:SI -> Seg register descriptor +; AX is seg register value +; EXIT: +; NONE +; USES: +; AX +; +; This routine is specific to TYPE 1 driver +; + +SEG_SET: +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING + PUSH DX + PUSH CX + MOV CX,16 + MUL CX ; Believe or not, this is faster than a 32 bit SHIFT + MOV WORD PTR [SI.SEG_BASE],AX + MOV BYTE PTR [SI.SEG_BASE + 2],DL + POP CX + POP DX + RET + +;** FIX_DESCRIPTOR - Shuffle GTD IDT descriptors +; +; The segment descriptors for the IDT and GDT are stored +; by the SIDT instruction in a slightly different format +; than the LOADALL instruction wants them. This routine +; performs the transformation by PUSHing the contents +; of the descriptor, and then POPing them in a different +; order. +; +; SEE ALSO +; INTEL special documentation of LOADALL instruction +; INTEL 80286 processor handbook description of SIDT instruction +; +; ENTRY: +; DS:SI points to IDT or GDT descriptor in SIDT form +; EXIT: +; DS:SI points to IDT or GDT descriptor in LOADALL form +; USES: +; 6 words of stack +; +; NOTE: The transformation is reversable, so this routine +; will also work to transform a descriptor in LOADALL +; format to one in SIDT format. +; +; Specific to TYPE 1 driver +; + +FIX_DESCRIPTOR: +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING + PUSH WORD PTR [SI + 4] + PUSH WORD PTR [SI + 2] + PUSH WORD PTR [SI] + POP WORD PTR [SI + 4] + POP WORD PTR [SI] + POP WORD PTR [SI + 2] + RET + +;** DATA SPECIFIC TO THE LOADALL INSTRUCTION USAGE +; +; SWAP_80 and LOADALL_TBL are data elements specific to the use +; of the LOADALL instruction by TYPE 1 drivers. +; + +; +; Swap buffer for contents of 80:0 +; + EVEN ; Force word alignment of SWAP_80 and LOADALL_TBL + +SWAP_80 DB 102 DUP(?) +ssSave dw ? + +; +; LOADALL data buffer placed at 80:0 +; +LOADALL_TBL LABEL BYTE + DB 6 DUP(0) +LDSW DW ? + DB 14 DUP (0) +TR DW 0 +FLAGS DW 0 ; High 4 bits 0, Int off, Direction clear + ; Trace clear. Rest don't care. +LIP DW OFFSET AFTER_LOADALL +LDT DW 0 +LDSS DW 8000h +LSSS DW ? +LCSS DW ? +LESS DW ? +LDI DW ? +LSI DW ? +LBP DW ? +LSP DW ? +LBX DW ? +LDX DW ? +LCX DW ? +LAX DW 80H +ESDES SEGREG_DESCRIPTOR <> +CSDES SEGREG_DESCRIPTOR <> +SSDES SEGREG_DESCRIPTOR <> +DSDES SEGREG_DESCRIPTOR <> +GDTDES DTR_DESCRIPTOR <> +LDTDES DTR_DESCRIPTOR <0D000H,0,0FFH,0088H> +IDTDES DTR_DESCRIPTOR <> +TSSDES DTR_DESCRIPTOR <0C000H,0,0FFH,0800H> + +;** TRUE LOCATION OF ABOVE_PID +; +; Define the TRUE (runtime TYPE 2 driver) location of ABOVE_PID. +; This is the only piece of TYPE 2 specific data that we need +; in the resident image. We must define it HERE rather than down +; at ABOVE_BLKMOV so that we have its TRUE location after the +; TYPE 2 code is swapped in at initialization. If we defined +; it down at ABOVE_BLKMOV any instruction like: +; +; MOV DX,[ABOVE_PID] +; +; Would have to be "fixed up" when we moved the ABOVE_BLKMOV +; code into its final location. +; + +ABOVE_PID EQU WORD PTR $ - 2 ; TRUE location of ABOVE_PID + +; +; The following label defines the end of the region where BLKMOV code +; may be swapped in. BLKMOV code to be swapped in MUST fit +; between DRIVE_CODE and DRIVE_END +; +DRIVE_END LABEL WORD + + +BREAK + +;** BPB pointer array data +; +; BPB pointer array returned by INIT call. Must be part of resident image. +; +; SEE ALSO +; MS-DOS Technical Reference manual section on +; Installable Device Drivers +; + +INITAB DW RDRIVEBPB + +; +; The following label defines the end of the RAMDrive resident code +; for cases where no INT 9/19 code is included. +; +DEVICE_END LABEL BYTE + +BREAK + +; +; As discussed above in the documentation of the EMM_CTRL sector it +; is necessary to hear about system re-boots so that the EMM_ISDRIVER +; bits in the EMM_REC structures can be manipulated correctly. +; +; On the IBM PC family of machines there are two events which cause a +; "soft" system re-boot which we might expect the EMM_CTRL sector to +; survive through. One is software INT 19H, the other is the Ctrl-Alt-Del +; character sequence which can be detected by "listening" on INT 9 for +; it. The code below consists of a handler for INT 19H, a handler +; for INT 9, and a drive TYPE dependant piece of code. +; +; The drive TYPE dependant piece of code works as follows: +; +; TYPE 1 uses EMM_CTRL sector so it scans the EMM_CTRL sector +; looking for all EMM_ALLOC and EMM_MSDOS EMM_REC +; structures and turns off the EMM_ISDRIVER bit. +; Since this scan is GLOBAL for all EMM_MSDOS +; marked structures we need only ONE INT 19/INT 9 +; handler even if we have more than one TYPE 1 +; RAMDrive in the system. The handler is always +; in the FIRST TYPE 1 RAMDrive installed at boot +; time. +; +; TYPE 2 DOES NOT use the EMM_CTRL sector but it still has +; a handler. What this handler does is issue an +; ABOVE_DEALLOC call to deallocate the Above Board +; memory allocated to the RAMDrive. In current versions +; of the EMM device driver this step is unnecessary +; as the EMM device driver is thrown away together +; with all of the allocation information when the system +; is re-booted. We do it anyway because some future version +; of the EMM device driver may be smarter and retain +; allocation information through a warm-boot. Currently, +; doing this doesn't hurt anything. Since this code cannot +; do a global ABOVE_DEALLOC for all TYPE 2 drivers in the +; system, it does an ABOVE_DEALLOC only for its memory +; and EACH TYPE 2 driver in the system includes the INT 19/9 +; code. +; +; TYPE 3 uses EMM_CTRL sector so it scans the EMM_CTRL sector +; looking for all EMM_ALLOC and EMM_MSDOS EMM_REC +; structures and turns off the EMM_ISDRIVER bit. +; Since this scan is GLOBAL for all EMM_MSDOS +; marked structures we need only ONE INT 19/INT 9 +; handler even if we have more than one TYPE 3 +; RAMDrive in the system. The handler is always +; in the FIRST TYPE 3 RAMDrive installed at boot +; time. +; +; TYPE 4 does not use EMM_CTRL or have any other need to hear +; about re-boots since this type of RAMDrive CANNOT +; live through a warm boot. So TYPE 4 drivers NEVER +; include the INT 19/9 code. +; + +; +; Storage locations for the "next" INT 19 and INT 9 vectors, the ones +; that were in the interrupt table when the device driver was loaded. +; They are initialized to -1 to indicate they contain no useful information. +; +OLD_19 LABEL DWORD + DW -1 + DW -1 + +;OLD_9 LABEL DWORD +; DW -1 +; DW -1 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; modification to meet new memory allocation standard +OLD_15 LABEL DWORD + DW -1 + DW -1 +int15_size dw 0 +; +; +INT_15: +ASSUME DS:NOTHING,SS:NOTHING,ES:NOTHING +; +; This piece of code determines the size of extended memory +; which was allocated before this driver and then subtracts +; the amount it has allocated for itself +; +; inputs: ah = 88h is of interest +; outputs: ax = size of extended memory allocated by all before and +; including us +; regs used: flags +; + pushf + cmp ah,88h + je mem_det + popf + jmp [old_15] +mem_det: + mov ax,[int15_size] + popf + clc + sti + iret + +;** INT 9 Keyboard handler +; +; All this piece of code does is look for the Ctrl-Alt-Del event. +; If key is not Ctrl-Alt-Del, it jumps to OLD_9 without doing +; anything. If the Ctrl-Alt-Del key is detected it calls +; RESET_SYSTEM to perform driver TYPE specific re-boot code +; and then jumps to OLD_9 to pass on the event. +; +; NOTE THAT UNLIKE INT 19 THIS HANDLER DOES NOT NEED TO RESET +; THE INT 9 AND INT 19 VECTORS. This is because the Ctrl-Alt-Del +; IBM ROM re-boot code resets these vectors. +; +; SEE ALSO +; INT 9 IBM ROM code in ROM BIOS listing of +; IBM PC Technical Reference manual for any PC family member +; +; ENTRY +; NONE +; EXIT +; NONE, via OLD_9 +; USES +; FLAGS +; +; THIS CODE IS USED BY TYPE 1,2 and 3 drivers. +; + +;INT_9: +;ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING +; PUSH AX +; PUSH DS +; IN AL,60H +; CMP AL,83 ; DEL key? +; JNZ CHAIN ; No +; XOR AX,AX +; MOV DS,AX +; MOV AL,BYTE PTR DS:[417H] ; Get KB flag +; NOT AL +; TEST AL,0CH ; Ctrl Alt? +; JNZ CHAIN ; No +; CALL RESET_SYSTEM ; Ctrl Alt DEL +;CHAIN: +; POP DS +; POP AX +; JMP [OLD_9] + +;** INT 19 Software re-boot handler +; +; All this piece of code does is sit on INT 19 waiting for +; a re-boot to be signaled by being called. It calls +; RESET_SYSTEM to perform driver TYPE specific re-boot code, +; resets the INT 19 and INT 9 vectors, +; and then jumps to OLD_19 to pass on the event. +; +; NOTE THAT UNLIKE INT 9 THIS HANDLER NEEDS TO RESET +; THE INT 9 AND INT 19 VECTORS. This is because the INT 19 +; IBM ROM re-boot code DOES NOT reset these vectors, and we +; don't want to leave them pointing to routines that are not +; protected from getting stomped on by the re-boot. +; +; SEE ALSO +; INT 19 IBM ROM code in ROM BIOS listing of +; IBM PC Technical Reference manual for any PC family member +; +; ENTRY +; NONE +; EXIT +; NONE, via OLD_19 +; USES +; FLAGS +; +; THIS CODE IS USED BY TYPE 1,2 and 3 drivers. +; + +INT_19: +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING + CALL RESET_SYSTEM + PUSH AX + PUSH DS + XOR AX,AX + MOV DS,AX + ; + ; Since INT 19 DOES NOT reset any vectors (like INT 9 Ctrl Alt DEL does), + ; we must replace those vectors we have mucked with. + ; + ; NOTE THAT WE RESET VECTORS DIRECTLY!!!!!!!!!!!!!!!!!! + ; We are not sure that DOS is reliable enough to call. + ; + MOV AX,WORD PTR [OLD_19] + CLI + MOV WORD PTR DS:[19H * 4],AX + MOV AX,WORD PTR [OLD_19 + 2] + MOV WORD PTR DS:[(19H * 4) + 2],AX +; MOV AX,WORD PTR [OLD_9] +; MOV WORD PTR DS:[9H * 4],AX +; MOV AX,WORD PTR [OLD_9 + 2] +; MOV WORD PTR DS:[(9H * 4) + 2],AX +; + mov ax,word ptr [old_15] + cmp ax,word ptr [old_15+2] + jne res_15 + cmp ax,-1 + je skip_res +res_15: + mov word ptr ds:[15h*4],ax + mov ax,word ptr [old_15+2] + mov word ptr ds:[(15h*4) +2],ax + +skip_res: + POP DS + POP AX + JMP [OLD_19] + +;** RESET_SYSTEM perform TYPE 1 (/E) driver specific reboot code +; +; This code performs the EMM_ISDRIVER reset function as described +; in EMM.ASM for all EMM_REC structures which are EMM_ALLOC and +; EMM_ISDRIVER and of type EMM_MSDOS. We use the same LOADALL +; method described at BLKMOV to address the EMM_CTRL sector +; at the start of extended memory and perform our changes in +; place. +; +; NOTE: RESET_SYSTEM ALSO defines the start of ANOTHER piece of +; driver TYPE specific code that TYPE 2, 3 and 4 drivers +; will have to swap in a different piece of code for. +; +; note: type 1 drivers allocation schemes have changed. so now +; only the olivetti special configuration has an emm +; control record. this is a 286 machine and we can stick +; to the code given below for that. would have preferred +; to give complete support here +; +; ENTRY +; NONE +; EXIT +; NONE +; USES +; NONE +; +; This code is specific to TYPE 1 drivers +; + +RESET_SYSTEM: +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING +; +; this piece of code is now redundant with the new aallocation scheme. +; for type 1 drivers we use the emm control record only in /u option +; and for that driver this piece of code is never executed +; +; this piece of code cannot be removed because other guys relocate +; on top of this +; + jmp reset_ret +; + PUSHA + PUSH DS + PUSH ES + PUSH CS + POP DS +ASSUME DS:RAMCODE + ; + ; Set up to address EMM_CTRL sector + ; + MOV [LIP],OFFSET AFTER_LDA + MOV WORD PTR [DSDES.SEG_BASE],EXTMEM_LOW + MOV BYTE PTR [DSDES.SEG_BASE + 2],EXTMEM_HIGH + MOV [LSI],0 + MOV [LDI],EMM_RECORD + MOV [LCX],EMM_NUMREC + MOV SI,OFFSET ESDES + MOV AX,ES + CALL SEG_SET ; Set ES segreg + MOV AX,SS + MOV [LSSS],AX + MOV SI,OFFSET SSDES + CALL SEG_SET ; Set SS segreg + MOV [LSP],SP +ON20: + MOV AH,0DFH + CALL A20 ; Enable adress 20 + CLI ; A20 STIs + JNZ ON20 + + MOV AX,80H + MOV DS,AX +ASSUME DS:NOTHING + PUSH CS + POP ES + XOR SI,SI + MOV DI,OFFSET SWAP_80 + MOV CX,102/2 + CLD + CLI + REP MOVSW ; Transfer out 80:0 + PUSH DS + PUSH ES + POP DS + POP ES + XOR DI,DI + MOV SI,OFFSET LOADALL_TBL + MOV CX,102/2 + REP MOVSW ; Transfer in LOADALL info + DW 050FH ; LOADALL INSTRUCTION +AFTER_LDA: + ; + ; Scan EMM_CTRL for MS-DOS ISDRIVER regions and turn off ISDRIVER + ; + +LOOK_RECY: + TEST [DI.EMM_FLAGS],EMM_ALLOC + JZ DONEY ; Hit free record, done + TEST [DI.EMM_FLAGS],EMM_ISDRIVER + JZ NEXTRECY ; No Driver + CMP [DI.EMM_SYSTEM],EMM_MSDOS + JNZ NEXTRECY ; Wrong system + AND [DI.EMM_FLAGS],NOT EMM_ISDRIVER ; No longer a driver +NEXTRECY: + ADD DI,SIZE EMM_REC + LOOP LOOK_RECY +DONEY: + MOV ES,AX ; LOADALL puts 80H in AX + XOR DI,DI + PUSH CS + POP DS +ASSUME DS:RAMCODE + MOV SI,OFFSET SWAP_80 + MOV CX,102/2 + REP MOVSW ; Restore 80:0 + +OFF20: + MOV AH,0DDH ; Disable adress line 20 + CALL A20 + CLI ; A20 STIs + JNZ OFF20 + POP ES + POP DS +ASSUME DS:NOTHING + POPA +reset_ret: + RET + +; +; The following label performs two functions. It defines the end of the +; Driver TYPE specific RESET_SYSTEM code which will have to be replaced +; for different driver TYPEs as the code between RESET_SYSTEM and +; RESET_INCLUDE. Swapped in code MUST FIT between RESET_SYSTEM and +; RESET_INCLUDE. It also defines the end of the resident device driver +; code for a driver which wants to include the INT 19/ INT 9 code. +; +RESET_INCLUDE LABEL BYTE + +BREAK + +;** DISPOSABLE INIT DATA +; +; INIT data which need not be part of resident image +; + +DRIVER_SEL DB 2 ; 0 if /E (TYPE 1), 1 if /A (TYPE 2), + ; 2 if resmem (TYPE 3 or 4) + +DEV_SIZE DW 64 ; Size in K of this device + +U_SWITCH db 0 ;; for the oliv's special config + +special_mem dw 0 ;; at&t special memory + +new_all db 0 ; to indicate new allocation scheme + +EXT_K DW ? ; Size in K of Exteneded memory. + +NUM_ARG DB 1 ; Counter for order dependent numeric + ; arguments bbbb ssss dddd. + +INIT_DRIVE DB 1 ; 0 means drive is inited + ; 1 means drive is to be inited + ; MUST BE DEFAULT SETTING + ; 2 means drive is to be inited + ; REGARDLESS of the existence of + ; a valid DOS volume signature. + +GOTSWITCH DB 0 ; 0 if no switch, NZ if switch seen + +DIRSEC DW ? ; Number of directory SECTORS + +TERM_ADDR LABEL DWORD ; Address to return as break address in INIT packet + DW OFFSET DEVICE_END ; INIT to NOT include INT 19/9 code + DW ? ; RAMDrive CS filled in at INIT + +TRUE_CS DW ? ; Used to store the "true" location of + ; the driver when the relocation at + ; RAMDrive_RELOC is performed. + +RESMEM_SPECIAL DB 0 ; 0 means NORMAL TYPE 3 RAMDrive + ; NZ means SPECIAL TYPE 4 RESMEM version + ; see code at RAMDrive_RELOC + +VALID_EMM db 0 ; +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +sys_det proc near +; +; author: sunilp, august 1, 1987. thanks to rickha for most of this +; routine. +; +; purpose: to determine whether extended memory cache can be installed +; on this system. also to determine and store in the system +; flag the machine identification. +; +; inputs: none +; +; outputs: CY set if this machine doesn't allow extended memory cache. +; CY clear if this machine allows extended memory cache and +; the system flag is set according to the machine type. +; +; registers used: ax,es,flags +;---------------------------------- +; Clear the state of the system flag +; +assume ds:ramcode,es:nothing,ss:nothing + xor ax,ax ; 0000 into AX +; mov [sys_flg],al ; clear system flag +;---------------------------------- +; Determine if 8086/8088 system. If so we should abort immediately. +; + push ax ; ax has 0 + popf ; try to put that in the flags + pushf + pop ax ; look at what really went into flags + and ax,0F000h ; mask off high flag bits + cmp ax,0F000h ; Q: was high nibble all ones ? + je cpu_err ; Y: it's an 8086 (or 8088) +;---------------------------------- +; Determine if 80286/80386 machine. +; + mov ax,0F000h ; N: try to set the high bits + push ax + popf ; ... in the flags + pushf + pop ax ; look at actual flags + and ax,0F000h ; Q: any high bits set ? + je cpu_286 ; N: it's an 80286 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; It is a 386 cpu. We should next try to determine if the ROM is +; B0 or earlier. We don't want these guys. +; +cpu_386: + pushf ; clear + pop ax ; NT + and ax,not 0F000h ; and + push ax ; IOPL + popf ; bits +;---------------------------------- +; the next three instructions were removed because we are loaded +; in real mode. So there is no need to check for virtual mode. +; +; smsw ax ;check for Virtual Mode +; test ax,0001 ; Q: Currently in Virtual Mode ? +; jnz cpu_exit ; Y: quit with error message +;---------------------------------- + ; N: check 386 stepping for B0 + call is_b0 ; Q: B0 ? + jc cpu_err ; Y: abort +;---------------------------------- +; We have a valid 386 guy. Set the flag to indicate this. +; + or [sys_flg],M_386 ; set 386 bit + jmp short PS2Test + +;---------------------------------- +; This is a 286 guy. Check for AT model byte. We don't want non-ATs. +; Set 286 bit if AT type. Then check for PS/2 +; +cpu_286: + mov ax,0ffffh + mov es,ax + cmp byte ptr es:[0eh],0fch ; AT model byte + jne cpu_err ; if not abort +; + or [sys_flg],M_286 ; set 286 flag bit +; +; +; Determine if this is a PS/2 system +; +PS2Test: + call IsPS2Machine + or ax,ax + jz NCRTest + or [sys_flg],M_PS2 + +NCRTest: + call IsNCRMachine + or ax,ax + jz cpu_suc + + ; We're on an NCR machine, send D7 and D5 to the 8042 in order + ; to toggle A20 instead of the DF and DD we usually send. + ; ChipA 06-16-88 + mov cs:[A20On],0D790h + mov cs:[A20Off],0D500h + + +;---------------------------------- +; success exit:-- +cpu_suc: + clc + ret + +;---------------------------------- +; error exit:-- +cpu_err: + stc + ret +; +sys_det endp + + +;*--------------------------------------------------------------------------* +;* * +;* IsPS2Machine HARDWARE DEP. * +;* * +;* Check for PS/2 machine * +;* * +;* ARGS: None * +;* RETS: AX = 1 if we're on a valid PS/2 machine, 0 otherwise * +;* REGS: AX and Flags clobbered * +;* * +;*--------------------------------------------------------------------------* + +IsPS2Machine proc near + + mov ax,0C300h ; Try to disable the Watchdog timer + stc + int 15h + jc IPMNoPS2 ; Error? Not a PS/2. + +IPMFoundIt: mov ax,1 ; Return 1 + ret + +IPMNoPS2: xor ax,ax + ret + +IsPS2Machine endp + + +;*--------------------------------------------------------------------------* +;* * +;* IsNCRMachine HARDWARE DEP. * +;* * +;* Check for NCR machine * +;* * +;* ARGS: None * +;* RETS: AX = 1 if we're on a valid NCR machine, 0 otherwise * +;* REGS: AX and Flags clobbered * +;* * +;*--------------------------------------------------------------------------* + +; Look for 'NC' at F000:FFEA + +IsNCRMachine proc near + + mov ax,0F000h + mov es,ax + mov ax,word ptr es:[0FFEAh] + cmp ax,'CN' + je INMFoundIt + xor ax,ax + ret + +INMFoundIt: mov ax,1 + ret + +IsNCRMachine endp + + +;****************************************************************************** +; IS_B0 - check for 386-B0 +; +; This routine takes advantage of the fact that the bit INSERT and +; EXTRACT instructions that existed in B0 and earlier versions of the +; 386 were removed in the B1 stepping. When executed on the B1, INSERT +; and EXTRACT cause an INT 6 (invalid opcode) exception. This routine +; can therefore discriminate between B1/later 386s and B0/earlier 386s. +; It is intended to be used in sequence with other checks to determine +; processor stepping by exercising specific bugs found in specific +; steppings of the 386. +; +; ENTRY: REAL MODE on 386 processor (CPU ID already performed) +; EXIT: CF = 0 if B1 or later +; CF = 1 if B0 or prior +; +; ENTRY: +; EXIT: +; USED: AX, flags +; STACK: +;------------------------------------------------------------------------------ +is_b0 proc near + push bx + push cx + push dx + push ds + + xor bx,bx + mov ds,bx ; DS = 0000 (real mode IDT) +assume ds:R_Mode_IDT + push [bx+(6*4)] + pop cs:[int6_save] ; save old INT 6 offset + push [bx+(6*4)+2] + pop cs:[int6_save+2] ; save old INT 6 segment + + mov word ptr [bx+(6*4)],offset int6 + mov [bx+(6*4)+2],cs ; set vector to new INT 6 handler +; +; Attempt execution of Extract Bit String instruction. Execution on +; B0 or earlier with length (CL) = 0 will return 0 into the destination +; (CX in this case). Execution on B1 or later will fail and dummy INT 6 +; handler will return execution to the instruction following the XBTS. +; CX will remain unchanged in this case. +; + xor ax,ax + mov dx,ax + mov cx,0FF00h ; Extract length (CL)=0, CX=non-zero + db 0Fh,0A6h,0CAh ; XBTS CX,DX,AX,CL + + xor bx,bx + mov ds,bx ; DS = 0000 (real mode IDT) + push cs:[int6_save] ; restore original INT 6 offset + pop [bx+(6*4)] ; + push cs:[int6_save+2] ; restore original INT 6 segment + pop [bx+(6*4)+2] + + or cx,cx ; Q: CX = 0 (meaning <=B0) ? + jz ib_exit ; Y: exit (carry clear) + stc ; N: set carry to indicate >=B1 +ib_exit: + cmc ; flip carry tense + pop ds + pop dx + pop cx + pop bx + ret ; *** RETURN *** +is_b0 endp +; +; Temporary INT 6 handler - assumes the cause of the exception was the +; attempted execution of an XTBS instruction. +; +int6 proc near + push bp + mov bp,sp + add word ptr [bp+2],3 ; bump IP past faulting instruction + pop bp + iret ; *** RETURN *** +int6_save dw 0000,0000 +int6 endp +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;** PRINT - Print a "$" terminated message on stdout +; +; This routine prints "$" terminated messages on stdout. +; It may be called with only the DX part of the DS:DX message +; pointer set, the routine puts the correct value in DS to point +; at the RAMDrive messages. +; +; ENTRY: +; DX pointer to "$" terminated message (RAMCODE relative) +; EXIT: +; NONE +; USES: +; AX +; +; COMMON TO TYPE 1, 2, 3, 4 drivers +; + +PRINT: +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING + PUSH DS + PUSH CS + POP DS + MOV AH,Std_Con_String_Output + INT 21H + POP DS + RET + +;** ITOA - Print Decimal Integer on stdout +; +; Print an unsigned 16 bit value as a decimal integer on stdout +; with leading zero supression. Prints from 1 to 5 digits. Value +; 0 prints as "0". +; +; Routine uses divide instruction and a recursive call. Maximum +; recursion is four (five digit number) plus one word on stack +; for each level. +; +; ENTRY AX has binary value to be printed +; EXIT NONE +; USES AX,CX,DX,FLAGS +; +; COMMON TO TYPE 1, 2, 3, 4 drivers +; + +ITOA: +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING + + MOV CX,10 + XOR DX,DX + DIV CX ; DX is low digit, AX is higher digits + OR AX,AX + JZ PRINT_THIS_DIGIT ; No more higher digits + PUSH DX ; Save this digit + CALL ITOA ; Print higher digits first + POP DX ; Recover this digit +PRINT_THIS_DIGIT: + ADD DL,"0" ; Convert to ASCII + MOV AH,Std_CON_Output + INT 21H + RET + + +;** RAM$INIT - Device Driver Initialization routine +; +; RAMDRIVE Initialization routine. This is the COMMON initialization +; code used by ALL driver TYPEs. Its jobs are to: +; +; 1. Initialize various global values +; 2. Check for correct DOS version and do changes to the device +; based on the DOS version if needed. +; 3. Parse the command line and set values accordingly +; 4. Call a TYPE specific INIT routine based on the Parse +; to set up a specific driver TYPE. +; 5. Initialize the DOS volume in the RAMDrive memory if appropriate +; 6. Print out report of RAMDrive parameters +; 7. Set the return INIT I/O packet values +; +; The first two lines perform step 1. Step two starts after and +; goes through VER_OK. Step 3 starts at VER_OK and goes through +; ARGS_DONE. Step 4 starts at ARGS_DONE and goes through I001. +; Step 5 starts at I001 and goes through DRIVE_SET. Step 6 starts +; at DRIVE_SET and goes through SETBPB. Step 7 starts at SETBPB +; and ends at the JMP DEVEXIT 10 lines later. +; +; At any time during the above steps an error may be detected. When +; this happens one of the error messages is printed and RAMDrive +; "de-installs" itself by returning a unit count of 0 in the INIT +; device I/O packet. The DOS device installation code is responsible +; for taking care of the details of re-claiming the memory used by +; the device driver. All RAMDrive needs to do is make sure any INT +; vectors it changed (INT 9 and INT 19) get restored to what they +; were when RAMDrive first started. If an EMM_CTRL sector is being +; used (TYPE 1 and 3) and one of the EMM_REC structures has been +; marked EMM_ISDRIVER by this driver, it must turn that bit back off +; since the driver did not install. A TYPE 2 driver must make sure it +; ABOVE_DEALLOCs any memory it allocated from the EMM device. The duty +; of reclaiming EMM_CTRL or Above Board memory and re-setting vectors +; is done by the DISK_ABORT routine which may be called by either +; this COMMON INIT code, or the TYPE specific INIT code. +; +; Step 1 initializes the segment part of TERM_ADDR to the correct +; value for type 1, 2 and 3 drivers. A TYPE 4 driver will put a +; different value in TERM_ADDR as it must include the space taken up +; by the RAMDrive memory itself which is part of the device. TRUE_CS +; is also initialized. This datum is relevant to the RESMEM_SPECIAL +; (TYPE 4) driver which relocates the driver code at RAMDrive_RELOC. +; This datum stores the CS of the REAL driver (the driver location +; BEFORE the relocation took place). +; +; Step 2 checks to make sure that we are running on a DOS in the +; 2.X or 3.X series which this driver is restricted to. If running +; on a 2.X series the device header attribute word and device command +; table are patched to exclude those device calls that don't exist +; on DOS 2.X. The HEADERMES message is also patched to not include +; the DOS drive letter part because 2.X DOS does not provide this +; information to the device at INIT time. +; +; Step 3 uses the "DEVICE = xxxxxxxxx" line pointer provided by +; DOS to look for the various device parameters. NOTE: This pointer +; IS NOT DOCUMENTED in the DOS 2.X tech ref material, but it does +; exist in the same way as 3.X. This code is simple even though +; it looks rather long. First it skips over the device name field +; to get to the arguments. In then parses the arguments as they are +; encountered. All parameter errors are detected here. NOTE THAT +; THIS ROUTINE IS NOT RESPONSIBLE FOR SETTING DEFAULT VALUES OF +; PARAMETER VARIABLES. This is accomplished by static initialization +; of the parameter variables. +; +; Step 4 calls a device TYPE specific initialization routine based +; on the parse in step 3 (presence or absense of /E and /A switches). +; NOTE THAT THERE IS ONE ROUTINE FOR TYPE 3 AND 4 DRIVERS. It is up +; to this routine itself to make the distinction between TYPE 3 and +; TYPE 4. NOTE that one of the prime jobs of these device TYPE specific +; routines is to set all of the variables that are needed by Step +; 5 and 7 that haven't been set by the COMMON init code: +; +; DEV_SIZE set to TRUE size of device +; BASE_ADDR set to TRUE start of device so MEMIO +; can be called +; BASE_RESET set so DISK_ABORT can be called +; TERM_ADDR set to correct end of device +; INIT_DRIVE set to indicate if DOS volume needs to +; be set up +; RESMEM_SPECIAL set if TYPE 4 driver +; +; Step 5 looks at the INIT_DRIVE variable to see if the DOS volume +; needs to be initialized. The only time we do not need to INITialize +; the DOS volume is when the driver TYPE specific INIT code finds +; that there is a VALID DOS volume in the RAMDrive memory it just +; set up. If the DOS volume does not need to be initialized, we +; go on to step 6. Otherwise the device BPB must be set, the +; RESERVED (boot) sector, FAT sectors, and root directory sectors +; must be initialized and written out to the RAMDrive. The first step +; is to initialize all of the BPB values. The code is a typical piece +; of MS-DOS code which given BYTES/SECTOR, TOTAL DISK SIZE +; and NUMBER OF ROOT DIRECTORY ENTRIES inputs figures out reasonable +; values for SEC/CLUSTER and SECTORS/FAT and TOTAL NUMBER OF CLUSTERS. +; NOTE THAT THIS CODE IS TUNED AND SPECIFIC TO 12 BIT FATS. Don't +; expect it to work AT ALL with a 16 bit FAT. The next step is to write +; out the BOOT record containing the BPB to sector 0, write out +; a FAT with all of the clusters free, and write out a root directory +; with ONE entry (the Volume ID at VOLID). Take CAREFUL note of the +; special code and comments at RAMDrive_RELOC. +; +; Step 6 makes the status report display of DEVICE SIZE, SECTOR SIZE, +; CLUSTER SIZE, and DIRECTORY SIZE by simply printing out the values +; from the BPB. +; +; Step 7 sets the INIT I/O packet return values for # of units, +; Break address, and BPB array pointer and returns via DEVEXIT. +; +; SEE ALSO +; MS-DOS Technical Reference manual section on +; Installable Device Drivers +; +; ENTRY from RAM$IN +; EXIT Through DEVEXIT +; USES ALL +; +; COMMON TO TYPE 1, 2, 3, 4 drivers +; + +RAM$INIT: +ASSUME DS:RAMCODE,ES:NOTHING,SS:NOTHING + ; + ; 1. Initialize various global values + ; + MOV WORD PTR [TERM_ADDR + 2],CS + MOV [TRUE_CS],CS + mov [sys_flg],0 + ; + ; 2. Check for correct DOS version and do changes to the device + ; based on the DOS version if needed. + ; + CLD + MOV AH,GET_VERSION + INT 21H + XCHG AH,AL + CMP AX,(2 SHL 8) + 00 + JB BADVER ; Below 2.00, BAD + CMP AX,(3 SHL 8) + 00 + JB VER2X ; 2.X requires some patches + CMP AX,(4 SHL 8) + 00 + je ldl_buf_present ; indicate that there is a hole for loadall + Ja BADVER ; 3.X ok, 4.0 or above bad + cmp al,30 ; 3.30 + jb ver_ok ; if below we cannot take advantage of 80:0 +ldl_buf_present: + or [sys_flg],DOS_33 ; indicate we have dos 3.3 or above + jmp ver_ok + +BADVER: + MOV DX,OFFSET BADVERMES + JMP DEVABORT + +VER2X: + AND [DEVATS],NOT DEVOPCL ; No such bit in 2.X + MOV BYTE PTR [RAMTBL],11 ; Fewer functions too + MOV WORD PTR [PATCH2X],0A0DH ; Don't know DOS drive + MOV BYTE PTR [PATCH2X + 2],"$" +VER_OK: +;; +;; 2.5 Check here for 6300 PLUS machine. First look for Olivetti Copy-right +;; and if found, check id byte at f000:fffd. +;; + + push es ;; Olivetti Machine? + mov ax,0fc00h ;; Look for 'OL' at fc00:50 + mov es,ax + cmp es:[0050h],'LO' + jnz notS5 ;; not found + mov ax,0f000h + mov es,ax + cmp word ptr es:[0fffdh],0fc00h ;; look for 6300 plus + jnz notS5 + mov [S5_FLAG],S_OLIVETTI ;; yep, set flag + jmp notHP +notS5: +;; Check here for an HP Vectra machine. Look for HP id byte. +;; + mov ax,0f000H + mov es,ax + cmp es:[0f8H],'PH' + jnz notHP + mov [S5_FLAG],S_VECTRA +notHP: + pop es +; +; 3. Parse the command line and set values accordingly +; + LDS SI,[PTRSAV] +ASSUME DS:NOTHING + MOV AL,[SI.INIT_DOSDEV] ; DOS drive letter + ADD CS:[DOS_DRV],AL ; Need explicit over, this is a forward ref + MOV DX,OFFSET HEADERMES + CALL PRINT + LDS SI,[SI.INIT_BPB] ; DS:SI points to config.sys +SKIPLP1: ; Skip leading delims to start of name + LODSB + CMP AL," " + JZ SKIPLP1 + CMP AL,9 + JZ SKIPLP1 + CMP AL,"," + JZ SKIPLP1 + JMP SHORT SKIPNM + +ARGS_DONEJ: + JMP ARGS_DONE + +SWITCHJ: + JMP SWITCH + +SKIPLP2: ; Skip over device name + LODSB +SKIPNM: + CMP AL,13 + JZ ARGS_DONEJ + CMP AL,10 + JZ ARGS_DONEJ + CMP AL," " + JZ FIRST_ARG + CMP AL,9 + JZ FIRST_ARG + CMP AL,"," + JZ FIRST_ARG + CMP AL,0 ; Need this for 2.0 2.1 + JNZ SKIPLP2 +SCAN_LOOP: ; PROCESS arguments + LODSB +FIRST_ARG: + OR AL,AL ; Need this for 2.0 2.1 + JZ ARGS_DONEJ + CMP AL,13 + JZ ARGS_DONEJ + CMP AL,10 + JZ ARGS_DONEJ + CMP AL," " + JZ SCAN_LOOP + CMP AL,9 + JZ SCAN_LOOP + CMP AL,"," + JZ SCAN_LOOP + CMP AL,"/" + JZ SWITCHJ + CMP AL,"0" + JB BAD_PARMJ + CMP AL,"9" + JA BAD_PARMJ + DEC SI + CALL GETNUM + CMP [NUM_ARG],3 + JA BAD_PARMJ ; Only 3 numeric arguments + JZ SET_DIR + CMP [NUM_ARG],2 + JZ SET_SECTOR +SET_SIZE: + CMP BX,16 + JB BAD_PARMJ + CMP BX,4096 + JA BAD_PARMJ + MOV [DEV_SIZE],BX + JMP SHORT NUM_DONE + +BAD_PARMJ: + JMP BAD_PARM + +SET_SECTOR: + MOV AL,6 + CMP BX,128 + JZ SET_SEC + INC AL + CMP BX,256 + JZ SET_SEC + INC AL + CMP BX,512 + JZ SET_SEC + INC AL + CMP BX,1024 + JNZ BAD_PARM +SET_SEC: + MOV [SSIZE],BX + MOV [SEC_SHFT],AL + JMP SHORT NUM_DONE + +SET_DIR: + CMP BX,2 + JB BAD_PARM + CMP BX,1024 + JA BAD_PARM + ; + ; NOTE: Since DIRNUM is the 3rd numeric arg and SSIZE is the first, + ; we know the desired sector size has been given. + ; + MOV DI,[SSIZE] + MOV CL,5 ; 32 bytes per dir ent + SHR DI,CL ; DI is number of dir ents in a sector + MOV AX,BX + XOR DX,DX + DIV DI ; Rem in DX is partial dir sector + OR DX,DX + JZ SET_DSZ ; User specified groovy number + SUB DI,DX ; Figure how much user goofed by + ADD BX,DI ; Round UP by DI entries +SET_DSZ: + MOV [DIRNUM],BX +NUM_DONE: + INC [NUM_ARG] ; Next numeric argument +SCAN_LOOPJ: + JMP SCAN_LOOP + +BAD_PARM: + MOV DX,OFFSET ERRMSG1 +DEVABORT: + CALL PRINT +DEVABORT_NOMES: + XOR AX,AX ;Indicate no devices + JMP SETBPB ;and return + +SWITCH: + MOV AL,0FFH + XCHG AL,[GOTSWITCH] ; Switch already? + OR AL,AL + JNZ BAD_PARM ; Yes, only one allowed + LODSB + CMP AL,"E" + JZ EXT_SET + CMP AL,"e" + JNZ ABOVE_TEST +EXT_SET: + MOV [DRIVER_SEL],0 + JMP SCAN_LOOP + +ABOVE_TEST: +;; Added for /u switch + cmp al,'u' ;; Look for U switch for PLUS + jz S5_TEST + cmp al,'U' ;; + jnz A_TEST +S5_TEST: + cmp [S5_FLAG],S_OLIVETTI ;; No good unless PLUS + jne bad_parm +; xchg al,[gotswitch] ; switch already +; or al,al +; jnz bad_parm +; + cmp [U_SWITCH],0 + jne bad_parm + dec [U_SWITCH] + jmp ext_set +A_TEST: + + CMP AL,"A" + JZ ABOVE_SET + CMP AL,"a" + JNZ BAD_PARM +ABOVE_SET: + MOV [DRIVER_SEL],1 + JMP SCAN_LOOP + +ARGS_DONE: +; +; 4. Call a TYPE specific INIT routine based on the Parse +; to set up a specific driver TYPE. +; + PUSH CS + POP DS +ASSUME DS:RAMCODE + MOV AL,[DRIVER_SEL] ; Find out which init to call + OR AL,AL + JNZ NEXTV + CALL AT_EXT_INIT + JMP SHORT INI_RET + +NEXTV: + DEC AL + JNZ DORESM + CALL ABOVE_INIT + JMP SHORT INI_RET + +DORESM: + CALL RESMEM_INIT +INI_RET: + JNC I001 + JMP DEVABORT_NOMES + +I001: +; +; 5. Initialize the DOS volume in the RAMDrive memory if appropriate +; + CMP [INIT_DRIVE],0 + JNZ INIDRV ; Need to initialize drive + JMP DRIVE_SET ; All set to go + +INIDRV: +; +; We must figure out what to do. +; All values are set so we can call MEMIO to read and write disk +; SSIZE is user sector size in bytes +; DIRNUM is user directory entries +; DEV_SIZE is size of device in K bytes +; + ; Figure out total number of sectors in logical image + MOV AX,[DEV_SIZE] + MOV CX,1024 + MUL CX ; DX:AX is size in bytes of image + DIV [SSIZE] ; AX is total sectors + ; Any remainder in DX is ignored + MOV [SECLIM],AX + ; Compute # of directory sectors + MOV AX,[DIRNUM] + MOV CL,5 ; Mult by 32 bytes per entry + SHL AX,CL ; Don't need to worry about overflow, # ents + ; is at most 1024 + XOR DX,DX + DIV [SSIZE] + OR DX,DX + JZ NOINC + INC AX +NOINC: ; AX is # sectors for root dir + MOV [DIRSEC],AX + ADD AX,2 ; One reserved, At least one FAT sector + CMP AX,[SECLIM] + JB OK001 ; we're OK + MOV [DIRNUM],16 ; Smallest reasonable number + XOR DX,DX + MOV AX,512 ; 16*32 = 512 bytes for dir + DIV [SSIZE] + OR DX,DX + JZ NOINC2 + INC AX +NOINC2: ; AX is # sectors for root dir + MOV [DIRSEC],AX + ADD AX,2 ; One reserved, At least one FAT sector + CMP AX,[SECLIM] + JB OK001 ; 16 directory sectors got us to OK + CALL DISK_ABORT ; Barf + MOV DX,OFFSET ERRMSG2 + JMP DEVABORT + +OK001: + mov si,64 ; set a loop bound for the homing process + ; to avoid oscillation in homing +CLUSHOME: + ; Figure a reasonable cluster size + MOV AX,[SECLIM] ; AX is total sectors on disk + SUB AX,[RESSEC] ; Sub off reserved sectors + MOV CL,[FATNUM] ; CX is number of FATs + XOR CH,CH +FATSUB: + SUB AX,[FATSEC] ; Sub off FAT sectors + LOOP FATSUB + SUB AX,[DIRSEC] ; Sub off directory sectors, AX is # data sectors + MOV BX,1 ; Start at 1 sec per alloc unit + CMP AX,4096-10 + JB CSET ; 1 sector per cluster is OK + MOV BX,2 + CMP AX,(4096-10) * 2 + JB CSET ; 2 sector per cluster is OK + MOV BX,4 + CMP AX,(4096-10) * 4 + JB CSET ; 4 sector per cluster is OK + MOV BX,8 + CMP AX,(4096-10) * 8 + JB CSET ; 8 sector per cluster is OK + MOV BX,16 ; 16 sector per cluster is OK +CSET: + ; Figure FAT size. AX is reasonable approx to number of DATA sectors + ; BX is reasonable sec/cluster + XOR DX,DX + DIV BX ; AX is total clusters, ignore remainder + ; can't have a "partial" cluster + MOV CX,AX + SHR CX,1 + JNC ADDIT + INC CX +ADDIT: + ADD AX,CX ; AX is Bytes for fat (1.5 * # of clusters) + ADD AX,3 ; Plus two reserved clusters + XOR DX,DX + DIV [SSIZE] ; AX is # sectors for a FAT this size + OR DX,DX + JZ NOINC4 + INC AX ; Round up +NOINC4: ; AX is # sectors for FAT + XCHG AX,[FATSEC] ; Set newly computed value + XCHG BL,[CSIZE] ; Set newly computed value + dec si ; have we looped enough? + jz homfin ; yes, time to get out + CMP BL,[CSIZE] ; Did we compute a different size? + JNZ CLUSHOME ; Keep performing FATSEC and CSIZE computation + ; until the values don't change. + CMP AX,[FATSEC] ; Did we compute a different size? + JNZ CLUSHOME ; Keep performing FATSEC and CSIZE computation + ; until the values don't change. +HOMFIN: + ; + ; 6. Print out report of RAMDrive parameters + ; + MOV DX,OFFSET STATMES1 + CALL PRINT + MOV AX,[DEV_SIZE] + CALL ITOA + MOV DX,OFFSET STATMES2 + CALL PRINT + MOV AX,[SSIZE] + CALL ITOA + MOV DX,OFFSET STATMES3 + CALL PRINT + MOV AL,[CSIZE] + XOR AH,AH + CALL ITOA + MOV DX,OFFSET STATMES4 + CALL PRINT + MOV AX,[DIRNUM] + CALL ITOA + MOV DX,OFFSET STATMES5 + CALL PRINT + CMP [RESMEM_SPECIAL],0 + JZ NO_RELOC + ; + ; We are in a special case. The RAMDrive driver area starts at DEVICE_END. + ; If we left this INIT code where it is and executed it the act of + ; Initializing the boot sector, FAT, and root directory would overwrite + ; this INIT code as we are executing it. So what we do is COPY this + ; code into the DATA area of the RAMDrive and execute it from there. + ; +RAMDrive_RELOC: + MOV AX,1 ; AX is sec # of start of FAT + ADD AX,[FATSEC] ; AX is sec # of start of directory + ADD AX,[DIRSEC] ; AX is sec # of start of DATA + MUL [SSIZE] ; DX:AX is byte offset of start of DATA + ADD AX,WORD PTR [BASE_ADDR] + ADC DX,WORD PTR [BASE_ADDR + 2] ; DX:AX is 32 addr of first byte of DATA + ADD AX,15 ; PARA round up + ADC DX,0 + MOV CX,16 + DIV CX ; AX is Seg addr of DATA region + ; + ; At this point we need to do a little check. We need to make + ; sure the distance between where we are now, and where we + ; are relocating to is AT LEAST as much as we are moving + ; so that we don't modify ourselves while we're moving + ; + MOV BX,AX + MOV DX,CS + SUB BX,DX ; BX is para between segs + CMP BX,((OFFSET RAMDrive_END - OFFSET RAMDEV) + 15) / 16 ; CMP to para moving + JAE OKMOV ; Distance is enough + MOV AX,CS ; Move far enough away + ADD AX,((OFFSET RAMDrive_END - OFFSET RAMDEV) + 15) / 16 +OKMOV: + MOV ES,AX + XOR SI,SI + MOV DI,SI + MOV CX,OFFSET RAMDrive_END ; Amount to move + CLD + REP MOVSB ; Reloc to data region + PUSH ES ; Push FAR return + MOV AX,OFFSET NO_RELOC + PUSH AX + PUSH ES + POP DS ; DS is NEW RAMCODE +RELOCR PROC FAR + RET +RELOCR ENDP + +NO_RELOC: + PUSH CS + POP ES + XOR DX,DX ; Sector 0 + MOV CX,1 ; One sector + MOV DI,OFFSET BOOT_SECTOR ; Boot sector + MOV BH,1 ; Write + CALL INIMEMIO + INC DX ; First FAT sector + MOV DI,OFFSET SECTOR_BUFFER + XOR AX,AX + MOV CX,512 + CLD + REP STOSW + MOV DI,OFFSET SECTOR_BUFFER + MOV CX,1 + MOV WORD PTR ES:[DI],0FFF8H + MOV BYTE PTR ES:[DI + 2],0FFH + CALL INIMEMIO + INC DX ; Next sector + MOV WORD PTR ES:[DI],0 + MOV BYTE PTR ES:[DI + 2],0 + MOV CX,[FATSEC] + DEC CX + JCXZ FATDONE +FATZERO: + PUSH CX + MOV CX,1 + CALL INIMEMIO + INC DX ; Next sector + POP CX + LOOP FATZERO +FATDONE: + MOV CX,1 + MOV DI,OFFSET VOLID + CALL INIMEMIO ; FIRST directory sector + INC DX + MOV CX,[DIRSEC] + DEC CX + JCXZ DRIVE_SET + MOV DI,OFFSET SECTOR_BUFFER +DIRZERO: + PUSH CX + MOV CX,1 + CALL INIMEMIO + INC DX ; Next sector + POP CX + LOOP DIRZERO +; +DRIVE_SET: +; +; BPB IS NOW ALL SET +; + MOV AL,1 ;Number of ramdrives +; +; NOTE FALL THROUGH!!!!!!! +; + +;** SETBPB - Set INIT packet I/O return values +; +; This entry is used in ERROR situations to return +; a unit count of 0 by jumping here with AL = 0. +; The successful code path falls through to here +; with AL = 1 +; +; ENTRY +; AL = INIT packet unit count +; EXIT +; through DEVEXIT +; USES +; DS, BX, CX +; +; COMMON TO TYPE 1, 2, 3, 4 drivers +; + +SETBPB: +ASSUME DS:NOTHING + ; + ; 7. Set the return INIT I/O packet values + ; + LDS BX,[PTRSAV] + MOV [BX.INIT_NUM],AL + MOV CX,WORD PTR [TERM_ADDR] + MOV WORD PTR [BX.INIT_BREAK],CX ;SET BREAK ADDRESS + MOV CX,WORD PTR [TERM_ADDR + 2] + MOV WORD PTR [BX.INIT_BREAK + 2],CX + MOV WORD PTR [BX.INIT_BPB],OFFSET INITAB ;SET POINTER TO BPB ARRAY + MOV CX,[TRUE_CS] + MOV WORD PTR [BX.INIT_BPB + 2],CX + JMP DEVEXIT + +;** INIMEMIO call MEMIO but preserve registers +; +; MEMIO is very register destructive, all this routine +; does is provide a less destructive way to call MEMIO. +; +; ENTRY +; Same as MEMIO +; EXIT +; Same as MEMIO +; USES +; AX, SI, BP +; +; COMMON TO TYPE 1, 2, 3, 4 drivers +; + +INIMEMIO: +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING + PUSH ES + PUSH DI + PUSH DS + PUSH CX + PUSH DX + PUSH BX + CALL MEMIO + POP BX + POP DX + POP CX + POP DS + POP DI + POP ES + RET + +;** GETNUM - Read an unsigned integer +; +; This routine looks at DS:SI for a decimal unsigned integer. +; It is up to the caller to make sure DS:SI points to the start +; of a number. If it is called without DS:SI pointing to a valid +; decimal digit the routine will return 0. Any non decimal digit +; defines the end of the number and SI is advanced over the +; digits which composed the number. Leading "0"s are OK. +; +; THIS ROUTINE DOES NOT CHECK FOR NUMBERS LARGER THAN WILL FIT +; IN 16 BITS. If it is passed a pointer to a number larger than +; 16 bits it will return the low 16 bits of the number. +; +; This routine uses the MUL instruction to multiply the running +; number by 10 (initial value is 0) and add the numeric value +; of the current digit. Any overflow on the MUL or ADD is ignored. +; +; ENTRY: +; DS:SI -> ASCII text of number +; EXIT: +; BX is binary for number +; SI advanced to point to char after number +; USES: +; AX,BX,DX,SI +; +; COMMON TO TYPE 1, 2, 3, 4 drivers +; + +GETNUM: +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING + + XOR BX,BX +GETNUM1: + LODSB + SUB AL,"0" + JB NUMRET + CMP AL,9 + JA NUMRET + CBW + XCHG AX,BX + MOV DX,10 + MUL DX + ADD BX,AX + JMP GETNUM1 + +NUMRET: + DEC SI + RET + +BREAK + +;** INITIAL EMM_CTRL sector +; +; This is a datum which represents a correct initial EMM_CTRL +; sector as discussed in the EMM_CTRL documentation. It is used +; to check for the presense of a valid EMM_CTRL by comparing +; the signature strings, and for correctly initializing the +; EMM_CTRL sector if needed. +; +; The DWORD at BASE_RESET, which is the EMM_BASE of the NULL +; 0th EMM_REC structure, is used as a storage location of +; the address of the EMM_CTRL sector (PLUS 1024!!!!!!). +; This value can be used if it is necessary to re-address the +; EMM_CTRL sector during initialization. See the DISK_ABORT routine. +; NOTE THAT BASE_RESET CAN NOT BE USED AT RUNTIME AS THIS DATUM +; IS NOT PART OF THE RESIDENT IMAGE. +; +; This data is appropriate to TYPE 1 and TYPE 3 drivers +; + +EMM_CONTROL LABEL BYTE + DB "MICROSOFT EMM CTRL VERSION 1.00 CONTROL BLOCK " + DW 0 + DW 0 + ; NULL 0th record + DW EMM_ALLOC + EMM_ISDRIVER + DW EMM_EMM +BASE_RESET LABEL DWORD ; RESMEM driver must patch this value + DW EXTMEM_LOW + 1024 + DW EXTMEM_HIGH + DW 0 + + DB 950 DUP(0) + DB "ARRARRARRA" + + +BREAK + +;** DISK_ABORT - De-install RAMDrive after init +; +; This routine MUST BE CALLED to de-install a RAMDrive driver +; if the de-installation takes place: +; +; AFTER INT 19/INT 9 vectors are replaced +; AFTER ABOVE_PID is valid for TYPE 2 +; AFTER an EMM_REC structure in the EMM_CTRL sector +; has been marked EMM_ISDRIVER for TYPE 1 or 3. +; +; NOTE: Since a TYPE 4 driver does NONE of the above things it is +; not necessary to call this routine, but the routine is +; designed so that it is OK to call for a TYPE 4 driver. +; +; In all cases the INT 9 and INT 19 vectors are replaced if the +; value of both words of OLD_19 is NOT -1. This is why the initial value +; of this datum is -1. In the event that the INT 9 and INT 19 vectors +; are replaced, this datum takes on some value other than -1. +; +; If this is a TYPE 1 or TYPE 3 driver the EMM_ISDRIVER bit is +; turned off in the LAST EMM_MSDOS EMM_REC structure. +; NOTE THAT A TYPE 1 or TYPE 3 DRIVER MUST NOT USE THIS ROUTINE +; IF IT HAS NOT "TURNED ON" AN EMM_ISDRIVER BIT IN ONE OF THE EMM_REC +; STRUCTURES. If this is done, this code MAY turn off the WRONG +; EMM_ISDRIVER bit (probably a bit for a previously installed RAMDrive +; of the same TYPE). +; +; If this is a TYPE 2 driver, an ABOVE_DEALLOC call is made on +; ABOVE_PID. +; +; ENTRY: +; NONE +; +; BASE_RESET valid if TYPE 1 or TYPE 3 +; ABOVE_PID valid if TYPE 2 +; +; EXIT: +; NONE +; USES: +; ALL but DS +; +; COMMON TO TYPE 1, 2, 3, 4 drivers +; + +DISK_ABORT: +ASSUME DS:RAMCODE,ES:NOTHING,SS:NOTHING + + CMP [DRIVER_SEL],1 + JNZ NOT_ABOVE +AGAIN: + ; + ; TYPE 2, De-alloc the Above Board memory + ; + MOV DX,[ABOVE_PID] + MOV AH,ABOVE_DEALLOC + INT 67H + CMP AH,ABOVE_ERROR_BUSY + JZ AGAIN + JMP SHORT RET002 + +NOT_ABOVE: + CMP [RESMEM_SPECIAL],0 + JNZ RET002 ; No EMM_CTRL on TYPE 4 +; +; sp new int15 allocation for ext memory (except for oli memory) so no +; emm control for these +; + ; + cmp [new_all],0 ;new allocation scheme + jne ret002 ; if yes then skip emm updates + ; + ; TYPE 1 or 3, turn off last EMM_ISDRIVER + ; + MOV AX,WORD PTR [BASE_RESET] + MOV DX,WORD PTR [BASE_RESET + 2] + SUB AX,1024 ; Backup to EMM_CTRL + SBB DX,0 + MOV WORD PTR [BASE_ADDR],AX + MOV WORD PTR [BASE_ADDR + 2],DX + XOR BH,BH ; READ + CALL CTRL_IO ; Get EMM_CTRL + JC RET002 + MOV DI,OFFSET SECTOR_BUFFER + MOV SI,DI + ADD DI,EMM_RECORD + MOV BX,-1 ; Init to "no such record" + MOV CX,EMM_NUMREC +LOOK_RECX: + ; + ; Look for last installed MS-DOS region + ; + TEST [DI.EMM_FLAGS],EMM_ALLOC + JZ DONE + TEST [DI.EMM_FLAGS],EMM_ISDRIVER + JZ NEXTRECX ; No Driver + CMP [DI.EMM_SYSTEM],EMM_MSDOS + JNZ NEXTRECX + MOV BX,DI +NEXTRECX: + ADD DI,SIZE EMM_REC + LOOP LOOK_RECX +DONE: + CMP BX,-1 ; DIDn't find it + JZ RET002 + AND [BX.EMM_FLAGS],NOT EMM_ISDRIVER ; Undo install + MOV BH,1 ; WRITE + CALL CTRL_IO ; EMM_CTRL back out +RET002: + ; + ; Reset INT 9 and/or INT 19 if OLD_19 is not -1 + ; + PUSH DS + LDS DX,[OLD_19] +ASSUME DS:NOTHING + MOV AX,DS + CMP AX,-1 + JNZ RESET_VECS + CMP AX,DX + JZ NO_VECS +RESET_VECS: + MOV AX,(Set_Interrupt_Vector SHL 8) OR 19H + INT 21H +; LDS DX,[OLD_9] +; MOV AX,(Set_Interrupt_Vector SHL 8) OR 9H +; INT 21H +; +; sp we have to deinstall the int15 handler also if it was installed +; + lds dx,[old_15] ; get the old 15h handler addressin ds:dx + mov ax,ds + cmp ax,-1 + jne reset_15 + cmp ax,dx + je no_vecs +reset_15: + mov ax,(set_interrupt_vector shl 8) or 15h + int 21h +NO_VECS: + POP DS + RET + +;** CTRL_IO - Read/Write the first 1024 bytes at BASE_ADDR +; +; This routine is used at INIT time to read the first 1024 +; bytes at BASE_ADDR. If TYPE 1 or TYPE 3 and BASE_ADDR points +; to the EMM_CTRL address (initial value), the EMM_CTRL sector +; is read/written. If TYPE 1 or TYPE 3 and BASE_ADDR has been set +; to the start of a RAMDrive, the first 1024 bytes of the DOS volume +; are read/written. If TYPE 2 or TYPE 4, the first 1024 bytes of +; the DOS volume are read/written. All this routine does is +; set inputs to BLKMOV to transfer 1024 bytes at offset 0 to/from +; SECTOR_BUFFER. +; +; ENTRY: +; BH = 0 for READ, 1 for WRITE +; EXIT: +; SECTOR_BUFFER filled in with 1024 bytes at BASE_ADDR +; USES: +; ALL but DS +; +; COMMON TO TYPE 1, 2, 3, 4 drivers +; + +CTRL_IO: +ASSUME DS:RAMCODE,ES:NOTHING,SS:NOTHING + XOR DX,DX + MOV AX,DX ; Offset 0 + MOV CX,512 ; 1024 bytes + PUSH CS + POP ES + MOV DI,OFFSET SECTOR_BUFFER + PUSH DS + CALL BLKMOV ; Read in EMM_CTRL + POP DS + RET + +;** MM_SETDRIVE - Look for/Init EMM_CTRL and DOS volume +; +; This routine is used by TYPE 1 and 3 drivers to check for/initialize +; the EMM_CTRL sector, and check for a valid DOS volume if approriate. +; +; This routine reads the EMM_CTRL sector in to SECTOR_BUFFER +; CALLS FIND_VDRIVE to check out and alloc or find an EMM_REC +; Sets BASE_ADDR to point to the start of the RAMDrive memory +; Writes the updated EMM_CTRL back out from SECTOR_BUFFER +; JUMPs to CHECK_DOS_VOL to snoop for a valid DOS volume if +; the return from FIND_VDRIVE indicates this is worth +; doing, OTHERWISE return leaving INIT_DRIVE set to the +; default value of 1 (needs to be INITed). +; +; ENTRY: +; BASE_ADDR initialized to point at START of extended memory +; so that the EMM_CTRL sector can be accessed by +; doing I/O at offset 0. +; EXT_K is set to size of extended memory +; DEV_SIZE is set to user requested device size +; EXIT: +; CARRY SET - error, message already printed +; CARRY CLEAR +; BASE_ADDR set for this drive +; INIT_DRIVE set +; DEV_SIZE set to TRUE size +; +; WARNING! Exit conditions MUST match CHECK_DOS_VOL as it transfers +; to that routine. +; +; USES +; ALL but DS +; +; Used by TYPE 1 and TYPE 3 drivers +; + +MM_SETDRIVE: +ASSUME DS:RAMCODE,ES:NOTHING,SS:NOTHING + XOR BH,BH ; READ + CALL CTRL_IO ; Get EMM_CTRL + MOV DX,OFFSET INIT_IO_ERR + JC ERR_RET2 + CALL FIND_VDRIVE ; Snoop + JC RET001 + PUSHF ; Save zero status for DOS VOL snoop + PUSH ES ; Save EMM_BASE from EMM_REC + PUSH DI +; +; once again if we installed according to new int15 standard we should +; not write emm back +; + ; + ; test if we installed according to new standard + ; + cmp [new_all],0 ; did we install according to new standard + jne skip_emm_write ; skip writing back emm +; + MOV BH,1 ; WRITE + CALL CTRL_IO ; Write EMM_CTRL back out + MOV DX,OFFSET INIT_IO_ERR + JC ERR_RET2P +skip_emm_write: + POP WORD PTR [BASE_ADDR] ; Set final correct BASE_ADDR + POP WORD PTR [BASE_ADDR + 2] + POPF +; +; NOTE TRANSFER TO DIFFERENT ROUTINE +; + JZ CHECK_DOS_VOL + CLC ; Leave INIT_DRIVE set +RET001: + RET + +ERR_RET2P: + ADD SP,6 +ERR_RET2: + CALL PRINT + STC + RET + +;** CHECK_DOS_VOL examine RAMDrive region for valid DOS volume. +; +; This routine is used by TYPE 1, 2 and 3 drivers to check and see +; if the RAMDrive memory contains a valid DOS volume (one that lived +; through a re-boot). Its prime job is to set INIT_DRIVE to indicate +; whether the DOS volume needs to be initialized. +; +; First the first 1024 bytes of the drive are read in to SECTOR_BUFFER +; Next we check for a match of the signature areas up at BOOT_SECTOR +; to see if this drive contains a VALID RAMDrive boot record. +; IF the signatures are valid AND INIT_DRIVE != 2 (ignore valid signature) +; We check to make sure that SSIZE and DIRNUM set by the user +; match the values in the BPB we just found. +; IF they match +; we set INIT_DRIVE to 0 (don't init) +; and transfer the BPB out of the boot sector on the drive +; (in SECTOR_BUFFER) into the BPB for this driver at +; RDRIVEBPB. +; ELSE +; Leave INIT_DRIVE set to whatever it was on input (1 or 2) +; indicating that the drive must be INITed. +; ELSE +; Leave INIT_DRIVE set to whatever it was on input (1 or 2) +; indicating that the drive must be INITed. +; +; WARNING! This routine DOES NOT check to make sure that the size of +; the device as indicated in the BPB transfered in if a valid +; DOS volume is found is consistent with the actual size +; of the memory allocated to the device (DEV_SIZE). It +; is up to the caller to check this if so desired. +; +; ENTRY: +; BASE_ADDR set to point at START of DOS device +; EXIT: +; CARRY SET - error, message already printed +; CARRY CLEAR +; INIT_DRIVE set +; SECTOR_BUFFER contains first 1024 bytes of device +; USES: +; All but DS +; +; WARNING! Exit conditions MUST match MM_SETDRIVE as it jumps to this +; routine. +; +; Used by TYPE 1, 2 and 3 drivers +; + +CHECK_DOS_VOL: +ASSUME DS:RAMCODE,ES:NOTHING,SS:NOTHING + XOR BH,BH ; READ + ; + ; NOTE: WE CANNOT CALL MEMIO, WE MUST STILL USE CTRL_IO because the BPB + ; is not set up. + ; + CALL CTRL_IO ; Since BASE_ADDR is set, reads start of DEVICE + MOV DX,OFFSET INIT_IO_ERR + JC ERR_RET2 + PUSH CS + POP ES + MOV DI,OFFSET SECTOR_BUFFER + MOV SI,OFFSET BOOT_SECTOR + MOV CX,OFFSET RDRIVEBPB - OFFSET BOOT_SECTOR + CLD + REPE CMPSB + JNZ OK_RET ; No DOS device + ADD DI,OFFSET BOOT_START - OFFSET RDRIVEBPB + ADD SI,OFFSET BOOT_START - OFFSET RDRIVEBPB + MOV CX,OFFSET BOOT_END - OFFSET BOOT_START + REPE CMPSB + JNZ OK_RET ; No DOS device + CMP [INIT_DRIVE],2 + JZ NOT_VALID ; Current value 2 means we CANNOT + ; assume this BPB is valid. + ; + ; Check to make sure found BPB has same SSIZE and DIRNUM values + ; + MOV SI,OFFSET SECTOR_BUFFER + (OFFSET SSIZE - OFFSET BOOT_SECTOR) + LODSW + CMP AX,[SSIZE] + JNZ NOT_VALID ; Sector size different than user request + MOV SI,OFFSET SECTOR_BUFFER + (OFFSET DIRNUM - OFFSET BOOT_SECTOR) + LODSW + CMP AX,[DIRNUM] + JNZ NOT_VALID ; Sector size different than user request + + MOV [INIT_DRIVE],0 ; Found a DOS drive + MOV DI,OFFSET RDRIVEBPB + MOV SI,OFFSET SECTOR_BUFFER + (OFFSET RDRIVEBPB - OFFSET BOOT_SECTOR) + MOV CX,OFFSET BOOT_START - OFFSET RDRIVEBPB + REP MOVSB ; Set correct BPB +NOT_VALID: +OK_RET: + CLC + RET + +;** FIND_VDRIVE - Check out EMM_CTRL and alloc +; +; This code checks for a valid EMM_CTRL and sets up +; an initial one if there isn't. It then performs the +; algorithm described in the EMM_CTRL documentation +; to either allocate a NEW EMM_REC of type EMM_MSDOS, +; or find an existing EMM_REC which is EMM_MSDOS and has +; its EMM_ISDRIVER bit clear. In the later case it +; checks to see if DEV_SIZE is consistent with EMM_KSIZE +; and tries to make adjustments to EMM_KSIZE or DEV_SIZE +; if they are not consistent. +; +; As a side effect of scanning the EMM_CTRL sector for +; EMM_RECs with EMM_MSDOS and EMM_ISDRIVER we also find +; out if this is the first TYPE 1 or TYPE 3 driver in the +; system. If this is the first, then the INT 9/INT 19 code +; is installed. +; +; First the EMM_CTRL signature strings are checked. +; If they are not valid we go to SETCTRL to set up a new +; empty EMM_CTRL in SECTOR_BUFFER. +; If the signatures are valid, EMM_TOTALK is checked +; against EXT_K. If they are the same, the EMM_CTRL sector is +; valid and we skip to SCAN_DEV. Otherwise we initialize the +; EMM_CTRL sector at SETCTRL. All we need to do to set up the initial +; EMM_CTRL sector is transfer the record at EMM_CONTROL into +; SECTOR_BUFFER and set EMM_TOTALK and EMM_AVAILK to EXT_K - 1. +; +; In either case, finding a valid EMM_CTRL or setting up a correct +; initial one, we end up at SCAN_DEV. This code performs the +; scan of the EMM_REC structures looking for a "free" one +; or an allocated one which is EMM_MSDOS and has its EMM_ISDRIVER +; bit clear as described in the EMM_CTRL sector documentation. +; NOTE THAT THIS SCAN SETS THE BX REGISTER TO INDICATE WHETHER +; WE FOUND ANY EMM_REC STRUCTURES WHICH WERE EMM_MSDOS AND HAD +; THEIR EMM_ISDRIVER BIT SET. If we found such an EMM_REC structure +; then this IS NOT the first driver in the system and the INT 9/INT 19 +; code SHOULD NOT be installed. +; +; If we find a "free" EMM_REC structure we go to GOT_FREE_REC +; and try to allocate some memory. This attempt will fail if +; EMM_AVAILK is less than 16K. We then call SET_RESET to do +; the INT 9/INT 19 setup if the BX register set by the EMM_REC +; scan indicates we should. We adjust DEV_SIZE to equal the +; available memory if DEV_SIZE is > EMM_AVAILK. Then all we do +; is set EMM_AVAILK and all of the fields in the EMM_REC structure +; as described in the EMM_CTRL sector documentation. We return +; with zero reset as there cannot be a valid RAMDrive in this +; region because we just allocated it. +; +; If we find an EMM_REC structure with EMM_MSDOS and EMM_ISDRIVER +; clear then we know this region MIGHT have a valid DOS volume +; so we will return with zero set (this is set up at OK_SET_DEV). +; At CHECK_SYS plus 5 lines we: +; +; Call SET_RESET to do INT 9/INT 19 setup if BX indicates +; IF the EMM_REC structure we found is the LAST EMM_REC structure +; we cannot edit any sizes and whatever the EMM_KSIZE +; is we stuff it into DEV_SIZE and set the EMM_ISDRIVER +; bit, and we're done. +; NOTE: We DO NOT check that EMM_KSIZE is at least +; 16K as we know this EMM_REC was created +; by some PREVIOUS RAMDrive program who +; DID make sure it was at least 16K +; ELSE +; IF EMM_KSIZE == DEV_SIZE +; set EMM_ISDRIVER and we're done +; IF EMM_KSIZE < DEV_SIZE +; either the user has edited his DEVICE = line since +; the last time the system was re-booted, or at the +; time we initially allocated this region EMM_AVAILK +; was less than DEV_SIZE and we had to trim the device +; size back. +; This case is handled at INSUFF_MEM. +; IF the next EMM_REC structure is not allocated +; IF EMM_AVAILK == 0 +; We can't do anything, so set DEV_SIZE +; to EMM_KSIZE and we're done. +; ELSE +; allocate appropriate amount off of EMM_AVAILK +; and add it to EMM_KSIZE. +; Set INIT_DRIVE to 2 and we're done. +; The reason we set INIT_DRIVE to 2 is because +; we just changed the size of this block from +; what it was before so there is no way the BPB +; in the region (if there is one) can be valid. +; Setting INIT_DRIVE to 2 means "I don't care if +; there is a valid boot record in this region, +; re-initialize it based on DEV_SIZE +; ELSE +; We can't do anything, so set DEV_SIZE +; to EMM_KSIZE and we're done. +; ELSE +; This is the EMM_KSIZE > DEV_SIZE case, it means the +; user MUST have edited his DEVICE = line. +; IF next EMM_REC is NOT free +; We can't shrink the allocation block, +; but we'll leave DEV_SIZE set to the user +; specification and let him waste memory. +; We set INIT_DRIVE to 2 because we're not +; sure what to do and this is safe and we're done. +; NOTE that this drive will get re-initialized +; on EVERY re-boot. Tough cookies. +; ELSE +; SHRINK the allocation block by adding +; the extra memory back onto EMM_AVAILK +; and subtracting it from EMM_KSIZE. Set +; INIT_DRIVE to 2 because we changed the +; allocation block size, and we're done. +; +; ENTRY: +; SECTOR_BUFFER containes POSSIBLE EMM_CTRL sector +; MUST BE CHECKED +; EXT_K is set to size of extended memory +; DEV_SIZE is set to user requested device size +; EXIT: +; CARRY SET +; Error, message already printed +; CARRY CLEAR +; ES:DI = BASE_ADDR for this drive from EMM_BASE of EMM_REC +; EMM_REC is marked EMM_ISDRIVER +; SECTOR_BUFFER must be written out, it contains an updated +; EMM_CTRL sector +; DEV_SIZE set to TRUE size +; Zero SET +; An existing disk was found, region should be checked +; for valid MS-DOS volume +; Zero RESET +; A new block was allocated from the EMM_CTRL sector +; TERM_ADDR may be adjusted to include RESET_SYSTEM code and +; INT 19 and 9 vector patched if this is the first +; TYPE 1 or TYPE 3 RAMDrive in the system (no other +; EMM_MSDOS EMM_REC structures marked EMM_ISDRIVER). +; +; USES: +; ALL but DS +; +; Specific to TYPE 1 and 3 drivers +; + +FIND_VDRIVE: +ASSUME DS:RAMCODE,ES:NOTHING,SS:NOTHING + PUSH CS + POP ES + MOV DI,OFFSET SECTOR_BUFFER + MOV SI,OFFSET EMM_CONTROL + MOV CX,50 + CLD + REPE CMPSB + JNZ no_emm_rec ; No EMM_CTRL + ADD SI,EMM_TAIL_SIG - 50 + ADD DI,EMM_TAIL_SIG - 50 + MOV CX,10 + REPE CMPSB + jnz no_emm_rec +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; JNZ SETCTRL ; No EMM_CTRL +; MOV DI,OFFSET SECTOR_BUFFER +; MOV AX,[EXT_K] +; DEC AX ; Size in EMM_CTRL doesn't include EMM_CTRL +; CMP AX,[DI.EMM_TOTALK] +; JZ SCAN_DEV ; EMM_CTRL is valid +;SETCTRL: +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; + dec [valid_emm] ; signal prescence of emm record +no_emm_rec: +; +; we have to decide which standard to use for installing the driver, the old or +; the new. driver type 3 - old, driver type 2 not u - new, u driver - old +; + ; + ; check if driver in extended + ; + cmp [driver_sel],0 ; if driver not in extended memory + jne old_st ; install according to old standard + cmp [u_switch],0h ; is it a u driver + jne old_st ; if not go to install acc to new int15 + jmp new_st ; standard +; +; for olivetti u memory we still have to install according to ol' microsoft st +; +old_st: + cmp [valid_emm],0h ; do we have a valid emm + jne scan_dev ; if yes go to scan structures +set_ctrl: ; else we have to install a new one + MOV DI,OFFSET SECTOR_BUFFER + PUSH DI + MOV SI,OFFSET EMM_CONTROL + MOV CX,1024/2 + REP MOVSW ; Move in initial EMM_CTRL + POP DI + MOV AX,[EXT_K] + DEC AX ; Size in EMM_CTRL doesn't include EMM_CTRL + MOV [DI.EMM_TOTALK],AX + MOV [DI.EMM_AVAILK],AX +SCAN_DEV: + XOR BX,BX ; Will get tripped if a DOS dev found + MOV SI,OFFSET SECTOR_BUFFER ; DS:SI points to EMM_CTRL + MOV DI,SI + ADD DI,EMM_RECORD ; DS:DI points to EMM records + MOV CX,EMM_NUMREC +LOOK_REC: + TEST [DI.EMM_FLAGS],EMM_ALLOC + JNZ CHECK_SYS + JMP GOT_FREE_REC ; Must alloc new region + +CHECK_SYS: + CMP [DI.EMM_SYSTEM],EMM_MSDOS + JNZ NEXTREC ; Not MS-DOS + TEST [DI.EMM_FLAGS],EMM_ISDRIVER + JNZ NEXTRECI ; Driver already in, I am not first driver + CALL SET_RESET ; Set up INT 19,9 as per BX + MOV AX,[DI.EMM_KSIZE] + CMP CX,1 + JBE OK_SET_DEV ; If this is last record, must + ; select this size + CMP AX,[DEV_SIZE] + JZ OK_SET_DEV ; Exact match, Okay + JB INSUFF_MEM ; User asked for more + ; Size of found block is bigger than requested size. + ; User MUST have edited CONFIG.SYS. + PUSH DI + ADD DI,SIZE EMM_REC + TEST [DI.EMM_FLAGS],EMM_ALLOC + POP DI + JZ SHRINK_BLOCK ; Next block is free, shrink + MOV AX,[DEV_SIZE] + JMP SHORT SET_2 + +SHRINK_BLOCK: + SUB AX,[DEV_SIZE] ; AX is amount to shrink + ADD [SI.EMM_AVAILK],AX + MOV AX,[DEV_SIZE] + MOV [DI.EMM_KSIZE],AX + JMP SHORT SET_2 + +INSUFF_MEM: ; Size of found block is smaller + ; than requested size. + PUSH DI + ADD DI,SIZE EMM_REC + TEST [DI.EMM_FLAGS],EMM_ALLOC + POP DI + JNZ OK_SET_DEV ; Next block is NOT free, can't grow +TRY_TO_GROW_BLOCK: + CMP [SI.EMM_AVAILK],0 + JZ OK_SET_DEV ; Need SPECIAL check for this case so + ; that INIT_DRIVE doesn't get set to 2 + ; when it shouldn't + SUB AX,[DEV_SIZE] + NEG AX ; AX is amount we would like to grow + SUB [SI.EMM_AVAILK],AX + JNC GOT_THE_MEM + ADD AX,[SI.EMM_AVAILK] ; AX is MAX we can grow + MOV [SI.EMM_AVAILK],0 ; We take all that's left +GOT_THE_MEM: + ADD [DI.EMM_KSIZE],AX + MOV AX,[DI.EMM_KSIZE] +SET_2: + MOV [INIT_DRIVE],2 ; CANNOT TRUST BPB in boot sector +OK_SET_DEV: + MOV [DEV_SIZE],AX + OR [DI.EMM_FLAGS],EMM_ISDRIVER + LES DI,[DI.EMM_BASE] + XOR AX,AX ; Set zero, clear carry + RET + +NEXTRECI: + INC BX ; Flag that we ARE NOT first DOS device +NEXTREC: + ADD DI,SIZE EMM_REC ; Next record + LOOP LOOK_RECJ +VERRR: + MOV DX,OFFSET ERRMSG2 + CALL PRINT + STC + RET + +LOOK_RECJ: + JMP LOOK_REC + +GOT_FREE_REC: + MOV AX,[SI.EMM_AVAILK] + CMP AX,16 + JB VERRR ; 16K is smallest device + CALL SET_RESET ; Set INT 19,9 as per BX + CMP AX,[DEV_SIZE] + JBE GOTSIZE ; Not enough for user spec + MOV AX,[DEV_SIZE] ; User size is OK +GOTSIZE: + MOV [DEV_SIZE],AX + SUB [SI.EMM_AVAILK],AX + MOV [DI.EMM_KSIZE],AX + MOV [DI.EMM_SYSTEM],EMM_MSDOS + MOV [DI.EMM_FLAGS],EMM_ALLOC + EMM_ISDRIVER + PUSH DI + SUB DI,SIZE EMM_REC ; Look at prev record to compute base + MOV AX,[DI.EMM_KSIZE] + LES BX,[DI.EMM_BASE] + MOV DI,ES ; DI:BX is prev base + MOV CX,1024 + MUL CX ; Mult size by 1024 to get # bytes + ADD AX,BX ; Add size onto base to get next base + ADC DX,DI + POP DI + MOV WORD PTR [DI.EMM_BASE],AX + MOV WORD PTR [DI.EMM_BASE + 2],DX + LES DI,[DI.EMM_BASE] + XOR AX,AX ; Set zero, clear carry + INC AX ; RESET zero + RET +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; the new int15 standard +; +new_st: + dec [new_all] ; indicate new standard allocation + mov bx,[ext_k] ; contiguous memory reported by int15 + cmp [valid_emm],0 ; is there a valid emm record + je no_adjust ; if not there no need to adjust + ; the memory available +; else we have to find how much memory is already allocated by the microsoft +; emm control block and subtract this from the amount that is available. the +; memory allocated is totalk - availk + 1 +; + sub bx,1 ; subtract the emm ctrl record size + mov di,offset sector_buffer ; set up to address the ctrl record + ; read in + mov ax,[di.emm_totalk] ; ax <- totalk + sub ax,[di.emm_availk] ; ax <- totalk - availk + sub bx,ax ; adjust memory available + jc verrr ; if no memory go to abort +; + cmp bx,128 ; is it the minimum required + jb verrr ; if less go to abort +; +; the memory available has been found and is in bx. now compare it with +; requested device size and take the minimum of the two +; +no_adjust: + cmp [dev_size],bx ; + jb skip_adj_dev_size ; if enough space we don't need to adj + ; dev_size + mov [dev_size],bx ; else we have compromise on dev size +skip_adj_dev_size: +; +; now that we have the correct dev size we should proceed with the installation +; of a new int 15 handler which will account for the memory grabbed by this guy +; + mov bx,[ext_k] ; get memory which was reported by int15 + add bx,[special_mem] ; account for olivetti guys + sub bx,[dev_size] ; + mov [int15_size],bx ; this is the size thaat will be reported + ; by the int 15 handler +; now install the int15 handler +; + push ax + push dx + push bx + push es + mov ax,(get_interrupt_vector shl 8) or 15h + int 21h + mov word ptr [old_15],bx + mov word ptr [old_15+2],es + mov dx,offset int_15 + mov ax,(set_interrupt_vector shl 8) or 15h + int 21h + pop es + pop bx + pop dx + pop ax +; +; set up int19 vector +; + xor bx,bx ; for int19 to be installed + call set_reset +; +; now fill device base address in es:di +; + mov ax,[ext_k] + sub ax,[dev_size] ; this now has memory left + mov cx,1024 ; we are going to find size in bytes + mul cx ; dx:ax = ax * 1024 + add ax,word ptr [base_addr] ; + adc dx,word ptr [base_addr+2] ; + mov es,dx ; + mov di,ax ; + xor ax,ax ; to say that there + inc ax ; was no dos volume reset 0 + ret + +;** SET_RESET - Set up INT 19/INT 9 vectors +; +; This routine will do nothing if BX is non-zero +; otherwise it will install the INT 9 and INT 19 +; code by saving the current INT 9 and INT 19 +; vectors in OLD_9 and OLD_19 (NOTE: the change in the value of OLD_19 +; to something other than -1 indicates that the vectors have been +; replaced), setting the vectors to point to INT_9 and INT_19, +; and adjusting TERM_ADDR to include the code as part of the resident +; image. +; +; ENTRY: +; BX is 0 if INT 19/9 code to be installed +; EXIT: +; NONE +; USES: +; None +; +; COMMON TO TYPE 1, 2, 3, 4 drivers +; + +SET_RESET: +ASSUME DS:RAMCODE,ES:NOTHING,SS:NOTHING + OR BX,BX + JNZ RET005 + cmp [u_switch],0 ; for uswitch don't bother + jne ret005 + PUSH AX + PUSH DX + PUSH BX + PUSH ES + MOV AX,(Get_Interrupt_Vector SHL 8) OR 19H + INT 21H + MOV WORD PTR [OLD_19],BX + MOV WORD PTR [OLD_19 + 2],ES + MOV DX,OFFSET INT_19 + MOV AX,(Set_Interrupt_Vector SHL 8) OR 19H + INT 21H +; MOV AX,(Get_Interrupt_Vector SHL 8) OR 9H +; INT 21H +; MOV WORD PTR [OLD_9],BX +; MOV WORD PTR [OLD_9 + 2],ES +; MOV DX,OFFSET INT_9 +; MOV AX,(Set_Interrupt_Vector SHL 8) OR 9H +; INT 21H + MOV WORD PTR [TERM_ADDR],OFFSET RESET_INCLUDE + POP ES + POP BX + POP DX + POP AX +RET005: + RET + +BREAK + +;** AT_EXT_INIT - Perform /E (TYPE 1) specific initialization +; +; This code does the drive TYPE specific initialization for TYPE 1 +; drivers. +; +; Make sure running on 80286 IBM PC-AT compatible system by +; making sure the model byte at FFFF:000E is FC. +; Get the size of extended memory by using 8800H call to INT 15. +; and make sure it is big enough to accomodate a RAMDrive. +; Limit DEV_SIZE to the available memory found in the previous step +; by making DEV_SIZE smaller if necessary. +; Initialize the GLOBAL parts of the LOADALL information which +; are not set by each call to BLKMOV. +; CALL MM_SETDRIVE to look for EMM_CTRL and perform all the +; other initialization tasks. +; +; ENTRY: +; Invokation line parameter values set. +; EXIT: +; CARRY SET +; Error, message already printed. Driver not installed. +; EMM_CTRL not marked (but MAY be initialized if +; a valid one was not found). +; CARRY CLEAR +; BASE_ADDR set for this drive from EMM_BASE of EMM_REC +; BASE_RESET set from BASE_ADDR +; EMM_REC is marked EMM_ISDRIVER +; DEV_SIZE set to TRUE size +; INIT_DRIVE set appropriatly +; TERM_ADDR set to correct device end. +; RESET_SYSTEM code and INT 9/INT 19 code included, +; INT 19 and 9 vector patched if this is the first +; TYPE 1 RAMDrive in the system. +; +; USES: +; ALL but DS +; +; Code is specific to TYPE 1 driver +; + +AT_EXT_INIT: +ASSUME DS:RAMCODE,ES:NOTHING,SS:NOTHING + push ds + call sys_det ; new routine to do more comprehensive checking + pop ds + jnc at001 ; sp +; + MOV DX,OFFSET BAD_AT +ERR_RET: + CALL PRINT + STC + RET + +AT001: +;; patch the values of base_reset and base_addr to get the addressing right. +;; + cmp [U_SWITCH],0 ;; patch the code for /U option + jz AT001A + mov ax,00fah +; mov word ptr [emm_ctrl_addr+2],ax ;; in resident part for reset code + mov word ptr [base_reset+2],ax ;; patching upper address + mov word ptr [base_addr+2],ax ;; to FA from 10 +AT001A: + MOV AX,8800H + INT 15H ; Get extended memory size + MOV DX,OFFSET NO_MEM + OR AX,AX + JZ ERR_RET + +;; If running on a 6300 PLUS, it is necessary to subtract any upper extended +;; memory from the value obtained by int 15 to determine the correct memory +;; available for a type /E RAMDrive. If loading a /U RAMDrive, it is necessary +;; to find out if there IS any upper extended memory. + + cmp [U_SWITCH],0 ;; did we ask for upper extended memory + jz olstuff ;; no + call UpperMemCheck ;; yes, see if anything there + jc ERR_RET ;; no, quit + mov ax,384 ;; yes, but max allowed is 384K + jmp short at001b +olstuff: + cmp [S5_FLAG],S_OLIVETTI ;; if not 6300 PLUS, go on + jne at001b + call UpperMemCheck ;; yes, see if 384K is there + jc at001b ;; no, so int 15h is right + sub ax,384 ;; yes, subtract 384K + mov [special_mem],384 ;; store special memory size +AT001B: + + MOV DX,OFFSET ERRMSG2 + cmp ax,16 +; CMP AX,17 ; 1k ident block plus 16k min Ramdrive + JB ERR_RET + MOV [EXT_K],AX + MOV BX,AX +; DEC BX ; BX is MAX possible disk size + CMP [DEV_SIZE],BX + JBE AT002 ; DEV_SIZE OK + MOV [DEV_SIZE],BX ; Limit DEV_SIZE to available +AT002: +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; 386 modification + test [sys_flg],M_386 + je loadall_setup + mov ax,cs + mov word ptr [cod_seg],ax +; set cs descriptor + mov cx,16 + mul cx + mov si,offset cs_des + mov [si].bas_0_15,ax + mov [si].bas_16_23,dl + mov [si].bas_24_31,dh +; set gdt base + mov si,offset emm_gdt + add ax,offset start_gdt + adc dx,0 + mov [si].gdt_base_0,ax + mov [si].gdt_base_2,dx + jmp common_setup +; +loadall_setup: + ; + ; Init various pieces of LOADALL info + ; +;;;; SMSW [LDSW] +;;;; SIDT QWORD PTR [IDTDES] +;;;; SGDT QWORD PTR [GDTDES] +;;;; ; +;;;; ; NOW The damn SXXX instructions store the desriptors in a +;;;; ; different order than LOADALL wants +;;;; ; +;;;; MOV SI,OFFSET IDTDES +;;;; CALL FIX_DESCRIPTOR +;;;; MOV SI,OFFSET GDTDES +;;;; CALL FIX_DESCRIPTOR + MOV [LCSS],CS + MOV SI,OFFSET CSDES + MOV AX,CS + CALL SEG_SET +common_setup: + CALL MM_SETDRIVE + RET +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;* UpperMemCheck - Called by 6300 PLUS to verify existence of +;; upper extended memory of 384K at FA0000h +;; +;; Returns carry set if no upper extended memory. +;; +;; This routine is called only by a 6300 PLUS, and +;; it reads the hardware switch DSW2 to do the job. +;; +UpperMemCheck: + push ax + in al,66h + and al,00001111b + cmp al,00001011b + pop ax + jnz nomem + clc + ret +nomem: + stc + ret + + + +BREAK + +;** EMM device driver name +; +; The following datum defines the Above Board EMM 8 character +; device driver name that is looked for as part of TYPE 2 +; specific initialization. +; +; This datum is specific to TYPE 2 drivers +; + +ABOVE_DEV_NAME DB "EMMXXXX0" + +;** ABOVE_INIT - Perform /A (TYPE 2) specific initialization +; +; This code performes the driver specific initialization for +; type 2 drivers. +; +; Swap ABOVE_BLKMOV code in for TYPE 1 code at BLKMOV +; Swap ABOVE_RESET code in for TYPE 1 code at RESET_SYSTEM +; Check to make sure EMM Above Board device driver is installed +; by looking for device name relative to INT 67H segment +; address. This is method 2 described on page 36 and 37 +; of the Expanded Memory Manager Programming Specification. +; +; WARNING! If run on a version of DOS where all INT vectors +; are managed by the kernel, or on a system where some +; foreign program (not EMM.SYS) is also using INT 67H, this +; method will fail to find the EMM device driver. +; The reason this method was used rather than the more portable +; method 1 described on pages 33 and 34 of the EMM Programming +; Specification is that the DOS Installable Device Driver +; document makes a statement about which DOS system calls +; may be made in a device initialization routine, and +; OPEN, IOCTL, and CLOSE are not included in the allowed +; set. Adherance to the Installable Device Driver document, +; therefore, excludes the use of method 1. +; +; Check the EMM device status +; Get the EMM map window address and set BASE_ADDR +; Get the available Above Board memory +; Adjust DEV_SIZE to be consistent with the available memory if needed, +; and also round DEV_SIZE up so that it is a multiple of the 16K +; granularity of the Above Board memory. +; Allocate DEV_SIZE worth of Above Board memory and set ABOVE_PID. +; After this point we can use CTRL_IO and/or BLKMOV to +; read/write the memory we have allocated. +; Install the INT 9 and INT 19 code by calling SET_RESET with BX = 0. +; Adjust the TERM_ADDR set by SET_RESET to a more appropriate size. +; Call CHECK_DOS_VOL to look for a DOS volume and set INIT_DRIVE. +; IF INIT_DRIVE indicates that a DOS volume was found +; Check to make sure that the size of the found DOS +; volume is consistent with DEV_SIZE. +; IF it is not +; Set INIT_DRIVE to 2 to indicate that the found volume +; is invalid and needs to be re-initialized. +; +; SEE ALSO +; INTEL Expanded Memory Manager Programming Specification +; +; ENTRY: +; Invokation line parameter values set. +; EXIT: +; ABOVE_BLKMOV code swapped in at BLKMOV +; ABOVE_RESET code swapped in at RESET_SYSTEM +; CARRY SET +; Error, message already printed. Driver not installed. +; No Above Board memory allocated. +; CARRY CLEAR +; BASE_ADDR set to segment address of Above Board map window +; ABOVE_PID contains PID of allocated above board memory +; DEV_SIZE set to TRUE size +; INIT_DRIVE set appropriatly +; TERM_ADDR set to correct device end. +; RESET_SYSTEM code and INT 9/INT 19 code included. +; +; USES: +; ALL but DS +; +; Code is specific to TYPE 2 driver +; + +ABOVE_INIT: +ASSUME DS:RAMCODE,ES:NOTHING,SS:NOTHING + ; + ; Swap above code into place + ; + PUSH CS + POP ES + MOV SI,OFFSET ABOVE_CODE + MOV DI,OFFSET DRIVE_CODE + MOV CX,OFFSET DRIVE_END - OFFSET DRIVE_CODE + REP MOVSB + MOV SI,OFFSET ABOVE_RESET + MOV DI,OFFSET RESET_SYSTEM + MOV CX,OFFSET RESET_INCLUDE - OFFSET RESET_SYSTEM + REP MOVSB + ; + ; Check for presence of Above board memory manager + ; + MOV AX,(Get_Interrupt_Vector SHL 8) OR 67H + INT 21H + MOV DI,SDEVNAME + MOV SI,OFFSET ABOVE_DEV_NAME + MOV CX,8 + REPE CMPSB + JZ GOT_MANAGER + MOV DX,OFFSET NO_ABOVE +ABOVE_ERR: + CALL PRINT + STC + RET + +GOT_MANAGER: + ; + ; Check memory status + ; + MOV CX,8000H +STLOOP: + MOV AH,ABOVE_STATUS + INT 67H + CMP AH,ABOVE_SUCCESSFUL + JZ MEM_OK + CMP AH,ABOVE_ERROR_BUSY + LOOPZ STLOOP +ST_ERR: + MOV DX,OFFSET BAD_ABOVE + JMP ABOVE_ERR + +MEM_OK: + ; + ; Get base address of map region and set BASE_ADDR + ; + MOV AH,ABOVE_GET_SEG + INT 67H + CMP AH,ABOVE_ERROR_BUSY + JZ MEM_OK + CMP AH,ABOVE_SUCCESSFUL + JNZ ST_ERR + MOV WORD PTR [BASE_ADDR],0 + MOV WORD PTR [BASE_ADDR + 2],BX + ; + ; Allocate drive memory + ; +GET_AVAIL: + MOV AH,ABOVE_GET_FREE + INT 67H + CMP AH,ABOVE_ERROR_BUSY + JZ GET_AVAIL + CMP AH,ABOVE_SUCCESSFUL + JNZ ST_ERR + MOV AX,DX ; AX is total 16K pages + ; BX is un-allocated 16K pages + MOV DX,OFFSET NO_MEM + OR AX,AX + JZ ABOVE_ERR + MOV DX,OFFSET ERRMSG2 + OR BX,BX ; 16k is min Ramdrive + JZ ABOVE_ERR + TEST BX,0F000H + JNZ AB001 ; Avialable K is REAL big + MOV CX,4 + SHL BX,CL ; BX is un-allocated K + CMP [DEV_SIZE],BX + JBE AB001 ; DEV_SIZE OK + MOV [DEV_SIZE],BX ; Limit DEV_SIZE to available +AB001: + MOV BX,[DEV_SIZE] + ; + ; BX is K we want to allocate (limited by available K) + ; BX is at least 16 + ; + MOV AX,BX + MOV CX,4 ; Convert back to # of 16K pages + SHR BX,CL + TEST AX,0FH ; Even???? + JZ OKAYU ; Yes + INC BX ; Gotta round up + PUSH BX + MOV CX,4 + SHL BX,CL + MOV [DEV_SIZE],BX ; Correct dev size too by rounding it up to + ; next multiple of 16K, no sense wasting + ; part of a page. + POP BX +OKAYU: + MOV AH,ABOVE_ALLOC + INT 67H + CMP AH,ABOVE_ERROR_BUSY + JZ OKAYU + CMP AH,ABOVE_SUCCESSFUL + JZ GOT_ID + CMP AH,ABOVE_ERROR_MAP_CNTXT + JZ ST_ERRJ + CMP AH,ABOVE_ERROR_OUT_OF_PIDS + JB ST_ERRJ + MOV DX,OFFSET ERRMSG2 + JMP ABOVE_ERR + +ST_ERRJ: + JMP ST_ERR + +GOT_ID: + MOV [ABOVE_PID],DX + ; + ; INSTALL ABOVE RESET handler + ; + XOR BX,BX + CALL SET_RESET + ; + ; The above RESET_SYSTEM handler is real small, and since we include it in + ; EACH driver, we make sure the size is minimal + ; + MOV WORD PTR [TERM_ADDR],OFFSET RESET_SYSTEM + (OFFSET ABOVE_RESET_END - OFFSET ABOVE_RESET) + ; + ; We are now in good shape. Can call BLKMOV to read drive + ; + CALL CHECK_DOS_VOL ; Snoop for DOS volume + JNC DOUBLE_CHECK + CALL DISK_ABORT + STC + RET + +DOUBLE_CHECK: + CMP [INIT_DRIVE],0 + JNZ RETAB ; No DOS volume found + ; + ; We MUST check to see if the FOUND DOS volume is consistent + ; with DEV_SIZE. + ; + MOV AX,[SECLIM] + MUL [SSIZE] ; DX:AX is size of volume in bytes + MOV CX,1024 + DIV CX ; AX is size in K + CMP AX,[DEV_SIZE] + JE RETAB ; Volume is OK +RE_INIT: + MOV [INIT_DRIVE],2 ; Force re-compute of volume +RETAB: + CLC + RET + +BREAK + +; +; This label defines the start of the code swapped in at DRIVE_CODE +; +ABOVE_CODE LABEL WORD + +; +; WARNING DANGER!!!!!!! +; +; This code is tranfered over the /E driver code at DRIVE_CODE +; +; ALL jmps etc. must be IP relative. +; ALL data references must be to cells at the FINAL, TRUE location +; (no data cells may be named HERE, must be named up at BLKMOV). +; OFFSET of ABOVE_BLKMOV relative to ABOVE_CODE MUST be the same as +; the OFFSET of BLKMOV relative to DRIVE_CODE. +; SIZE of stuff between ABOVE_CODE and ABOVE_END MUST be less than +; or equal to size of stuff between DRIVE_CODE and DRIVE_END. + +IF2 + IF((OFFSET ABOVE_BLKMOV - OFFSET ABOVE_CODE) NE (OFFSET BLKMOV - OFFSET DRIVE_CODE)) + %out ERROR BLKMOV, ABOVE_BLKMOV NOT ALIGNED + ENDIF + IF((OFFSET ABOVE_END - OFFSET ABOVE_CODE) GT (OFFSET DRIVE_END - OFFSET DRIVE_CODE)) + %out ERROR ABOVE CODE TOO BIG + ENDIF +ENDIF + + DD ? ; 24 bit address of start of this RAMDRV +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;** ABOVE_BLKMOV - Perform transfer for TYPE 2 driver +; +; This routine is the transfer routine for moving bytes +; to and from the Above Board memory containing the cache. +; +; The Above Board is implemented as 4 16K windows into the Above +; Board memory, giving a total window of 64K wich starts on some +; 16K boundary of the Above Board memory. Given that a DOS I/O +; request is up to 64K bytes starting on some sector boundary, +; the most general I/O picture is: +; +; |------------|------------|------------|------------|------------| +; | Above Brd | Above Brd | Above Brd | Above Brd | Above Brd | +; |Log page n |Log page n+1|Log page n+2|log page n+3|Log page n+4| +; |------------|------------|------------|------------|------------| +; |---|---| | | +; | | |---------------- 64K bytes of sectors -------------| +; Byte | | | +; offset|------------------|------------------------| | +; of first| Number of words in | | +; byte of | first part of I/O that |---|---| +; I/O in | can be performed once Number +; first | logical pages n - n+3 of words +; Log page| are mapped into physical in tail +; | pages 0 - 3 part of I/O +; Location of that have +; first byte to be done +; of sector M, once logical +; the start sector page n+4 is +; of the I/O mapped into +; physical page +; 0 +; +; One or both of "Byte offset of first byte of I/O in first page" and +; "Number of words in tail part of I/O" may be zero depending on the +; size of the I/O and its start offset in the first logical page it is +; possible to map. +; +; WARNING: IF A PRE-EMPTIVE MULTITASKING SYSTEM SCHEDULES A TASK WHICH +; IS USING THE ABOVE BOARD DURING THE TIME THIS DRIVER IS IN THE +; MIDDLE OF PERFORMING AN I/O, THE SYSTEM HAD BETTER MANAGE THE A +; BOARD MAPPING CONTEXT CORRECTLY OR ALL SORTS OF STRANGE UNPLEASANT +; THINGS WILL OCCUR. +; +; SEE ALSO +; INTEL Expanded Memory Manager Programming Specification +; +; ENTRY: +; ES:DI is packet transfer address. +; CX is number of words to transfer. +; DX:AX is 32 bit start byte offset (0 = start of cache) +; BH is 1 for WRITE, 0 for READ +; +; BASE_ADDR set to point to Above Board mapping window in main memory +; This "input" is not the responsibility of the caller. It +; is up to the initialization code to set it up when the +; device is installed +; +; EXIT: +; Carry Clear +; OK, operation performed successfully +; Carry Set +; Error during operation, AL is error number +; +; USES: +; ALL +; +; This routine is specific to TYPE 2 driver +; +; sunilp - note that this has one limitation. in the case where +; one is using the above board for ramdrive and for +; the buffer then one is limited to 32k byte transfers +; +; tonyg - above limitation removed - now handles 64kb transfers +; which can overlap the page frame +; +above_blkmov: +assume ds:ramcode,es:nothing,ss:nothing +; +; save mapping context and return with error if save fails +; + save_mapping_context + jnc ab_blk$1 + ret +; +; find logical page number, offset of i/o in first page +; +ab_blk$1: + push cx + mov cx,1024*16 ; 16k bytes / page + div cx ; dx:ax / 16k --> log page numb in ax + ; --> offset of i/o in dx + mov si,dx ; transfer offset to si + mov dx,ax ; store the page number in dx + pop cx +; +; find case and dispatch accordingly +; +; case 0 : user buffer below page map, can use aaron's code +; case 1 : user buffer above page map, can use aaron's code +; case 2 : user buffer partly/totally in page map, use pai's code +; + push bx + push cx +; +; if( final_user_off < pm_base_addr ) then case 0 +; + mov ax,di ; get user buffer initial offset into ax + add ax,1 ; round up (add to get carry) + rcr ax,1 ; convert to word offset + dec cx ; convert word count to 0 based number + add ax,cx ; user buffer final word offset + shr ax,1 ; convert to segment + shr ax,1 ; + shr ax,1 ; + mov bx,es ; get segment of buffer + add ax,bx ; now we have the last segment of the user buffer + ; with offset < 16 + sub ax,word ptr [base_addr+2] ; compare against page map + jc aar_cd ; if end below page map then execute old code +; +; if( initial_user_off < pm_base_addr ) then case 2 +; + mov cx,4 + mov bp,di ; get initial segment in bp + shr bp,cl ; + add bp,bx ; + sub bp,word ptr [base_addr +2] + jc within_pm ; case 2 +; +; if ( initial_user_off >= pm_end_addr ) then case1 +; + cmp bp,4*1024 ; + jae aar_cd ; case 1 +; +; case 2 +; +within_pm: jmp new_code ; user buffer in page map + ; so we need to execute new code +aar_cd: + pop cx + pop bx +; +; Referring back to the diagram given above the following routine is +; to take care of transfer of the most general case. +; What this routine does is break every I/O down into the above parts. +; The first or main part of the I/O is performed by mapping 1 to 4 +; sequential logical pages into the 4 physical pages and executing one +; REP MOVSW. If the tail word count is non-zero then the fith sequential +; logical page is mapped into physical page 0 and another REP MOVSW is +; executed. +; +; METHOD: +; Break I/O down as described above into main piece and tail piece +; Map the appropriate number of sequential pages (up to 4) +; into the page window at BASE_ADDR to set up the main piece +; of the I/O. +; Set appropriate seg and index registers and CX to perform the +; main piece of the I/O into the page window +; REP MOVSW +; IF there is a tail piece +; Map the next logical page into physical page 0 +; Reset the appropriate index register to point at phsical page 0 +; Move tail piece word count into CX +; REP MOVSW +; Restore Above Board page mapping context +; + XOR BP,BP ; No tail page + PUSH BX + ; + ; DX is first page #, SI is byte offset of start of I/O in first page + ; + MOV AX,DX + MOV BX,SI + SHR BX,1 ; # Words in first 16k page which are not part + ; of I/O + PUSH CX + ADD BX,CX ; # of words we need to map to perform I/O + MOV DX,BX + AND DX,1FFFH ; DX is number of words to transfer last page + ; remainder of div by words in 16K bytes + MOV CL,13 ; Div by # words in 16K + SHR BX,CL ; BX is number of pages to map (may need round up) + OR DX,DX ; Remainder? + JZ NO_REM + INC BX ; Need one more page +NO_REM: + MOV CX,BX ; CX is total pages we need to map + MOV BX,AX ; BX is first logical page + CMP CX,4 ; We can map up to 4 pages + JBE NO_TAIL + MOV BP,DX ; Words to move in tail page saved in BP + DEC CX ; Need second map for the 5th page + POP AX + SUB AX,DX ; Words to move in first 4 pages is input + ; word count minus words in tail page + PUSH AX ; Count for first mapping back on stack +NO_TAIL: + ; Map CX pages + MOV DX,[ABOVE_PID] + MOV AX,ABOVE_MAP SHL 8 ; Physical page 0 + PUSH AX +MAP_NEXT: + POP AX ; Recover correct AX register + PUSH AX + PUSH BX + PUSH DX + INT 67H ; Damn call ABOVE_MAP zaps BX,DX,AX + POP DX + POP BX + OR AH,AH + JNZ MAP_ERR1 ; error +IF2 + IF (ABOVE_SUCCESSFUL) + %out ASSUMPTION IN CODE THAT ABOVE_SUCCESSFUL = 0 IS INVALID + ENDIF +ENDIF +NEXT_PAGE: + INC BX ; Next logical page + POP AX + INC AL ; Next physical page + PUSH AX + LOOP MAP_NEXT + POP AX ; Clean stack + POP CX ; Word count for first page mapping + POP AX ; Operation in AH + ; + ; BX has # of next logical page (Tail page if BP is non-zero) + ; BP has # of words to move in tail page (0 if no tail) + ; CX has # of words to move in current mapping + ; SI is offset into current mapping of start of I/O + ; AH indicates READ or WRITE + ; + PUSH AX ; Save op for possible second I/O + OR AH,AH + JZ READ_A + ; + ; WRITE + ; + PUSH ES + PUSH DI + MOV DI,SI ; Start page offset to DI + POP SI ; DS:SI is transfer addr + POP DS +ASSUME DS:NOTHING + MOV ES,WORD PTR [BASE_ADDR + 2] ; ES:DI -> start + JMP SHORT FIRST_MOVE + +READ_A: +ASSUME DS:ramcode + MOV DS,WORD PTR [BASE_ADDR + 2] ; DS:SI -> start +ASSUME DS:NOTHING +FIRST_MOVE: + REP MOVSW + OR BP,BP ; Tail? + JNZ TAIL_IO ; Yup +ALL_DONE: + POP AX + CLC +REST_CONT: + ; Restore page mapping context + PUSH AX ; Save possible error code + PUSHF ; And carry state +REST_AGN: + MOV DX,[ABOVE_PID] + MOV AH,ABOVE_RESTORE_MAP_PID + INT 67H + OR AH,AH + JZ ROK +IF2 + IF (ABOVE_SUCCESSFUL) + %out ASSUMPTION IN CODE THAT ABOVE_SUCCESSFUL = 0 IS INVALID + ENDIF +ENDIF + CMP AH,ABOVE_ERROR_BUSY + JZ REST_AGN + CMP AH,ABOVE_ERROR_NO_CNTXT + JZ ROK ; Ignore the invalid PID error + POP DX + POP DX ; Clean stack + MOV AL,0cH ; General failure + STC + RET + +ROK: + POPF ; Recover carry state + POP AX ; and possible error code + RET + +TAIL_IO: + MOV DX,[ABOVE_PID] +MAP_AGN: + MOV AX,ABOVE_MAP SHL 8 ; map logical page BX to phys page 0 + PUSH BX + PUSH DX + INT 67H ; Damn call ABOVE_MAP zaps BX,DX,AX + POP DX + POP BX + OR AH,AH + JNZ MAP_ERR2 ; Error +IF2 + IF (ABOVE_SUCCESSFUL) + %out ASSUMPTION IN CODE THAT ABOVE_SUCCESSFUL = 0 IS INVALID + ENDIF +ENDIF +SECOND_MOVE: + POP AX ; Recover Op type + PUSH AX + OR AH,AH + JZ READ_SEC + ; + ; WRITE + ; + XOR DI,DI ; ES:DI -> start of tail + JMP SHORT SMOVE + +READ_SEC: + XOR SI,SI ; DS:SI -> start of tail +SMOVE: + MOV CX,BP + REP MOVSW + JMP ALL_DONE + +MAP_ERR1: + CMP AH,ABOVE_ERROR_BUSY ; Busy? + JZ MAP_NEXT ; Yes, wait till not busy (INTs are ON) + ADD SP,6 ; Clean stack + JMP SHORT DNR_ERR + +MAP_ERR2: + CMP AH,ABOVE_ERROR_BUSY + JZ MAP_AGN + ADD SP,2 +DNR_ERR: + MOV AL,02H ; Drive not ready + STC + JMP REST_CONT +; +; +; this code has been written to handle te cases of overlapping usage +; of the above board page frame segment by the cache and user buffer +; assumption: in dos tracks cannot be more than 64 sectors long so +; in the worst case we shall have the user buffer occupying three +; pages is the page frame. we attempt to find the page that is +; available for the cache and use it repeatedly to access the cache +; +; above comment was for smartdrv. 128 sector reads are possible here +; see the kludge in step 2 and step 4 to handle this + + +;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +; the algorithm is: +; ****************************************************** +; [STEP1: determine the page we can use for the cache] +; +; if (initial_para_offset_user in page 1, 2 or 3 ) then { +; physical_cache_page = 0; +; cache_segment = above board segment; +; } +; else { +; physical_cache_page = 3; +; cache_segment = above_board_segment + 3*1024; +; } +; +; ****************************************************** +; [STEP2: initial setup] +; +; count = user_count_requested; +; number_to_be_transferred = min ( count, (16K - si) >> 2 ); +; exchange source and destination if necessary; +; +; ******************************************************* +; [STEP3: set up transfer and do it] +; +; count = count - number_to_be_transferred; +; map_page cache_handle,physical_cache_page,logical_cache_page +; mov data +; +; ******************************************************* +; [STEP4: determine if another transfer needed and setup if so] +; +; if ( count == 0 ) then exit; +; if ( operation == read ) then source_offset = 0; +; else dest_offset = 0; +; number_to_be_transferred = min ( count, 8*1024 ); +; logical_page_number++ ; +; +; ******************************************************* +; [STEP5: go to do next block] +; +; goto [STEP3] +;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +; +new_code: + assume ds:ramcode,es:nothing,ss:nothing +; +; input parameters: +; +; bp : start para offset of user buffer from start of physical page frame +; ax : end para offset of user buffer in physical page frame +; di : transfer offset of user buffer +; es : transfer segment of user buffer +; dx : logical page number in cache +; si : offset from start in logical page number +; +; on stack { cx,bx } where cx = number of words, bx = read / write status +; +; [STEP1: finding physical cache page and page frame] +; + ; + ; assume is physical page 0 + ; + xor al, al ; use page 0 for cache + mov bx,word ptr [base_addr+2] + ; + ; see if this assumption valid + ; + cmp bp, 4*1024 ; base is below start of page frame + jae ab$300 + cmp bp,1024 ; is initial in page 1 or above + jae ab$30 ; if so or assumption is valid + ; + ; else we have to correct our assumption + ; +ab$300: + mov al, 3 ; use page 3 for cache + add bx, 3*1024 ; segment of page 3 + ; + ; initialise page frame segment + ; +ab$30: + add bp, 2*1024 ; base of second transfer + mov cx, bp + mov ds,bx + ; +assume ds:nothing +; +; [STEP2: initialising transfer parameters] +; + ; + pop bp ; bp will have count of words left to be transferred + pop bx ; read / write status +; +; kludged to handle 64k byte transfers +; + push cx ; base of second transfer + ; + ; initialise the number of words needed for a second transfer to 0 + ; + xor cx,cx ; + ; + ; compare the number to be transferred to 16k words. any more than this + ; will have to be done in the second transfer + ; + cmp bp,16*1024 ; more than 16k word transfers + jbe ab$301 ; if not cx is fine + mov cx,bp ; else cx = number of words - 16*1024 + mov bp,16*1024 ; and bp = 16*1024 + sub cx,bp ; +ab$301: + ; + ; store this on stack + ; + push cx +; +; end of kludge in step 2 +; + push bx ; save it back again + push dx ; save this too + ; + ; initially si offset into logical page, so we can only do 16*1024 - si + ; byte transfer + ; + mov cx,16*1024 + sub cx,si + shr cx,1 ; convert to word count + ; + ; number to be transferred is the minimum of this and the user requested + ; count + ; + cmp cx,bp + jb ab$31 + mov cx,bp + ; +ab$31: + ; + ; see if write, then we have to switch source with destination + ; + or bh,bh + je ab$32 ; if read we don't have to do anything + ; else we have to switch + src_dest_switch +ab$32: + ; + ; set direction flag so that we don't have to do it repeatedly + ; + cld +; +; [STEP3: set up transfer and do it] +; +ab$33: + ; + ; update count of words still left to be transferred after this + ; + sub bp,cx + ; + ; map the logical page in cache to the physical page selected + ; + mov bx,dx ; get logical page into bx + ; al already holds the physical page # + map_page + jnc ab$34 ; suceeded ? + ; + ; else report error + ; + add sp,6 + stc + jmp restore_mp ; and go to restore page map +ab$34: + ; + ; succeeded, do the transfer + ; +rep movsw + ; +; +; [STEP4: check if transfer done, if not set up for next block] +; [STEP5: go back to STEP3] + ; + ; check if done + ; + or bp,bp ; count 0 + je ab$40 ; yes, go to finish up + ; + ; recover original dx and bx, increment dx and then save both again + ; + pop dx + pop bx + inc dx + push bx + push dx + ; + ; words to be transferred minimum of count and 8*1024 words + ; + mov cx,8*1024 ; 8k words in a page + cmp cx,bp ; + jbe ab$35 ; if below or equal this is what we want + ; + mov cx,bp ; else we can transfer the whole count +ab$35: + ; + ; see whether cache src or dest and accordingly reset either si or di + ; + or bh,bh ; read? + jne ab$36 ; if write go to modify + ; + ; read, zero si and go back to step3 + ; + xor si,si + jmp short ab$33 ; to step 3 +ab$36: + ; + ; write, zero di and go back to step3 + ; + xor di,di + jmp short ab$33 ; to step 3 +; +; finishing up we have to restore the page map +; +ab$40: +; +; also kludged to handle 64k byte transfers +; + pop dx + pop bx + pop bp ; number of words for second transfer + pop ax ; base of second transfer + or bp,bp ; are we done? + jne ab$407 ; no, we have to do another transfer + jmp ab$405 ; yes we can go to finish up +ab$407: ; apologies for such abominations + push ax ; dummy transfer base + xor cx, cx + push cx ; zero count for next time +; +; restore the mapping context +; + clc + push dx ; dx is destroyed by restore mapping context + restore_mapping_context + pop dx ; + jnc ab$401 +; +; error we should quit here +; + add sp, 4 ; throw base & count + ret +; +; we need to save the mapping context again +; +ab$401: + save_mapping_context + jnc ab$406 ; if we couldn't save it then error + add sp, 4 + ret +; +; reset physical page to be mapped to 0 and ds or es to page map base +; and increment logical page if we have si = 0 (read) or di=0 (write) +; +ab$406: + mov cx, word ptr [base_addr+2] + cmp ax, 1024 ; new base in page 0? + jb ab$4060 + cmp ax, 4*1024 + jae ab$4060 + xor ax, ax + jmp short ab$4061 +ab$4060: + mov al, 3 + add cx, 3*1024 +ab$4061: + or bh,bh ; read or write? + jne ab$402 ; if write branch +; + ; + ; read, reset ds to base address + ; + mov ds,cx + mov cx,16*1024 ; + cmp si, cx ; at end of page? + jbe ab$4030 + inc dx + xor si, si +ab$4030: + sub cx,si + shr cx,1 + +ab$403: + push bx ; save these + push dx +; + cmp cx,bp ; is the cx appropriate + jbe ab$404 ; if yes go to do transfer + mov cx,bp ; else cx <--- bp +ab$404: + jmp ab$33 ; and go to do transfer +; +ab$402: + ; + ; write, reset es to base address + ; + mov es,cx + mov cx,16*1024 + cmp di, cx + jb ab$4020 + xor di, di + inc dx +ab$4020: + sub cx,di + shr cx,1 + jmp short ab$403 +; +; add sp,4 +ab$405: + clc +restore_mp: + restore_mapping_context + ret + + DW ? ; SPACE for ABOVE_PID + +; +; This label defines the end of the code swapped in at DRIVE_CODE +; +ABOVE_END LABEL WORD + +BREAK + + +; +; WARNING DANGER!!!!!!! +; +; This code is tranfered over the /E driver code at RESET_SYSTEM +; +; ALL jmps etc. must be IP relative. +; ALL data references must be to cells at the FINAL, TRUE location +; (no data cells may be named HERE, must be named up at RESET_SYSTEM). +; SIZE of stuff between ABOVE_RESET and ABOVE_RESET_END MUST be less than +; or equal to size of stuff between RESET_SYSTEM and RESET_INCLUDE. +; +; NOTE: EACH ABOVE BOARD driver has an INT 19 and 9 handler. This is +; different from /E and RESMEM in which only the first +; driver has an INT 19 and 9 handler. +; + +IF2 + IF((OFFSET ABOVE_RESET_END - OFFSET ABOVE_RESET) GT (OFFSET RESET_INCLUDE - OFFSET RESET_SYSTEM)) + %out ERROR ABOVE_RESET CODE TOO BIG + ENDIF +ENDIF + +;** ABOVE_RESET perform TYPE 2 (/A) driver specific reboot code +; +; This code issues an ABOVE_DEALLOC call for the memory +; associated with this particular TYPE 2 RAMDrive since the +; system is being re-booted and the driver is "gone". +; +; ENTRY +; NONE +; EXIT +; NONE +; USES +; NONE +; +; This code is specific to TYPE 2 drivers +; + +ABOVE_RESET: +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING + PUSH AX + PUSH DX +AGAIN_RESET: + MOV DX,[ABOVE_PID] + MOV AH,ABOVE_DEALLOC ; Close PID + INT 67H + CMP AH,ABOVE_ERROR_BUSY + JZ AGAIN_RESET + POP DX + POP AX + RET + +; +; This label defines the end of the code swapped in at RESET_SYSTEM +; +ABOVE_RESET_END LABEL BYTE + +BREAK + +;** RESMEM specific data +; +; The following datums are specific to the RESMEM (TYPE 3 +; or 4) drivers +; +; Specific to TYPE 3 or TYPE 4 drivers +; + +HIGH_SEG DW ? ; Segment addr of "end of memory" from INT 12 + +RAMSEG DW 0 ; Segment addr of the start of RAMDrive memory. + ; Basically a segment register version of + ; BASE_ADDR + +CRTSEG EQU 0A000H ; Memory past this segment value is RESERVED + ; Memory scan must stop here. + + +;** RESMEM_INIT - Perform RESMEM (TYPE 3 or 4) specific initialization +; +; This code performs the driver TYPE specific initialization for +; TYPE 3 and TYPE 4 drivers. +; +; Memory scan +; The method used by this code to "find" valid RAM between +; the "end of memory" as determined from the INT 12 memory +; size and CRTSEG is to look for memory which will correctly +; store data. It looks on 1K boundaries. If the first 2 words +; of a 1k block are good, it is assumed that the rest of the +; 1K block is good without explicitly checking it. The scan +; is interested only in the FIRST block it finds. If two +; separated (by invalid RAM) blocks of RAM exist in the +; above range, the second block WILL NOT be found. +; NOTE that this can be fooled by a bad memory chip in +; a block of RAM. In this case RAMDrive will use the +; memory up to the bad spot and ignore the rest. +; Also note that since 16K is the minimum RAMDrive +; size, and the EMM_CTRL sector takes 1k, a block +; of size < 17K results in an insufficient memory error. +; +; Since access to invalid RAM (RAM that isn't present) +; results in a parity error, the above scan must be done +; with parity checking disabled. +; +; Since the ROM BIOS memory initialization code and tests +; is only run on the memory indicated by INT 12, one of +; the things this code must do when it finds memory "above +; INT 12" is make sure all of the parity bits are set correctly. +; This is accomplished easily by just copying the memory to +; itself. +; +; The scan is NON-DESTRUCTIVE so that any data contained in +; the memory will not be destroyed. +; +; The result of this scan also makes the determination between +; a TYPE 3 and TYPE 4 RAMDrive. If memory is found, then we're +; TYPE 3. If no memory is found, then we're TYPE 4. +; +; +; RESMEM_BLKMOV code swapped in at BLKMOV +; RESMEM_RESET code swapped in at RESET_SYSTEM +; NOTE: This step is not needed for a TYPE 4 driver +; since TYPE 4 NEVER has an INT 9 or INT 19 handler, +; but it isn't harmful either, so we do it always. +; Issue INT 12 to get size of memory +; Convert INT 12 result to segment address of first byte after system +; memory. +; IF this segment address is equal to or grater than CRTSEG +; There cannot be any memory "above INT 12" so we are TYPE 4. +; Skip the memory scan since there is no memory to scan and +; go to the TYPE 4 init code at CASE1. +; Disable parity checking so access to non-existent RAM won't crash +; the system. +; Perform the memory scan. This starts at FOO and ends at HAVE_MEM +; if we find some valid memory, or at CASE1 if we don't. +; A word about the scan. +; There are two cases for valid RAM. +; 1.) Valid memory starts at the INT 12 address +; 2.) There is invalid RAM for a while, then valid RAM starts. +; The DX register is used to tell us what is going on. It is +; non-zero if we are skipping over invalid RAM looking for +; some valid RAM (case 2), or 0 is we have found some valid RAM +; (case 1, or case 2 after skipping invalid RAM) and are scanning +; to set parity and find the end of the valid RAM. +; RAMSEG is given the initial value of 0 to indicate we have not +; found the start of a valid block. +; When the scan is finished ENABLE_PARITY is called to turn parity +; checking back on. +; IF we have valid RAM and end at HAVE_MEM +; We are TYPE 3. +; RAMSEG contains the segment address of the start of the block +; BX is the segment address of the end of the block +; Subtract RAMSEG from BX to get size of region in paragraphs +; Convert size in Paragraphs to size in K +; Check that size is AT LEAST 17k (minimum size) +; Jump to GOT_RESMEM if OK else error +; Set EXT_K to size of block +; Adjust DEV_SIZE if bigger than EXT_K - 1 (-1 for EMM_CTRL) +; Convert RAMSEG to 32 bit address and set it into BASE_ADDR +; This sets BASE_ADDR to point to EMM_CTRL sector. +; Set BASE_RESET to BASE_ADDR plus 1024 +; Call MM_SETDRIVE to complete TYPE 3 specific initialization +; ELSE we end up at CASE1 +; We are TYPE 4. +; Set RESMEM_SPECIAL to indicate TYPE 4 +; Set INIT_DRIVE to 2 (DOS volume MUST be initialized) +; Set BASE_ADDR to be the first para boundary after the resident +; code (which DOES NOT include INT 19/INT 9 code). +; Compute TERM_ADDR based on DEV_SIZE Kbytes of device starting at +; BASE_ADDR. +; NOTE: We must make sure the specified DEV_SIZE is reasonable: +; It must not be bigger than 10 bits (1 Meg) +; as this is the memory limit of the 8086. +; It must not be so big that there is less than 48k of system +; memory after the device is installed. +; This is checked by computing the segment address +; of the end of the device and comparing it to the +; INT 12 memory end address minus 48k worth of paragraphs +; +; ENTRY: +; Invokation line parameter values set. +; EXIT: +; RESMEM_BLKMOV code swapped in at BLKMOV +; RESMEM_RESET code swapped in at RESET_SYSTEM +; Determination of TYPE 3 or TYPE 4 made by setting RESMEM_SPECIAL +; if TYPE 4. +; CARRY SET +; Error, message already printed. Driver not installed. +; If TYPE 3 +; EMM_CTRL not marked (but MAY be initialized if +; a valid one was not found). +; CARRY CLEAR +; DEV_SIZE set to TRUE size +; INIT_DRIVE set appropriatly +; IF TYPE 3 +; BASE_ADDR set for this drive from EMM_BASE of EMM_REC +; BASE_RESET set from BASE_ADDR +; EMM_REC is marked EMM_ISDRIVER +; TERM_ADDR set to correct device end. +; RESET_SYSTEM code and INT 9/INT 19 code included, +; INT 19 and 9 vector patched if this is the first +; TYPE 3 RAMDrive in the system. +; IF TYPE 4 +; BASE_ADDR set for this drive by computing address of +; start of memory after RAMDrive code. +; BASE_RESET set from BASE_ADDR +; TERM_ADDR set to correct device end which includes +; the memory taken up by the RAMDrive itself. +; +; USES: +; ALL but DS +; +; Code is specific to TYPE 3 and TYPE 4 drivers +; + +RESMEM_INIT: +ASSUME DS:RAMCODE,ES:NOTHING,SS:NOTHING + ; + ; Swap RESMEM code into place + ; + PUSH CS + POP ES + MOV SI,OFFSET RESMEM_CODE + MOV DI,OFFSET DRIVE_CODE + MOV CX,OFFSET DRIVE_END - OFFSET DRIVE_CODE + REP MOVSB + MOV SI,OFFSET RESMEM_RESET + MOV DI,OFFSET RESET_SYSTEM + MOV CX,OFFSET RESET_INCLUDE - OFFSET RESET_SYSTEM + REP MOVSB + ; + ; We have THREE cases to contend with: + ; + ; 1. There is NO memory above the INT 12H switch setting. + ; In this case we will use the user specified device + ; size (within limits) to allocate some memory as part + ; of the RAMDRIVE.SYS resident image. + ; NOTE: This type of a RAMDrive will not live through a warm boot + ; + ; 2. There is memory immediately after the INT 12H memory size. + ; We will check for a EMM_CTRL there etc. + ; + ; 3. There is memory after the INT 12H memory size, but not + ; Immediately after. + ; We will check for a EMM_CTRL there etc. + ; + INT 12H ; Get size of memory set on switches + +IF DEBUG + + JMP SHORT DEB1 + +DEB1MES DB 13,10,"INT 12 returned $" + +DEB1: + PUSH CX + PUSH DX + PUSHF + PUSH AX + MOV DX,OFFSET DEB1MES + CALL PRINT + POP AX + PUSH AX + CALL ITOA + POP AX + POPF + POP DX + POP CX +ENDIF + + MOV CL,6 + SHL AX,CL ; Convert to Segment register value + MOV BX,AX ; Save in BX + MOV [HIGH_SEG],AX ; And here + +; +;***************************************************************************** +; Ramdrives installed between int12 reported memory and crtseg (A000h) are +; no longer allowed because on several machines including the model 50/60 +; and the Tandy AT clone this area is used for something else. The idea to +; install a ramdrive in system memory is bad anyway but we shall still support +; the installation of a ramdrive in low memory as part of the driver. isp +; +; **START OF CODE REMOVED +; +; +; CMP BX,CRTSEG +; +;IF DEBUG +; JB DEBX +; JMP CASE1 +;DEBX: +;ELSE +; JAE CASE1 ; No memory to scan +;ENDIF +; +; IN AL,61H +; OR AL,20H ; Turn off parity interrupt +; JMP FOO ; 286 back to back IN OUT bug fix +;FOO: OUT 61H,AL +; ; +; ; SCAN memory +; ; +; XOR DI,DI +; MOV SI,DI +; MOV ES,BX ;Segment to scan for valid memory +; MOV DS,BX +;ASSUME DS:NOTHING +; CALL TEST_RAM +; JNZ NO_RAM +; ; We have case 2 +;HAVE_START: +; XOR DX,DX ; DX = 0 means skipping memory +; MOV [RAMSEG],BX ; This is the start of our memory +; +;IF DEBUG +; +; JMP SHORT DEB2 +; +;DEB2MES DB 13,10,"CASE 1 Ramseg $" +; +;DEB2: +; PUSH CX +; PUSH DX +; PUSHF +; PUSH AX +; MOV DX,OFFSET DEB2MES +; CALL PRINT +; MOV AX,[RAMSEG] +; CALL ITOA +; POP AX +; POPF +; POP DX +; POP CX +;ENDIF +; +; JMP SHORT NEXT_K +; +;NO_RAM: +; MOV DX,1 ; DX = 1 means skipping hole +; CMP [RAMSEG],0 ; If ramseg is NZ we are done, +; JZ NEXT_K ; have case 2 or 3 +; CALL ENABLE_PARITY +;HAVE_MEM: +; ; +; ; Driver is TYPE 3 +; ; +; SUB BX,[RAMSEG] ; BX is Para of RAMDRV region +; MOV CX,6 +; SHR BX,CL ; BX is K in region +; CMP BX,17 ; Ik EMM_CTRL, 16k min ramdrive +; +;IF DEBUG +; +; JMP SHORT DEB3 +; +;DEB3MESA DB 13,10,"CASE 3 Ramseg $" +;DEB3MESB DB " AVAIL K $" +; +;DEB3: +; PUSH CX +; PUSH DX +; PUSHF +; PUSH AX +; MOV DX,OFFSET DEB3MESA +; CALL PRINT +; MOV AX,[RAMSEG] +; CALL ITOA +; MOV DX,OFFSET DEB3MESB +; CALL PRINT +; MOV AX,BX +; CALL ITOA +; POP AX +; POPF +; POP DX +; POP CX +;ENDIF +; +; JB RES_NOMEMJ +; JMP GOT_RESMEM +; +;RES_NOMEMJ: +; JMP RES_NOMEM +; +;CONT_SCAN: +; XOR DI,DI +; MOV SI,DI +; MOV ES,BX ;Segment to scan for valid memory +; MOV DS,BX +; CALL TEST_RAM +; JNZ AT_DIS ;No, detected discontinuity +; OR DX,DX +; JZ NEXT_K +; JMP HAVE_START +; +;AT_DIS: +; OR DX,DX +; JZ NO_RAM +;NEXT_K: +; ADD BX,64 ; Next K +; CMP BX,CRTSEG +; JB CONT_SCAN +; CALL ENABLE_PARITY +; CMP [RAMSEG],0 +; JNZ HAVE_MEM +;***END OF CODE REMOVED*** +;***************************************************************************** +CASE1: + ; + ; Have CASE 1. + ; Driver is TYPE 4 + ; + +IF DEBUG + + JMP SHORT DEB4 + +DEB4MES DB 13,10,"CASE 1$" + +DEB4: + PUSH CX + PUSH DX + PUSHF + PUSH AX + MOV DX,OFFSET DEB4MES + CALL PRINT + POP AX + POPF + POP DX + POP CX +ENDIF + + PUSH CS + POP DS +ASSUME DS:RAMCODE + INC [RESMEM_SPECIAL] ; Flag SPECIAL case for INIDRV + MOV [INIT_DRIVE],2 ; This type must ALWAYS be inited + ; + ; Compute BASE_ADDR to be right after DEVICE_END, NO INT 19/9 handler + ; + MOV AX,OFFSET DEVICE_END + ADD AX,15 ; Para round up + MOV CL,4 + SHR AX,CL ; # of para in RAMDrive resident code + MOV DX,CS + ADD AX,DX ; AX is seg addr of start of RAMDrive + PUSH AX + MOV CX,16 + MUL CX ; DX:AX is byte offset of that many paras + MOV WORD PTR [BASE_ADDR],AX + MOV WORD PTR [BASE_ADDR + 2],DX + POP AX + ; + ; Compute correct ending address and set TERM_ADDR + ; Check that there is at least 48k of system memory after device end + ; AX is the segment address of the start of the device + ; + MOV DX,[DEV_SIZE] ; Get size in K + ; + ; DEV_SIZE can be at most a 10 bit number as that is 1 Meg, the memory + ; limit on the 8086 + ; + TEST DX,0FC00H ; If any of high 6 bits set, too big + JNZ RES_NOMEM + MOV CL,6 + SHL DX,CL ; DX is # of PARA in that many k + ADD AX,DX ; AX is end seg addr + JC RES_NOMEM ; Overflow + ; + ; Make sure at least 48K left after device + ; + MOV DX,[HIGH_SEG] + SUB DX,0C00H ; 48K worth of PARAs left for system + +IF DEBUG + + JMP SHORT DEB5 + +DEB5MESA DB " Max end is $" +DEB5MESB DB " end is $" + +DEB5: + PUSH CX + PUSHF + PUSH DX + PUSH AX + MOV DX,OFFSET DEB5MESA + CALL PRINT + POP DX + POP AX + PUSH AX + PUSH DX + CALL ITOA + MOV DX,OFFSET DEB5MESB + CALL PRINT + POP AX + PUSH AX + CALL ITOA + POP AX + POP DX + POPF + POP CX +ENDIF + + JC RES_NOMEM + CMP AX,DX + JA RES_NOMEM ; Too big + MOV WORD PTR [TERM_ADDR],0 + MOV WORD PTR [TERM_ADDR + 2],AX + +IF DEBUG + + JMP SHORT DEB6 + +DEB6MES DB " OK term $" + +DEB6: + PUSH CX + PUSHF + PUSH DX + PUSH AX + MOV DX,OFFSET DEB6MES + CALL PRINT + POP AX + PUSH AX + CALL ITOA + POP AX + POP DX + POPF + POP CX +ENDIF + CLC + RET + +RES_NOMEM: +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING + MOV DX,OFFSET ERRMSG2 + CALL PRINT + PUSH CS + POP DS + STC + RET + +GOT_RESMEM: +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING +; +; Completion of TYPE 3 initialization. +; RAMSEG is start seg addr of ramdrv region, BX is its size in K +; + PUSH CS + POP DS +ASSUME DS:RAMCODE + MOV [EXT_K],BX + DEC BX ; BX is MAX possible disk size + CMP [DEV_SIZE],BX + JBE RES002 ; DEV_SIZE is OK + MOV [DEV_SIZE],BX ; Limit DEV_SIZE to available K +RES002: + MOV AX,[RAMSEG] + MOV CX,16 + MUL CX + MOV WORD PTR [BASE_ADDR],AX + MOV WORD PTR [BASE_ADDR + 2],DX + ADD AX,1024 + ADC DX,0 + MOV WORD PTR [BASE_RESET],AX + MOV WORD PTR [BASE_RESET + 2],DX + CALL MM_SETDRIVE + RET + + +;** ENABLE_PARITY - Turn on parity checking of IBM PC AT XT +; +; This routine enables the memory parity checking on an IBM PC +; family machine +; +; ENTRY NONE +; EXIT NONE +; USES AL +; +; SEE ALSO +; IBM PC Technical Reference manual for any PC family member +; +; Code is specific to TYPE 3 and TYPE 4 drivers +; + +ENABLE_PARITY: +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING + IN AL,61H + AND AL,NOT 20H ;Re-enable parity checking + JMP BAR ; 286 back to back IN OUT bug fix +BAR: OUT 61H,AL + RET + + +;** TEST_RAM - Check if valid RAM exists and reset parity if it does +; +; This routine checks for valid RAM is a 1k block by performing +; various tests on the first two words of the block. If the RAM +; is valid, the parity of the 1k block is set by copying the block +; to itself. +; +; TESTS +; See if first word will store its own compliment +; See if read first word writes out correctly (also resets first +; word to its original value) +; See if second word will store a fixed value "AR" +; On this test we wait a while between the store and +; the test to allow the buss to settle. +; +; ENTRY +; DS:SI = ES:DI -> a 1k region of RAM to be tested +; PARITY CHECKING DISABLED +; EXIT +; Zero set if RAM is valid +; Zero reset if RAM is invalid +; USES +; AX, SI, DI +; +; Code is specific to TYPE 3 and TYPE 4 drivers +; + +TEST_RAM: +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING + LODSW ; See what's there + NOT AX + MOV [DI],AX ; See if memory can store complement + CMP AX,[DI] ; Memory OK? + JNZ RET007 ; Not valid RAM + NOT AX + STOSW ; Restore correct value + CMP AX,[DI - 2] ; Memory OK? + JNZ RET007 ; Not valid RAM + LODSW ; Next word + MOV WORD PTR [DI],"AR" ; Store fixed value + NOP ; Wait + NOP + NOP + NOP + CMP WORD PTR [DI],"AR" ; Did it store? + JNZ RET007 ; Not Valid RAM + STOSW ; Restore correct value + MOV CX,510 ; Copy to self to reset parity in this 1k block + REP MOVSW +RET007: + RET + +BREAK + +; +; This label defines the start of the TYPE 3 and 4 code swapped +; in at BLKMOV +; +RESMEM_CODE LABEL WORD + +; +; WARNING DANGER!!!!!!! +; +; This code is tranfered over the /E driver code at DRIVE_CODE +; +; ALL jmps etc. must be IP relative. +; ALL data references must be to cells at the FINAL, TRUE location +; (no data cells may be named HERE, must be named up at BLKMOV). +; OFFSET of RESMEM_BLKMOV relative to RESMEM_CODE MUST be the same as +; the OFFSET of BLKMOV relative to DRIVE_CODE. +; SIZE of stuff between RESMEM_CODE and RESMEM_END MUST be less than +; or equal to size of stuff between DRIVE_CODE and DRIVE_END. + +IF2 + IF((OFFSET RESMEM_BLKMOV - OFFSET RESMEM_CODE) NE (OFFSET BLKMOV - OFFSET DRIVE_CODE)) + %out ERROR BLKMOV, RESMEM_BLKMOV NOT ALIGNED + ENDIF + IF((OFFSET RESMEM_END - OFFSET RESMEM_CODE) GT (OFFSET DRIVE_END - OFFSET DRIVE_CODE)) + %out ERROR RESMEM CODE TOO BIG + ENDIF +ENDIF + + DD ? ; 24 bit address of start of this RAMDRV + +;** RESMEM_BLKMOV - Perform transfer for TYPE 3 and 4 driver +; +; This routine is the transfer routine for moving bytes +; to and from a RAMDrive located in main memory. +; +; METHOD: +; Convert start address into segreg index reg pair +; Mov computed segreg index reg pairs into correct registers +; Execute REP MOVSW to perform transfer +; +; ENTRY: +; ES:DI is packet transfer address. +; CX is number of words to transfer. +; DX:AX is 32 bit start byte offset (0 = sector 0 of RAMDrive drive) +; BH is 1 for WRITE, 0 for READ +; +; BASE_ADDR set to point to start of RAMDrive memory +; This "input" is not the responsibility of the caller. It +; is up to the initialization code to set it up when the +; device is installed +; +; EXIT: +; Carry Clear +; OK, operation performed successfully +; Carry Set +; Error during operation, AL is error number +; +; USES: +; ALL +; +; This routine is specific to TYPE 3 and 4 drivers +; + +RESMEM_BLKMOV: +ASSUME DS:RAMCODE,ES:NOTHING,SS:NOTHING + + ADD AX,WORD PTR [BASE_ADDR] + ADC DX,WORD PTR [BASE_ADDR + 2] + PUSH CX + MOV CX,16 + DIV CX ; AX is seg reg value, DX is index register + POP CX + OR BH,BH + JZ READ_ITR + ; + ; WRITE + ; + PUSH ES + POP DS +ASSUME DS:NOTHING + MOV SI,DI + MOV ES,AX + MOV DI,DX +TRANS: + REP MOVSW + CLC + RET + +READ_ITR: + MOV DS,AX +ASSUME DS:NOTHING + MOV SI,DX + JMP TRANS + +; +; This label defines the end of the RESMEM code swapped in at BLKMOV +; +RESMEM_END LABEL WORD + +BREAK + + +; +; WARNING DANGER!!!!!!! +; +; This code is tranfered over the /E driver code at RESET_SYSTEM +; +; ALL jmps etc. must be IP relative. +; ALL data references must be to cells at the FINAL, TRUE location +; (no data cells may be named HERE, must be named up at RESET_SYSTEM). +; SIZE of stuff between RESMEM_RESET and RESMEM_RESET_END MUST be less than +; or equal to size of stuff between RESET_SYSTEM and RESET_INCLUDE. + +IF2 + IF((OFFSET RESMEM_RESET_END - OFFSET RESMEM_RESET) GT (OFFSET RESET_INCLUDE - OFFSET RESET_SYSTEM)) + %out ERROR RESMEM_RESET CODE TOO BIG + ENDIF +ENDIF + +;** RESMEM_RESET perform TYPE 3 (RESMEM) driver specific reboot code +; +; This code performs the EMM_ISDRIVER reset function as described +; in EMM.ASM for all EMM_REC structures which are EMM_ALLOC and +; EMM_ISDRIVER and of type EMM_MSDOS. +; +; ENTRY +; NONE +; EXIT +; NONE +; USES +; NONE +; +; This code is specific to TYPE 3 drivers +; + +RESMEM_RESET: +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING + PUSH SI + PUSH DI + PUSH AX + PUSH BX + PUSH CX + PUSH DX + PUSH DS + PUSH ES + PUSH CS + POP DS +ASSUME DS:RAMCODE + MOV AX,WORD PTR [BASE_ADDR] + MOV DX,WORD PTR [BASE_ADDR + 2] + SUB AX,1024 ; Point back to EMM block + SBB DX,0 +; +; NOTE: We can address the EMM block by just backing up +; by 1024 bytes from BASE_ADDR because the RESET_SYSTEM handler +; is in the FIRST RAMDrive driver +; + MOV CX,16 + DIV CX ; AX is seg reg, DX is index reg + MOV DS,AX +ASSUME DS:NOTHING + MOV SI,DX ; DS:SI -> EMM_CTRL + MOV DI,SI + ADD DI,EMM_RECORD + MOV CX,EMM_NUMREC +LOOK_RECRY: + ; + ; Scan EMM_CTRL for all ISDRIVER MS-DOS regions and turn off ISDRIVER + ; + TEST [DI.EMM_FLAGS],EMM_ALLOC + JZ DONERY + TEST [DI.EMM_FLAGS],EMM_ISDRIVER + JZ NEXTRECRY ; No Driver + CMP [DI.EMM_SYSTEM],EMM_MSDOS + JNZ NEXTRECRY + AND [DI.EMM_FLAGS],NOT EMM_ISDRIVER +NEXTRECRY: + ADD DI,SIZE EMM_REC + LOOP LOOK_RECRY +DONERY: + POP ES + POP DS +ASSUME DS:NOTHING + POP DX + POP CX + POP BX + POP AX + POP DI + POP SI + RET + +; +; This label defines the end of the RESMEM code swapped in at RESET_SYSTEM +; +RESMEM_RESET_END LABEL BYTE + +BREAK + +;** Message texts and common data +; +; Init data. This data is disposed of after initialization. +; it is mostly texts of all of the messages +; +; COMMON to TYPE 1,2,3 and 4 drivers +; +; +; translatable messages moved to message module (SP) + + EXTRN NO_ABOVE:BYTE,BAD_ABOVE:BYTE,BAD_AT:BYTE,NO_MEM:BYTE + EXTRN ERRMSG1:BYTE,ERRMSG2:BYTE,INIT_IO_ERR:BYTE,BADVERMES:BYTE + EXTRN HEADERMES:BYTE,PATCH2X:BYTE,DOS_DRV:BYTE + EXTRN STATMES1:BYTE,STATMES2:BYTE,STATMES3:BYTE + EXTRN STATMES4:BYTE,STATMES5:BYTE + db "RAMDrive is a trademark of Microsoft Corporation." + db "This program is the property of Microsoft Corporation." + +VOLID DB 'MS-RAMDRIVE',ATTR_VOLUME_ID + DB 10 DUP (0) + DW 1100000000000000B ;12:00:00 + DW 0000101011001001B ;JUN 9, 1985 + DW 0,0,0 + +SECTOR_BUFFER DB 1024 DUP(0) + +RAMDrive_END LABEL BYTE + +RAMCODE ENDS + END + \ No newline at end of file diff --git a/v4.0/src/DEV/RAMDRIVE/RAMDRIVE.LNK b/v4.0/src/DEV/RAMDRIVE/RAMDRIVE.LNK new file mode 100644 index 0000000..98a3458 --- /dev/null +++ b/v4.0/src/DEV/RAMDRIVE/RAMDRIVE.LNK @@ -0,0 +1,3 @@ +ramdrive messages +ramdrive.exe +ramdrive.map -map; diff --git a/v4.0/src/DEV/RAMDRIVE/SYSCALL.INC b/v4.0/src/DEV/RAMDRIVE/SYSCALL.INC new file mode 100644 index 0000000..9761b0c --- /dev/null +++ b/v4.0/src/DEV/RAMDRIVE/SYSCALL.INC @@ -0,0 +1,146 @@ +BREAK + +Abort EQU 0 ; 0 0 +Std_Con_Input EQU 1 ; 1 1 +Std_Con_Output EQU 2 ; 2 2 +Std_Aux_Input EQU 3 ; 3 3 +Std_Aux_Output EQU 4 ; 4 4 +Std_Printer_Output EQU 5 ; 5 5 +Raw_Con_IO EQU 6 ; 6 6 +Raw_Con_Input EQU 7 ; 7 7 +Std_Con_Input_No_Echo EQU 8 ; 8 8 +Std_Con_String_Output EQU 9 ; 9 9 +Std_Con_String_Input EQU 10 ; 10 A +Std_Con_Input_Status EQU 11 ; 11 B +Std_Con_Input_Flush EQU 12 ; 12 C +Disk_Reset EQU 13 ; 13 D +Set_Default_Drive EQU 14 ; 14 E +FCB_Open EQU 15 ; 15 F +FCB_Close EQU 16 ; 16 10 +Dir_Search_First EQU 17 ; 17 11 +Dir_Search_Next EQU 18 ; 18 12 +FCB_Delete EQU 19 ; 19 13 +FCB_Seq_Read EQU 20 ; 20 14 +FCB_Seq_Write EQU 21 ; 21 15 +FCB_Create EQU 22 ; 22 16 +FCB_Rename EQU 23 ; 23 17 +Get_Default_Drive EQU 25 ; 25 19 +Set_DMA EQU 26 ; 26 1A +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; +Get_Default_DPB EQU 31 ; 31 1F +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +FCB_Random_Read EQU 33 ; 33 21 +FCB_Random_Write EQU 34 ; 34 22 +Get_FCB_File_Length EQU 35 ; 35 23 +Get_FCB_Position EQU 36 ; 36 24 +Set_Interrupt_Vector EQU 37 ; 37 25 +Create_Process_Data_Block EQU 38 ; 38 26 +FCB_Random_Read_Block EQU 39 ; 39 27 +FCB_Random_Write_Block EQU 40 ; 40 28 +Parse_File_Descriptor EQU 41 ; 41 29 +Get_Date EQU 42 ; 42 2A +Set_Date EQU 43 ; 43 2B +Get_Time EQU 44 ; 44 2C +Set_Time EQU 45 ; 45 2D +Set_Verify_On_Write EQU 46 ; 46 2E +; Extended functionality group +Get_DMA EQU 47 ; 47 2F +Get_Version EQU 48 ; 48 30 +Keep_Process EQU 49 ; 49 31 +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; +Get_DPB EQU 50 ; 50 32 +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +Set_CTRL_C_Trapping EQU 51 ; 51 33 +Get_InDOS_Flag EQU 52 ; 52 34 +Get_Interrupt_Vector EQU 53 ; 53 35 +Get_Drive_Freespace EQU 54 ; 54 36 +Char_Oper EQU 55 ; 55 37 +International EQU 56 ; 56 38 +; Directory Group +MKDir EQU 57 ; 57 39 +RMDir EQU 58 ; 58 3A +CHDir EQU 59 ; 59 3B +; File Group +Creat EQU 60 ; 60 3C +Open EQU 61 ; 61 3D +Close EQU 62 ; 62 3E +Read EQU 63 ; 63 3F +Write EQU 64 ; 64 40 +Unlink EQU 65 ; 65 41 +LSeek EQU 66 ; 66 42 +CHMod EQU 67 ; 67 43 +IOCtl EQU 68 ; 68 44 +XDup EQU 69 ; 69 45 +XDup2 EQU 70 ; 70 46 +Current_Dir EQU 71 ; 71 47 +; Memory Group +Alloc EQU 72 ; 72 48 +Dealloc EQU 73 ; 73 49 +Setblock EQU 74 ; 74 4A +; Process Group +Exec EQU 75 ; 75 4B +Exit EQU 76 ; 76 4C +Wait EQU 77 ; 77 4D +Find_First EQU 78 ; 78 4E +; Special Group +Find_Next EQU 79 ; 79 4F +; SPECIAL SYSTEM GROUP +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; +Set_Current_PDB EQU 80 ; 80 50 +Get_Current_PDB EQU 81 ; 81 51 +Get_In_Vars EQU 82 ; 82 52 +SetDPB EQU 83 ; 83 53 +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +Get_Verify_On_Write EQU 84 ; 84 54 +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; +Dup_PDB EQU 85 ; 85 55 +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +Rename EQU 86 ; 86 56 +File_Times EQU 87 ; 87 57 +AllocOper EQU 88 ; 88 58 +; Network extention system calls +GetExtendedError EQU 89 ; 89 59 +CreateTempFile EQU 90 ; 90 5A +CreateNewFile EQU 91 ; 91 5B +LockOper EQU 92 ; 92 5C Lock and Unlock +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; +ServerCall EQU 93 ; 93 5D CommitAll, ServerDOSCall, + ; CloseByName, CloseUser, + ; CloseUserProcess, + ; GetOpenFileList +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +UserOper EQU 94 ; 94 5E Get and Set +AssignOper EQU 95 ; 95 5F On, Off, Get, Set, Cancel +xNameTrans EQU 96 ; 96 60 +PathParse EQU 97 ; 97 61 +GetCurrentPSP EQU 98 ; 98 62 +Hongeul EQU 99 ; 99 63 + +Set_Oem_Handler EQU 248 ; 248 F8 +OEM_C1 EQU 249 ; 249 F9 +OEM_C2 EQU 250 ; 250 FA +OEM_C3 EQU 251 ; 251 FB +OEM_C4 EQU 252 ; 252 FC +OEM_C5 EQU 253 ; 253 FD +OEM_C6 EQU 254 ; 254 FE +OEM_C7 EQU 255 ; 255 FF diff --git a/v4.0/src/DEV/SMARTDRV/ABOVE.ASM b/v4.0/src/DEV/SMARTDRV/ABOVE.ASM new file mode 100644 index 0000000..058124b --- /dev/null +++ b/v4.0/src/DEV/SMARTDRV/ABOVE.ASM @@ -0,0 +1,62 @@ +BREAK + +; +; Assorted equates for use with Intel Above Board +; + +; +; EMM INT 67H Function codes +; +ABOVE_STATUS EQU 40H +ABOVE_GET_SEG EQU 41H +ABOVE_GET_FREE EQU 42H +ABOVE_ALLOC EQU 43H +ABOVE_MAP EQU 44H +ABOVE_DEALLOC EQU 45H +ABOVE_GET_VERSION EQU 46H +ABOVE_SAVE_MAP_PID EQU 47H +ABOVE_RESTORE_MAP_PID EQU 48H + +; +; NEW call not implemented in version 1.00 Above Board +; +ABOVE_GETSET_MAP EQU 4EH +; +; 4EH AX equates for subfunctions +; +ABOVE_GETSET_GET EQU 4E00H +ABOVE_GETSET_SET EQU 4E01H +ABOVE_GETSET_GETSET EQU 4E02H + + +; +; "Maintenance" calls +; +ABOVE_GET_IOPORT EQU 49H +ABOVE_GET_MAP_ARRAY EQU 4AH +ABOVE_GET_PIDS EQU 4BH +ABOVE_GET_PAGES EQU 4CH +ABOVE_GET_ALLOC EQU 4DH +ABOVE_REALLOCATE_PID EQU 51H + + +; +; EMM INT 67H AH return values +; +ABOVE_SUCCESSFUL EQU 0 +ABOVE_ERROR_SOFTWARE EQU 80H +ABOVE_ERROR_HARDWARE EQU 81H +ABOVE_ERROR_BUSY EQU 82H +ABOVE_ERROR_BAD_PID EQU 83H +ABOVE_ERROR_BAD_FUNC EQU 84H +ABOVE_ERROR_OUT_OF_PIDS EQU 85H +ABOVE_ERROR_MAP_CNTXT EQU 86H +ABOVE_ERROR_INSUFF_MEM EQU 87H +ABOVE_ERROR_INSUFF_FREE EQU 88H +ABOVE_ERROR_ALLOC_ZERO EQU 89H +ABOVE_ERROR_LOG_INVALID EQU 8AH +ABOVE_ERROR_PHYS_INVALID EQU 8BH +ABOVE_ERROR_CNTXT_NO_STACK EQU 8CH +ABOVE_ERROR_SECOND_SAVE EQU 8DH +ABOVE_ERROR_NO_CNTXT EQU 8EH +ABOVE_ERROR_BAD_PARM EQU 8FH diff --git a/v4.0/src/DEV/SMARTDRV/AB_MACRO.ASM b/v4.0/src/DEV/SMARTDRV/AB_MACRO.ASM new file mode 100644 index 0000000..f15367a --- /dev/null +++ b/v4.0/src/DEV/SMARTDRV/AB_MACRO.ASM @@ -0,0 +1,180 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; MACRO definitions for expanded memory manager +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; 1. MACRO to save mapping context in case somebody else has +; mapped the page registers. +; +save_mapping_context macro +local save_agn_m,save_err_m,save_ok_m,save_exit_m +; +; the save mapping call for the above board --> +; +; mov ah,47h +; mov dx,handle +; int 67h +; +; on return ax = 0 signifies success +; +; + push ax ; save registers + push dx +; +; set up emm registers and execute call to save mapping context +; +save_agn_m: + mov dx,cs:[above_pid] ; get emm handle + mov ah,above_save_map_pid ; save map call + int 67h ; call the manager + or ah,ah ; is there an error? + jz save_ok_m ; if not we are done +; +; error in saving mapping context, check for error +; + cmp ah,above_error_busy ; if the emm manager was busy + jz save_agn_m ; we would like to try again +; +; unrecoverable error, indicate error type in al +; + pop dx + pop dx ; pop the regs off the stack +; + mov al,0aah ; drive not ready + cmp ah,above_error_cntxt_no_stack ; + jz save_err_m + cmp ah,above_error_second_save ; + ja save_err_m + mov al,0bbh ; general failure +save_err_m: + stc + jmp short save_exit_m +save_ok_m: + clc + pop dx + pop ax ; restore registers +save_exit_m: + endm +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; 2. MACRO to restore the mapping context saved earlier +; +restore_mapping_context macro +local rest_agn_m, rest_ok_m, rest_exit_m +; +; the restore above map call --> +; +; mov ah,48h +; mov dx,handle +; int 67h +; ah = 0 is success +; +; + push ax + pushf +; +rest_agn_m: + mov dx,cs:[above_pid] ; get emm handle + mov ah,above_restore_map_pid ; restore map call + int 67h ; call manager + or ah,ah ; is there any error + jz rest_ok_m ; if not go to finish up +; +; error condition, check for recoverable error +; + cmp ah,above_error_busy ; if manager was busy + jz rest_agn_m ; we sure can try again + cmp ah,above_error_no_cntxt ; + jz rest_ok_m ; ignore invalid pid error +; +; unrecoverable error +; + pop dx + pop dx + mov al,0bbh ; general failure + stc + jmp short rest_exit_m +; +rest_ok_m: + popf + pop ax +rest_exit_m: +; + endm +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; 3. MACRO to map a page in the physical page map onto a logical +; page. +; +; the map above page requires +; mov ah,44h +; mov dx,handle +; mov al,physical_page# (0-3) +; mov bx,logical_page# +; int 67H +; ah = 0 success and this routine zaps ax,dx and bx +; +map_page macro +local map_agn_m,map_exit_m,map_fin_m +; + mov ah,above_map ; function map page + mov dx,cs:[above_pid] ; get emm handle +; + push ax +; +map_agn_m: + pop ax + push ax + push bx + push dx ; "damn call above_map zaps these registers" +; + int 67h ; map call + pop dx + pop bx +; + or ah,ah ; is there an error? + jz map_fin_m ; if not go to finish up +; +; error condition - check for recoverable error +; + cmp ah,above_error_busy ; if manager was busy + jz map_agn_m ; we sure can try again +; +; unrecoverable error +; + pop ax + mov al,0aah ; device not ready error + stc + jmp short map_exit_m +; +; exit point +; +map_fin_m: + clc + pop ax +map_exit_m: +; + endm +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; OTHER MACROS +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; 1) MACRO to switch es:di with ds:si +; +src_dest_switch macro +; + push ds + push es + push si + mov si,di + pop di + pop ds + pop es +; + endm +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/v4.0/src/DEV/SMARTDRV/CMACROS.INC b/v4.0/src/DEV/SMARTDRV/CMACROS.INC new file mode 100644 index 0000000..28dcb1b --- /dev/null +++ b/v4.0/src/DEV/SMARTDRV/CMACROS.INC @@ -0,0 +1,932 @@ +comment $ +cmacros - assembly macros for interfacing to HHLs +(C)Copyright 1988 Microsoft Corporation +$ +if1 +outif MACRO name,defval,onmsg,offmsg + ifndef name + ifb + name=0 + else + name=defval + endif + endif + if name + name=1 + ifnb + %out ! onmsg + endif + else + ifnb + %out ! offmsg + endif + endif +endm + +error MACRO msg +bug +%out E r r o r ----- msg +ENDM +%out cMacros Version 1.04 +outif memS,0, +outif memM,0, +outif memL,0, +outif memC,0, +outif memH,0, +memMOD= memS + memM + memL + memC + memH +if memMOD ne 1 +if memMOD eq 0 +memS= 1 +outif memS,0, +else +error +endif +endif +sizeC= memM + memL + memH +sizeD= memL + memC + (memH*2) +outif ?DF,0, +outif ?WIN,0, +outif ?PLM,0, +endif + .XCREF + .XCREF ?N,?AX,?AH,?AL,?BX,?BH + .XCREF ?BL,?CX,?CH,?CL,?DX,?DH + .XCREF ?DL,?SI,?DI,?ES,?DS,?BP + .XCREF ?SP,?SS,?CS + .XCREF ?RSL,?CPD,?argl,?argc,?BA + .XCREF ?ACB,???,?PO + .XCREF ?PAS,?PC + .XCREF Uconcat,mPush,mPop + .XCREF ?RI,?pp,?pp1,?al1 + .XCREF ?aD,?AP,?Atal,?pd,?dd,?dd1,?ex1,?cas + .XCREF ?pg,?pg1,?aloc,?cs1,?cs2 + .XCREF ?lb1,?lblpu + .XCREF ?DF,?PLM,?WIN,?IA,?PU,?ADJ + .CREF +?RSL = 0 +?CPD = 0 +?ArgL = 0 +?ArgC = 0 +?BA = 0 +?ACB = 0 +??? = 0 +?PO = 0 +?PAS = 0 +?PC = 0 +?IA = 0 +?PU = 0 +?ADJ = 0 +?lblpu = 0 +?N = 0000000000000000B +?AX = 0000000000000011B +?AH = 0000000000000001B +?AL = 0000000000000010B +?BX = 0000000000001100B +?BH = 0000000000000100B +?BL = 0000000000001000B +?CX = 0000000000110000B +?CH = 0000000000010000B +?CL = 0000000000100000B +?DX = 0000000011000000B +?DH = 0000000001000000B +?DL = 0000000010000000B +?SI = 0000000100000000B +?DI = 0000001000000000B +?ES = 0000010000000000B +?DS = 0000100000000000B +?BP = 0001000000000000B +?SP = 0010000000000000B +?SS = 0100000000000000B +?CS = 1000000000000000B +uconcat macro n1,n2,o1,o2,p1,p2 +n1&n2 o1&o2 p1&p2 +endm +mpush macro rV +irp x, +if rV AND ?&&x +push x +endif +endm +endm +mpop macro rV +irp x, +if rV AND ?&&x +pop x +endif +endm +endm +SAVE macro rL +?RSL = 0 +?RI ?RSL, +endm +smashes macro n,rL + .xcref + .xcref ?SM&n + .cref +?SM&n = 0 +?RI ?SM&n, +endm +?RI macro n,rL +irp x, +ifdef ?&&x +n = n or ?&&x +endif +endm +endm +parmB macro nl +?pp <&nL>,,2,1 +endm +parmW macro nl +?pp <&nL>,,2,2 +endm +parmD macro nl +ife ?PLM +irp x, +?pp <&&x>,,0,4 +?pp ,,2,2 +?pp ,,2,2 +endm +else +irp x, +?pp ,,2,2 +?pp ,,2,2 +?pp <&&x>,,0,4 +endm +endif +endm +parmQ macro nl +?pp <&nL>,,8,8 +endm +parmT macro nl +?pp <&nL>,,10,10 +endm +if sizeC +parmCP macro nl +parmD +endm +else +parmCP macro nl +parmW +endm +endif +if sizeD +parmDP macro nl +parmD +endm +else +parmDP macro nl +parmW +endm +endif +?pp macro nL,t,l,s +if ?CPD + .xcref +ife ?PLM +irp x, +?pp1 x,,%?PO,%?adj,%(?PO+?adj) +?PO = ?PO + l + .xcref ?T&&x +?T&&x = s +endm +else +irp x, +?PO = ?PO + l +?pp1 x,,%?PO,%?adj,%(?PO+?adj) + .xcref ?T&&x +?T&&x = s +endm +endif + .cref +else +%out Parm(s) "&nl" declared outside proc def. +endif +endm +?pp1 macro n,t,o,a,b +ife ?PLM +n equ t ptr [bp+b] +else +n equ t ptr [bp+a+?PO-o] +endif +endm +localB macro nL +?aLoc <&nL>,,1,1,0 +endm +localW macro nL +?aLoc <&nL>,,2,2,1 +endm +localD macro nL +irp x, +?aLoc ,,2,2,1 +?aLoc ,,2,2,1 +?aLoc <&&x>,,0,4,1 +endm +endm +localQ macro nL +?aLoc <&nL>,,8,8,1 +endm +localT macro nL +?aLoc <&nL>,,10,10,1 +endm +if sizeC +localCP macro nL +localD +endm +else +localCP macro nL +localW +endm +endif +if sizeD +localDP macro nL +localD +endm +else +localDP macro nL +localW +endm +endif +localV macro n,a +?aLoc <&n>,,%(&a),0,1 +endm +?aLoc macro nL,t,l,s,a +if ?CPD + .xcref +??? = ??? + l +if a +??? = ((??? + 1) AND 0FFFEH) +endif +irp x, +?aL1 x,,%??? + .xcref ?T&&x +?T&&x = s +endm + .cref +else +%out Locals "&nl" declared outside procedure def. +endif +endm +?aL1 macro n,t,o +if ?IA +n equ t [bp-?IA-o] +else +n equ t [bp-o] +endif +endm +globalB macro n,i,s +?aD ,1 +?dd n,1,,,, +endm +globalW macro n,i,s +?aD ,2 +?dd n,1,,,, +endm +globalD macro n,i,s +?aD ,4 +?dd n,1,,
,, +endm +globalQ macro n,i,s +?aD ,8 +?dd n,1,,,, +endm +globalT macro n,i,s +?aD ,10 +?dd n,1,,
,, +endm +if sizeC +globalCP macro n,i,s +globalD n,, +endm +else +globalCP macro n,i,s +globalW n,, +endm +endif +if sizeD +globalDP macro n,i,s +globalD n,, +endm +else +globalDP macro n,i,s +globalW n,, +endm +endif +staticB macro n,i,s +?aD ,1 +?dd n,0,,,, +endm +staticW macro n,i,s +?aD ,2 +?dd n,0,,,, +endm +staticD macro n,i,s +?aD ,4 +?dd n,0,,
,, +endm +staticQ macro n,i,s +?aD ,8 +?dd n,0,,,, +endm +staticT macro n,i,s +?aD ,10 +?dd n,0,,
,, +endm +if sizeC +staticCP macro n,i,s +staticD n,, +endm +else +staticCP macro n,i,s +staticW n,, +endm +endif +if sizeD +staticDP macro n,i,s +staticD n,, +endm +else +staticDP macro n,i,s +staticW n,, +endm +endif +?dd macro n,p,t,d,i,s +ife ?PLM +n label t +?dd1 _&n,p,,, +else +?dd1 n,p,,, +endif +endm +?dd1 macro n,p,d,i,s +if p +PUBLIC n +endif +ifb +n d i +else +ifb +n d s DUP (?) +else +n d s DUP (i) +endif +endif +endm +externB macro nL +?ex1 <&nL>,1, +endm +externW macro nL +?ex1 <&nL>,2, +endm +externD macro nL +?ex1 <&nL>,4, +endm +externQ macro nL +?ex1 <&nL>,8, +endm +externT macro nL +?ex1 <&nL>,10, +endm +externNP macro nL +?ex1 <&nL>,2, +endm +externFP macro nL +?ex1 <&nL>,4, +endm +if sizeC +externP macro nL +?ex1 <&nL>,4, +endm +else +externP macro nL +?ex1 <&nL>,2, +endm +endif +if sizeC +externCP macro nL +?ex1 <&nL>,4, +endm +else +externCP macro nL +?ex1 <&nL>,2, +endm +endif +if sizeD +externDP macro nL +?ex1 <&nL>,4, +endm +else +externDP macro nL +?ex1 <&nL>,2, +endm +endif +?ex1 macro nL,s,d +irp x, + .xcref + .xcref ?T&&x + .cref +?T&&x = s +ife ?PLM +extrn _&&x:&d +x equ _&&x +else +extrn x:&d +endif +endm +endm +labelB macro nL +?lb1 <&nL>,1, +endm +labelW macro nL +?lb1 <&nL>,2, +endm +labelD macro nL +?lb1 <&nL>,4, +endm +labelQ macro nL +?lb1 <&nL>,8, +endm +labelT macro nL +?lb1 <&nL>,10, +endm +labelNP macro nL +?lb1 <&nL>,2, +endm +labelFP macro nL +?lb1 <&nL>,4, +endm +if sizeC +labelP macro nL +?lb1 <&nL>,4, +endm +else +labelP macro nL +?lb1 <&nL>,2, +endm +endif +if sizeC +labelCP macro nL +?lb1 <&nL>,4, +endm +else +labelCP macro nL +?lb1 <&nL>,2, +endm +endif +if sizeD +labelDP macro nL +?lb1 <&nL>,4, +endm +else +labelDP macro nL +?lb1 <&nL>,2, +endm +endif +?lb1 macro nL,s,d +?lblpu = 0 +irp x, +ifidn , +?lblpu = 1 +else + .xcref + .xcref ?T&&x + .cref +?T&&x = s +ife ?PLM +if ?lblpu +public _&&x +endif +_&&x label &d +x equ _&&x +else +if ?lblpu +public x +endif +x label &d +endif +endif +endm +endm +defB macro nL +?aD <&nL>,1 +endm +defW macro nL +?aD <&nL>,2 +endm +defD macro nL +?aD <&nL>,4 +endm +defQ macro nL +?aD <&nL>,8 +endm +defT macro nL +?aD <&nL>,10 +endm +if sizeC +defCP macro nL +defD +endm +else +defCP macro nL +defW +endm +endif +if sizeD +defDP macro nL +defD +endm +else +defDP macro nL +defW +endm +endif +?aD macro nL,s +irp x, + .xcref + .xcref ?T&&x + .cref +?T&&x = s +endm +endm +regPtr macro n,S,O + .xcref + .xcref ?T&n,?SR&n,?OR&n + .cref +?T&n = 0FFFFH +?SR&n = 0 +?RI ?SR&n,<&S> +?OR&n = 0 +?RI ?OR&n,<&O> +endm +arg macro aL +irp x, +?argc = ?argc + 1 +?Atal ,%?argc +endm +endm +?Atal macro n,i + .xcref + .xcref ?ALI&i + .cref +?ALI&i ¯o +?AP n +&endm +endm +?AP macro n +?argl = ?argl + 2 +ifdef ?T&n +ife ?T&n-1 +push word ptr (n) +exitm +endif +ife ?T&n-2 +push n +exitm +endif +ife ?T&n-4 +push word ptr (n)+2 +push word ptr (n) +?argl = ?argl + 2 +exitm +endif +ife ?T&n-8 +push word ptr (n)+6 +push word ptr (n)+4 +push word ptr (n)+2 +push word ptr (n) +?argl = ?argl + 6 +exitm +endif +ife ?T&n-0FFFFH +mpush %(?SR&n),1 +mpush %(?OR&n),1 +?argl = ?argl + 2 +exitm +endif +ife ?T&n +push word ptr (n) +exitm +endif +endif +push n +endm +ife ?PLM +ccall macro n,a,sleaze +ifnb +Arg +endif +ifdef ?SM&n +?RSL = ?RSL AND ?SM&n +endif +mpush %?RSL +?argl = 0 +?ACB = ?argc +rept ?argc +uconcat ,%?ACB +uconcat ,,,%?ACB +?ACB = ?ACB - 1 +endm +ife ?PLM +ifb +call _&n +else +call n +endif +else +call n +endif +if ?argl +add sp,?argl +endif +mpop %?RSL +?RSL = 0 +?argc = 0 +?argl = 0 +endm +else +ccall macro n,a +ifnb +Arg +endif +ifdef ?SM&n +?RSL = ?RSL AND ?SM&n +endif +mpush %?RSL +?argl = 0 +?ACB = 1 +rept ?argc +uconcat ,%?ACB +uconcat ,,,%?ACB +?ACB = ?ACB + 1 +endm +ife ?PLM +call _&n +else +call n +endif +mpop %?RSL +?RSL = 0 +?argc = 0 +?argl = 0 +endm +endif +cProc macro n,cl,s +?pd n,,,4 +endm +?pd macro n,c,a,i +if ?CPD +?UTPE +endif +?CPD = 1 +??? = 0 +?argc = 0 +?BA = 0 +?PO = 0 +?PU = 0 +?IA = 0 +?adj = i +?PAS = 0 +ifnb +?RI ?PAS, +endif +?PC = sizeC +irp x, +ifidn , +?PC = 1 +endif +ifidn , +?PC = 0 +endif +ifidn , +?PU = 1 +endif +endm +if ?PC +if ?WIN +?IA = 2 +endif +?adj = ?adj + 2 +endif +ife ?PLM +ife ?PC +n label near +else +n label far +endif +?pg <_&n>,%?PU,%?PC,%?PAS +else +?pg ,%?PU,%?PC,%?PAS +endif +endm +?pg macro n,p,c,a + .xcref + cBegin ¯o g + .xcref + ?pg1 ,c,a,%?PO + ?CPD = 0 + ?argc = 0 + ?BA = 1 + ??? = (???+1) AND 0FFFEH + if p + PUBLIC n + endif + ife c + n proc NEAR + else + n proc FAR + endif + ifidn , + if ???+?PO+a + %out + endif + else + if ?IA + mov ax,ds + nop + inc bp + push bp + mov bp,sp + push ds + mov ds,ax + else + push bp + mov bp,sp + endif + if ??? + sub sp,??? + endif + mPush a,1 + endif + .cref + purge cBegin + &endm + ?UTPE ¯o + %out Unterminated Procedure Definition: "&n" + &endm +endm + +?pg1 macro n,c,a,o + .xcref + cEnd ¯o g + .xcref + ?BA = 0 + ifidn , + if o+a + %out + endif + else + mPop a,1 + if ?IA + sub bp,2 + mov sp,bp + pop ds + pop bp + dec bp + else + mov sp,bp + pop bp + endif + ife ?PLM + ret + else + ret o + endif + endif + n endp + .cref + purge cEnd + &endm + .cref +endm + +assumes macro s,g +local assumed +assumed = 0 +ifidn , +?cas +assumed = 1 +endif +ifidn , +?cas +assumed = 1 +endif +ifidn , +assume s&:dgroup +assumed = 1 +endif +ifidn , +assume s&:dgroup +assumed = 1 +endif +ife assumed +assume s&:&g +endif +endm +if sizeC +?cas macro s +assume s&:_TEXT +endm +else +?cas macro s +assume s&:IGROUP +endm +endif +createSeg macro n,ln,a,co,cl,grp +ifnb +ifidn , +ife sizeC +addSeg IGROUP,n +endif +else +addSeg grp,n +endif +endif +ifnb +n segment a co '&cl' +else +n segment a co +endif +n ends +?cs1 , +endm +if1 +ASMpass=1 +else +ASMpass=2 +endif +addSeg macro grp,seg +ifndef def_&grp +def_&grp= 0 +endif +if def_&grp ne ASMpass +add_&grp ¯o s +in_&grp ,s +&endm +in_&grp ¯o sl,s +ifb +grp group sl +else +add_&grp ¯o ns +in_&grp ,ns +&endm +endif +&endm +def_&grp=ASMpass +else +add_&grp seg +endif +endm +defGrp macro nam +addSeg nam +endm +?cs1 macro n,ln +begin&ln ¯o +?cs2 +n segment +&endm +endm + +?cs2 macro n + sEnd ¯o + n ends + &endm +endm + +sBegin macro ln + begin&ln +endm + +ife ?DF + createSeg _TEXT,code,byte,public,CODE,IGROUP + createSeg _DATA,data,word,public,DATA,DGROUP + if ?WIN + ife sizeC + createSeg _INITTEXT,initcode,byte,public,CODE,IGROUP + createSeg _INITDATA,initdata,word,public,DATA,DGROUP + endif + endif + ife sizeC + defGrp IGROUP + endif + defGrp DGROUP + if sizeC + codeOFFSET equ OFFSET _TEXT: + else + codeOFFSET equ OFFSET IGROUP: + endif + dataOFFSET equ OFFSET DGROUP: +endif + +errnz macro x + if2 + if x + errnz1 ,%(x) + endif + endif +endm + +errnz1 macro x1,x2 + = *ERRNZ* x1 = x2 +endm + +errn$ macro l,x + errnz +endm diff --git a/v4.0/src/DEV/SMARTDRV/DEVSYM.ASM b/v4.0/src/DEV/SMARTDRV/DEVSYM.ASM new file mode 100644 index 0000000..44a1ab8 --- /dev/null +++ b/v4.0/src/DEV/SMARTDRV/DEVSYM.ASM @@ -0,0 +1,128 @@ +BREAK + +; The device table list has the form: +SYSDEV STRUC +SDEVNEXT DD ? ;Pointer to next device header +SDEVATT DW ? ;Attributes of the device +SDEVSTRAT DW ? ;Strategy entry point +SDEVINT DW ? ;Interrupt entry point +SDEVNAME DB 8 DUP (?) ;Name of device (only first byte used for block) +SYSDEV ENDS + +; +; Attribute bit masks +; +; Character devices: +; +; Bit 15 -> must be 1 +; 14 -> 1 if the device understands IOCTL control strings +; 13 -> 1 if the device supports output-until-busy +; 12 -> unused +; 11 -> 1 if the device understands Open/Close +; 10 -> must be 0 +; 9 -> must be 0 +; 8 -> unused +; 7 -> unused +; 6 -> unused +; 5 -> unused +; 4 -> 1 if device is recipient of INT 29h +; 3 -> 1 if device is clock device +; 2 -> 1 if device is null device +; 1 -> 1 if device is console output +; 0 -> 1 if device is console input +; +; Block devices: +; +; Bit 15 -> must be 0 +; 14 -> 1 if the device understands IOCTL control strings +; 13 -> 1 if the device determines media by examining the FAT ID byte. +; This requires the first sector of the fat to *always* reside in +; the same place. +; 12 -> unused +; 11 -> 1 if the device understands Open/Close/removable media +; 10 -> must be 0 +; 9 -> must be 0 +; 8 -> unused +; 7 -> unused +; 6 -> unused +; 5 -> unused +; 4 -> unused +; 3 -> unused +; 2 -> unused +; 1 -> unused +; 0 -> unused + +DevTyp EQU 8000H ; Bit 15 - 1 if Char, 0 if block +CharDev EQU 8000H +DevIOCtl EQU 4000H ; Bit 14 - CONTROL mode bit +ISFATBYDEV EQU 2000H ; Bit 13 - Device uses FAT ID bytes, + ; comp media. +OutTilBusy EQU 2000h ; Output until busy is enabled +ISNET EQU 1000H ; Bit 12 - 1 if a NET device, 0 if + ; not. Currently block only. +DEVOPCL EQU 0800H ; Bit 11 - 1 if this device has + ; OPEN,CLOSE and REMOVABLE MEDIA + ; entry points, 0 if not + +EXTENTBIT EQU 0400H ; Bit 10 - Currently 0 on all devs + ; This bit is reserved for future use + ; to extend the device header beyond + ; its current form. + +; NOTE Bit 9 is currently used on IBM systems to indicate "drive is shared". +; See IOCTL function 9. THIS USE IS NOT DOCUMENTED, it is used by some +; of the utilities which are supposed to FAIL on shared drives on server +; machines (FORMAT,CHKDSK,RECOVER,..). + +ISSPEC EQU 0010H ;Bit 4 - This device is special +ISCLOCK EQU 0008H ;Bit 3 - This device is the clock device. +ISNULL EQU 0004H ;Bit 2 - This device is the null device. +ISCOUT EQU 0002H ;Bit 1 - This device is the console output. +ISCIN EQU 0001H ;Bit 0 - This device is the console input. + +;Static Request Header +SRHEAD STRUC +REQLEN DB ? ;Length in bytes of request block +REQUNIT DB ? ;Device unit number +REQFUNC DB ? ;Type of request +REQSTAT DW ? ;Status Word + DB 8 DUP(?) ;Reserved for queue links +SRHEAD ENDS + +;Status word masks +STERR EQU 8000H ;Bit 15 - Error +STBUI EQU 0200H ;Bit 9 - Buisy +STDON EQU 0100H ;Bit 8 - Done +STECODE EQU 00FFH ;Error code + +;Function codes +DEVINIT EQU 0 ;Initialization +DINITHL EQU 26 ;Size of init header +DEVMDCH EQU 1 ;Media check +DMEDHL EQU 15 ;Size of media check header +DEVBPB EQU 2 ;Get BPB +DEVRDIOCTL EQU 3 ;IOCTL read +DBPBHL EQU 22 ;Size of Get BPB header +DEVRD EQU 4 ;Read +DRDWRHL EQU 22 ;Size of RD/WR header +DEVRDND EQU 5 ;Non destructive read no wait (character devs) +DRDNDHL EQU 14 ;Size of non destructive read header +DEVIST EQU 6 ;Input status +DSTATHL EQU 13 ;Size of status header +DEVIFL EQU 7 ;Input flush +DFLSHL EQU 15 ;Size of flush header +DEVWRT EQU 8 ;Write +DEVWRTV EQU 9 ;Write with verify +DEVOST EQU 10 ;Output status +DEVOFL EQU 11 ;Output flush +DEVWRIOCTL EQU 12 ;IOCTL write +DEVOPN EQU 13 ;Device open +DEVCLS EQU 14 ;Device close +DOPCLHL EQU 13 ;Size of OPEN/CLOSE header +DEVRMD EQU 15 ;Removable media +REMHL EQU 13 ;Size of Removable media header + +DevOUT EQU 16 ; output until busy. +DevOutL EQU DevWrt ; length of output until busy + +SUBTTL diff --git a/v4.0/src/DEV/SMARTDRV/DIRENT.ASM b/v4.0/src/DEV/SMARTDRV/DIRENT.ASM new file mode 100644 index 0000000..e7150c8 --- /dev/null +++ b/v4.0/src/DEV/SMARTDRV/DIRENT.ASM @@ -0,0 +1,56 @@ +Break + +; +; +---------------------------+ +; | (12 BYTE) filename/ext | 0 0 +; +---------------------------+ +; | (BYTE) attributes | 11 B +; +---------------------------+ +; | (10 BYTE) reserved | 12 C +; +---------------------------+ +; | (WORD) time of last write | 22 16 +; +---------------------------+ +; | (WORD) date of last write | 24 18 +; +---------------------------+ +; | (WORD) First cluster | 26 1A +; +---------------------------+ +; | (DWORD) file size | 28 1C +; +---------------------------+ +; +; First byte of filename = E5 -> free directory entry +; = 00 -> end of allocated directory +; Time: Bits 0-4=seconds/2, bits 5-10=minute, 11-15=hour +; Date: Bits 0-4=day, bits 5-8=month, bits 9-15=year-1980 +; + +dir_entry STRUC +dir_name DB 11 DUP (?) ; file name +dir_attr DB ? ; attribute bits +dir_pad DB 10 DUP (?) ; reserved for expansion +dir_time DW ? ; time of last write +dir_date DW ? ; date of last write +dir_first DW ? ; first allocation unit of file +dir_size_l DW ? ; low 16 bits of file size +dir_size_h DW ? ; high 16 bits of file size +dir_entry ENDS + +attr_read_only EQU 1h +attr_hidden EQU 2h +attr_system EQU 4h +attr_volume_id EQU 8h +attr_directory EQU 10h +attr_archive EQU 20h +attr_device EQU 40h ; This is a VERY special bit. + ; NO directory entry on a disk EVER + ; has this bit set. It is set non-zero + ; when a device is found by GETPATH + +attr_all EQU attr_hidden+attr_system+attr_directory + ; OR of hard attributes for FINDENTRY + +attr_ignore EQU attr_read_only+attr_archive+attr_device + ; ignore this(ese) attribute(s) during + ; search first/next + +attr_changeable EQU attr_read_only+attr_hidden+attr_system+attr_archive + ; changeable via CHMOD diff --git a/v4.0/src/DEV/SMARTDRV/EMM.ASM b/v4.0/src/DEV/SMARTDRV/EMM.ASM new file mode 100644 index 0000000..ff61ab0 --- /dev/null +++ b/v4.0/src/DEV/SMARTDRV/EMM.ASM @@ -0,0 +1,223 @@ +BREAK + +; +; The EMM control sector is a 1024 byte record which ALWAYS occupies the +; very first 1024 bytes of "extra" memory that needs to be managed. Its +; function is to provide a method to allocate available "extra" memory +; to programs which desire to use it and avoid program conflicts that +; would occur if two different programs attempted to use the same piece +; of "extra" memory. +; + +; +; The EMM_CTRL structure defines the offsets into the 1024 byte control +; sector of the various fields. The EMM_REC structure defines a sub-structure +; contained within the EMM_CTRL structure which represents a particular +; piece of allocated "extra" memory (an allocation record). +; + +; Layout of each EMM record. + +EMM_REC STRUC +EMM_FLAGS DW 0 +EMM_SYSTEM DW 0 +EMM_BASE DD ? ; 24 bit address of start of region +EMM_KSIZE DW ? ; Size of region in kbytes +EMM_REC ENDS + +; EMM_FLAGS Bits +EMM_ALLOC EQU 0000000000000001B ; Zero -> record is free +EMM_ISDRIVER EQU 0000000000000010B ; 1 -> driver is installed + ; for this region + +; EMM_SYSTEM Values +EMM_EMM EQU 0 ; Allocated to EMM +EMM_MSDOS EQU 1 +EMM_XENIX EQU 2 +EMM_APPLICATION EQU 3 + +; Layout of EMM control 1024 byte record + +EMM_CTRL STRUC +EMM_VER DB 50 DUP(?) +EMM_TOTALK DW ? ; EXCLUDING the 1k of this record +EMM_AVAILK DW ? ; Amount of above NOT allocated + DB SIZE EMM_REC DUP(?) ; NULL (0th) RECORD +EMM_RECORD DB (1024 - 50 - 4 - 10 - (SIZE EMM_REC)) DUP(?) + ; EMM_REC structures +EMM_TAIL_SIG DB 10 DUP(?) +EMM_CTRL ENDS + +EMM_NUMREC EQU (1024 - 50 - 4 - 10 - (SIZE EMM_REC)) / (SIZE EMM_REC) + + +; +; The current initial (no "extra" memory allocated) EMM_CTRL sector is +; +; EMM_CONTROL LABEL BYTE +; DB "MICROSOFT EMM CTRL VERSION 1.00 CONTROL BLOCK " +; DW EXTMEM_TOTALK - 1 +; DW EXTMEM_TOTALK - 1 +; ; NULL 0th record +; DW EMM_ALLOC + EMM_ISDRIVER +; DW EMM_EMM +; DW EXTMEM_LOW + 1024 +; DW EXTMEM_HIGH +; DW 0 +; ;** +; DB 950 DUP(0) +; DB "ARRARRARRA" +; +; Where EXTMEM_LOW:EXTMEM_HIGH is the 32 bit address of the first byte +; of the EMM_CTRL sector (first byte of "extra" memory) and EXTMEM_TOTALK +; is the size in K of the available "extra" memory. One is subtracted +; from EXTMEM_TOTALK because the sizes in the EMM_CTRL record DO NOT +; include the 1k taken up by the EMM_CTRL sector. +; +; The reason for the existance of the NULL 0th record is to facilitate +; the computation of EMM_BASE for the first EMM_REC allocation record +; created. +; +; The EMM_REC structures CANNOT be sparse. In other words if one sets +; up a scan of the EMM_REC structures in the EMM_CTRL sector, as soon as +; an EMM_REC structure WITHOUT the EMM_ALLOC bit set in its flag word +; is encountered it is not necessary to scan further because it IS KNOWN +; that all of the EMM_REC structures after the first one with EMM_ALLOC +; clear also have EMM_ALLOC clear. What this means is that EMM_CTRL +; memory CANNOT BE deallocated. Once an EMM_REC structure has its +; EMM_ALLOC bit set, there is NO correct program operation which +; can clear the bit UNLESS it IS KNOWN that the next EMM_REC structure +; has its EMM_ALLOC bit clear or the EMM_REC structure is the last one. +; +; +; USING THE EMM_CTRL SECTOR: +; +; A program which wishes to use the EMM_CTRL sector to access "extra" +; memory should work as follows: +; +; Figure out how much memory you wish to allocate +; +; Figure out the location and size of the "extra" memory in the system +; +; IF (the first 1024 bytes of "extra" memory DO NOT contain a valid +; EMM_CTRL record determined by checking for the existence of the +; correct EMM_VER and EMM_TAIL_SIG strings) +; Write a correct initial EMM_CTRL sector to the first 1024 +; bytes of extra memory. Be sure to fill in EMM_TOTALK, +; EMM_AVAILK and EMM_BASE in the 0th record. +; +; Set up a scan of the EMM_REC structures in the EMM_CTRL sector. +; NOTE: You can skip the NULL 0th record if you want since it has +; known value. +; +; FOR (i=0;i= EMM_NUMREC) +; ERROR no free EMM_REC structures +; +; +; You can now see why we need that NUL 0th EMM_REC structure. In order to +; perform this step +; +; EMM_BASE = EMM_BASE of PREVIOUS EMM_REC + +; (1024 * EMM_KSIZE of PREVIOUS EMM_REC) +; +; when the very first EMM_REC is allocated we must have a "previous EMM_REC" +; structure to point at. +; +; The above code is rather simplistic in that all it does is do a simple +; allocation. The EMM_ISDRIVER bit allows us to do some more sophisticated +; things. In particular in the case of a RAMDrive type of program it is +; desirable to "re-find" the same RAMDrive area in "extra" memory when the +; system is re-booted. The EMM_ISDRIVER bit is used to help us do this. +; +; The EMM_ISDRIVER bit means "there is presently a piece of code in the +; system which is using this memory". If we find an EMM_REC structure +; which has its EMM_ALLOC bit set, but the EMM_ISDRIVER bit is clear +; it means that the piece of code that originally allocated +; the memory is gone and we may want to "re-find" this memory by +; setting the EMM_ISDRIVER bit again. A RAMDrive program would have +; slightly different code than the above: +; +; FOR (i=0;i, + +ParmW Nameptr + +cBegin + mov dx,Nameptr + MOV AX,3D02H + INT 21H ; Open the device + JC NO_DEV_ERR ; No device + MOV BX,AX + MOV AX,4400H + INT 21H ; Make sure it IS a device + JC CLOSE_NO_DEV + TEST DX,4080H + JZ CLOSE_NO_DEV + mov ax,bx ; Return the handle + jmp short PXDONE + +CLOSE_NO_DEV: + mov ax,3e00H ; Close + int 21H +NO_DEV_ERR: + mov ax,-1 +PXDONE: +cEnd + +;** IOCTLClose - Close the indicated handle +; +; ENTRY: +; Handle +; EXIT: +; None +; USES: +; Standard 'C' +; +cProc IOCTLClose, , + +ParmW Handle + +cBegin + mov bx,Handle + MOV AX,3E00H + INT 21H ; close the device +cEnd + +;** IOCTLWrite - Perform IOCTLWrite to device handle +; +; ENTRY: +; Handle to open device +; Pointer to data to write +; Count in bytes of data to write +; EXIT: +; AX = -1 error +; else AX = input count +; USES: +; Standard 'C' +; +cProc IOCTLWrite, , + +ParmW WHandle +ParmW WDataPtr +ParmW WCount + +cBegin + mov bx,WHandle + mov cx,WCount + mov dx,WDataPtr + MOV AX,4403H ; IOCTL Write + INT 21H + JC Werr + CMP AX,CX + JNZ Werr + jmp short WDONE + +WERR: + mov ax,-1 +WDONE: +cEnd + +;** IOCTLRead - Perform IOCTLRead to device handle +; +; ENTRY: +; Handle to open device +; Pointer to data area to read into +; Count in bytes of size of data area +; EXIT: +; AX = -1 error +; else AX = input count +; USES: +; Standard 'C' +; +cProc IOCTLRead, , + +ParmW RHandle +ParmW RDataPtr +ParmW RCount + +cBegin + mov bx,RHandle + mov cx,RCount + mov dx,RDataPtr + MOV AX,4402H ; IOCTL Read + INT 21H + JC Rerr + CMP AX,CX + JNZ Rerr + jmp short RDONE + +RERR: + mov ax,-1 +RDONE: +cEnd + + +sEnd CODE + + end diff --git a/v4.0/src/DEV/SMARTDRV/FLMES.ASM b/v4.0/src/DEV/SMARTDRV/FLMES.ASM new file mode 100644 index 0000000..25177ba --- /dev/null +++ b/v4.0/src/DEV/SMARTDRV/FLMES.ASM @@ -0,0 +1,86 @@ + TITLE Message texts for FLUSH13 + +PAGE 58,132 + +CONST SEGMENT WORD PUBLIC 'DATA' +CONST ENDS + +_BSS SEGMENT WORD PUBLIC 'DATA' +_BSS ENDS + +_DATA SEGMENT WORD PUBLIC 'DATA' +_DATA ENDS + +DGROUP GROUP CONST, _BSS, _DATA + +ASSUME DS:DGROUP + +_DATA SEGMENT + + public _SWTCH_CONF + public _BAD_PARM + public _NO_DEV_MESS + public _IOCTL_BAD_MESS + public _STATUS_MES1 + public _STATUS_MES2 + public _DISSTRING + public _ENSTRING + public _OFFSTRING + public _ONSTRING + public _LOCKSTRING + public _UNLSTRING + public _REBOOT_MES + public _STATUS_3R + public _STATUS_3W + public _STATUS_3T + public _CACHE_MES + public _WT_MES + public _WB_MES + public _L_MES + public _C_MES + public _T_MES + public _STATUS_4 + public _STATUS_5 + +; +; Messages +; +_SWTCH_CONF DB "Conflicting switch specified",13,10 +_BAD_PARM DB "Usage:",13,10," FLUSH13 [/s|/sx|/sr] [/d|/e] [/l|/u] [/i] [/f] [/wt:on|/wt:off]",13,10 + DB " [/wc:on|/wc:off] [/t:nnnnn] [/c:on|/c:off]",0 + +_NO_DEV_MESS DB "SMARTDRV device not found, or device error",0 + +_IOCTL_BAD_MESS DB "SMARTDRV device function failed",0 + +_STATUS_MES1 DB "SMARTDRV Device is NUL (instalation failed)",13,10,0 + +_STATUS_MES2 DB "FLUSH13/SMARTDRV version 1.00",13,10,0 +_CACHE_MES DB " Caching is %-8s",0 +_L_MES DB " Cache is %-8s",13,10,0 + +_WB_MES DB " Write Caching is %-3s",0 +_REBOOT_MES DB " Reboot flush is %-3s",13,10,0 + +_C_MES DB " Caching of full track reads is %-3s",0 +_WT_MES DB " Write Through is %-3s",13,10,0 + +_T_MES DB " Cache is auto flushed every %2u:%02u minutes (%u ticks)",13,10,0 + +_DISSTRING DB "DISABLED",0 +_ENSTRING DB "ENABLED",0 +_OFFSTRING DB "OFF",0 +_ONSTRING DB "ON",0 +_LOCKSTRING DB "LOCKED",0 +_UNLSTRING DB "UNLOCKED",0 + + +_STATUS_3W DB " %10lu Write hits out of %10lu Total Writes. Hit rate %3u%%",13,10,0 +_STATUS_3R DB " %10lu Read hits out of %10lu Total Reads. Hit rate %3u%%",13,10,0 +_STATUS_3T DB " %10lu hits out of %10lu Total operations. Hit rate %3u%%",13,10,0 +_STATUS_4 DB " %3u Total tracks, %3u are used, %3u are locked, %3u are dirty",13,10,0 + +_STATUS_5 DB " %4u - Current Size, %4u - Initial Size, %4u - Minimum Size",13,10,0 + +_DATA ENDS + END diff --git a/v4.0/src/DEV/SMARTDRV/FLUSH13.C b/v4.0/src/DEV/SMARTDRV/FLUSH13.C new file mode 100644 index 0000000..cf01107 --- /dev/null +++ b/v4.0/src/DEV/SMARTDRV/FLUSH13.C @@ -0,0 +1,686 @@ +/* + * FLUSH13 -- Device mod utility for INT13 memory cache + * + * FLUSH13 [/s|/sx|/sr] [/d|/e] [/l|/u] [/i] [/f] [/wt:on|/wt:off] + * [/wc:on|/wc:off] [/t:nnnnn] [/r:on|/r:off] [/c:on|/c:off] + * + * No arguments - This causes FLUSH13 to flush out any "dirty" + * tracks in the INT13 cache. A "dirty" track is one + * which has been written into the cache, but not yet + * written to the disk. This invokation causes all dirty tracks + * to be written out to the disk so that the system can + * be re-booted or turned off. NOTE: FAILURE TO FLUSH + * THE CACHE BEFORE A RE-BOOT OR POWER OFF CAN CAUSE THE + * INFORMATION ON THE HARDFILE TO BE CORRUPTED. + * + * /f - Flush. Same as the no arguments case, but allows you to + * perform the flush and do something else (like /s). + * + * /i - Flush and invalidate. This is the same as the no argument + * case except that all of the information in the cache + * is also discarded. This makes the cache EMPTY. + * + * /d - Disable caching. This causes all dirty cache information + * to be flushed and all caching to stop. + * + * /e - Enable caching. This causes caching to be enabled after + * a previous /d disable. When INT13 is started it is enabled. + * + * /l - Lock the cache. This causes all dirty information to be + * flushed, and the cache contents to be locked in the cache. + * When in this mode the locked elements will not be discarded + * to make room for new tracks. This can be used + * to "load" the cache with desired things. For instance if + * you use the "foobar" program a lot, you can run foobar, + * causing it to be loaded into the cache, then lock the cache. + * This causes the foobar program to always be in the cache. + * You may lock the cache as many times as you want. Each lock + * causes the current information (including any previously + * locked information) to be locked. + * NOTE: Information in a locked cache is READ ONLY!! Any write + * operation on information in a locked cache causes the + * information to be unlocked. + * + * /u - Unlock the cache. This undoes a previous /l and returns + * the cache to normal operation. + * + * /s - Print status. This displays the settings of the setable + * device parameters. + * /sx - Print extended status. Same as /s, only additional + * Statistical information is also given. + * /sr - Reset statistics. Same as /sx, only the additional + * Statistical information is reset to 0. + * + * /wt:on off - Enable or Disable write through. When INT13 is caching + * write information, it is a good idea to imply a flush of + * the cache on some operations so that in case of a crash or + * power failure the information in the cache which is not on + * the disk will not be lost. /wt:on enables write through on full + * track INT 13s which are to tracks not currently in the cache. + * /wt:off disables it. INT13 is faster with write through + * off, at the expense of there being a bigger risk of + * loosing data. /wt:on IS NOT a substitute for flushing before + * a re-boot!!!! This write through mechanism is far from perfect, + * all it is is a risk REDUCER, not a risk eliminator. /wt:off + * is the setting when INT13 is started. + * + * /wc:on off - Enable or Disable write caching. There is risk when + * caching "dirty" information that the system will crash, + * or be re-booted, or be turned off before this information + * can be written to the disk. This may corrupt the disk. + * This risk can be ELIMINATED, at the expense of cache + * performance, by NOT caching any dirty information. + * /wc:off disables the caching of dirty information, + * eliminating the risk. /wc:on enables the caching of dirty + * information. /wc:on is the default when INT13 is started. + * + * WARNING: You must be careful to flush the cache before + * re-booting the system, or turning it off if /wc:on is selected. + * You should also be careful to disable the cache (/d), or do + * /wc:off before running any program under development which + * has a chance of crashing due to bugs. + * + * NOTE: When /wc:off is selected, write info CAN get into + * the cache (when the write is to a track which is currently + * in the cache). The difference is that this "dirty" information + * is IMMEDIATELY written out to the disk instead of being + * held in the cache in the "dirty" state. When the write is + * to a track that is not in the cache, it will be passed + * through to the disk without being cached. + * + * /t:nnnnn - Set the auto flush interval. INT13 listens on the system + * timer to note the passage of time and "age" the dirty + * information in the cache. Every nnnnn ticks, the cache is + * flushed. The timer ticks 18.2 times a second. + * + * nnnnn | + * =========================================== + * 18 | Flush every second + * 1092 | Flush every minute + * 5460 | Flush every 5 minutes + * 10920 | Flush every 10 minutes + * 21840 | Flush every 20 minutes + * 32760 | Flush every 30 minutes + * 65520 | Flush every hour + * + * The default setting of nnnnn is 1092 or every minute. + * NOTE: There is no way to "disable" this tick aging. Setting + * nnnnn = 0 causes a wait for 65536 ticks which is a + * little over an hour. The max value for nnnnn is 65535. + * Disabling the cache (/d), or turning write caching + * off (/wc:off) effectively prevents the aging from + * doing anything as there is never anything to flush + * in these cases. Setting very low values of nnnnn + * should be avoided as it places a lot of overhead into + * the timer interrupt service. Rather than set low values, + * it is better to just turn off write caching (/wc:off). + * NOTE: As stated above, the max value for nnnnn is 65535. It + * should be noted however that FLUSH13 DOES NOT object if + * you specify a number larger than this! It will simply + * use only the low 16 bits of the number. + * + * /r:on off - En/Disable reboot flush. + * INT13 has a provision for detecting Ctrl-Alt-Del user + * reboots. /r:on enables a flush of the cache at this time + * to prevent the disks from being corrupted. The default + * setting is /r:off. NOTE WARNING DANGER!!!!! Enabling + * this feature can prevent disks from being damaged BUT + * the mechanism has flaws. For one, you will have to hit + * Ctrl-Alt-Del a second time to get the system to reboot. + * YOU MUST NOT POUND ON THE KEY. You will crash the system if + * you do. Hit the key ONCE, if the system re-boots, fine. If + * there is info to flush out of the cache, the drive light + * will come on and the system will probably NOT reboot. WAIT + * until the drive light is OFF before hitting Ctrl-Alt-Del + * again. This feature of INT13 MAY NOT WORK with other + * software in the system. USER BEWARE!!!!!!!!!!!!!!!!!!! + * + * /c:on off - En/Disable all cache on reads. + * Normally INT13 does not cache EVERY I/O. Whenever + * it sees a full track I/O which is not currently in + * the cache, it DOES NOT cache that track. This is + * an optimization for "typical" operation, and actually + * increases performance. This is the default setting + * (/c:off). There may be some cases where it is desirable + * that ALL reads be cached. One example is that you are + * "loading" the cache prior to locking it with FLUSH13 /l. + * With /c:off, some pieces of what you're trying to load + * may not get into the cache. Another example is that + * you continually access in a sequential manner (like + * program load) some large file which happens to be + * contiguous on the disk. Again, there may be some "piece" + * of the file which does not get into the cache with + * /c:off. /c:on enables the caching of ALL reads. + * NOTE: The same "don't bother caching operations which + * are full track and not in the cache" applies + * to writes as well. /c has NO EFFECT on this + * behavior however. /c only effects read operations. + * + * MODIFICATION HISTORY + * + * 1.10 5/26/86 ARR First version in assembler + * 1.20 5/27/86 ARR Lock cache function added. + * 1.22 5/30/86 ARR /r reboot flush code added + * 1.23 6/03/86 ARR Cache statistics added + * 1.24 6/05/86 ARR Added /a "all cache" code + * 1.25 6/10/86 ARR Added total used, total locked to status + * RECODED in 'C'. + * /f switch added. + * 1.26 6/12/86 ARR /wb changed to /wc. Some status report wording + * changed. This was to align the behavior with the + * documentation a little better. + * 1.27 1/22/87 ARR Change to format of status information. + */ + +#include + +/* + * Messages in flmes.asm + */ +extern char NO_DEV_MESS[], IOCTL_BAD_MESS[], STATUS_MES2[], SWTCH_CONF[]; +extern char BAD_PARM[], STATUS_MES1[], DISSTRING[], ENSTRING[]; +extern char LOCKSTRING[], UNLSTRING[], REBOOT_MES[]; +extern char STATUS_3R[], STATUS_3W[], STATUS_3T[]; +extern char CACHE_MES[], WT_MES[], WB_MES[], L_MES[], C_MES[], T_MES[]; +extern char STATUS_4[], ONSTRING[], OFFSTRING[], STATUS_5[]; + +/* + * Structure of the data returned by the status call to INT13 + */ +typedef struct { + unsigned char write_through; + unsigned char write_buff; + unsigned char enable_13; + unsigned char nuldev; + unsigned int ticksetting; + unsigned char lock_cache; + unsigned char reboot_flush; + unsigned char all_cache; + unsigned char pad; + unsigned long total_writes; + unsigned long write_hits; + unsigned long total_reads; + unsigned long read_hits; + unsigned int ttracks; + unsigned int total_used; + unsigned int total_locked; + unsigned int total_dirty; + unsigned int current_size; + unsigned int initial_size; + unsigned int minimum_size; +} status; + +/* + * Assembler routines in fl13.asm + */ +extern int IOCTLOpen(char *); +extern int IOCTLWrite(int,char *,int); +extern int IOCTLRead(int,status *,int); +extern int IOCTLClose(int); + +/* + * GetNum - Read an unsigned 16 bit decimal number + * + * ENTRY: cptr points to string where decimal number is + * iptr points to unsigned int where number goes + * + * NOTES: Calls Fatal (which doesn't return) if no number is present. + * No error if number is > 16 bits, only low 16 bits are returned. + * + * EXIT: returns cptr advanced past number + * iptr contains number found + * + */ +char *GetNum(cptr,iptr) +unsigned char *cptr; +unsigned int *iptr; +{ + *iptr = 0; + if((*cptr < '0') || (*cptr > '9')) + Fatal(BAD_PARM); + while((*cptr >= '0') && (*cptr <= '9')) + *iptr = (*iptr * 10) + ((unsigned int) (*cptr++ - '0')); + return(cptr); +} + +/* + * GetOnOff - Check for :on or :off string + * + * ENTRY: cptr points to string where :on or :off is supposed to be + * iptr points to unsigned int which is a boolean + * + * NOTES: Calls Fatal (which doesn't return) if :on or :off is not found. + * Case insensitive. + * + * EXIT: returns cptr advanced past :on or :off + * iptr contains 1 if :on was found + * iptr contains 0 if :off was found + * + */ +char *GetOnOff(cptr,iptr) +char *cptr; +int *iptr; +{ + if(*cptr++ != ':') + Fatal(BAD_PARM); + *cptr |= 0x20; + if(*cptr++ != 'o') + Fatal(BAD_PARM); + *cptr |= 0x20; + if(*cptr == 'n') { + cptr++; + *iptr = 1; + } + else if(*cptr == 'f'){ + cptr++; + *cptr |= 0x20; + if(*cptr++ != 'f') + Fatal(BAD_PARM); + *iptr = 0; + } + else + Fatal(BAD_PARM); + return(cptr); +} + + +/* + * Flush13 + * + * ENTRY: Std + * + * NOTES: + * + * EXIT: exit(0) if OK, exit(-1) if error. + * + */ +main(argc, argv, envp) +int argc; +char **argv; +char **envp; + +{ + + int handle,boolval; + char *cptr; + unsigned long total_hits,total_ops; + unsigned int minutes,seconds; + struct { + unsigned SWITCH_S : 1; + unsigned SWITCH_I : 1; + unsigned SWITCH_D : 1; + unsigned SWITCH_E : 1; + unsigned SWITCH_L : 1; + unsigned SWITCH_U : 1; + unsigned SWITCH_T : 1; + unsigned SWITCH_WCON : 1; + unsigned SWITCH_WCOFF : 1; + unsigned SWITCH_WTON : 1; + unsigned SWITCH_WTOFF : 1; + unsigned SWITCH_ROFF : 1; + unsigned SWITCH_RON : 1; + unsigned SWITCH_SX : 1; + unsigned SWITCH_SR : 1; + unsigned SWITCH_CON : 1; + unsigned SWITCH_COFF : 1; + unsigned SWITCH_F : 1; + } switches; + struct { + unsigned char Tchar; + unsigned char tickvall; /* this is actually an unsigned int */ + unsigned char tickvalh; /* but we have to declare it this way */ + } tickpacket; /* so that the compiler doesn't word align */ + status config; + + /* Check for no arguments case and process if found */ + + handle = -1; + if (argc == 1) { /* no arguments */ + if((handle = IOCTLOpen("SMARTAAR")) == -1) + Fatal(NO_DEV_MESS); + if(IOCTLWrite(handle,"\x00",1) == -1) + Fatal(IOCTL_BAD_MESS); + IOCTLClose(handle); + exit(0); + } + + /* Initialize data associated with the argument parse */ + + switches.SWITCH_S = switches.SWITCH_I = switches.SWITCH_D = 0; + switches.SWITCH_E = switches.SWITCH_L = switches.SWITCH_U = 0; + switches.SWITCH_T = switches.SWITCH_WCON = switches.SWITCH_WCOFF = 0; + switches.SWITCH_WTON = switches.SWITCH_WTOFF = switches.SWITCH_ROFF = 0; + switches.SWITCH_RON = switches.SWITCH_SX = switches.SWITCH_SR = 0; + switches.SWITCH_CON = switches.SWITCH_COFF = switches.SWITCH_F = 0; + + /* Parse the arguments */ + + ++argv; /* Skip argv[0] */ + while(--argc) { /* While arguments */ + cptr = *argv; + if(*cptr++ != '/') /* all arguments are switches */ + Fatal(BAD_PARM); + if(*cptr == '\0') /* trailing / error? */ + Fatal(BAD_PARM); + *cptr |= 0x20; /* lower case */ + switch (*cptr++) { + + /* Status */ + case 's': + if(switches.SWITCH_S || switches.SWITCH_SX || switches.SWITCH_SR) + Fatal(SWTCH_CONF); + if(*cptr == '\0') + switches.SWITCH_S = 1; + else { + *cptr |= 0x20; + if(*cptr == 'r') + switches.SWITCH_SR = 1; + else if(*cptr == 'x') + switches.SWITCH_SX = 1; + else + Fatal(BAD_PARM); + cptr++; + } + break; + + /* c on or off */ + case 'c': + if(switches.SWITCH_CON || switches.SWITCH_COFF) + Fatal(SWTCH_CONF); + cptr = GetOnOff(cptr,&boolval); + if(boolval) + switches.SWITCH_CON = 1; + else + switches.SWITCH_COFF = 1; + break; + + /* t set tick value */ + case 't': + if(switches.SWITCH_T) + Fatal(SWTCH_CONF); + if(*cptr++ != ':') + Fatal(BAD_PARM); + cptr = GetNum(cptr,&tickpacket.tickvall); + tickpacket.Tchar = '\x0B'; /* set tick is call 5 */ + switches.SWITCH_T = 1; + break; + + /* wt or wb on or off */ + case 'w': + *cptr |= 0x20; + if(*cptr == 'c') { + cptr++; + if(switches.SWITCH_WCOFF || switches.SWITCH_WCON) + Fatal(SWTCH_CONF); + cptr = GetOnOff(cptr,&boolval); + if(boolval) + switches.SWITCH_WCON = 1; + else + switches.SWITCH_WCOFF = 1; + } + else if(*cptr == 't') { + cptr++; + if(switches.SWITCH_WTOFF || switches.SWITCH_WTON) + Fatal(SWTCH_CONF); + cptr = GetOnOff(cptr,&boolval); + if(boolval) + switches.SWITCH_WTON = 1; + else + switches.SWITCH_WTOFF = 1; + } + else + Fatal(BAD_PARM); + break; + + /* d disable */ + case 'd': + if(switches.SWITCH_D || switches.SWITCH_E) + Fatal(SWTCH_CONF); + switches.SWITCH_D = 1; + break; + + /* e enable */ + case 'e': + if(switches.SWITCH_D || switches.SWITCH_E) + Fatal(SWTCH_CONF); + switches.SWITCH_E = 1; + break; + + /* l lock */ + case 'l': + if(switches.SWITCH_L || switches.SWITCH_U) + Fatal(SWTCH_CONF); + switches.SWITCH_L = 1; + break; + + /* u unlock */ + case 'u': + if(switches.SWITCH_L || switches.SWITCH_U) + Fatal(SWTCH_CONF); + switches.SWITCH_U = 1; + break; + + /* i invalidate */ + case 'i': + if(switches.SWITCH_I) + Fatal(SWTCH_CONF); + switches.SWITCH_I = 1; + break; + + /* f flush */ + case 'f': + if(switches.SWITCH_F) + Fatal(SWTCH_CONF); + switches.SWITCH_F = 1; + break; + + /* r on or off */ + case 'r': + if(switches.SWITCH_RON || switches.SWITCH_ROFF) + Fatal(SWTCH_CONF); + cptr = GetOnOff(cptr,&boolval); + if(boolval) + switches.SWITCH_RON = 1; + else + switches.SWITCH_ROFF = 1; + break; + + default: + Fatal(BAD_PARM); + + } + if(*cptr != '\0') /* must be at end of argument */ + Fatal(BAD_PARM); + ++argv; /* next argument */ + } + + /* Open the device */ + + if((handle = IOCTLOpen("SMARTAAR")) == -1) + Fatal(NO_DEV_MESS); + + /* Perform the actions indicated by the arguments */ + + if(switches.SWITCH_I) { + if(IOCTLWrite(handle,"\x01",1) == -1) + FatalC(handle,IOCTL_BAD_MESS); + } + + if(switches.SWITCH_F) { + if(IOCTLWrite(handle,"\x00",1) == -1) + FatalC(handle,IOCTL_BAD_MESS); + } + + if(switches.SWITCH_WTON) { + if(IOCTLWrite(handle,"\x04\x01",2) == -1) + FatalC(handle,IOCTL_BAD_MESS); + } + else if(switches.SWITCH_WTOFF) { + if(IOCTLWrite(handle,"\x04\x00",2) == -1) + FatalC(handle,IOCTL_BAD_MESS); + } + + if(switches.SWITCH_WCON) { + if(IOCTLWrite(handle,"\x04\x03",2) == -1) + FatalC(handle,IOCTL_BAD_MESS); + } + else if(switches.SWITCH_WCOFF) { + if(IOCTLWrite(handle,"\x04\x02",2) == -1) + FatalC(handle,IOCTL_BAD_MESS); + } + + if(switches.SWITCH_L) { + if(IOCTLWrite(handle,"\x06",1) == -1) + FatalC(handle,IOCTL_BAD_MESS); + } + else if(switches.SWITCH_U) { + if(IOCTLWrite(handle,"\x07",1) == -1) + FatalC(handle,IOCTL_BAD_MESS); + } + + if(switches.SWITCH_T) { + if(IOCTLWrite(handle,&tickpacket.Tchar,3) == -1) + FatalC(handle,IOCTL_BAD_MESS); + } + + if(switches.SWITCH_RON) { + if(IOCTLWrite(handle,"\x08\x01",2) == -1) + FatalC(handle,IOCTL_BAD_MESS); + } + else if(switches.SWITCH_ROFF) { + if(IOCTLWrite(handle,"\x08\x00",2) == -1) + FatalC(handle,IOCTL_BAD_MESS); + } + + if(switches.SWITCH_CON) { + if(IOCTLWrite(handle,"\x0A\x01",2) == -1) + FatalC(handle,IOCTL_BAD_MESS); + } + else if(switches.SWITCH_COFF) { + if(IOCTLWrite(handle,"\x0A\x00",2) == -1) + FatalC(handle,IOCTL_BAD_MESS); + } + + if(switches.SWITCH_E) { + if(IOCTLWrite(handle,"\x03",1) == -1) + FatalC(handle,IOCTL_BAD_MESS); + } + else if(switches.SWITCH_D) { + if(IOCTLWrite(handle,"\x02",1) == -1) + FatalC(handle,IOCTL_BAD_MESS); + } + + if(switches.SWITCH_S || switches.SWITCH_SR || switches.SWITCH_SX) { + if(IOCTLRead(handle,&config,sizeof(config)) == -1) + FatalC(handle,IOCTL_BAD_MESS); + if(config.nuldev != 0) + printf(STATUS_MES1); + else { + printf(STATUS_MES2); + if(config.enable_13 != 0) + printf(CACHE_MES,ENSTRING); + else + printf(CACHE_MES,DISSTRING); + if(config.lock_cache != 0) + printf(L_MES,LOCKSTRING); + else + printf(L_MES,UNLSTRING); + + if(config.write_buff != 0) + printf(WB_MES,ONSTRING); + else + printf(WB_MES,OFFSTRING); + if(config.reboot_flush != 0) + printf(REBOOT_MES,ONSTRING); + else + printf(REBOOT_MES,OFFSTRING); + + if(config.all_cache != 0) + printf(C_MES,ONSTRING); + else + printf(C_MES,OFFSTRING); + if(config.write_through != 0) + printf(WT_MES,ONSTRING); + else + printf(WT_MES,OFFSTRING); + + if(config.ticksetting == 0) { + minutes = 60; + seconds = 1; + } + else { + seconds = ((unsigned long)config.ticksetting * 10) / 182; + minutes = seconds / 60; + seconds = seconds % 60; + } + printf(T_MES,minutes,seconds,config.ticksetting); + + if(switches.SWITCH_SR) { + if(IOCTLWrite(handle,"\x09",1) == -1) + FatalC(handle,IOCTL_BAD_MESS); + /* get the status again so that the extended status has the reset */ + if(IOCTLRead(handle,&config,sizeof(config)) == -1) + FatalC(handle,IOCTL_BAD_MESS); + } + if(switches.SWITCH_SX || switches.SWITCH_SR) { + if(config.total_writes == 0) + printf(STATUS_3W,config.write_hits,config.total_writes,(unsigned int) 0); + else + printf(STATUS_3W,config.write_hits,config.total_writes,(unsigned int)(config.write_hits*100/config.total_writes)); + if(config.total_reads == 0) + printf(STATUS_3R,config.read_hits,config.total_reads,(unsigned int) 0); + else + printf(STATUS_3R,config.read_hits,config.total_reads,(unsigned int)(config.read_hits*100/config.total_reads)); + total_ops = config.total_reads + config.total_writes; + total_hits = config.read_hits + config.write_hits; + if(total_ops == 0) + printf(STATUS_3T,total_hits,total_ops,(unsigned int) 0); + else + printf(STATUS_3T,total_hits,total_ops,(unsigned int)(total_hits*100/total_ops)); + printf(STATUS_4,config.ttracks,config.total_used,config.total_locked,config.total_dirty); + printf(STATUS_5,config.current_size,config.initial_size,config.minimum_size); + } + } + } + + /* Close the device, and done */ + + IOCTLClose(handle); + exit(0); +} + +/* + * Fatal -- Fatal (to flush13) error + * + * ENTRY: p is pointer to error message to print + * + * NOTES: + * + * EXIT: exit(-1) + * + */ +Fatal(p) +char *p; +{ + fprintf(stderr,"\n%s\n",p); + exit(-1); +} + +/* + * FatalC -- Fatal (to flush13) error, and close open handle + * + * ENTRY: p is pointer to error message to print + * hand is handle number of open device channel to close + * + * NOTES: + * + * EXIT: To Fatal + * + */ +FatalC(hand,p) +int hand; +char *p; +{ + IOCTLClose(hand); + Fatal(p); +} diff --git a/v4.0/src/DEV/SMARTDRV/FLUSH13.LNK b/v4.0/src/DEV/SMARTDRV/FLUSH13.LNK new file mode 100644 index 0000000..16fb1dd --- /dev/null +++ b/v4.0/src/DEV/SMARTDRV/FLUSH13.LNK @@ -0,0 +1,4 @@ +flush13.obj fl13.obj flmes.obj +flush13.exe /m + + diff --git a/v4.0/src/DEV/SMARTDRV/INT13.DOC b/v4.0/src/DEV/SMARTDRV/INT13.DOC new file mode 100644 index 0000000..3e1917b --- /dev/null +++ b/v4.0/src/DEV/SMARTDRV/INT13.DOC @@ -0,0 +1,369 @@ +mINT13.SYS is an MS-DOS device driver which implements a memory cache +for data referenced on IBM-PC XT/AT Hard disks. It caches at the +"INT 13H" level and caches tracks. + +NOTE WARNING: There is a "re-boot" bug in RAMDrive version 1.16. When + INT13 and RAMDrive are both installed, it is possible + that Ctrl-Alt-Del will not work. This problem is "fixed" + by updating your RAMDrive to version 1.17 or later. + +IN CONFIG.SYS: + + device = [d:][path]int13.sys [bbbb] [/e | /a] [/d] [/wt:on] [/wc:off] + [/t:nnnnn] [/r:on] [/c:on] + + bbbb First numeric argument, if present, is cache size + in K bytes. Default value is 256. Min is 128. Max + is 4096 (4 Meg). + + /e Specifies that PC AT Extended Memory is to be used. + It is an error if /E is specified on a machine other + than an IBM PC AT. /E is the default. + + NOTE: There is 1k of INT13 overhead. That is to say, + if there are 512k bytes of extended memory, there + will be 511k bytes available for assignment to INT13. + + /a Specifies that Above Board memory is to be used. It + is an error if the above board device driver is not + present. + + Neither /A or /E Specifies /E + + NOTE: THESE ARE THE ONLY CONFIGURATIONS. You must either have an + Above Board (or compatible), or you must have extended memory + on an IBM PC-AT (or compatible). + + /d Disable caching. Causes INT13 to come up with caching + disabled (default is enabled). + + /wt:on Enable write through. When INT13 is + caching write information, it is a good idea to imply + a flush of the cache on some operations so that in + case of a crash or power failure the information in + the cache which is not on the disk will not be lost. + /wt:on enables write through on full track INT 13s which + are to tracks not currently in the cache. /wt:off + disables it. INT13 is faster with write through + disabled, at the expense of there being a bigger risk of + loosing data. /wt:on IS NOT a substitute for flushing + before a re-boot!!!! The write through mechanism is far + from perfect, all it is is a risk REDUCER, not a risk + eliminator. Write through is off by default. + + /wc:off - Disable write caching. There is risk when + caching "dirty" information that the system will crash, + or be re-booted, or be turned off before this + information can be written to the disk. This may + corrupt the disk. This risk can be ELIMINATED, at the + expense of cache performance, by NOT caching any dirty + information. /wc:off disables the caching of dirty + information, eliminating the risk. Write caching is + on by default. + + /t:nnnnn - Set the auto flush interval. INT13 listens on the + system timer to note the passage of time and "age" the + dirty information in the cache. Every nnnnn ticks, + the cache is flushed. The timer ticks 18.2 times a + second. + + nnnnn | + =========================================== + 18 | Flush every second + 1092 | Flush every minute + 5460 | Flush every 5 minutes + 10920 | Flush every 10 minutes + 21840 | Flush every 20 minutes + 32760 | Flush every 30 minutes + 65520 | Flush every hour + + The default setting of nnnnn is 1092 or every minute. + nnnnn = 0 causes a wait for 65536 ticks which is a + little over an hour. The max value for nnnnn is 65535. + + /r:on - Enable re-boot flush. + This enables the flush on re-boot logic. The default + is /r:off. This enables a flush in the Ctrl-Alt-Del + keyboard re-boot logic. NOTE WARNING DANGER!!!!!!!! + Enabling this feature can cause strange system behavior. + You will have to type Ctrl-Alt-Del twice at least. This + can adversly effect other software in the system. + The result of this can be very unpredictable. + + /c:on - Enable all cache on reads. + Normally INT13 does not cache EVERY I/O. Whenever + it sees a full track I/O which is not currently in + the cache, it DOES NOT cache that track. This is + an optimization for "typical" operation, and actually + increases performance. This is the default setting + (/c:off). There may be some cases where it is desirable + that ALL reads be cached. One example is that you are + "loading" the cache prior to locking it with FLUSH13 /l. + With /c:off, some pieces of what you're trying to load + may not get into the cache. Another example is that + you continually access in a sequential manner (like + program load) some large file which happens to be + contiguous on the disk. Again, there may be some "piece" + of the file which does not get into the cache with + /c:off. /c:on enables the caching of ALL reads. + NOTE: The same "don't bother caching operations which + are full track and not in the cache" applies + to writes as well. /c has NO EFFECT on this + behavior however. /c only effects read operations. + + + +MESSAGES: + + + INT13: Above Board Memory Manager not present + +The /A switch was given but INT13 could not detect the presence of the +Above Board memory manager. You need to have a + + device = EMM.SYS + +line in your CONFIG.SYS file before you have any device = int13.sys +lines. INT13 will install a driver, but it will be non-functional. + + + INT13: Above Board Memory Status shows error + +During the process of trying to set up the cache in Above Board memory +an error was detected. Run the Above Board Confidence test to test +your Above Board memory. INT13 will install a driver, but it will be +non-functional. + + + INT13: Computer must be PC-AT, or PC-AT compatible + +The /E switch can only be given on an IBM PC AT or an IBM PC AT +compatible computer that has the FCH model byte (byte at FFFF:000E). +INT13 will install a driver, but it will be non-functional. + + + INT13: No extended memory available + +Your system has NO memory for RAMDrive drives. +INT13 will install a driver, but it will be non-functional. + + + INT13: Insufficient memory + +Your system has some memory available for INT13 cache, but not enough +to set up a driver. INT13 will install a driver, but it will be non-functional. + + + INT13: Invalid parameter + +You specified too many parameters, your numeric parameter is not +valid, you specified conflicting or too many switches. Edit your CONFIG.SYS +file and fix the INT13 line. INT13 will install a driver, but it will +be non-functional. + + + INT13: Incorrect DOS version + +INT13 only runs on 2.X and 3.X versions of DOS. +INT13 will install a driver, but it will be non-functional. + + + INT13: I/O error accessing cache memory + +During the set up of the INT13 cache, an error was detected trying to +access the cache memory. Run any memory tests you have that will +exercise your extended or expanded memory. +INT13 will install a driver, but it will be non-functional. + + + INT13: No hardfiles on system + +INT13 could not find any hardfiles on your system. Only hardfiles +which are compatible with IBM hardfiles at the ROM BIOS INT 13H +level can be supported. INT13 will install a driver, but it will +be non-functional. + + + INT13: Too many bytes per track on hardfile + +One of the hardfiles on your system defined a very large track. +This track is too large for INT13 to be able to cache it. +INT13 will install a driver, but it will be non-functional. + + + Microsoft INT13 Cache version Y.YY + +INT13 Header message, Y.YY is the version of INT13. + + + Cache size: nnnnk in UUUUUU Memory + Room for tttt tracks of ssss sectors each + +This is an informational message from INT13 telling you how many Kilo Bytes +of memory were assigned to the cache and what type of memory it is, how many +tracks this allows to be buffered and how many sectors there are per track. + +NOTE: There is nothing to "prevent" you from having two device = INT13.SYS + lines in your CONFIG.SYS file, but you should not do this. Very + unpredictable behavior will occur, and FLUSH13 will only "talk" to + one of them. + +INT13 has several behavior aspects that can be changed. This is done +with the FLUSH13 utility. + + FLUSH13 [/s|/sx|/sr] [/d|/e] [/l|/u] [/i] [/f] [/wt:on|/wt:off] + [/wc:on|/wc:off] [/t:nnnnn] [/r:on|/r:off] [/c:on|/c:off] + + No arguments - This causes FLUSH13 to flush out any "dirty" + tracks in the INT13 cache. A "dirty" track is one + which has been written into the cache, but not yet + written to the disk. This invokation causes all dirty tracks + to be written out to the disk so that the system can + be re-booted or turned off. NOTE: FAILURE TO FLUSH + THE CACHE BEFORE A RE-BOOT OR POWER OFF CAN CAUSE THE + INFORMATION ON THE HARDFILE TO BE CORRUPTED. + + /f - Flush. Same as the no arguments case, but allows you to + perform the flush and do something else (like /s). + + /i - Flush and invalidate. This is the same as the no argument + case except that all of the information in the cache + is also discarded. This makes the cache EMPTY. + + /d - Disable caching. This causes all dirty cache information + to be flushed and all caching to stop. + + /e - Enable caching. This causes caching to be enabled after + a previous /d disable. When INT13 is started it is enabled. + + /l - Lock the cache. This causes all dirty information to be + flushed, and the cache contents to be locked in the cache. + When in this mode the locked elements will not be discarded + to make room for new tracks. This can be used + to "load" the cache with desired things. For instance if + you use the "foobar" program a lot, you can run foobar, + causing it to be loaded into the cache, then lock the cache. + This causes the foobar program to always be in the cache. + You may lock the cache as many times as you want. Each lock + causes the current information (including any previously + locked information) to be locked. + NOTE: Information in a locked cache is READ ONLY!! Any write + operation on information in a locked cache causes the + information to be unlocked. + + /u - Unlock the cache. This undoes a previous /l and returns + the cache to normal operation. + + /s - Print status. This displays the settings of the setable + device parameters. + /sx - Print extended status. Same as /s, only additional + Statistical information is also given. + /sr - Reset statistics. Same as /sx, only the additional + Statistical information is reset to 0. + + /wt:on off - Enable or Disable write through. When INT13 is caching + write information, it is a good idea to imply a flush of + the cache on some operations so that in case of a crash or + power failure the information in the cache which is not on + the disk will not be lost. /wt:on enables write through on full + track INT 13s which are to tracks not currently in the cache. + /wt:off disables it. INT13 is faster with write through + off, at the expense of there being a bigger risk of + loosing data. /wt:on IS NOT a substitute for flushing before + a re-boot!!!! This write through mechanism is far from perfect, + all it is is a risk REDUCER, not a risk eliminator. /wt:off + is the setting when INT13 is started. + + /wc:on off - Enable or Disable write caching. There is risk when + caching "dirty" information that the system will crash, + or be re-booted, or be turned off before this information + can be written to the disk. This may corrupt the disk. + This risk can be ELIMINATED, at the expense of cache + performance, by NOT caching any dirty information. + /wc:off disables the caching of dirty information, + eliminating the risk. /wc:on enables the caching of dirty + information. /wc:on is the default when INT13 is started. + + WARNING: You must be careful to flush the cache before + re-booting the system, or turning it off if /wc:on is selected. + You should also be careful to disable the cache (/d), or do + /wc:off before running any program under development which + has a chance of crashing due to bugs. + + NOTE: When /wc:off is selected, write info CAN get into + the cache (when the write is to a track which is currently + in the cache). The difference is that this "dirty" information + is IMMEDIATELY written out to the disk instead of being + held in the cache in the "dirty" state. When the write is + to a track that is not in the cache, it will be passed + through to the disk without being cached. + + /t:nnnnn - Set the auto flush interval. INT13 listens on the system + timer to note the passage of time and "age" the dirty + information in the cache. Every nnnnn ticks, the cache is + flushed. The timer ticks 18.2 times a second. + + nnnnn | + =========================================== + 18 | Flush every second + 1092 | Flush every minute + 5460 | Flush every 5 minutes + 10920 | Flush every 10 minutes + 21840 | Flush every 20 minutes + 32760 | Flush every 30 minutes + 65520 | Flush every hour + + The default setting of nnnnn is 1092 or every minute. + NOTE: There is no way to "disable" this tick aging. Setting + nnnnn = 0 causes a wait for 65536 ticks which is a + little over an hour. The max value for nnnnn is 65535. + Disabling the cache (/d), or turning write caching + off (/wc:off) effectively prevents the aging from + doing anything as there is never anything to flush + in these cases. Setting very low values of nnnnn + should be avoided as it places a lot of overhead into + the timer interrupt service. Rather than set low values, + it is better to just turn off write caching (/wc:off). + NOTE: As stated above, the max value for nnnnn is 65535. It + should be noted however that FLUSH13 DOES NOT object if + you specify a number larger than this! It will simply + use only the low 16 bits of the number. + + /r:on off - En/Disable reboot flush. + INT13 has a provision for detecting Ctrl-Alt-Del user + reboots. /r:on enables a flush of the cache at this time + to prevent the disks from being corrupted. The default + setting is /r:off. NOTE WARNING DANGER!!!!! Enabling + this feature can prevent disks from being damaged BUT + the mechanism has flaws. For one, you will have to hit + Ctrl-Alt-Del a second time to get the system to reboot. + YOU MUST NOT POUND ON THE KEY. You will crash the system if + you do. Hit the key ONCE, if the system re-boots, fine. If + there is info to flush out of the cache, the drive light + will come on and the system will probably NOT reboot. WAIT + until the drive light is OFF before hitting Ctrl-Alt-Del + again. This feature of INT13 MAY NOT WORK with other + software in the system. USER BEWARE!!!!!!!!!!!!!!!!!!! + + /c:on off - En/Disable all cache on reads. + Normally INT13 does not cache EVERY I/O. Whenever + it sees a full track I/O which is not currently in + the cache, it DOES NOT cache that track. This is + an optimization for "typical" operation, and actually + increases performance. This is the default setting + (/c:off). There may be some cases where it is desirable + that ALL reads be cached. One example is that you are + "loading" the cache prior to locking it with FLUSH13 /l. + With /c:off, some pieces of what you're trying to load + may not get into the cache. Another example is that + you continually access in a sequential manner (like + program load) some large file which happens to be + contiguous on the disk. Again, there may be some "piece" + of the file which does not get into the cache with + /c:off. /c:on enables the caching of ALL reads. + NOTE: The same "don't bother caching operations which + are full track and not in the cache" applies + to writes as well. /c has NO EFFECT on this + behavior however. /c only effects read operations. + +If invalid or conflicting arguments are given, FLUSH13 prints a usage line. diff --git a/v4.0/src/DEV/SMARTDRV/LOADALL.ASM b/v4.0/src/DEV/SMARTDRV/LOADALL.ASM new file mode 100644 index 0000000..0476acd --- /dev/null +++ b/v4.0/src/DEV/SMARTDRV/LOADALL.ASM @@ -0,0 +1,35 @@ +BREAK + +DEF_ACCESS EQU 92H +DEF_LIMIT EQU 0FFFFH + +SEGREG_DESCRIPTOR STRUC +SEG_BASE DW ? + DB ? +SEG_ACCESS DB DEF_ACCESS +SEG_LIMIT DW DEF_LIMIT +SEGREG_DESCRIPTOR ENDS + +DTR_DESCRIPTOR STRUC +DTR_BASE DW ? + DB ? + DB 0 +DTR_LIMIT DW ? +DTR_DESCRIPTOR ENDS +; +; 386 Descriptor template +; +desc struc +lim_0_15 dw 0 ; limit bits (0..15) +bas_0_15 dw 0 ; base bits (0..15) +bas_16_23 db 0 ; base bits (16..23) +access db 0 ; access byte +gran db 0 ; granularity byte +bas_24_31 db 0 ; base bits (24..31) +desc ends + +gdt_descriptor struc +gdt_limit dw ? +gdt_base_0 dw ? +gdt_base_2 dw ? +gdt_descriptor ends diff --git a/v4.0/src/DEV/SMARTDRV/MAKEFILE b/v4.0/src/DEV/SMARTDRV/MAKEFILE new file mode 100644 index 0000000..80b7706 --- /dev/null +++ b/v4.0/src/DEV/SMARTDRV/MAKEFILE @@ -0,0 +1,19 @@ +# rules and dependencies follow +# +# use microsoft make to build +# +# set up build environment - include and library for c +# + +all: smartdrv.sys + +smartdrv.obj: smartdrv.asm mi.asm loadall.asm \ + syscall.asm emm.asm above.asm \ + devsym.asm + masm smartdrv.asm; + +smartdrv.exe: smartdrv.obj + link smartdrv,,smartdrv/M; + +smartdrv.sys: smartdrv.exe + exe2bin smartdrv smartdrv.sys diff --git a/v4.0/src/DEV/SMARTDRV/MI.ASM b/v4.0/src/DEV/SMARTDRV/MI.ASM new file mode 100644 index 0000000..9d8efed --- /dev/null +++ b/v4.0/src/DEV/SMARTDRV/MI.ASM @@ -0,0 +1,18 @@ +BREAK + +mi_INT EQU 0CDh +mi_Long_JMP EQU 0EAh +mi_Long_CALL EQU 09Ah +mi_Long_RET EQU 0CBh +mi_Near_RET EQU 0C3h + +; xxxxoditszxaxpxc +f_Overflow EQU 0000100000000000B +f_Direction EQU 0000010000000000B +f_Interrupt EQU 0000001000000000B +f_Trace EQU 0000000100000000B +f_Sign EQU 0000000010000000B +f_Zero EQU 0000000001000000B +f_Aux EQU 0000000000010000B +f_Parity EQU 0000000000000100B +f_Carry EQU 0000000000000001B diff --git a/v4.0/src/DEV/SMARTDRV/OLI.CMP b/v4.0/src/DEV/SMARTDRV/OLI.CMP new file mode 100644 index 0000000..8a9a767 --- /dev/null +++ b/v4.0/src/DEV/SMARTDRV/OLI.CMP @@ -0,0 +1,464 @@ +CMP V2.13 Copyright (C) 1984, 1985 by White Heron Corporation + All rights reserved + + old: smartdrv.asm (on the left) Note: < marks old lines. + new: a:smartdrv.asm (on the right) > marks new lines. + +=============================================================================== + +6<; Will use IBM extended memory on PC-AT or +7<; use Above Board on PC, XT, or AT +8<; +9<; +10<; device = SMARTDRV.sys [bbbb] [/a] + + ----> changed to the following: + +6>;; Will use IBM extended memory on PC-AT or +7>;; use Above Board on PC, XT, or AT, and +8>;; use extended, expanded, or upper extended memory on AT&T 6300 PLUS +9>; +10>; +11>;; device = SMARTDRV.sys [bbbb] [/a] [/u] + +=============================================================================== + +40<; + + ----> changed to the following: + +41>;; /u Specifies that upper extended memory will be used +42>;; on the AT&T 6300 PLUS. Upper extended memory +43>;; is the memory beginning at FA0000. It is used +44>;; to hold the UNIX kernel when the machine is running +45>;; Simul-Task. However, when operating as a pure +46>;; MS-DOS machine, this 384K of memory is available +47>;; for SMARTDRIVE. +48>;; Note that it is an error to specify this switch +49>;; if the machine is not a 6300 PLUS. + +=============================================================================== + +102>;; ?.?? 7/24/87 WSH Added 6300 PLUS support. This code is marked by +103>;; the use of double semi-colons to make it easy to +104>;; find. + + ----> inserted before the following old file line: + +93< + +=============================================================================== + +125> +126>;; In order to address memory above 1 MB on the AT&T 6300 PLUS, it is +127>;; necessary to use the special OS-MERGE hardware to activate lines +128>;; A20 to A23. However, these lines can be disabled only by resetting +129>;; the processor. The return address offset and segment can be found +130>;; at 40:a2, noted here as RealLoc1. +131>;; +132>BiosSeg segment at 40h ;; Used to locate 6300 PLUS reset address +133> org 00a2h +134>RealLoc1 dd 0 +135>BiosSeg ends + + ----> inserted before the following old file line: + +113< + +=============================================================================== + +147>;; The /U configuration using upper extended memory on the +148>;; 6300 PLUS is a special case of the type 1 configuration. + + ----> inserted before the following old file line: + +124<; + +=============================================================================== + +327>;; The internal name of the device driver has been changed from SMARTDRV +328>;; to SMARTAAR to avoid DOS name conflicts with files named SMARTDRV.* +329>;; + + ----> inserted before the following old file line: + +302 changed to the following: + +335> DB "SMARTAAR" ;Name of device + +=============================================================================== + +387>;; Data peculiar to AT&T 6300 PLUS. +388> +389>S5_FLAG DB 0 ;; If set, computer is a 6300 PLUS + + ----> inserted before the following old file line: + +359< + +=============================================================================== + +3074>;; NOTE: The value at BASE_ADDR is patched during initialization when +3075>;; loading a RAMDrive into upper extended memory on a PLUS +3076>;; + + ----> inserted before the following old file line: + +3043 changed to the following: + +3224> +3225>;; +3226>;; Enable address line 20 on the PC AT or activate A20-A23 on the 6300 PLUS. +3227>;; The former can be done by placing 0dfh in AH and activating the keyboard +3228>;; processor. On the PLUS, 90h goes in AL and the port at 03f20h is written. +3229>;; So the combined value of 0df90h can be used for both machines with +3230>;; appropriate coding of the called routine A20. +3231>;; +3232> +3233>;; MOV AH,0DFH +3234> mov ax,0df90h ;; set up for PLUS or AT + +=============================================================================== + +3248< MOV AH,0DDH +3249< CALL A20 ; Disable address line 20 + + ----> changed to the following: + +3292> +3293>;; +3294>;; Reset of line A20 on the PC AT requires writing 0ddh to the keyboard +3295>;; processor. On the PLUS, the appropriate value is 00. +3296>;; +3297> +3298>;; MOV AH,0DDH +3299> mov ax,0DD00h ;; setup for PLUS or AT. ah for IBM, al for PLUS +3300> CALL A20 ; Disable address line 20 + +=============================================================================== + +3331>;; CS override needed on S5_FLAG to avoid phase errors on +3332>;; forward declaration of this variable. +3333> cmp cs:[S5_FLAG],0 ;; test for 6300 PLUS +3334> jnz A20S5 ;; yes, do this code + + ----> inserted before the following old file line: + +3280< CLI + +=============================================================================== + +3376> +3377>;;* A20S5 - Address enable/disable routine for the 6300 PLUS. +3378>;; +3379>;; This routine enables lines A20-A23 on the PLUS by writing +3380>;; to port 03f20h. Bit 7 turns the lines on, and bit 4 sets +3381>;; the power-up bit. To disable the lines, the processor +3382>;; must be reset. This is done by saving the world and +3383>;; jumping to the ROM 80286 reset code. Since the power-up bit +3384>;; is set, the data segment is set to the BiosSeg at 40h +3385>;; and a jump is then made to the address at RealLoc1. +3386>;; At RealLoc1, one can find the CS:IP where the code +3387>;; is to continue. +3388>;; +3389>;; Uses ax, flags. +3390>;; Returns with zero flag set. +3391>;; +3392>A20S5: +3393> cli +3394> or al,al ;; if zero, then resetting processor +3395> jnz A20S5Next +3396> call RSet ;; must return with entry value of ax +3397>A20S5Next: +3398> push dx ;; set/reset port +3399> mov dx,3f20h +3400> out dx,al +3401> pop dx +3402> xor al,al +3403> STI +3404> RET +3405> +3406>;;* a20S5BOOT - This code bypasses the processor reset on a reboot +3407>;; of the 6300 PLUS. Otherwise the machine hangs. +3408>a20s5BOOT: ;; use this code before reboot +3409> cli +3410> jmp short a20s5next +3411> +3412>OldStackSeg dw 0 ;; used during PLUS processor reset +3413> ;; to save the stack segment +3414> +3415>;;* Rset - Reset the 80286 in order to turn off the address lines +3416>;; on the 6300 PLUS. Only way to do this on the +3417>;; current hardware. The processor itself can be +3418>;; reset by reading or writing prot 03f00h +3419>;; +3420>;; Uses flags. +3421>;; +3422>RSet: +3423> pusha ;; save world +3424> push ds ;; save segments +3425> push es +3426> mov ax,BiosSeg ;; point to the bios segment +3427> mov ds,ax ;; ds -> 40h +3428>assume ds:BiosSeg +3429> push word ptr [RealLoc1] ;; save what might have been here +3430> push word ptr [RealLoc1+2] +3431> mov word ptr [RealLoc1],cs:[offset ReturnBack] ;; load our return address +3432> mov word ptr [RealLoc1+2],cs +3433>assume ds:nothing +3434> mov [OldStackSeg],ss ;; save the stack segment, too +3435> mov dx,03f00h ;; reset the processor +3436> in ax,dx +3437> nop +3438> nop +3439> nop +3440> cli +3441> hlt ;; should never get here +3442>ReturnBack: +3443> mov ss,[OldStackSeg] ;; start the recovery +3444>assume ds:BiosSeg +3445> pop word ptr [RealLoc1+2] +3446> pop word ptr [RealLoc1] +3447> pop es +3448> pop ds +3449> popa +3450> ret + + ----> inserted before the following old file line: + +3321< + +=============================================================================== + +3530<; out any dirty tracks take a LONG time, so long that we loose + + ----> changed to the following: + +3660>; out any dirty tracks take a LONG time, so long that we lose + +=============================================================================== + +3652< ; Reset INT 1C vector to trun cache off + + ----> changed to the following: + +3782> ; Reset INT 1C vector to turn cache off + +=============================================================================== + +3732< MOV AH,0DFH + + ----> changed to the following: + +3862>;; MOV AH,0DFH +3863> mov ax,0df90h ;; set up for PLUS or AT + +=============================================================================== + +3775< MOV AH,0DDH ; Disable adress line 20 +3776< CALL A20 + + ----> changed to the following: + +3906>;; MOV AH,0DDH ; Disable adress line 20 +3907> mov ax,0DD00h ;; setup for PLUS or AT. ah for IBM, al for PLUS +3908> cmp [S5_FLAG],0 +3909> jz OFF20A +3910> call a20s5boot ;; Don't reset the processor on PLUS, this time +3911> jmp short off20b +3912>off20a: +3913> CALL A20 +3914>off20b: + +=============================================================================== + +4078> +4079>U_SWITCH db 0 ;; upper extended memory requested on 6300 PLUS + + ----> inserted before the following old file line: + +3940< + +=============================================================================== + +4274> +4275>;; +4276>;; 2.5 Check here for 6300 PLUS machine. First look for Olivetti copyright, +4277>;; and if found, check id byte at f000:fffd. +4278>;; +4279> +4280> push es ;; Olivetti Machine? +4281> mov ax,0fc00h ;; Look for 'OL' at fc00:50 +4282> mov es,ax +4283> cmp es:[0050h],'LO' +4284> jnz notS5 ;; not found +4285> mov ax,0f000h +4286> mov es,ax +4287> cmp word ptr es:[0fffdh],0fc00h ;; look for 6300 plus +4288> jnz notS5 +4289> dec [S5_FLAG] ;; yep, set flag +4290>notS5: +4291> pop es +4292> + + ----> inserted before the following old file line: + +4134<; + +=============================================================================== + +4411>;; Added for /u switch +4412> cmp al,'u' ;; Look for U switch for PLUS +4413> jnz A_TEST +4414> cmp [S5_FLAG],0 ;; No good unless PLUS +4415> jz bad_parm +4416> TEST [GOTSWITCH],SWITCH_A ;; Already have switch A ? +4417> JNZ BAD_PARM +4418> cmp [U_SWITCH],0 +4419> jne bad_parm +4420> dec [U_SWITCH] +4421> jmp scan_loop +4422>A_TEST: +4423>;; + + ----> inserted before the following old file line: + +4252< CMP AL,"a" + +=============================================================================== + +4435>;; added for /u switch +4436> cmp [U_SWITCH],0 +4437> jne bad_parm +4438>;; + + ----> inserted before the following old file line: + +4263< OR [GOTSWITCH],SWITCH_A + +=============================================================================== + +4847>;; Note: When using upper extended memory on the PLUS, the value +4848>;; at BASE_RESET + 2 is patched to FA during initialization. +4849>;; + + ----> inserted before the following old file line: + +4671 cmp U_SWITCH,0 ;; don't do this for at&t 6300 plus +5313> jnz ret005 + + ----> inserted before the following old file line: + +5133< PUSH AX + +=============================================================================== + +5394> +5395>;; If upper extended memory is used on the PLUS, it is necessary to +5396>;; patch the values of base_reset and base_addr to get the addressing right. +5397>;; +5398> cmp [U_SWITCH],0 ;; patch the code for /U option +5399> jz AT001A +5400> mov ax,00fah +5401> mov word ptr [base_reset+2],ax ;; patching upper address +5402> mov word ptr [base_addr+2],ax ;; to FA from 10 +5403>AT001A: +5404> + + ----> inserted before the following old file line: + +5213< MOV AX,8800H + +=============================================================================== + +5214< INT 15H ; Get extended memory size + + ----> changed to the following: + +5406> INT 15H ; Get extended memory size + +=============================================================================== + +5410> +5411>;; If running on a 6300 PLUS, it is necessary to subtract any upper extended +5412>;; memory from the value obtained by int 15 to determine the correct memory +5413>;; available for a type /E RAMDrive. If loading a /U RAMDrive, it is necessary +5414>;; to find out if there IS any upper extended memory. +5415> +5416> cmp [U_SWITCH],0 ;; did we ask for upper extended memory +5417> jz olstuff ;; no +5418> call UpperMemCheck ;; yes, see if anything there +5419> jc ERR_RET ;; no, quit +5420> mov ax,384 ;; yes, but max allowed is 384K +5421> jmp short at001b +5422>olstuff: +5423> cmp [S5_FLAG],0 ;; if not 6300 PLUS, go on +5424> jz at001b +5425> call UpperMemCheck ;; yes, see if 384K is there +5426> jc at001b ;; no, so int 15h is right +5427> sub ax,384 ;; yes, subtract 384K +5428>AT001B: +5429> + + ----> inserted before the following old file line: + +5218< MOV DX,OFFSET ERRMSG2 + +=============================================================================== + +5466> +5467>;;* UpperMemCheck - Called by 6300 PLUS to verify existence of +5468>;; upper extended memory of 384K at FA0000h +5469>;; +5470>;; Returns carry set if no upper extended memory. +5471>;; +5472>;; This routine is called only by a 6300 PLUS, and +5473>;; it reads the hardware switch DSW2 to do the job. +5474>;; +5475>UpperMemCheck: +5476> push ax +5477> in al,66h +5478> and al,00001111b +5479> cmp al,00001011b +5480> pop ax +5481> jnz nomem +5482> clc +5483> ret +5484>nomem: +5485> stc +5486> ret + + ----> inserted before the following old file line: + +5254< + +=============================================================================== + +6301>s5flagmsg db " = S5 flag",13,10,"$" +6302>U_msg db " = U Switch", 13,10,'$' + + ----> inserted before the following old file line: + +6068 + +; +; Define I/O packet offsets for useful values. +; +; SEE ALSO +; MS-DOS Technical Reference manual section on Installable Device Drivers +; + +; READ/WRITE PACKET OFFSETS +RW_COUNT EQU WORD PTR (SIZE SRHEAD) + 5 +RW_TRANS EQU DWORD PTR (SIZE SRHEAD) + 1 +RW_START EQU WORD PTR (SIZE SRHEAD) + 7 + +; MEDIA CHECK PACKET OFFSETS +MCH_RETVAL EQU BYTE PTR (SIZE SRHEAD) + 1 +MCH_MEDIA EQU BYTE PTR (SIZE SRHEAD) + 0 + +; BUILD BPB PACKET OFFSETS +BPB_BUFFER EQU DWORD PTR (SIZE SRHEAD) + 1 +BPB_MEDIA EQU BYTE PTR (SIZE SRHEAD) + 0 +BPB_BPB EQU DWORD PTR (SIZE SRHEAD) + 5 + +; INIT PACKET OFFSETS +INIT_NUM EQU BYTE PTR (SIZE SRHEAD) + 0 +INIT_BREAK EQU DWORD PTR (SIZE SRHEAD) + 1 +INIT_BPB EQU DWORD PTR (SIZE SRHEAD) + 5 +INIT_DOSDEV EQU BYTE PTR (SIZE SRHEAD) + 9 + +BREAK + +; +; The cache control structure is the "management" data associated +; with all of the data in the cache. The cache structures are +; part of the device driver and they contain pointers to the +; actual cache memory where the data is. This is more efficient +; than putting the structures with the data as there is more overhead +; to access stuff in the data area. The structures form a double +; linked list in LRU order. The head points to the MRU element. The +; tail points to the LRU element. Scans start at MRU as this is the +; highest probability of a hit. Selection for bump is at LRU. All of +; the links are short pointers. This limits the size of the cache +; as the cache structures together with the device code must all +; fit in 64K. This is more efficient than FAR links. Each cache element +; contains one complete track of one of the INT 13 hard files (INT 13 +; floppy drives are NOT cached). Cache "read ahead" is obtained by +; reading complete tracks into the cache even though the INT 13 user +; may have only requested one sector. Write behind is accomplished +; (if enabled) by holding tracks for a while allowing user writes +; on that track to "accumulate". +; +; The original INT 13 caching algorithm (Aaronr) is sumarized as follows: +; +; If user read is in cache +; Perform user read from cache +; Else +; If read is full track +; Perform write through (if enabled) +; Pass Read to old INT 13 handler (no cache operation) +; Else +; Read track into cache using old INT 13 handler +; Perform user read out of cache +; +; If user write is in cache +; If write buffering is enabled +; Perform user write into cache +; Else +; Discard cache for this track +; Pass write through to old INT 13 handler +; Else +; If write is full track +; Perform write through (if enabled) +; Pass Write to old INT 13 handler (no cache operation) +; Else +; If write buffering is enabled +; Read track into cache using old INT 13 handler +; Perform user write into cache +; Else +; Pass write through to old INT 13 handler +; +; SMARTDRV modifications: +; +; 1. Write through always. +; 2. Multi track I/O capability support. +; 3. Direct transfer between cache and user buffer address for +; full tracks. +; +; +; + +CACHE_CONTROL STRUC +FWD_LRU_LNK DW ? ; Link to next CACHE_CONTROL, -1 if last +BACK_LRU_LNK DW ? ; Link to previous CACHE_CONTROL, -1 if first +BASE_OFFSET DD ? ; Offset releative to start of cache + ; memory of start of this track buffer +TRACK_FLAGS DW ? ; Flags +; +; NOTE: The next two bytes are refed as a word. +; MOV DX,WORD PTR STRC.TRACK_DRIVE +; OR DH,80H +; Puts the INT 13 drive in DL, and the head in DH which is correct +; for an INT 13 +; +TRACK_DRIVE DB ? ; INT 13 drive with high bit = 0 +TRACK_HEAD DB ? ; INT 13 head +TRACK_CYLN DW ? ; INT 13 cylinder + ; High byte is low byte of cylinder # + ; High two bits of Low byte are high + ; two bits of cylinder #. Other bits + ; are 0. This makes it easy to load the + ; CX register for an INT 13 for this + ; track: + ; MOV CX,STRC.CACHE_CYLN + ; OR CL,1 +CACHE_CONTROL ENDS + +; +; TRACK_FLAGS bits +; +TRACK_FREE EQU 0000000000000001B ; Track buffer is free +TRACK_DIRTY EQU 0000000000000010B ; Track needs to be written +TRACK_LOCKED EQU 0000000000000100B ; Track is locked + +BREAK + +INT13CODE SEGMENT +ASSUME CS:INT13CODE,DS:NOTHING,ES:NOTHING,SS:NOTHING + + IF DEBUG + public strategy,int13$in,cmderr,err$cnt,err$exit,devexit + public INT13$IOCTL_Read,INT13$Read_St,INT13$Write_St,INT13$IOCTL_Write + public int_1C_handler,int_13_handler,POP_NO_PROC,INVALIDATE_CACHE + public CACHE_READ,CACHE_WRITE,FLUSH_PASS,FLUSH_INVALID_PASS + public FLUSH_WHOLE_CACHE_SAV,FLUSH_WHOLE_CACHE,FLUSH_CACHE + public WRITE_FROM_CACHE + public Cache_hit + public blkmov,INT_9,INT_19,RESET_SYSTEM,DO_INIT,SETBPB + public PRINT,ITOA,INT13$INIT,DRIVEPARMS,GETNUM,DISK_ABORT + public CTRL_IO,MM_SETDRIVE,FIND_VDRIVE,SET_RESET + public AT_EXT_INIT,FIX_DESCRIPTOR,ABOVE_INIT + public process_read_partial,process_block_read,pr_acc_trks + public pr_acc_trks,pr_cur_trk,process_write_partial,process_block_write + public check_parameters,process_regions,bytes_in_trk,sect_in_trk + public not_in_mem,read_disk + public not_in_memw,rd_partw,rd_part + public region + public SECTRKARRAY + ENDIF + +;** +; +; INT13 DEVICE HEADER +; +; COMMON TO TYPE 1, 2 drivers +; +; SEE ALSO +; MS-DOS Technical Reference manual section on +; Installable Device Drivers +; + +;; The internal name of the device driver has been changed from SMARTDRV +;; to SMARTAAR to avoid DOS name conflicts with files named SMARTDRV.* +;; +INT13DEV LABEL WORD + DW -1,-1 +DEVATS DW DEVOPCL + CharDev + DevIOCtl + DW STRATEGY + DW INT13$IN + DB "SMARTAAR" ;Name of device + + +BREAK + +;** +; +; This is the device driver command dispatch table. +; +; The first byte indicates the size of the table and therefore defines +; which device function codes are valid. +; +; The entries in the table are NEAR word addresses of the appropriate +; device routine. Thus the address of the routine to handle device function +; 3 is: +; WORD at ((INT13TBL + 1) + (2 * 3)) +; +; COMMON TO TYPE 1, 2 drivers +; +; + +INT13TBL LABEL WORD + DB 15 ; Max allowed command code + DW INT13$INIT ; Init + DW CMDERR ; Media check + DW CMDERR ; Build BPB + DW INT13$IOCTL_Read ; IOCTL input + DW CMDERR ; Read + DW CMDERR ; Non-des read no-wait + DW INT13$Read_St ; Read status + DW CMDERR ; Read flush + DW CMDERR ; Write + DW CMDERR ; Write with verify + DW INT13$Write_St ; Output status + DW CMDERR ; Output flush + DW INT13$IOCTL_Write ; IOCTL output + DW DEVEXIT ; Open + DW DEVEXIT ; Close + DW CMDERR ; Rem media? + +BREAK + +STATISTICS_SIZE EQU 40 + +DRIVER_SEL DB 0 ; 0 if /E (TYPE 1), 1 if /A (TYPE 2), + +DEV_SIZE DW 256 ; Size in K of the cache + +SECTRACK DW ? ; Sectors per track + +current_dev_size dw ? ; Current size in K of cache + +;; Data peculiar to AT&T 6300 PLUS. + +S5_FLAG DB 0 ;; = S_OLIVETTI if 6300 plus machine + ;; = S_VECTRA if HP Vectra machine + + db ? ; Spacer + +A20On dw 0DF90h +A20Off dw 0DD00h + +special_mem dw 0 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Unfortunately the code in smartdrv is very machine dependent +; necessitating the use of a system flag to store the machine +; configuration. The system flag is initialised during init time +; and used when the caching services are requested. One bit which +; is set and tested during caching is the state of the a20 line +; when the cache code is entered. This is used because there are +; applications which enable the a20 line and leave it enabled +; throughout the duration of execution. Since smartdrv is a device +; driver it shouldn't change the state of the environment. +; +; The system flag bit assignments are: +; +; ------------------------------------------------- +; | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | +; ------------------------------------------------- +; |-----|-----| | | | | | +; | | | | | -----286 (and AT) +; | | | | -----------386 (later than B0) +; not | | -----------------PS/2 machine +; used | -----------------------Olivetti (not used) +; -----------------------------A20 state (enabled ?) +; +; The Olivetti guys have defined a flag of their own. This should be removed +; and the bit assigned out here for them should be used. +; +sys_flg db ? +; +; equates used for the system flag +; +M_286 equ 00000001B +M_386 equ 00000010B +M_PS2 equ 00000100B +M_OLI equ 00001000B +A20_ST equ 00010000B +ifdef OMTI +OMTI_EXT equ 00100000B +endif + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; flag to indicate that reset code is being executed +reboot_flg db 0 +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; emm ctrl address, needed for the reset code +emm_ctrl_addr dw EXTMEM_LOW + dw EXTMEM_HIGH +; +; +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; A20 address line state determination addresses +; +low_mem label dword + dw 20h*4 + dw 0 + +high_mem label dword + dw 20h*4 + 10h + dw 0ffffh + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; A20 PS2 equates +; +PS2_PORTA equ 0092h +GATE_A20 equ 010b + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; 386 working areas +start_gdt label byte +nul_des desc <> +cs_des desc <0FFFFh,0,0,09Fh,0,0> +ss_des desc <0FFFFh,0,0,093h,0,0> +ds_des desc <0FFFFh,0,0,093h,0,0> +es_des desc <0FFFFh,0,0,093h,0,0> +end_gdt label byte + +emm_gdt gdt_descriptor +; +; int 15 gdt +; +int15_gdt label byte + desc <> ;dummy descriptor + desc <> ;descriptor for gdt itself +src desc <0ffffh,,,93h,,> +tgt desc <0ffffh,,,93h,,> + desc <> ;bios cs descriptor + desc <> ;stack segment descriptor + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; 0 if device is valid +; Non-0 if device install failed (device non-functional) +; +; We need this state because there is no way to "un-install" +; a character device as there is with block devices +; +NULDEV DB 0 + +; +; 0 if caching is off +; Non-0 if caching is on +; +ENABLE_13 DB 1 ; 0 for debug + +; +; 0 if no write through +; Non-0 if write through +; +WRITE_THROUGH DB 0 + +; +; 0 if no write buffering +; Non-0 if write buffering enabled +; +WRITE_BUFF DB 0 + +; +; 0 if cache is unlocked +; Non-0 if cache is locked +; +LOCK_CACHE DB 0 + +; +; 0 if full track I/O to tracks not in cache is not cached. +; Non-0 if ALL I/O is to be cached +; +ALL_CACHE DB 1 + +; +; 0 if reboot flush is disabled +; Non-0 if reboot flush is enabled +; +REBOOT_FLUSH DB 0 + +; +; An exclusion sem so that the INT 13 handler and the timer interact +; without re-entrancy problems +; +INT_13_BUSY DB 0 ; Exclusion sem + + EVEN ; Force word data to word align +; +; Statistics counters +; +; WARNING!!!! Do not disturb the order of these!!!! See IOCTL_READ code. +; +TOTAL_WRITES DD 0 +WRITE_HITS DD 0 +TOTAL_READS DD 0 +READ_HITS DD 0 +TTRACKS DW ? ; Total number of track buffers that fit + ; in DEV_SIZE K (number of cache elements) +TOTAL_USED DW 0 +TOTAL_LOCKED DW 0 +TOTAL_DIRTY DW 0 + +; +; Tick counters +; +TICK_SETTING DW 1092 ; Approx 1 minute +TICK_CNT DW 1092 + +; +; Non-zero if there are dirty buffers in the cache +; +DIRTY_CACHE DW 0 ; 0 if no dirty elements in cache + +BREAK + +; INT13 DEVICE ENTRY POINTS - STRATEGY, INT13$IN +; +; This code is standard DOS device driver function dispatch +; code. STRATEGY is the device driver strategy routine, INT13$IN +; is the driver interrupt routine. +; +; INT13$IN uses INT13TBL to dispatch to the appropriate handler +; for each device function. It also does standard packet +; unpacking. +; +; SEE ALSO +; MS-DOS Technical Reference manual section on +; Installable Device Drivers +; + +ASSUME CS:INT13CODE,DS:NOTHING,ES:NOTHING,SS:NOTHING + +PTRSAV DD 0 ; Storage location for packet addr + +;** STRATEGY - Device strategy routine +; +; Standard DOS 2.X 3.X device driver strategy routine. All it does +; is save the packet address in PTRSAV. +; +; ENTRY ES:BX -> Device packet +; EXIT NONE +; USES NONE +; +; COMMON TO TYPE 1, 2 drivers +; +; + +STRATP PROC FAR + +STRATEGY: + MOV WORD PTR [PTRSAV],BX ; Save packet addr + MOV WORD PTR [PTRSAV+2],ES + RET + +STRATP ENDP + +;** INT13$IN - Device interrupt routine +; +; Standard DOS 2.X 3.X device driver interrupt routine. +; +; +; ENTRY PTRSAV has packet address saved by previous STRATEGY call. +; EXIT Dispatch to appropriate function handler +; CX = Packet RW_COUNT +; DX = Packet RW_START +; ES:DI = Packet RW_TRANS +; DS = INT13CODE +; STACK has saved values of all regs but FLAGS +; All function handlers must return through one of +; the standard exit points +; USES FLAGS +; +; COMMON TO TYPE 1, 2 drivers +; +; + +INT13$IN: + PUSH SI + PUSH AX + PUSH CX + PUSH DX + PUSH DI + PUSH BP + PUSH DS + PUSH ES + PUSH BX + + LDS BX,[PTRSAV] ;GET POINTER TO I/O PACKET + ; + ; Set up registers for READ or WRITE since this is the most common case + ; + MOV CX,DS:[BX.RW_COUNT] ;CX = COUNT + MOV DX,DS:[BX.RW_START] ;DX = START SECTOR + MOV AL,DS:[BX.REQFUNC] ; Command code + MOV AH,BYTE PTR [INT13TBL] ; Valid range + CMP AL,AH + JA CMDERR ; Out of range command code + MOV SI,OFFSET INT13TBL + 1 ; Table of routines + CBW ; Make command code a word + ADD SI,AX ; Add it twice since one word in + ADD SI,AX ; table per command. + + LES DI,DS:[BX.RW_TRANS] ; ES:DI transfer address + + PUSH CS + POP DS + +ASSUME DS:INT13CODE + + JMP WORD PTR [SI] ; GO DO COMMAND + +;** EXIT - ALL ROUTINES RETURN THROUGH ONE OF THESE PATHS +; +; Exit code entry points: +; +; SEE ALSO +; MS-DOS Technical Reference manual section on +; Installable Device Drivers +; +; GENERAL ENTRY for all entry points +; All packet values appropriate to the specific device function +; filled in except for the status word in the static request +; header. +; +; CMDERR - Used when an invalid device command is detected +; +; ENTRY Stack has frame set up by INT13$IN +; EXIT Standard Device driver with error 3 +; USES FLAGS +; +; ERR$CNT - Used when READ or WRITE wants to return with error code. +; The packet RW_COUNT field is zeroed +; +; ENTRY AL is error code for low byte of packet status word +; Stack has frame set up by INT13$IN +; EXIT Standard Device driver with error AL +; USES FLAGS +; +; ERR$EXIT - Used when a function other that READ or WRITE wants to +; return an error +; +; ENTRY AL is error code for low byte of packet status word +; Stack has frame set up by INT13$IN +; EXIT Standard Device driver with error AL +; USES FLAGS +; +; DEVEXIT - Used when a function wants to return with no error +; +; ENTRY AL is value for low byte of packet status word +; NOTE: Typically there is no meaningful value +; in the AL register when EXITing through here. +; This is OK as the low 8 bits of the status word +; have no meaning unless an error occured. +; Stack has frame set up by INT13$IN +; EXIT Standard Device driver with no error +; USES FLAGS +; +; ERR1 - Used when a function wants to return with a value +; for the whole status word +; +; ENTRY AX is value for packet status word +; Stack has frame set up by INT13$IN +; EXIT Standard Device driver with or without error +; USES FLAGS +; +; COMMON TO TYPE 1, 2 drivers +; +; + +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING + +CMDERR: + MOV AL,3 ;UNKNOWN COMMAND ERROR + JMP SHORT ERR$EXIT + +ERR$CNT: + LDS BX,[PTRSAV] + MOV [BX.RW_COUNT],0 ; NO sectors transferred +ERR$EXIT: ; Error in AL + MOV AH,(STERR + STDON) SHR 8 ;MARK ERROR RETURN + JMP SHORT ERR1 + +EXITP PROC FAR + +DEVEXIT: + MOV AH,STDON SHR 8 +ERR1: + LDS BX,[PTRSAV] + MOV [BX.REQSTAT],AX ; Set return status + + POP BX + POP ES + POP DS + POP BP + POP DI + POP DX + POP CX + POP AX + POP SI + RET ;RESTORE REGS AND RETURN +EXITP ENDP + +; +; The following functions are not supported at this time. +; +INT13$Read_St: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING +INT13$Write_St: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + JMP CMDERR + +BREAK + +SET_ZRJ3: + JMP SET_ZR + +INT13$IOCTL_Read: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + CLD + CMP CX,STATISTICS_SIZE ; Must have room to transfer data. + JB SET_ZRJ3 ; Not enough room from user + MOV [TOTAL_USED],0 + MOV [TOTAL_LOCKED],0 + MOV [TOTAL_DIRTY],0 + ; + ; Count all occupied, dirty and locked elements + ; + MOV [INT_13_BUSY],1 + MOV SI,[CACHE_HEAD] + INC SI +NEXTCC: + DEC SI + TEST [SI.TRACK_FLAGS],TRACK_FREE + JNZ SKIPCC + INC [TOTAL_USED] + TEST [SI.TRACK_FLAGS],TRACK_LOCKED + JZ TEST_DIRTY + INC [TOTAL_LOCKED] +TEST_DIRTY: + TEST [SI.TRACK_FLAGS],TRACK_DIRTY + JZ SKIPCC + INC [TOTAL_DIRTY] +SKIPCC: + MOV SI,[SI.FWD_LRU_LNK] + INC SI + JNZ NEXTCC + MOV [INT_13_BUSY],0 + MOV AL,[WRITE_THROUGH] + MOV AH,[WRITE_BUFF] + STOSW + MOV AL,[ENABLE_13] + MOV AH,[NULDEV] + STOSW + MOV AX,[TICK_SETTING] + STOSW + MOV AL,[LOCK_CACHE] + MOV AH,[REBOOT_FLUSH] + STOSW + MOV AL,[ALL_CACHE] + XOR AH,AH ; Unused currently + STOSW + MOV SI,OFFSET TOTAL_WRITES + MOV CX,12 + REP MOVSW +; +; Transfer Above Board Information +; + xor dx,dx + mov es:[di][0],dx + mov es:[di][2],dx + mov es:[di][4],dx + cmp [driver_sel],dl ; is it expanded memory? + jz no_ems ; no, info already set + mov cx,16 + mov ax,[current_dev_size] + div cx + or dx,dx + jz no_remain + inc ax + xor dx,dx +no_remain: + stosw + mov ax,[dev_size] + div cx + or dx,dx + jz no_remaind + inc ax +no_remaind: + stosw + mov ax,MIN_CACHE_SIZE_K / 16 + stosw +no_ems: + LDS BX,[PTRSAV] +ASSUME DS:NOTHING + MOV [BX.RW_COUNT],STATISTICS_SIZE ; transfer amount + JMP DEVEXIT + +BREAK + +; +; Command table for IOCTL Write functions. The first byte of the written +; data contains the "function" code which is dispatched via this +; table. The first byte is the maximum legal function code, then the word +; addresses of the handlers for each function. +; +IOCTLTBL DB 0Ch + DW IOCTL_FLUSH ; Function 0h + DW IOCTL_FLUSH_INVALID ; Function 1h + DW IOCTL_DISABLE ; Function 2h + DW IOCTL_ENABLE ; Function 3h + DW IOCTL_WRITE_MOD ; Function 4h + DW IOCTL_SET_TICK ; Function 5h + DW IOCTL_LOCK ; Function 6h + DW IOCTL_UNLOCK ; Function 7h + DW IOCTL_REBOOT ; Function 8h + DW IOCTL_STAT_RESET ; Function 9h + DW IOCTL_ALL_CACHE ; Function Ah + dw ioctl_reduce_cache_size ; Function Bh + dw ioctl_increase_cache_size ; Function Ch + +SET_ZR: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + LDS BX,[PTRSAV] +ASSUME DS:NOTHING + MOV [BX.RW_COUNT],0 ; NO bytes transferred + JMP DEVEXIT + +SET_ERR_CNT: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + MOV AL,3 ;UNKNOWN COMMAND ERROR + JMP ERR$CNT + +INT13$IOCTL_Write: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + CMP [NULDEV],0 ; Is the device valid? + JNZ SET_ZR ; No, you get an error + MOV AL,ES:[DI] ; Get command byte + MOV AH,BYTE PTR [IOCTLTBL] ; Valid range + CMP AL,AH ; In range? + JA SET_ERR_CNT ; No + MOV SI,OFFSET IOCTLTBL + 1 ; Table of routines + CBW ; Make command code a word + ADD SI,AX ; Add it twice since one word in + ADD SI,AX ; table per command. + JMP WORD PTR [SI] ; GO DO COMMAND + +;** IOCTL_FLUSH -- Flush the cache, but keep the data +; +; ENTRY: +; ES:DI is transfer address +; CX is transfer count +; EXIT: +; Through one of the device exit paths +; USES: +; ALL +; +IOCTL_FLUSH: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + MOV [INT_13_BUSY],1 + CALL FLUSH_WHOLE_CACHE + MOV [INT_13_BUSY],0 + JMP DEVEXIT + +;** IOCTL_FLUSH_INVALIDATE -- Flush the cache, and discard the data +; +; ENTRY: +; ES:DI is transfer address +; CX is transfer count +; EXIT: +; Through one of the device exit paths +; USES: +; ALL +; +IOCTL_FLUSH_INVALID: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + MOV [INT_13_BUSY],1 + CALL FLUSH_WHOLE_CACHE + CALL INVALIDATE_CACHE + MOV [INT_13_BUSY],0 + JMP DEVEXIT + +;** IOCTL_DISABLE -- Disable the caching for both reads and writes +; +; Also flush and invalidate the cache +; +; ENTRY: +; ES:DI is transfer address +; CX is transfer count +; EXIT: +; Through one of the device exit paths +; USES: +; ALL +; +IOCTL_DISABLE: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + MOV [INT_13_BUSY],1 + CALL FLUSH_WHOLE_CACHE + CALL INVALIDATE_CACHE + MOV [ENABLE_13],0 + MOV [INT_13_BUSY],0 + JMP DEVEXIT + +;** IOCTL_ENABLE -- Enable the caching for reads (and possibly writes) +; +; ENTRY: +; ES:DI is transfer address +; CX is transfer count +; EXIT: +; Through one of the device exit paths +; USES: +; ALL +; +IOCTL_ENABLE: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + MOV [ENABLE_13],1 + JMP DEVEXIT + +;** IOCTL_WRITE_MOD -- En/Disable Write through and write caching +; +; ENTRY: +; ES:DI is transfer address +; CX is transfer count +; Second byte of data indicates what to set +; 0 Turn off Write through +; 1 Turn on Write through +; 2 Turn off Write buffering (also flush) +; 3 Turn on Write buffering (also flush) +; EXIT: +; Through one of the device exit paths +; USES: +; ALL +; +IOCTL_WRITE_MOD: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + CMP CX,2 ; Did user write enough? + JB SET_ZR ; No, error + MOV AL,ES:[DI.1] ; Get second byte + CMP AL,3 ; In range? + JA SET_ZR ; No, error + CMP AL,2 ; WT or WB? + JB SET_WRITE_TH ; WT + DEC AL + DEC AL ; 2 = 0, 3 = 1 + MOV [INT_13_BUSY],1 + MOV [WRITE_BUFF],AL + CALL FLUSH_WHOLE_CACHE + MOV [INT_13_BUSY],0 + JMP DEVEXIT + +SET_WRITE_TH: + MOV [WRITE_THROUGH],AL + JMP DEVEXIT + +;** IOCTL_SET_TICK -- Set tick count for auto flush +; +; ENTRY: +; ES:DI is transfer address +; CX is transfer count +; Second byte and third byte of data is value to set +; EXIT: +; Through one of the device exit paths +; USES: +; ALL +; +IOCTL_SET_TICK: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + CMP CX,3 ; Did user write enough? + JB SET_ZRJ ; No, error + MOV AX,ES:[DI.1] ; Get second byte and third byte as word + MOV [TICK_SETTING],AX + JMP DEVEXIT + +SET_ZRJ: + JMP SET_ZR + +;** IOCTL_LOCK -- Lock the current cache +; +; Also flush the cache +; +; ENTRY: +; ES:DI is transfer address +; CX is transfer count +; EXIT: +; Through one of the device exit paths +; USES: +; ALL +; +IOCTL_LOCK: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + MOV [INT_13_BUSY],1 + CALL FLUSH_WHOLE_CACHE + MOV [LOCK_CACHE],1 + ; + ; Lock all cache elements that have something in them + ; + MOV SI,[CACHE_HEAD] + INC SI +NEXTCS: + DEC SI + TEST [SI.TRACK_FLAGS],TRACK_FREE + JNZ SKIPCS + OR [SI.TRACK_FLAGS],TRACK_LOCKED +SKIPCS: + MOV SI,[SI.FWD_LRU_LNK] + INC SI + JNZ NEXTCS + MOV [INT_13_BUSY],0 + JMP DEVEXIT + +;** IOCTL_UNLOCK -- Unlock the cache +; +; ENTRY: +; ES:DI is transfer address +; CX is transfer count +; EXIT: +; Through one of the device exit paths +; USES: +; ALL +; +IOCTL_UNLOCK: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + MOV [INT_13_BUSY],1 + MOV [LOCK_CACHE],0 + ; + ; UnLock all cache elements + ; + MOV SI,[CACHE_HEAD] + INC SI +NEXTCX: + DEC SI + AND [SI.TRACK_FLAGS],NOT TRACK_LOCKED + MOV SI,[SI.FWD_LRU_LNK] + INC SI + JNZ NEXTCX + MOV [INT_13_BUSY],0 + JMP DEVEXIT + +;** IOCTL_REBOOT -- En/Disable Reboot flush +; +; ENTRY: +; ES:DI is transfer address +; CX is transfer count +; Second byte of data indicates what to set +; 0 Turn off reboot flush +; 1 Turn on reboot flush +; EXIT: +; Through one of the device exit paths +; USES: +; ALL +; +IOCTL_REBOOT: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + CMP CX,2 ; Did user write enough? + JB SET_ZRJ ; No, error + MOV AL,ES:[DI.1] ; Get second byte + CMP AL,1 ; In range? + JA SET_ZRJ ; No, error + MOV [REBOOT_FLUSH],AL + JMP DEVEXIT + + +;** IOCTL_STAT_RESET -- Reset the INT 13 statistics counters +; +; ENTRY: +; ES:DI is transfer address +; CX is transfer count +; EXIT: +; Through one of the device exit paths +; USES: +; ALL +; +IOCTL_STAT_RESET: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + XOR AX,AX + MOV WORD PTR [TOTAL_WRITES],AX + MOV WORD PTR [TOTAL_WRITES + 2],AX + MOV WORD PTR [WRITE_HITS],AX + MOV WORD PTR [WRITE_HITS + 2],AX + MOV WORD PTR [TOTAL_READS],AX + MOV WORD PTR [TOTAL_READS + 2],AX + MOV WORD PTR [READ_HITS],AX + MOV WORD PTR [READ_HITS + 2],AX + JMP DEVEXIT + +;** IOCTL_ALL_CACHE -- En/Disable All cache +; +; ENTRY: +; ES:DI is transfer address +; CX is transfer count +; Second byte of data indicates what to set +; 0 Turn off all cache +; 1 Turn on all cache +; EXIT: +; Through one of the device exit paths +; USES: +; ALL +; +IOCTL_ALL_CACHE: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + CMP CX,2 ; Did user write enough? + JB SET_ZRJ2 ; No, error + MOV AL,ES:[DI.1] ; Get second byte + CMP AL,1 ; In range? + JA SET_ZRJ2 ; No, error + MOV [ALL_CACHE],AL + JMP DEVEXIT + +SET_ZRJ2: + JMP SET_ZR + +;** ioctl_reduce_cache_size Dynamically reduce the size of the cache +; +; This routine dynamically reduces the size of an Above Board memory (/A) +; cache. The routine is passed the number of pages that the cache should +; be reduced by. The minimum size for a cache is 64K or 4 pages. In +; removing the tracks from the cache, the memory is returned to the EMM +; and then the cache control structures for that memory are taken off the +; LRU list, and set to free. +; +; NOTE: In this version of INT13, only reads are cached, so that when +; a cached track is "removed" from memory, it's contents are not +; updated to disk. +; +; ENTRY: +; ES:DI is transfer address +; EXIT: +; Through one of the device exit paths +; USES: +; ALL +; +error_reduce_exitj: + jmp error_reduce_exit + +ioctl_reduce_cache_size: + assume ds:Int13Code + assume es:nothing + assume ss:nothing + + cmp byte ptr [driver_sel],1 ; Make sure using Above Board + jnz error_reduce_exitj + mov ax,es:[di.1] ; Get second byte + or ax,ax ; Reduce by a non-0 amount? + jnz do_it + jmp devexit +do_it: mov cl,4 ; Multiply by 16 to get # of K bytes + shl ax,cl ; AX has requested reduction in K + mov bx,word ptr [current_dev_size] + mov si,bx ; Save current_dev_size in SI for error + sub bx,ax ; BX now has remaining cache memory in K + cmp bx,MIN_CACHE_SIZE_K ; Compare BX with min cache in K bytes + jl error_reduce_exitj + mov word ptr [current_dev_size],bx + shr bx,cl ; BX has new cache size in pages + mov byte ptr [int_13_busy],1 +; +; Request Reallocation of Pages from EMM +; + push ax + mov dx,word ptr [above_pid] + mov ah,ABOVE_REALLOCATE_PID + int 67h + or ah,ah + jnz real_fail +; +; Determine how many cache tracks will be lost +; + mov bx,word ptr [sectrack] ; Init code checked for too large track + mov cl,9 + shl bx,cl ; BX has bytes/track + mov ax,word ptr [ttracks] + mul bx ; AX:DX has bytes used by tracks + xchg ax,si + mov di,dx + mov cx,1024 + mul cx ; AX:DX has total bytes allocated + sub ax,si ; Find difference in allocated and used + sbb dx,di + xchg ax,si + xchg dx,di + pop ax ; AX still has requested reduction in K + mul cx ; DX:AX has requested reduction in byte + +; +; Make sure the we have to free up tracks in order to satisfy the request +; HACK! HACK! HACK! Smartdrv should only allocate as many pages as it needs. +; ChipA 14-Mar-1988 +; + cmp dx,di + ja free_tracks + jb no_need_to_free_tracks + cmp ax,si + ja free_tracks +no_need_to_free_tracks: + sub ax,ax + mov dx,ax + jmp all_freed + +free_tracks: + sub ax,si ; Account for part not used + sbb dx,di + div bx ; AX has number of tracks being "lost" + or dx,dx + jz no_remainder + inc ax ; Add one more track if remainder +; +; Determine which cache control structures we are to remove +; +no_remainder: + mov si,ax + mov cx,SIZE CACHE_CONTROL + mul cx + xchg ax,bx ; BX has backward offset into CCS's + mov ax,word ptr [ttracks] + sub word ptr [ttracks],si + mul cx ; AX has end of Cache Control + sub ax,bx ; AX has start offset of CCS's to remove + mov cx,si ; CX has number of CCS's to remove + mov si,word ptr [cache_control_ptr] + add si,ax ; SI points to first CCS to modify +; +; Loop through each cache control structure, removing from LRU list +; +remove_cache_entries: + mov word ptr [si].track_flags,TRACK_FREE + call unlink_cache + add si,SIZE CACHE_CONTROL + loop remove_cache_entries + +all_freed: + mov byte ptr [int_13_busy],0 + jmp devexit + +real_fail: + pop ax + mov [current_dev_size],si ; Restore former dev size + mov byte ptr [int_13_busy],0 +error_reduce_exit: + mov al,0Ch ; General failure + jmp err$cnt + + +;** ioctl_increase_cache_size Dynamically increase the size of the cache +; +; This routine dynamically increases the size of an Above Board memory (/A) +; cache. The routine is passed the number of pages that the cache should +; be increased by. The maximum size allowed is the size specified from the +; INT13.SYS command line. The cache control structures for the memory added +; to the cache are placed on the LRU list at the LRU position, so that they +; will be immediately available for incoming tracks. +; +; ENTRY: +; ES:DI is transfer address +; EXIT: +; Through one of the device exit paths +; USES: +; ALL +; +error_increase_exitj: + jmp error_increase_exit + +ioctl_increase_cache_size: + assume ds:Int13Code + assume es:nothing + assume ss:nothing + + cmp [driver_sel],1 ; Make sure using Above Board + jnz error_increase_exitj + mov ax,es:[di.1] ; Get second byte + mov cl,4 ; Multiply by 16 to get # of K bytes + shl ax,cl ; AX has requested addition in K + mov bx,word ptr [current_dev_size] + mov si,bx ; Save current dev size for error + add bx,ax ; BX now has new cache memory size in K + cmp bx,[dev_size] ; Compare BX with largest size in K bytes + jbe increase_size_ok + mov bx, [dev_size] ; Go to MAX size + mov ax, bx + sub ax, si ; Correct increase +increase_size_ok: + mov word ptr [current_dev_size],bx + shr bx,cl ; BX has new cache size in pages + mov [int_13_busy],1 +; +; Request Reallocation of Pages from EMM +; + push ax + mov dx,[above_pid] + mov ah,ABOVE_REALLOCATE_PID + int 67h + or ah,ah + jnz realloc_fail +; +; Determine how many cache tracks will be gained +; + mov bx,word ptr [sectrack] ; Init code checked for too large track + mov cl,9 + shl bx,cl ; BX has bytes/track + mov ax,word ptr [ttracks] + mul bx ; AX:DX has bytes used by tracks + xchg ax,si + mov di,dx + mov cx,1024 + mul cx ; AX:DX has total bytes allocated + sub ax,si ; Find difference in allocated and used + sbb dx,di + xchg ax,si + xchg dx,di + pop ax ; AX still has requested reduction in K + mul cx ; DX:AX has requested reduction in byte + add ax,si ; Account for part not used + adc dx,di + div bx ; AX has number of tracks being "gained" + or ax, ax ; DIV trashes flags + jz nothing_to_gain +; +; Determine which cache control structures we are to add +; + mov si,ax + mov cx,SIZE CACHE_CONTROL + mov ax,[ttracks] + add [ttracks],si ; Update TTRACKS + mul cx ; AX has end of Cache Control + mov cx,si ; CX has number of CCS's to add + mov si,[cache_control_ptr] + add si,ax ; SI points to first CCS to modify +; +; Loop through each cache control structure, adding to LRU list +; +add_cache_entries: + mov di,si ; Place element at LRU position + xchg di,[cache_tail] + mov [di].fwd_lru_lnk,si + mov [si].back_lru_lnk,di + mov [si].fwd_lru_lnk,-1 + mov [si].track_flags,TRACK_FREE + + add si,SIZE CACHE_CONTROL + loop add_cache_entries +nothing_to_gain: + mov [int_13_busy],0 + jmp devexit + +realloc_fail: + pop ax + mov [current_dev_size],si ; Restore to original size + mov [int_13_busy],0 +error_increase_exit: + mov al,0Ch ; General failure + jmp err$cnt + + +; +; If the device errors out during install, we set the break address here. +; +ERROR_END LABEL BYTE + +BREAK + + EVEN ; Force word align +; +; Storage for the INT 1C vector BEFORE cache installed +; +OLD_1C DD ? + +;** INT_1C_HANDLER - Handler for INT 1C timer ticks +; +; ENTRY +; None +; +; EXIT +; To next 1C handler, EOI may be sent +; +; USES +; None +; +; SEE ALSO +; IBM PC TECH REF MANUAL section on INT 1C +; DOS PRINT utility (most of this is stolen from there) +; +INT_1C_HANDLER PROC FAR +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING + PUSH AX + DEC [TICK_CNT] + JNZ CHAIN_1C + CMP [INT_13_BUSY],0 + JZ TRY_FLSH +RE_TRIGGER: + INC [TICK_CNT] ; Set it back to 1 so next tick triggers +CHAIN_1C: + POP AX + JMP [OLD_1C] + +TRY_FLSH: + mov al,00001011b ; Select ISR in 8259 + out 20H,al + jmp short yyyy +yyyy: + jmp short zzzz +zzzz: + in al,20H ; Get ISR register + and al,0FEH ; Mask timer int + jnz RE_TRIGGER ; Another int is in progress + INC [INT_13_BUSY] ; Exclude + CMP [DIRTY_CACHE],0 ; Anything to do? + JZ SKIP_FLSH ; No + STI + mov al,20H + out 20H,al + CALL FLUSH_WHOLE_CACHE_SAV +SKIP_FLSH: + MOV AX,[TICK_SETTING] + CLI + MOV [TICK_CNT],AX + MOV [INT_13_BUSY],0 + JMP CHAIN_1C + +INT_1C_HANDLER ENDP + +BREAK + + +; INT 13 stack frame +; +STACK_FRAME STRUC +USER_OFF DW ? ; added for user transfer address +USER_ES DW ? +USER_DS DW ? +USER_DI DW ? +USER_SI DW ? +USER_BP DW ? + DW ? +USER_BX DW ? +USER_DX DW ? +USER_CX DW ? +USER_AX DW ? +USER_IP DW ? +USER_CS DW ? +USER_FL DW ? +STACK_FRAME ENDS + + EVEN ; Force word align +; +; Storage for the INT 13 vector BEFORE cache installed +; +OLD_13 DD ? + +; +; Array of sec/track for all hardfiles on system. First element cooresponds +; to first hard file. +; Value = 0 indicates no hardfile +; +SECTRKARRAY DB MAX_HARD_FILES DUP (0) +; +; ARRAY OF MAXIMUM USEABLE HEADS FOR ALL THE HARDFILES IN THE SYSTEM. FIRST +; ELEMENT CORRESPONDS TO FIRST HARDFILE. +; VALUE = FF INDICATES NO HARDFILE (SUNILP) +; +HDARRAY DB MAX_HARD_FILES DUP (0FFH) + +ifdef OMTI +OMTI_SET_CYL EQU 0EEh +OMTI_GET_CYL EQU 0FEh +OMTI_GET_REV EQU 0F9h +endif ;OMTI +; +; INT 13 function dispatch +; Addresses of routines for AH INT 13 functions +; +INT13DISPATCH LABEL WORD + DW POP_NO_PROC ; 0, reset + DW POP_NO_PROC ; 1, Read status + DW CACHE_READ ; 2, read + DW CACHE_WRITE ; 3, write + DW POP_NO_PROC ; 4, verify + DW INVALID_PASS ; 5, format + DW INVALID_PASS ; 6, format + DW INVALID_PASS ; 7, format + DW POP_NO_PROC ; 8, drive parms + DW INVALID_PASS ; 9, Init drive characteristic + DW INVALID_PASS ; A, Read long + DW INVALID_PASS ; B, Write long + DW POP_NO_PROC ; C, Seek + DW POP_NO_PROC ; D, Alt reset + DW INVALID_PASS ; E, Read buffer + DW INVALID_PASS ; F, Write buffer + DW POP_NO_PROC ; 10, Test drive rdy + DW POP_NO_PROC ; 11, Recalibrate + DW POP_NO_PROC ; 12, Controller diag + DW INVALID_PASS ; 13, Drive diag + DW POP_NO_PROC ; 14, Controller diag internal + DW POP_NO_PROC ; 15, READ DASD +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; MODIFICATIONS TO DATA STRUCT TO SUPPORT MULTI-TRACK I/O +; +; sunilp +; +; extra declarations needed +; +max_hd db ? ;maximum useable head number for curr. drive +sect_in_trk db ? ;maximum sector number in trk for curr drive +bytes_in_trk dw ? ;numb of bytes in trk for current drive +int13err db ? +; +TRUE = 0ffH +FALSE = NOT TRUE +REG1_P = 001B +REG2_P = 010B +REG3_P = 100B +; +REG1t struc +START_H db ? ;start head +START_T dw ? ;start track +COUNT dw ? ;number of words +START_S dw ? ;start sector +REG1t ends +; +REG2t struc + db ? ;start head + dw ? ;start track +TRACKS db ? ;number of tracks +REG2t ends +; +REG3t struc + db ? ;start head + dw ? ;start track + dw ? ;number of words +REG3t ends +; +REGIONt struc +FLAG db 0 +REG1 db size REG1t dup(?) +REG2 db size REG2t dup(?) +REG3 db size REG3t dup(?) +REGIONt ends +; +; +REGION db size REGIONt dup(?) +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; INT_13_HANDLER - Handler for INT 13 requests +; +; ENTRY +; All regs as for INT 13 +; +; EXIT +; To old INT 13 handler with regs unchanged if cache not involved +; Else return in AH and flags as per INT 13. +; +; USES +; AH and carry bit of FLAGS +; +; SEE ALSO +; IBM PC TECH REF MANUAL section on INT 13 +; +INT_13_HANDLER PROC FAR +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING + MOV [INT_13_BUSY],1 ; Exclude + TEST DL,80H ; Hard file? + JNZ IS_HARD ; Yes +NO_PROC: + PUSHF + CLI + CALL [OLD_13] ; Let old handler do it + MOV [INT_13_BUSY],0 ; Clear sem + RET 2 ; "IRET" chucking flags + +; +; Pop off the stack frame and pass to old handler +; +POP_NO_PROC: + POP BX + POP ES + POP DS + ; Simulate POPA + POP DI + POP SI + POP BP + POP BX ; Dummy for pop sp + POP BX + POP DX + POP CX + POP AX + ; + JMP NO_PROC + +IS_HARD: + STI ; INTs ok now + ; + ; Set up standard stack frame + ; + ; Simulate PUSHA + PUSH AX + PUSH CX + PUSH DX + PUSH BX + PUSH BX ; dummy for push sp + PUSH BP + PUSH SI + PUSH DI + ; + PUSH DS + PUSH ES + push bx + ; Set frame pointer + MOV BP,SP + MOV BL,AH + XOR BH,BH ; Command in BX + PUSH CS + POP DS +ASSUME DS:INT13CODE + CMP [ENABLE_13],0 ; Are we enabled? + JZ POP_NO_PROC ; No, ignore + +ifdef OMTI +; +; The following code is used to handle the extended cylinder access method +; used by the OMTI controller. This controller has a modified INT13 routine +; that uses a unique function number to tell the controller that the next +; access to INT13 is for an extended cylinder. +; + test sys_flg,OMTI_EXT ; Are we in extended state? + jnz in_extended_state + cmp bx,OMTI_SET_CYL ; Is this the OMTI extended function? + jnz check_command_range + or sys_flg,OMTI_EXT + jmp pop_no_proc +in_extended_state: +; +; If we are in the extended state, we want to make sure that this call +; does not go through into the cache. Therefore, we will check to see +; if this is a read or write function, and will return to the old INT13 +; routine if so. +; + and sys_flg,NOT OMTI_EXT ; Clear the extended flag + cmp bx,2h ; READ + jz pop_no_proc + cmp bx,3h ; WRITE + jz pop_no_proc +check_command_range: +; +; Allow the other OMTI functions to pass through +; + cmp bx,OMTI_GET_CYL + jz pop_no_proc + cmp bx,OMTI_GET_REV + jz pop_no_proc +endif ; OMTI + + CMP BX,15H ; Command in range? + JA INVALID_PASS ; No, throw out cache + SHL BX,1 ; Times two bytes per table entry + JMP [BX.INT13DISPATCH] ; Dispatch to handler + +;** FLUSH_INVALID_PASS -- Discard cache and pass through +; +; ENTRY: +; INT 13 regs except for BP,BX and DS +; EXIT: +; To old INT13 handler +; +FLUSH_INVALID_PASS: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + CALL FLUSH_WHOLE_CACHE + CALL INVALIDATE_CACHE + JMP POP_NO_PROC + +;** INVALID_PASS -- DISCARD CACHE, NO NEED TO FLUSH, PASS THROUGH +; +;** SUNIL PAI +; +; ENTRY: +; INT 13 regs except for BP,BX and DS +; EXIT: +; To old INT 13 handler +; +INVALID_PASS: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + CALL INVALIDATE_CACHE + JMP POP_NO_PROC + +;** FLUSH_PASS -- Flush cache (but retain data) and pass through +; +; ENTRY: +; INT 13 regs except for BP,BX and DS +; EXIT: +; To old INT13 handler +; +FLUSH_PASS: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + CALL FLUSH_WHOLE_CACHE + JMP POP_NO_PROC + +BREAK + +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING +; +cache_read: +; +; inputs: int13 regs except for bp - user stack frame +; bx - function (read,write) +; ds - int13code segment +; +; exits: to user success routine +; to user error routine +; to old int13 handler call +; +; uses: all but bp +; +; written by: sunil pai +; + call check_parameters ; check user params + jc pop_no_proc ; if error go to old int 13 handler + ; + call process_regions ; for multi-track business find the + ; initial partial track, middle block + ; and final partial track + ; sets up REGION struct +; +; mov [int13err],FALSE ; clear int 13 error flag +; + test [REGION.FLAG],REG1_P ; is region1 present + je cr$2 ; if not present try region2 +; + mov dh,[REGION.REG1.START_H] ;start head + mov cx,[REGION.REG1.START_T] ;get start track + mov bx,[REGION.REG1.START_S] ;start sector + mov ax,[REGION.REG1.COUNT] ;number of words + call process_read_partial ; + jc error ;go to process error +; +cr$2: test [REGION.FLAG],REG2_P ; is region2 present + je cr$3 ; if not present try region3 +; + mov dh,[REGION.REG2.START_H] ; get start head + mov cx,[REGION.REG2.START_T] ; get start track + mov al,[REGION.REG2.TRACKS] ; get number of tracks + call process_block_read ; multi track capability + jc error ; fouled? +; +cr$3: test [REGION.FLAG],REG3_P ; is region3 present + je suc ; if not we are done +; + mov dh,[REGION.REG3.START_H] ; start head + mov cx,[REGION.REG3.START_T] ; start track + mov bx,1 ; start sector is 1 + mov ax,[REGION.REG3.COUNT] ; number of words + call process_read_partial ; + jc error ; just as we were about to fin! +; +; exit points - suc and error. +; +suc: and [bp.USER_FL],NOT f_Carry ; + mov byte ptr [bp.USER_AX.1],0 ; +; +operation_done: + mov cs:[int_13_busy],0 ;clear semaphore + pop bx ;user offset +; +; simulate popa +; + pop es + pop ds + pop di + pop si + pop bp + pop bx + pop bx + pop dx + pop cx + pop ax +; + iret +; +error: +; +; the next two instructions were removed because of the way Compaq +; handles bad sectors. they mark sectors bad not tracks. so in a +; track there may be good and bad sectors. However our int13 caching +; system does i/o from disk in tracks and will not get any track with +; bad sectors. to take care of this, we pass the read to the old int13 +; handler even when there is an int 13 error +; +; test [int13err],TRUE +; jne er$1 ;if not int13 error go to call + ;int13 + jmp pop_no_proc +;er$1: or [bp.USER_FL],f_Carry ; +; mov byte ptr [bp.USER_AX.1],AL ;int13 error code +; jmp operation_done +; +pop_no_procw: + call invalidate_cache + jmp pop_no_proc +; +cache_write: +; +; inputs: int13 regs except for bp - user stack frame +; bx - function (read,write) +; ds - int13code segment +; +; uses: all but bp +; +; written by: sunil pai +; + call check_parameters ;check user params + jc pop_no_procw ;error + ; + call process_regions ;for multi-track business find the + ;initial partial track, middle block + ;and final partial track + ;sets up REGION struct +; +; writes always update disk, i.e., write through always operational +; + mov ax,[bp.user_ax] ; restore int13 registers + mov cx,[bp.user_cx] ; + mov dx,[bp.user_dx] ; + mov bx,[bp.user_bx] ; + mov es,[bp.user_es] ; + pushf ; since interrupt routine being called + cli + call [old_13] ; call old int 13 handler + jnc cw$1 ; no error in writing to disk, continue +; + or [bp.user_fl],f_Carry ; error then set carry + mov byte ptr [bp.user_ax.1],ah ; and error code + jmp short errorw ; and take error exit +; +; int 13 was successful, now we have to update cache as well +; +cw$1: and [bp.user_fl],not f_Carry ; int 13 success + mov byte ptr [bp.user_ax.1],0 ; +; + and dl,not 80h +; + test [REGION.FLAG],REG1_P ; is region1 present + je cw$2 ; if not present try region2 +; + mov dh,[REGION.REG1.START_H] ; get start head + mov cx,[REGION.REG1.START_T] ; get start track + mov bx,[REGION.REG1.START_S] ; start sector + mov ax,[REGION.REG1.COUNT] ; number of words + call process_write_partial ; partial write + jc errorw ; go to process error +; +cw$2: test [REGION.FLAG],REG2_P ; is region2 present + je cw$3 ; if not present try region3 +; + mov dh,[REGION.REG2.START_H] ; get start head + mov cx,[REGION.REG2.START_T] ; get start track + mov al,[REGION.REG2.TRACKS] ; get number of tracks + call process_block_write ; + jc errorw ; fouled? +; +cw$3: test [REGION.FLAG],REG3_P ; is region3 present + je operation_donew ; if not we are done +; + mov dh,[REGION.REG3.START_H] ; start head + mov cx,[REGION.REG3.START_T] ; start track + mov bx,1 ; start sector is 1 + mov ax,[REGION.REG3.COUNT] ; number of words + call process_write_partial ; + jnc operation_donew ; no error - finish +; +errorw: call invalidate_cache ; we are not sure of the +operation_donew: + jmp operation_done +; +; +INT_13_HANDLER endp +; +process_read_partial proc near +; +; is used to read a partial track +; +; inputs: dx: head and drive (8th bit stripped) +; cx: track +; bx: start sector +; ax: number of words +; +; outputs:cy set if error +; clear if success +; +; strategy: +; if (track in cache) then { +; if (track in track_buffer) then +; perform user read from track buffer; +; else +; perform user read from cache; +; } +; else { +; read track into track buffer; +; read track buffer into cache; +; perform user read from track buffer; +; } +; +; cache transfers handled by freeing cache element if possible +; and making it lru +; +; uses: only dx assumed unchanged +; + call track_in_cache ; is track in cache + jc read_disk ; if not we have to read from disk +; + cmp cx,[track_buffer_cyln] ; is it in the track buffer + jnz not_in_mem ; no + cmp dx,[track_buffer_hddr] ; + jz read_bufferj ; yes +; +; read buffer from cache +; +not_in_mem: + push dx + xchg ax,bx ;get number of words in bx and start sect in ax + dec ax ;0 based number + mov cl,9 ; + shl ax,cl ;byte offset + xor dx,dx ; +; + mov cx,bx ;number of words + mov es,[bp.user_es] ; + mov di,[bp.user_off]; + shl bx,1 ; number of bytes + add [bp.user_off],bx ; update user offset +; + add ax,word ptr [si.base_offset] + adc dx,word ptr [si.base_offset.2] + xor bh,bh + push si + push ds + push bp + call blkmov + pop bp + pop ds + pop si + pop dx + jc err_cache + call cache_is_mru + clc + ret +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; track not in cache. see if free cache available to initiate transfer +; +read_disk: + cmp di,-1 ;free cache + jnz rd_part ;if present we can initiate read + stc ; else error exit + ret +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +read_bufferj: + jmp short read_buffer +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; cache element available. we can start by transferring track from disk +; to track buffer. +; +rd_part: + mov si,di ;get element in si + mov [track_buffer_cyln],-1 ;invalidate present track buffer + mov [track_buffer_hddr],-1 + mov [si.track_flags],track_free ;if read fails + push dx + push cx + push bx + push ax + or cl,1 + or dl,80h + mov al,[sect_in_trk] + mov ah,2 ; read + push cs + pop es + mov bx,[track_buffer_ptr] + pushf + cli + call [old_13] + jnc rd$1 + cmp ah,11h ;the int13 error which is not an error + je rd$1 + mov [int13err],TRUE + add sp,8 + mov al,ah + stc + ret +; +; transfer track buffer to cache +; +rd$1: + mov di,[track_buffer_ptr] ;es:di is transfer address + mov cx,[bytes_in_trk] + shr cx,1 ; cx is number words in track + mov bh,1 ;write + mov ax,word ptr [si.base_offset] ;address of cache + mov dx,word ptr [si.base_offset.2] ; + push ds + push si + push bp + call blkmov + pop bp + pop si + pop ds + pop ax + pop bx + pop cx + pop dx + jnc rd$2 +; +; error in transferring info to cache. invalidate cache element and +; make it lru +; +err_cache: + mov [si.track_flags],track_free + call cache_is_lru ; make cache element lru + stc + ret +; +; info transfer to cache successful. fill in track, head and drive +; info into cache control element and track buffer control element +; +if debug +rd_2: +endif +rd$2: + mov word ptr [si.track_cyln],cx + mov word ptr [si.track_drive],dx + and [si.track_flags], not track_free + mov word ptr [track_buffer_cyln],cx + mov word ptr [track_buffer_hddr],dx +; +; perform user i/o from track buffer +; +read_buffer: + call cache_is_mru +; + mov si,bx ; start sector + dec si ; 0 based number + mov cl,9 ; + shl si,cl ; byte offset in si + add si,[track_buffer_ptr] + mov cx,ax + mov es,[bp.user_es] + mov di,[bp.user_off] + cld +rep movsw + mov [bp.user_off],di + clc + ret +; +process_read_partial endp +; +process_block_read proc near +; +; inputs: ax = number of tracks +; dx = drive and head (8th bit stripped) +; cx = start track +; bp = user stack frame +; +; outputs: cy set if error +; cy clear if okay +; +; algorithm: +; +; repeat +; if (cur_trk in cache) then +; transfer track from cache to user buffer; +; no_of_trks = no_of_trks - 1 +; else +; accumulate tracks which are not in cache +; read these in one disk operation +; transfer these from user buffer to cache +; no_of_trks = no_of_trks - accumulated_trks +; until no_of_trks == 0 +; +pbr$1: +; +; since we are going to look ahead and see how many tracks can +; be dealt with together, we have to save start head and track +; + push cx ; save start head + push dx ; save start track + xor ah,ah ;number of accumulated tracks +pbr$2: call track_in_cache ; + jnc pbr$4 ; if current track in cache start processing + inc dh ; go to next track + call adj_hd_trk ; + inc ah ;accumulate the tracks + dec al ;are we done + jne pbr$2 ;go to see next track + pop dx ;restore start head and track + pop cx ; + call pr_acc_trks ;process the accumulated tracks + ret ;we are done +pbr$4: + pop dx ;restore start head and track + pop cx + or ah,ah ;are there any accumulated + je pbr$5 + call pr_acc_trks ;process the accumulated tracks + jc pbr$7 ;if carry set finish with error + add dh,ah ;adjust track and head + call adj_hd_trk + jmp pbr$1 +; +pbr$5: call pr_cur_trk ;process current track which is in cache + jc pbr$7 ;if carry set finish with error + inc dh + call adj_hd_trk +pbr$6: + dec al ;are we done? + jne pbr$1 ; + clc +pbr$7: ret +; +process_block_read endp +; +pr_acc_trks proc near +; +; inputs: cx = start track +; dh = start head +; ah = number of accumulated tracks +; +; outputs: if success :- cy clear, [bp.user_off] modified +; if failure :- cy set +; +; regs to be preserved: al,cx,si +; +; algorithm: +; +; read buffer from disk; +; for (cur_trk=start_trk,transfer_off=user_off; no_of_trks-- > 0; +; transfer_off=transfer_off+size_of_trk) do +; if ((cache=get_cache())!=-1) then +; transfer_trk_to_cache; +; else +; exit with error; +; +; + push si + push dx + push cx + push ax ; stack:- {ax,cx,dx,si} +; +; initialise int13 registers for reading the accumulated tracks into +; user memory. +; + mov al,ah ;number of tracks + xor ah,ah ;in ax +; + mul [sect_in_trk] ;get number of sectors in ax +; + mov ah,2 + or cx,1 ;start sector +; + or dl,80h ;set hard disk bit + mov bx,[bp.user_off]; + mov es,[bp.user_es] ; +; + pushf + cli + call [old_13] ;perform multi track read +; +; check for int 13 error +; + jnc pat$1 ;if okay proceed +; + add sp,8 ;clear stack + mov al,ah + mov [int13err],TRUE ; + stc + ret ;error exit +; +; we have succesfully read al tracks into user memory. now these have +; to transfer these to cache. +; +pat$1: and dl,not 80h ;clear off 8th bit + pop ax ;restore ax + pop cx ; + push cx ; + push ax +; + mov di,[bp.user_off];initialise transfer offset +; +; ah has number of tracks still left to be transferred +; di has transfer offset +; cx has current track number +; dx has current drive and head +; +pat$2: + call get_cache ;get free cache element +; +; si = cache element +; + cmp si,-1 ;was there an element + je pat$5 ;cache saturated exit +; +; check if track is in track buffer +; + cmp cx,[track_buffer_cyln] + jne pat$21 + cmp dx,[track_buffer_hddr] + jne pat$21 +; +; track is in track buffer. to avoid two transfers invalidate +; track buffer +; + mov [track_buffer_cyln],-1 + mov [track_buffer_hddr],-1 +; +; transfer track from user buffer to cache +; +pat$21: mov [si.track_flags],track_free ;if write fails + push cx + push ax + push ds + push si + push bp + push di + push dx +; + mov es,[bp.user_es] + mov cx,[bytes_in_trk] + shr cx,1 ;words + mov ax,word ptr [si.base_offset] + mov dx,word ptr [si.base_offset.2] + mov bh,1 ;write + call blkmov +; + pop dx + pop di + pop bp + pop si + pop ds + pop ax + pop cx +; + jnc pat$3 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; error in transferring information to cache. make it lru +; +; + call cache_is_lru +pat$5: + add sp,8 + stc + ret ;cache error exit +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; successfully transferred information to cache. fill in track and +; drive and head information into cache control element +; +pat$3: mov word ptr [si.track_cyln],cx + mov word ptr [si.track_drive],dx + and [si.track_flags],not track_free + call cache_is_mru + +; + add di,[bytes_in_trk] ;advance pointer in user transfer buffer to + ;next track +; + inc dh ;advance track + call adj_hd_trk +; +pat$4: dec ah ;have we processed all the accumulated trks + jne pat$2 + mov [bp.user_off],di ;update user transfer address to beyond + ;this accumulated block + pop ax + pop cx + pop dx + pop si + clc + ret ;success exit +; +pr_acc_trks endp +; +pr_cur_trk proc near +; +; inputs: +; si = cache element +; cx = current track +; dx = drive and head +; +; outputs: +; cy = set if error +; = clear if success +; +; algorithm: +; transfer track from cache to user memory +; + push ax + push cx + push dx + push si + push ds + push bp +; + mov cx,[bytes_in_trk] + shr cx,1 + mov ax,word ptr [si.base_offset] + mov dx,word ptr [si.base_offset.2] + mov es,[bp.user_es] + mov di,[bp.user_off] + xor bh,bh ;read + call blkmov +; + pop bp + pop ds + pop si + pop dx + pop cx + pop ax +; + jnc pct$1 +; + mov [si.track_flags],track_free + call cache_is_lru + stc + ret ;error exit +; +pct$1: call cache_is_mru + mov di,[bytes_in_trk] + add [bp.user_off],di + clc + ret +; +pr_cur_trk endp +; +process_write_partial proc near +; +; is used to write a partial track +; +; inputs: dx: int13 dx with high bit of dl set off +; cx: track +; bx: start sector +; ax: number of words +; +; outputs:cy set if error +; clear if success +; +; strategy: +; if (track in cache) then { +; if (track in track_buffer) then +; invalidate track buffer; +; perform user write into cache; +; } +; else { +; read track into track buffer; +; write track buffer into cache; +; } +; +; + call track_in_cache ;is track in cache + jc read_diskw ;if not we have to read from disk +; + cmp cx,[track_buffer_cyln] ;is it in the track buffer + jnz not_in_memw ;no + cmp dx,[track_buffer_hddr] ; + jnz not_in_memw ;no + ;yes +; + mov [track_buffer_cyln],-1 ;invalidate trk buf + mov [track_buffer_hddr],-1 ;to avoid two transfers +; +; update cache element from user buffer +; +not_in_memw: + push dx + xchg ax,bx ;get number of words in bx and start sect in ax + dec ax ;0 based number + mov cl,9 ; + shl ax,cl ;byte offset + xor dx,dx ; +; + mov cx,bx ;number of words + mov es,[bp.user_es] ; + mov di,[bp.user_off]; + shl bx,1 + add [bp.user_off],bx +; + add ax,word ptr [si.base_offset] + adc dx,word ptr [si.base_offset.2] + mov bh,1 ;write + push si + push ds + push bp + call blkmov + pop bp + pop ds + pop si + pop dx + jc err_cw + call cache_is_mru + clc + ret +; +; cache error +; +err_cw: mov [si.track_flags],track_free + call cache_is_lru + stc + ret +; +; track not in cache. see if free cache element available +; +read_diskw: + cmp di,-1 ;free cache + jnz rd_partw ;if present we can initiate read + stc + ret +; +; free cache element available. read track from disk into track buffer +; +rd_partw: + mov si,di ;get element in si + mov [track_buffer_cyln],-1 + mov [track_buffer_hddr],-1 + mov [si.track_flags],track_free + push dx + push cx + push bx + push ax + or cl,1 + or dl,80h + mov al,[sect_in_trk] + mov ah,2 + push cs + pop es + mov bx,[track_buffer_ptr] + pushf + cli + call [old_13] + jnc wr$1 + cmp ah,11h ;the int13 error which is not an error + je wr$1 + mov [int13err],TRUE + add sp,8 + mov al,ah + stc + ret +; +; since we have already updated disk, the track read doesn't need +; to be updated from user buffer. transfer track from track buffer +; into cache +; +wr$1: mov di,[track_buffer_ptr] ;es:di is transfer address + mov al,[sect_in_trk] + xor ah,ah + mov cl,8 + shl ax,cl + mov cx,ax + mov bh,1 ;write + mov ax,word ptr [si.base_offset] + mov dx,word ptr [si.base_offset.2] + push ds + push si + push bp + call blkmov + pop bp + pop si + pop ds + pop ax + pop bx + pop cx + pop dx + jnc wr$2 + ret +; +; information successfully transferred to cache. fill in cache +; control element with the info on head, drive and track +; +wr$2: + mov word ptr [si.track_cyln],cx + mov word ptr [si.track_drive],dx + and [si.track_flags], not track_free + mov word ptr [track_buffer_cyln],cx + mov word ptr [track_buffer_hddr],dx +; + call cache_is_mru +; + shl ax,1 + add [bp.user_off],ax + clc + ret +; +process_write_partial endp +; +; +process_block_write proc near +; +; al = number of tracks +; cx = start track +; dx = drive and start head +; bp = user stack frame +; +; cy set if error +; cy clear if success +; +; algorithm: for (cur_trk=st_trk; trks-- > 0; ) +; if (cur_trk in cache) then +; write cur_trk from user buffer into cache; +; else { +; get a free cache element; +; write cur_trk from user buffer into this cache elem +; } +; + mov di,[bp.user_off] +; +pbw$1: push di ;save it because next call destroys di + call track_in_cache ;is the track in cache + jnc pbw$2 +; + cmp di,-1 ;no free cache + je pbw$4 ;error exit +; + mov si,di ;track was not in cache. now there will be one + mov [si.track_flags],track_free + mov word ptr [si.track_cyln],cx + mov word ptr [si.track_drive],dx +; +pbw$2: pop di +; +; check if it is in track buffer also in which case invalidate trk buffer +; + cmp cx,[track_buffer_cyln] + jne pbw$21 + cmp dx,[track_buffer_hddr] + jne pbw$21 +; +; invalidate track buffer to avoid two transfers +; + mov [track_buffer_cyln],-1 + mov [track_buffer_hddr],-1 +; +; update cache from user buffer +pbw$21: + push cx ; + push ax + push ds + push si + push bp + push di + push dx +; + mov es,[bp.user_es] + mov cx,[bytes_in_trk] + shr cx,1 + mov ax,word ptr [si.base_offset] + mov dx,word ptr [si.base_offset.2] + mov bh,1 + call blkmov +; + pop dx + pop di + pop bp + pop si + pop ds + pop ax + pop cx +; + jnc pbw$22 + jmp err_cw +; +pbw$22: and [si.track_flags],not track_free +; + inc dh ;go to next track + call adj_hd_trk +pbw$3: add di,[bytes_in_trk] + call cache_is_mru +; + dec al ; are we done + jne pbw$1 +; +; success exit + mov [bp.user_off],di + clc + ret +; +; error exit +; +pbw$4: pop di + stc + ret +; +process_block_write endp +; +check_parameters proc near +; +; inputs: same as int13 registers except for +; BP - user_stack_frame +; BX - function (either read or write) +; DS - int13code segment +; +; outputs: carry set if params invalid +; carry clear if params okay +; +; if parameters okay : +; dl - drive with high bit off +; bx - sector number +; cl - cleared of the sector number +; +; +; check for number of drives +; + and dl, not 80H ; turn off high bit of drive + cmp dl,MAX_HARD_FILES ; more than allowed drives? + jae bad_parmx ; error. +; +; check for number of sectors +; + or al,al ; zero sectors ? + je bad_parmx ; error. +; + cmp al,80h ; more than 80h sectors ? + ja bad_parmx ; error. +; +; check for wrap in user transfer address +; + mov di,[bp.user_bx] ; es:di is transfer address + xor ah,ah ; ax has number of sectors + mov si,ax ; get it into si + push cx ; + mov cl,9 + shl si,cl ; convert number of sectors into + ; number of bytes + dec si ; convert into zero based number + pop cx ; + add di,si ; add to transfer address offset + jc bad_parmx ; if exceeds 64k offset then wrap +; +; get drive number into di to use as offset into sect / trk table +; + mov di,dx ; drive number + and di,0000000011111111B ; just get the relevant bits +; +; form sector number in bx and compare against allowed number of sectors +; in track on the drive indicated +; + mov bx,cx ; + and bx,0000000000111111B ; bl will then have sector number + or bx,bx ; zero sector number + je bad_parmx ; is bad + cmp bl, [di.sectrkarray] ; is it more than number of sectors + ; allowed + ja bad_parmx ; +; +; check head parameter +; + cmp dh,[di.hdarray] ; is it more than max useable val for drive + ja bad_parmx ; +; +; do we need some code to check if read exceeds tracks in system ? +; should we also put a limit on the number of sectors that could +; be looked up in cache ? +; +; +; clear off sector number from cl to leave just trk number in cx +; + and cl,11000000B ; clear off sector number +; +; store sectors in track for current drive and bytes in track for +; current drive in memory +; + push bx + push cx + mov bl,[di.hdarray] + mov [max_hd],bl ; maximum head number for cur. drive + mov bl,[di.sectrkarray] ; number of sectors in trk + mov [sect_in_trk],bl ; store this + mov cl,9 + shl bx,cl ; bytes in track + mov [bytes_in_trk],bx ; store this + pop cx + pop bx + clc + ret ;return with no error +; +bad_parmx: + stc + ret +; +check_parameters endp +; +process_regions proc near +; +; inputs: bx - start sector +; al - number of sectors +; cx - start track +; +; outputs: none +; +; action: initialise regions struct +; + mov byte ptr [REGION.FLAG],0 ; clear regions flag + cmp bx,1 ; if start sector is one + je pr$2 ; might as well start with region2 +; +; process region1 +; + or [REGION.FLAG],REG1_P ; mark region1 present + mov ah,[sect_in_trk] ; get sectors in track + sub ah,bl ; remaining number of sectors in track + inc ah ; adjust 0 based numb to one based numb + cmp ah,al + jbe pr$1 ; if below or equal ah has number of sectors + ; in region1 + mov ah,al ; else all the sectors are in region1 +pr$1: sub al,ah ; adjust number of sectors + mov [REGION.REG1.START_H],dh + mov [REGION.REG1.START_T],cx + mov [REGION.REG1.START_S],bx + push cx ; save these registers + push ax ; + mov al,ah ; + xor ah,ah ; ax has number of sectors now + mov cl,8 ; + shl ax,cl ; multiply by 256 to get number of words + mov [REGION.REG1.COUNT],ax ; store this count + pop ax ; + pop cx + inc dh + call adj_hd_trk +; +; process region2 +; +pr$2: or al,al ; are we done + je pr$end ; + xor ah,ah ; ax has number of sectors + div [sect_in_trk] ; find number of tracks + or al,al ; al will have number of full tracks + ; ah will have number of sectors left + je pr$3 ; if no full tracks no region2 +; + or [REGION.FLAG],REG2_P ; mark region2 present + mov [REGION.REG2.START_H],dh + mov [REGION.REG2.START_T],cx; store start track + mov [REGION.REG2.TRACKS],al ; and number of tracks + add dh,al ; adjust track number + call adj_hd_trk +; +; process region3 +; +pr$3: or ah,ah ; are we done (no sectors left) + je pr$end ; if yes go to fin + or [REGION.FLAG],REG3_P ; else mark region3 present + mov [REGION.REG3.START_H],dh + mov [REGION.REG3.START_T],cx ;store track number + mov cl,8 + mov al,ah + xor ah,ah ; convert number of sectors into number of + shl ax,cl ; words + mov [REGION.REG3.COUNT],ax ; store this +pr$end: +; + ret +; +process_regions endp +; +; Support Routines: +; +; +track_in_cache proc near +; +; input: dl = drive number with bit 8 set off +; cx = cylinder number +; + mov di,-1 ; di will return lru item nearest to matching + ; element, -1 if none + mov si,[cache_head] ; start with mru cache entry + inc si ; to counter next instruction +nexte: + dec si ; to counter last instruction in the loop + test [si.track_flags],track_locked ; is the track locked? + jnz no_set ; + mov di,si ; if not locked update di to this element +no_set: + test [si.track_flags],track_free ; is element free + jnz skipe ; if free we need not check this one + cmp dx,word ptr [si.track_drive] ; if not free check drive+head + jnz skipe ; + cmp cx,[si.track_cyln] ; and cylinder number + jz tic$1 ; if found exit routine +skipe: + mov si,[si.fwd_lru_lnk] ; else go to check next cache element + inc si ; if last element was end then si = -1 + jnz nexte ; and incrementing it will set zero flag + stc + ret +tic$1: clc + ret +; +track_in_cache endp +; +get_cache proc near +; +; inputs: none +; outputs: si = lru cache element not locked +; = -1 if all elems locked +; + mov si,[cache_tail] ;start with lru element + inc si ;to counter next instruction +gc$1: + dec si ; to counter last instruction in loop + test [si.track_flags],track_locked ; is the element locked + jz gc$2 ; if not locked this is the lucky(?) guy +; + mov si,[si.back_lru_lnk] ; else go back in chain to check the + ; next recently used cache element + inc si ; as before -1 is the end of chain + jnz gc$1 ; incrementing it will set zero flag +; + dec si ; no element found, si = -1 +; +gc$2: ret +; +get_cache endp +; +adj_hd_trk proc near +; +; inputs: ch,cl track number +; dh changed head number to be checked and adjusted +; +; outputs: cx and dh updated +; + pushf +aht$1: cmp dh,[max_hd] ;is the head number > heads on drive + jbe aht$2 + sub dh,[max_hd] ;if so decrease head number by number of + ;heads on drive + dec dh ;by one more + add ch,1 ;and step to next track + jnc aht$1 + add cl,40h + jmp aht$1 +aht$2: popf + ret +; +adj_hd_trk endp + +CACHE_HIT PROC NEAR +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING +CACHE_HIT ENDP + + +;** INVALIDATE_CACHE -- Discard all cache info +; +; ENTRY +; Cache is flushed (If it is not, all dirty info will simply be chucked) +; EXIT +; All elements of cache are marked free +; USES +; BX,FLAGS +; +INVALIDATE_CACHE PROC NEAR +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + MOV BX,[CACHE_HEAD] + INC BX ; Counter next instruction +NEXTC: + DEC BX + MOV [BX.TRACK_FLAGS],TRACK_FREE + MOV BX,[BX.FWD_LRU_LNK] + INC BX + JNZ NEXTC + ; + ; Track buffer invalid too + ; + MOV [TRACK_BUFFER_CYLN],-1 + MOV [TRACK_BUFFER_HDDR],-1 + MOV [DIRTY_CACHE],0 + ret + +INVALIDATE_CACHE ENDP + +;** CACHE_IS_MRU -- Put cache element in LRU chain at MRU position +; +; ENTRY +; SI points cache element to place at MRU position +; EXIT +; SI is at MRU position (head) +; USES +; DI,FLAGS +; +CACHE_IS_MRU PROC NEAR +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + push di + CMP SI,[CACHE_HEAD] + JZ RET444 + CALL UNLINK_CACHE + MOV DI,SI + XCHG DI,[CACHE_HEAD] + MOV [DI.BACK_LRU_LNK],SI + MOV [SI.FWD_LRU_LNK],DI + MOV [SI.BACK_LRU_LNK],-1 +RET444: pop di + RET + +CACHE_IS_MRU ENDP + +;** CACHE_IS_LRU -- Put cache element in LRU chain at LRU position +; +; ENTRY +; SI points to cache element to place at LRU position +; EXIT +; SI is at LRU position (tail) +; USES +; DI,FLAGS +; +CACHE_IS_LRU PROC NEAR +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + push di + CMP SI,[CACHE_TAIL] + JZ RET555 + CALL UNLINK_CACHE + MOV DI,SI + XCHG DI,[CACHE_TAIL] + MOV [DI.FWD_LRU_LNK],SI + MOV [SI.BACK_LRU_LNK],DI + MOV [SI.FWD_LRU_LNK],-1 +RET555: pop di + RET + +CACHE_IS_LRU ENDP + +;** UNLINK_CACHE -- Unlink cache element from LRU chain +; +; ENTRY +; SI points to element to unlink +; EXIT +; SI is unlinked +; USES +; DI,FLAGS +; +UNLINK_CACHE PROC NEAR +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + PUSH BX + MOV DI,[SI.BACK_LRU_LNK] ; Get prev guy + INC DI ; Guy First? + JZ NEW_HEAD ; Yes + DEC DI + MOV BX,[SI.FWD_LRU_LNK] ; Get next guy + MOV [DI.FWD_LRU_LNK],BX ; Prev fwd is my fwd + INC BX ; Is that guy last? + JZ NEW_TAIL ; Yes + DEC BX + MOV [BX.BACK_LRU_LNK],DI ; Next back is my back +NULL_CACHE: + POP BX + RET + +NEW_HEAD: + MOV DI,[SI.FWD_LRU_LNK] ; Is head also tail? + INC DI + JZ NULL_CACHE ; Yes + DEC DI + MOV [CACHE_HEAD],DI ; New head + MOV [DI.BACK_LRU_LNK],-1 ; New head has no back link + POP BX + RET + +NEW_TAIL: + MOV [CACHE_TAIL],DI ; New tail + POP BX + RET +UNLINK_CACHE ENDP + +RETRY_CNT DB ? + +;** WRITE_FROM_CACHE -- Write out cache element to disk +; +; ENTRY +; SI -> cache element to write +; EXIT +; Carry Clear +; Written OK +; Track buffer is set to this track +; Carry Set +; Error, AL is error code +; Track buffer is set to empty +; USES +; AX,BX,CX,DX,ES,DI,FLAGS +; +WRITE_FROM_CACHE PROC NEAR +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + ; + ; First transfer track down to track buffer because we can't write + ; direct to extended or expanded mem with INT 13 + ; + PUSH CS + POP ES + MOV DI,[TRACK_BUFFER_PTR] ; ES:DI is transfer addr for BLKMOV + MOV BX,WORD PTR [SI.TRACK_DRIVE] + XOR BH,BH + MOV AL,[BX.SECTRKARRAY] + XOR AH,AH + PUSH AX + MOV CL,8 + SHL AX,CL ; AX is words in track + MOV CX,AX + XOR BH,BH ; Read + MOV AX,WORD PTR [SI.BASE_OFFSET] + MOV DX,WORD PTR [SI.BASE_OFFSET.2] ; DX:AX is address in mem + PUSH DS + PUSH SI + PUSH BP + CALL BLKMOV ; Track buffer contents to track buffer + POP BP + POP SI + POP DS + JC ERR_FLP + POP AX ; AL is sec/trk + ; + ; Now write it out to drive from the track buffer + ; + MOV CX,[SI.TRACK_CYLN] + MOV DX,WORD PTR [SI.TRACK_DRIVE] + MOV [TRACK_BUFFER_CYLN],CX ; Set track buffer currency + MOV [TRACK_BUFFER_HDDR],DX + OR CL,1 + OR DL,80H + MOV AH,3 + PUSH CS + POP ES + MOV BX,[TRACK_BUFFER_PTR] + PUSH AX + MOV [RETRY_CNT],5 +RETRY_WRITE: + PUSHF + CALL [OLD_13] ; Write it out + JC ERR_RETRY +NO_ERR1: + POP AX +ERR_FL: + ret + +ERR_RETRY: + CMP AH,11H ; The error that is not an error? + JZ NO_ERR1 ; Yes, cmp cleared carry + PUSH AX ; Save error in AH + MOV AH,0 ; Reset + INT 13H + POP AX ; Get error back + DEC [RETRY_CNT] + JZ SET_ERR ; Return error + POP AX ; Recover correct AX for INT 13 + PUSH AX + JMP RETRY_WRITE + +SET_ERR: + MOV AL,AH ; INT 13 error to AL +ERR_FLP: + ADD SP,2 + STC + MOV [TRACK_BUFFER_CYLN],-1 ; Zap the track buffer + MOV [TRACK_BUFFER_HDDR],-1 + JMP ERR_FL + +WRITE_FROM_CACHE ENDP + +;** FLUSH_CACHE -- Flush specific cache element if it's dirty +; +; ENTRY +; SI points to element to flush +; EXIT +; Carry Clear +; SI is flushed if it was dirty +; SI.TRACK_FLAGS dirty bit clear +; Track buffer set to this track +; Carry Set +; SI could not be flushed +; SI.TRACK_FLAGS = free +; AL is error code +; Track buffer set to empty +; USES +; AX,BX,CX,DX,ES,DI,FLAGS +; +FLUSH_CACHE PROC NEAR +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + TEST [SI.TRACK_FLAGS],TRACK_FREE ; Clears carry + JNZ IGNORE_TRK + TEST [SI.TRACK_FLAGS],TRACK_DIRTY ; Clears carry + JZ IGNORE_TRK + CALL WRITE_FROM_CACHE + DEC [DIRTY_CACHE] ; Doesn't effect carry + JC FLUSH_ERRX + AND [SI.TRACK_FLAGS],NOT TRACK_DIRTY ; Clears carry +IGNORE_TRK: + ret + +FLUSH_ERRX: + MOV [SI.TRACK_FLAGS],TRACK_FREE ; Track gone, unlocked + RET + +FLUSH_CACHE ENDP + +;** FLUSH_WHOLE_CACHE_SAV -- Flush all dirty cache elements saving regs +; +; ENTRY +; None +; EXIT +; Cache flushed +; USES +; FLAGS +; +FLUSH_WHOLE_CACHE_SAV PROC NEAR +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING + ; Simulate PUSHA + PUSH AX + PUSH CX + PUSH DX + PUSH BX + PUSH BX ; dummy for push sp + PUSH BP + PUSH SI + PUSH DI + ; + PUSH DS + PUSH ES + PUSH CS + POP DS +ASSUME DS:INT13CODE + CALL FLUSH_WHOLE_CACHE + POP ES + POP DS + ; Simulate POPA + POP DI + POP SI + POP BP + POP BX ; Dummy for pop sp + POP BX + POP DX + POP CX + POP AX + ; + ret +FLUSH_WHOLE_CACHE_SAV ENDP + +;** FLUSH_WHOLE_CACHE -- Flush all dirty cache elements +; +; ENTRY +; None +; EXIT +; Cache flushed +; USES +; AX,BX,CX,DX,ES,SI,DI,FLAGS +; +FLUSH_WHOLE_CACHE PROC NEAR +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + MOV SI,[CACHE_HEAD] + INC SI ; Counter next instruction +FLSH_LP: + DEC SI + CALL FLUSH_CACHE + MOV SI,[SI.FWD_LRU_LNK] + INC SI + JNZ FLSH_LP +FLUSH_DONE: + MOV [DIRTY_CACHE],0 ; No dirty guys in cache + ret + +FLUSH_WHOLE_CACHE ENDP + +BREAK + +; +; The following label defines the start of the I/O code which is driver type +; specific. +; +; THE TYPE 2 driver must REPLACE this code with code appropriate +; to the driver type. +; + EVEN ; Force start of drive code to word boundary + +DRIVE_CODE LABEL WORD + +EXTMEM_LOW EQU 0000H ; 24 bit addr of start of extended memory +EXTMEM_HIGH EQU 0010H + +;** BASE_ADDR data element +; +; The next value defines the 24 bit address of the start of the memory for +; the cache. It is equal to the EMM_BASE value in the +; EMM_REC structure for the cache. +; +; NOTE THAT IT IS INITIALIZED TO THE START OF EXTENDED MEMORY. This is +; because BLKMOV is used to read the EMM_CTRL sector during initialization +; of a TYPE 1 driver. +; +; NOTE: This data element is shared by TYPE 1, 2 drivers, but +; its meaning and correct initial value are driver type specific. +; + +;; NOTE: The value at BASE_ADDR is patched during initialization when +;; loading a RAMDrive into upper extended memory on a PLUS +;; +BASE_ADDR LABEL DWORD ; 24 bit address of start of this RAMDRV + DW EXTMEM_LOW + DW EXTMEM_HIGH +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;** BLKMOV - Perform transfer for TYPE 1 driver +; +; This routine is the transfer routine for moving bytes +; to and from the AT extended memory in real mode using +; the LOADALL instruction. The LOADALL instruction is used +; to set up a segment descriptor which has a 24 bit address. +; During the time the LOADALL 24 bit segment descriptor is +; in effect we must have interrupts disabled. If a real mode +; 8086 interrupt handler was given control it might perform +; a segment register operation which would destroy the special +; segment descriptor set up by LOADALL. This is prevented by +; doing a CLI during the "LOADALL time". +; +; WARNING NUMBER ONE: +; THIS CODE WILL NOT WORK ON ANY 80286 MACHINE WHERE THE NMI +; INTERRUPT IS ANYTHING BUT A FATAL, SYSTEM HALTING ERROR. +; +; Since it is bad to leave interrupts disabled for a long +; time, the I/O is performed 256 words at a time enabling +; interrupts between each 256 word piece. This keeps the time +; interrupts are disabled down to a reasonable figure in the 100mSec +; range. +; +; To use the LOADALL instruction 102 bytes at location 80:0 must +; be used. INT13 copies the contents of 80:0 into its own buffer, +; copies in the LOADALL info, performs the LOADALL, and then copies +; back the previous contents of 80:0. These operations are all +; performed during the time interrupts are disabled for each 256 word +; block. This must be done with interrupts disabled because this area +; on DOS 2.X and 3.X contains variable BIOS data. +; +; In order to gain full 24 bit addressing it is also required +; that address line 20 be enabled. This effects 8086 compatibility +; on 80286 systems. This code leaves address line 20 enabled +; for the ENTIRE duration of the I/O because it is too time +; expensive to disable/enable it for each 256 word block. +; +; WARNING NUMBER TWO: +; IF A MULTITASKING PRE-EMPTIVE SYSTEM SCHEDULES AND RUNS +; AN APPLICATION WHICH RELIES ON THE 1 MEG ADDRESS WRAP +; PROPERTY OF THE 8086 AND 8088 DURING THE TIME INT13 +; IS IN THE MIDDLE OF DOING AN I/O WITH ADDRESS LINE 20 ENABLED, +; THE APPLICATION WILL NOT RUN PROPERLY AND MAY DESTRUCT THE +; INT13 MEMORY. +; +; METHOD: +; Perform various LOADALL setup operations +; Enable address line 20 +; While there is I/O to perform +; Do "per 256 word block" LOADALL setup operations +; Set up copy of 80:0 to INT13 buffer +; CLI +; copy 80:0 to INT13 buffer +; copy LOADALL info to 80:0 +; LOADALL +; do 256 word transfer +; copy INT13 80:0 buffer back to 80:0 +; STI +; Disable address line 20 +; +; SEE ALSO +; INTEL special documentation of LOADALL instruction +; +; ENTRY: +; ES:DI is packet transfer address. +; CX is number of words to transfer. +; DX:AX is 32 bit start byte offset (0 = start of cache) +; BH is 1 for WRITE, 0 for READ +; +; BASE_ADDR set to point to start of cache memory +; This "input" is not the responsibility of the caller. It +; is up to the initialization code to set it up when the +; device is installed +; +; EXIT: +; Carry Clear +; OK, operation performed successfully +; Carry Set +; Error during operation, AL is error number (INT 13 error) +; +; USES: +; ALL +; +; This routine is specific to TYPE 1 driver +; +; sunilp - incorporated blkmov_386 (thanks to gregh) +; incorporated loadall_286 trick (thanks to scottra) +; added new a20 functionality +; ideally the code should be all relocatable abd the 386 +; blkmov should be relocated on the 286 blkmov for the +; 386 case. Also the A20 routines for the Olivetti or PS/2 +; should also ideally be relocated on top of the normal A20 + +BLKMOV: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + test [sys_flg],M_386 + je blkmov_286 + jmp blkmov_386 + ; + ; Compute 32 bit address of start of I/O + ; +blkmov_286: + ADD AX,WORD PTR [BASE_ADDR] + ADC DX,WORD PTR [BASE_ADDR + 2] + ; + ; Dispatch on function + ; + OR BH,BH + JZ READ_IT + ; + ; Write + ; + MOV WORD PTR [ESDES.SEG_BASE],AX + MOV BYTE PTR [ESDES.SEG_BASE + 2],DL +; MOV [LSI],DI + mov [lbx],di ;sp + MOV [LDI],0 + MOV SI,OFFSET DSDES + JMP SHORT SET_TRANS + +READ_IT: + MOV WORD PTR [DSDES.SEG_BASE],AX + MOV BYTE PTR [DSDES.SEG_BASE + 2],DL + MOV [LDI],DI +; MOV [LSI],0 ;sp + mov [lbx],0 + MOV SI,OFFSET ESDES +SET_TRANS: + MOV AX,ES + CALL SEG_SET ; Set ES or DS segreg + ; + ; Set stack descriptor + ; + MOV AX,SS + MOV [LSSS],AX + MOV SI,OFFSET SSDES + CALL SEG_SET + MOV [LSP],SP +; SUB [LSP],2 ; CX is on stack at LOADALL +; +; the loadall kludge +; + mov ax,cs ;sp + inc ax ;sp + mov [lcss],ax ;sp + mov si,offset CSDES ;sp + mov ax,cs ;sp + call seg_set ;sp + ; + ; Set Other LOADALL stuff + ; + SMSW [LDSW] + SIDT FWORD PTR [IDTDES] + SGDT FWORD PTR [GDTDES] + ; + ; NOW The damn SXXX instructions store the desriptors in a + ; different order than LOADALL wants + ; + MOV SI,OFFSET IDTDES + CALL FIX_DESCRIPTOR + MOV SI,OFFSET GDTDES + CALL FIX_DESCRIPTOR + ; + ; Enable address line 20 + ; + +;; +;; Enable address line 20 on the PC AT or activate A20-A23 on the 6300 PLUS. +;; The former can be done by placing 0dfh in AH and activating the keyboard +;; processor. On the PLUS, 90h goes in AL and the port at 03f20h is written. +;; So the combined value of 0df90h can be used for both machines with +;; appropriate coding of the called routine A20. +;; + +;; MOV AH,0DFH + mov ax,cs:[A20On] ;; set up for PLUS or AT + CALL A20 + Jc NR_ERR +; JMP SHORT IO_START ;sp + jmp short move_main_loop ;sp + +NR_ERR: + MOV AL,0AAH ; Drive not ready error + STC + RET + +;IOLOOP: ;sp +; PUSH CX ;sp + +move_main_loop: ;sp +assume ds:nothing ;sp + jcxz io_done ;sp + mov cs:[ldx],cx ;sp + MOV AX,80H + MOV DS,AX + PUSH CS + POP ES + XOR SI,SI + MOV DI,OFFSET cs:[SWAP_80] + MOV CX,102/2 + mov cs:[ssSave],ss + CLD + CLI ; Un interruptable + REP MOVSW ; Save contents of 80:0 + PUSH DS + PUSH ES + POP DS + POP ES + XOR DI,DI + MOV SI,OFFSET cs:LOADALL_TBL + MOV CX,102/2 + REP MOVSW ; Transfer in LOADALL info + DW 050FH ; LOADALL INSTRUCTION +AFTER_LOADALL: +; set up stack for moving 80:0 information back again +; + xor bp,bp + mov ss,ax + mov si,offset cs:[swap_80] + mov cx,102/2 +move_loop: + lods word ptr cs:[si] + mov ss:[bp],ax + inc bp + inc bp + loop move_loop + mov ss,cs:[ssSave] + mov cx,dx + mov si,bx +;critical code + sti + rep movsw + cli ; bugfix sunilp + mov ax,cs + dec ax + push ax + mov ax,offset io_done + push ax + db 0cbh +; + db 16 dup (0fah) ; bugfix sunilp + mov ax,cs + dec ax + push ax + mov ax,offset resume_int + push ax + db 0cbh +; +resume_int: + mov cs:[ldi],di + mov cs:[lbx],si + jmp move_main_loop + +; REP MOVSW ; Move data +;IO_START: +; JCXZ IODN +; MOV WORD PTR [LCX],256 ; ASSUME full block +; SUB CX,256 +; JNC IOLOOP ; OK +; ADD [LCX],CX ; OOPs, partial block +; XOR CX,CX ; This is the last block +; JMP IOLOOP + +;IODN: +io_done: + sti ; bugfix sunilp + MOV CX,800H ; Retry this many times +OFFLP: + +;; +;; Reset of line A20 on the PC AT requires writing 0ddh to the keyboard +;; processor. On the PLUS, the appropriate value is 00. +;; + +;; MOV AH,0DDH + mov ax,cs:[A20Off] ;; setup for PLUS or AT. ah for IBM, al for PLUS + CALL A20 ; Disable address line 20 + jnc dis_done + LOOP OFFLP +dis_done: + CLC + RET + +;** A20 - ENABLE/DISABLE ADDRESS LINE 20 ON IBM PC-AT +; +; This routine enables/disables address line 20 by twiddling bits +; in one of the keyboard controller registers. +; +; SEE ALSO +; IBM Technical Reference Personal Computer AT Manual #1502243 +; Page 5-155 +; +; ENTRY +; AH = 0DDH to disable A20 +; AH = 0DFH to enable A20 +; EXIT +; CY Failed +; NC Succeeded +; USES +; AL, FLAGS +; +; WARNING If this routine is called in a CLI state this routine has +; the side effect of enabling interrupts. +; +; This routine is specific to TYPE 1 driver +; + +A20: +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING +;; CS override needed on S5_FLAG to avoid phase errors on +;; forward declaration of this variable. + cmp cs:[S5_FLAG],S_OLIVETTI ;; test for 6300 PLUS + jne test_vec ;; yes, do this code + jmp a20s5 +test_vec: + cmp cs:[S5_FLAG],S_VECTRA + jne test_ps2 + jmp VecA20 +test_ps2: + test cs:[sys_flg],M_PS2 ; is it a ps2 machine + jne a20ps2 ; if yes it has separate a20 routine +old_a20: + CLI + call check_a20 ; check to see if it can be enb /disb + jc a20suc ; no it may not be toggled + CALL E_8042 + JNZ a20err + MOV AL,0D1H + OUT 64H,AL + CALL E_8042 + JNZ a20err + MOV AL,AH + OUT 60H,AL + CALL E_8042 + JNZ a20err + ; + ; We must wait for the a20 line to settle down, which (on an AT) + ; may not happen until up to 20 usec after the 8042 has accepted + ; the command. We make use of the fact that the 8042 will not + ; accept another command until it is finished with the last one. + ; The 0FFh command does a NULL 'Pulse Output Port'. Total execution + ; time is on the order of 30 usec, easily satisfying the IBM 8042 + ; settling requirement. (Thanks, CW!) + ; + mov al,0FFh ;* Pulse Output Port (pulse no lines) + out 64H,al ;* send cmd to 8042 + CALL E_8042 ;* wait for 8042 to accept cmd + jnz A20Err + +A20Suc: sti + clc + RET +A20Err: sti + stc + ret +; +; Helper routine for A20. It waits for the keyboard controller to be "ready". +; +E_8042: +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING + PUSH CX + XOR CX,CX +E_LOOP: + IN AL,64H + AND AL,2 + LOOPNZ E_LOOP + POP CX + RET +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; A20 status checking. If request is to enable a20 we must check to +; see if it is already enabled. If so we just set the sys_flg to +; indicate this. On disabling the routine checks to see if disabling +; is allowed +; +check_a20: +assume ds:nothing,es:nothing,ss:nothing + cmp ah,0ddh ; is it a disable operation + jne check_a20_enable +; +; check if a20 disabling allowed +; + test cs:[sys_flg],a20_st + jne no_toggle +toggle: clc + ret +; +; a20 enabling, check if allowed +; +check_a20_enable: + and cs:[sys_flg], not A20_ST + push cx + push ds + push si + push es + push di + lds si,cs:low_mem + les di,cs:high_mem + mov cx,3 + cld +repe cmpsw + pop di + pop es + pop si + pop ds + jcxz not_enabled + pop cx + or cs:[sys_flg],A20_ST +no_toggle: + stc + ret +not_enabled: + pop cx + clc + ret + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; A20 routine for PS2s. The PS2 A20 hardware has shifted and toggling +; a bit in the system port is all that is required. +A20PS2: +assume ds:nothing,es:nothing,ss:nothing + cli +; +; first separate disable operation from enable operation +; + cmp ah,0ddh + je disbl_PS2 +; +; enabling the a20 +; + and cs:[sys_flg],not A20_ST + in al,PS2_PORTA ; input a20 status + test al,GATE_A20 ; is the a20 line set + je set_it ; + or cs:[sys_flg],A20_ST ; indicate that it was already set +ps2a20suc: + clc + sti + ret + +set_it: push cx + xor cx,cx + or al,GATE_A20 + out PS2_PORTA,al ; set it +see_agn: + in al,PS2_PORTA ; read status again + test al,GATE_A20 + loopz see_agn + pop cx + jz ps2err + clc + sti + ret +; +; disabling the ps2 +; +disbl_PS2: + test cs:[sys_flg],A20_ST + jne ps2a20suc +; + push cx + xor cx,cx + in al,PS2_PORTA + and al,not GATE_A20 + out PS2_PORTA,al +see_agn1: + in al,PS2_PORTA + test al,GATE_A20 + loopnz see_agn1 + pop cx + jnz ps2err + clc + sti + ret +; +ps2err: + stc + sti + ret + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;* VECA20 - Address enable/disable routine for Vectra family computers +;; +;; This routine does the same function as A20 for Vectra machines. +;; Vectra machines require writing single byte as opposed to +;; double byte commands to the 8041. This is due to a bug +;; in older versions in the Vectra 8041 controllers. IBM +;; machines must use double byte commands due to lack of +;; implementation of single byte commands in some of their machines. +;; +;; Uses al, flags +;; Has same results as A20 +;; +VecA20: + CLI + call check_a20 + jc VecA20Suc + call E_8042 + jnz VecA20Err + mov al,ah ;sigle byte command is code passed + out 64H,al + call E_8042 + jnz VecA20Err +; See A20 for a description of the following code. It simply makes +; sure that the previous command has been completed. We cannot +; pulse the command reg since there is a bug in some Vectra 8041s +; instead we write the byte again knowing that when this one is +; accepted the previous one has been processed. + mov al,ah + out 64H,al + call E_8042 + jnz VecA20Err +VecA20Suc: + sti + clc + ret +VecA20Err: + sti + stc + ret + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;* A20S5 - Address enable/disable routine for the 6300 PLUS. +;; +;; This routine enables lines A20-A23 on the PLUS by writing +;; to port 03f20h. Bit 7 turns the lines on, and bit 4 sets +;; the power-up bit. To disable the lines, the processor +;; must be reset. This is done by saving the world and +;; jumping to the ROM 80286 reset code. Since the power-up bit +;; is set, the data segment is set to the BiosSeg at 40h +;; and a jump is then made to the address at RealLoc1. +;; At RealLoc1, one can find the CS:IP where the code +;; is to continue. +;; +;; Uses ax, flags. +;; Returns with zero flag set. +;; +A20S5: test [reboot_flg],0ffh ;; sunilp + jne a20s5boot ;; sunilp + cli + or al,al ;; if zero, then resetting processor + jnz A20S5Next + call RSet ;; must return with entry value of ax +A20S5Next: + push dx ;; set/reset port + mov dx,3f20h + out dx,al + pop dx + clc ;; sunilp modification cy flag now important + STI + RET + +;;* a20S5BOOT - This code bypasses the processor reset on a reboot +;; of the 6300 PLUS. Otherwise the machine hangs. +a20s5BOOT: ;; use this code before reboot + cli + jmp short a20s5next + +OldStackSeg dw 0 ;; used during PLUS processor reset + ;; to save the stack segment + +;;* Rset - Reset the 80286 in order to turn off the address lines +;; on the 6300 PLUS. Only way to do this on the +;; current hardware. The processor itself can be +;; reset by reading or writing prot 03f00h +;; +;; Uses flags. +;; +RSet: + pusha ;; save world + push ds ;; save segments + push es + mov ax,BiosSeg ;; point to the bios segment + mov ds,ax ;; ds -> 40h +assume ds:BiosSeg + push word ptr [RealLoc1] ;; save what might have been here + push word ptr [RealLoc1+2] + mov word ptr [RealLoc1],cs:[offset ReturnBack] ;; load our return address + mov word ptr [RealLoc1+2],cs +assume ds:nothing + mov [OldStackSeg],ss ;; save the stack segment, too + mov dx,03f00h ;; reset the processor + in ax,dx + nop + nop + nop + cli + hlt ;; should never get here +ReturnBack: + mov ss,[OldStackSeg] ;; start the recovery +assume ds:BiosSeg + pop word ptr [RealLoc1+2] + pop word ptr [RealLoc1] + pop es + pop ds + popa + ret +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +blkmov_386: ;_protect: +assume ds:int13code,es:nothing,ss:nothing +; +; Compute 32 bit address of start of I/O +; + add ax,word ptr [base_addr] + adc dx,word ptr [base_addr + 2] +; + push cx +; +; Are we in virtual mode +; + smsw cx + test cx,01B ; is the pe bit set + je pr_mode_tran + + jmp int_15_tran +; +; Dispatch on function +; +pr_mode_tran: + or bh,bh + jz read_it_1 +; +; Write +; +; Update ES descriptor with address of track in cache +; + mov si,offset es_des + mov [si].bas_0_15,ax + mov [si].bas_16_23,dl + mov [si].bas_24_31,dh +; +; Update DS descriptor with transfer address +; + mov ax,es + mov cx,16 + mul cx + mov si,offset ds_des + mov [si].bas_0_15,ax + mov [si].bas_16_23,dl + mov [si].bas_24_31,dh + + +; Switch SI and DI for write transfer + + mov si,di + xor di,di + + jmp short set_trans_1 + +read_it_1: +; +; Update DS descriptor with address of track in cache +; + mov si,offset ds_des + mov [si].bas_0_15,ax + mov [si].bas_16_23,dl + mov [si].bas_24_31,dh +; +; Update ES descriptor with transfer address +; + mov ax,es + mov cx,16 + mul cx + mov si,offset es_des + mov [si].bas_0_15,ax + mov [si].bas_16_23,dl + mov [si].bas_24_31,dh +; +; Keep SI and DI the same for read transfer +; + xor si,si + +set_trans_1: +; +; Restore Transfer Count +; + pop cx + +; + mov ax,cs:[A20On] + call A20 + jc nr_err_1 +; +; we shall do the transfer 1024 words at a time +; + db 66h + push ax + mov bx,cx +assume ds:nothing +pr_io_agn_1: + mov cx,1024 + cmp bx,cx + ja pr_strt_1 + mov cx,bx +pr_strt_1: + sub bx,cx + cli ; Un interruptable + cld + lgdt fword ptr emm_gdt + + +; +; Switch to protected mode +; + db 66h,0Fh, 20h, 0 ;mov eax,cr0 + or ax,1 + db 66h,0Fh,22h, 0 ;mov cr0,eax +; +; Clear prefetch queue +; + db 0eah ; far jump + dw offset flush_prefetch + dw cs_des - start_gdt +; +flush_prefetch: + assume cs:nothing +; +; Initialize segment registers +; + mov ax,ds_des - start_gdt + mov ds,ax + assume ds:nothing + mov ax,es_des - start_gdt + mov es,ax + assume es:nothing + shr cx,1 ; convert word count to dword count + db 0f3h,066h,0a5h ; rep movsd +; rep movsw ; Move data +; +; +; Return to Real Mode +; +; + db 66h,0Fh, 20h, 0 ; mov eax,cr0 + and ax,0FFFEh + db 66h,0Fh, 22h, 0 ; mov cr0,eax +; +; Flush Prefetch Queue +; + db 0EAh ; Far jump + dw offset flushcs +cod_seg dw ? ; Fixed up at initialization time + assume cs:Int13Code +flushcs: +; + sti +; see if transfer done else go to do next block +; + or bx,bx + jne pr_io_agn_1 +; + db 66h + pop ax + mov ax,cs + mov es,ax + assume es:nothing + mov ds,ax + assume ds:Int13Code + + mov cx,800h ; Retry this many times +offlp_1: + mov ax,cs:[A20Off] + call A20 ; Disable address line 20 + jnc offlp1_out + loop offlp_1 +offlp1_out: + clc + ret + +nr_err_1: + + mov al,0AAh ; Drive not ready error + stc + ret +; +int_15_tran: +assume ds:int13code,es:nothing,ss:nothing + or bh,bh + jz read_it_2 +; +; Write +; +; Update tgt descriptor with address of track in cache +; + mov si,offset tgt + mov [si].bas_0_15,ax + mov [si].bas_16_23,dl + mov [si].bas_24_31,dh +; +; Update src descriptor with transfer address +; + mov ax,es + mov cx,16 + mul cx + add ax,di + adc dx,0 + mov si,offset src + mov [si].bas_0_15,ax + mov [si].bas_16_23,dl + mov [si].bas_24_31,dh +; + jmp short set_trans_2 + +read_it_2: +; +; Update src descriptor with address of track in cache +; + mov si,offset src + mov [si].bas_0_15,ax + mov [si].bas_16_23,dl + mov [si].bas_24_31,dh +; +; Update tgt descriptor with transfer address +; + mov ax,es + mov cx,16 + mul cx + add ax,di + adc dx,0 + mov si,offset tgt + mov [si].bas_0_15,ax + mov [si].bas_16_23,dl + mov [si].bas_24_31,dh +; +set_trans_2: +; +; Restore Transfer Count +; + pop bx + +; +; we shall do the transfer 1024 words at a time +; +pr_io_agn_2: + mov cx,1024 + cmp bx,cx + ja pr_strt_2 + mov cx,bx +pr_strt_2: + sub bx,cx + push cs + pop es + mov si,offset int15_gdt + mov ax,emm_blkm shl 8 + int emm_int + jc nr_err_1 +; +; +; see if transfer done else fo to do next block +; + or bx,bx + je io_exit +; + add [src.bas_0_15],2048 + adc [src.bas_16_23],0 + adc [src.bas_24_31],0 +; + add [tgt.bas_0_15],2048 + adc [tgt.bas_16_23],0 + adc [tgt.bas_24_31],0 +; + jmp pr_io_agn_2 +io_exit: + clc + ret +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;** SEG_SET - Set up a LOADALL segment descriptor as in REAL mode +; +; This routine sets the BASE value in the segment descriptor +; pointed to by DS:SI with the segment value in AX as the 80286 +; does in REAL mode. This routine is used to set a descriptor +; which DOES NOT have an extended 24 bit address. +; +; SEE ALSO +; INTEL special documentation of LOADALL instruction +; +; ENTRY: +; DS:SI -> Seg register descriptor +; AX is seg register value +; EXIT: +; NONE +; USES: +; AX +; +; This routine is specific to TYPE 1 driver +; + +SEG_SET: +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING + PUSH DX + PUSH CX + MOV CX,16 + MUL CX ; Believe or not, this is faster than a 32 bit SHIFT + MOV WORD PTR [SI.SEG_BASE],AX + MOV BYTE PTR [SI.SEG_BASE + 2],DL + POP CX + POP DX + RET + +;** FIX_DESCRIPTOR - Shuffle GTD IDT descriptors +; +; The segment descriptors for the IDT and GDT are stored +; by the SIDT instruction in a slightly different format +; than the LOADALL instruction wants them. This routine +; performs the transformation by PUSHing the contents +; of the descriptor, and then POPing them in a different +; order. +; +; SEE ALSO +; INTEL special documentation of LOADALL instruction +; INTEL 80286 processor handbook description of SIDT instruction +; +; ENTRY: +; DS:SI points to IDT or GDT descriptor in SIDT form +; EXIT: +; DS:SI points to IDT or GDT descriptor in LOADALL form +; USES: +; 6 words of stack +; +; NOTE: The transformation is reversable, so this routine +; will also work to transform a descriptor in LOADALL +; format to one in SIDT format. +; +; Specific to TYPE 1 driver +; + +FIX_DESCRIPTOR: +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING + PUSH WORD PTR [SI + 4] + PUSH WORD PTR [SI + 2] + PUSH WORD PTR [SI] + POP WORD PTR [SI + 4] + POP WORD PTR [SI] + POP WORD PTR [SI + 2] + RET + +;** DATA SPECIFIC TO THE LOADALL INSTRUCTION USAGE +; +; SWAP_80 and LOADALL_TBL are data elements specific to the use +; of the LOADALL instruction by TYPE 1 drivers. +; + +; +; Swap buffer for contents of 80:0 +; + EVEN ; Force word alignment of SWAP_80 and LOADALL_TBL + +SWAP_80 DB 102 DUP(?) +ssSave dw ? + +; +; LOADALL data buffer placed at 80:0 +; +LOADALL_TBL LABEL BYTE + DB 6 DUP(0) +LDSW DW ? + DB 14 DUP (0) +TR DW 0 +FLAGS DW 0 ; High 4 bits 0, Int off, Direction clear + ; Trace clear. Rest don't care. +LIP DW OFFSET AFTER_LOADALL +LDT DW 0 +LDSS DW 8000h +LSSS DW ? +LCSS DW ? +LESS DW ? +LDI DW ? +LSI DW ? +LBP DW ? +LSP DW ? +LBX DW ? +LDX DW ? +LCX DW ? +LAX DW 80H +ESDES SEGREG_DESCRIPTOR <> +CSDES SEGREG_DESCRIPTOR <> +SSDES SEGREG_DESCRIPTOR <> +DSDES SEGREG_DESCRIPTOR <> +GDTDES DTR_DESCRIPTOR <> +LDTDES DTR_DESCRIPTOR <0D000H,0,0FFH,0088H> +IDTDES DTR_DESCRIPTOR <> +TSSDES DTR_DESCRIPTOR <0C000H,0,0FFH,0800H> + +;** TRUE LOCATION OF ABOVE_PID +; +; Define the TRUE (runtime TYPE 2 driver) location of ABOVE_PID. +; This is the only piece of TYPE 2 specific data that we need +; in the resident image. We must define it HERE rather than down +; at ABOVE_BLKMOV so that we have its TRUE location after the +; TYPE 2 code is swapped in at initialization. If we defined +; it down at ABOVE_BLKMOV any instruction like: +; +; MOV DX,[ABOVE_PID] +; +; Would have to be "fixed up" when we moved the ABOVE_BLKMOV +; code into its final location. +; + +ABOVE_PID EQU WORD PTR $ - 2 ; TRUE location of ABOVE_PID + +; +; The following label defines the end of the region where BLKMOV code +; may be swapped in. BLKMOV code to be swapped in MUST fit +; between DRIVE_CODE and DRIVE_END +; +DRIVE_END LABEL WORD + + +BREAK + +; +; As discussed above in the documentation of the EMM_CTRL sector it +; is necessary to hear about system re-boots so that the EMM_ISDRIVER +; bits in the EMM_REC structure can be manipulated correctly. +; +; On the IBM PC family of machines there are two events which cause a +; "soft" system re-boot which we might expect the EMM_CTRL sector to +; survive through. One is software INT 19H, the other is the Ctrl-Alt-Del +; character sequence which can be detected by "listening" on INT 9 for +; it. The code below consists of a handler for INT 19H, a handler +; for INT 9, and a drive TYPE dependant piece of code. +; +; The drive TYPE dependant piece of code works as follows: +; +; TYPE 1 uses EMM_CTRL sector so it turnd off the +; EMM_ISDRIVER bit in the record indicated by MY_EMM_REC. +; EACH TYPE 1 driver in the system includes the INT 19/9 +; code. +; +; TYPE 2 DOES NOT use the EMM_CTRL sector but it still has +; a handler. What this handler does is issue an +; ABOVE_DEALLOC call to deallocate the Above Board +; memory allocated to INT13. In current versions +; of the EMM device driver this step is unnecessary +; as the EMM device driver is thrown away together +; with all of the allocation information when the system +; is re-booted. We do it anyway because some future version +; of the EMM device driver may be smarter and retain +; allocation information through a warm-boot. Currently, +; doing this doesn't hurt anything. Since this code cannot +; do a global ABOVE_DEALLOC for all TYPE 2 drivers in the +; system, it does an ABOVE_DEALLOC only for its memory +; and EACH TYPE 2 driver in the system includes the INT 19/9 +; code. +; + +; +; Storage locations for the "next" INT 19 and INT 9 vectors, the ones +; that were in the interrupt table when the device driver was loaded. +; They are initialized to -1 to indicate they contain no useful information. +; +OLD_19 LABEL DWORD + DW -1 + DW -1 + +OLD_9 LABEL DWORD + DW -1 + DW -1 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; modification to meet new memory allocation standard +OLD_15 LABEL DWORD + DW -1 + DW -1 +int15_size dw 0 +; +; +INT_15: +ASSUME DS:NOTHING,SS:NOTHING,ES:NOTHING +; +; This piece of code determines the size of extended memory +; which was allocated before this driver and then subtracts +; the amount it has allocated for itself +; +; inputs: ah = 88h is of interest +; outputs: ax = size of extended memory allocated by all before and +; including us +; regs used: flags +; + pushf + cmp ah,88h + je mem_det + popf + jmp [old_15] +mem_det: + mov ax,[int15_size] + popf + clc + sti + iret +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;** INT 9 Keyboard handler +; +; All this piece of code does is look for the Ctrl-Alt-Del event. +; If key is not Ctrl-Alt-Del, it jumps to OLD_9 without doing +; anything. If the Ctrl-Alt-Del key is detected it calls +; RESET_SYSTEM to perform driver TYPE specific re-boot code. +; It then resets INT 13H to disable the cache and then jumps to +; OLD_9 to pass on the event. +; +; NOTE THAT UNLIKE INT 19 THIS HANDLER DOES NOT NEED TO RESET +; THE INT 9 AND INT 19 VECTORS. This is because the Ctrl-Alt-Del +; IBM ROM re-boot code resets these vectors. +; +; We would LIKE to ALSO flush the cache, but we can't. For one the +; keyboard is at a higher IRQ than the disk. We could EOI the keyboard, +; but this doesn't fix the second problem. INT 13s to write +; out any dirty tracks take a LONG time, so long that we lose +; the key. In other words we see Ctrl-Alt-Del, but none of the +; INT 9 handlers after us will. +; +; +; SEE ALSO +; INT 9 IBM ROM code in ROM BIOS listing of +; IBM PC Technical Reference manual for any PC family member +; +; ENTRY +; NONE +; EXIT +; NONE, via OLD_9 +; USES +; FLAGS +; +; THIS CODE IS USED BY TYPE 1,2 drivers. +; + +INT_9: +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING + PUSH AX + PUSH DS + IN AL,60H + CMP AL,83 ; DEL key? + JNZ CHAIN ; No + XOR AX,AX + MOV DS,AX + MOV AL,BYTE PTR DS:[417H] ; Get KB flag + NOT AL + TEST AL,0CH ; Ctrl Alt? + JNZ CHAIN ; No + MOV [INT_13_BUSY],1 ; Exclude +; +; We would LIKE to do this, always but we can't. For one the keyboard +; is at a higher IRQ than the disk. We can EOI the keyboard, +; but this doesn't fix the second problem. INT 13s to write +; out any dirty tracks take a LONG time, so long that we loose +; the key. In other words we see Ctrl-Alt-Del, but none of the +; INT 9 handlers after us will. +; + CMP [REBOOT_FLUSH],0 ; Reboot flush enabled? + JZ NO_REBOOT_FLUSH ; No + CMP [DIRTY_CACHE],0 ; Anything to do? + JZ NO_REBOOT_FLUSH ; No + MOV AL,20H + OUT 20H,AL ; EOI the keyboard int + CALL FLUSH_WHOLE_CACHE_SAV ; Flush cache +NO_REBOOT_FLUSH: +; + CALL RESET_SYSTEM ; Ctrl Alt DEL + ; + ; Reset INT 13 vector to turn cache off + ; + MOV AX,WORD PTR [OLD_13] + CLI + MOV WORD PTR DS:[13H * 4],AX + MOV AX,WORD PTR [OLD_13 + 2] + MOV WORD PTR DS:[(13H * 4) + 2],AX + ; + ; Reset INT 1C vector to turn cache off + ; +; MOV AX,WORD PTR [OLD_1C] +; MOV WORD PTR DS:[1CH * 4],AX +; MOV AX,WORD PTR [OLD_1C + 2] +; MOV WORD PTR DS:[(1CH * 4) + 2],AX + MOV [INT_13_BUSY],0 +CHAIN: + POP DS + POP AX + JMP [OLD_9] + +;** INT 19 Software re-boot handler +; +; All this piece of code does is sit on INT 19 waiting for +; a re-boot to be signaled by being called. It calls +; FLUSH_WHOLE_CACHE_SAV to flush out any dirty cache info then +; RESET_SYSTEM to perform driver TYPE specific re-boot code, +; resets the INT 19, INT 13 and INT 9 vectors, +; and then jumps to OLD_19 to pass on the event. +; +; NOTE THAT UNLIKE INT 9 THIS HANDLER NEEDS TO RESET +; THE INT 9 AND INT 19 VECTORS. This is because the INT 19 +; IBM ROM re-boot code DOES NOT reset these vectors, and we +; don't want to leave them pointing to routines that are not +; protected from getting stomped on by the re-boot. +; +; SEE ALSO +; INT 19 IBM ROM code in ROM BIOS listing of +; IBM PC Technical Reference manual for any PC family member +; +; ENTRY +; NONE +; EXIT +; NONE, via OLD_19 +; USES +; FLAGS +; +; THIS CODE IS USED BY TYPE 1,2 drivers. +; + +INT_19: +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING + MOV [INT_13_BUSY],1 ; Exclude + cmp [reboot_flush],0 ; + je no_flush + CALL FLUSH_WHOLE_CACHE_SAV ; Flush out the cache +no_flush: + CALL RESET_SYSTEM + PUSH AX + PUSH DS + XOR AX,AX + MOV DS,AX + MOV AX,WORD PTR [OLD_13] + CLI + ; + ; Reset INT 13 vector to trun cache off + ; + MOV WORD PTR DS:[13H * 4],AX + MOV AX,WORD PTR [OLD_13 + 2] + MOV WORD PTR DS:[(13H * 4) + 2],AX + ; + ; Reset INT 1C vector to turn cache off + ; +; MOV AX,WORD PTR [OLD_1C] +; MOV WORD PTR DS:[1CH * 4],AX +; MOV AX,WORD PTR [OLD_1C + 2] +; MOV WORD PTR DS:[(1CH * 4) + 2],AX + ; + ; Since INT 19 DOES NOT reset any vectors (like INT 9 Ctrl Alt DEL does), + ; we must replace those vectors we have mucked with. + ; + ; NOTE THAT WE RESET VECTORS DIRECTLY!!!!!!!!!!!!!!!!!! + ; We are not sure that DOS is reliable enough to call. + ; + MOV AX,WORD PTR [OLD_19] + MOV WORD PTR DS:[19H * 4],AX + MOV AX,WORD PTR [OLD_19 + 2] + MOV WORD PTR DS:[(19H * 4) + 2],AX +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; removed from smartdrv +; MOV AX,WORD PTR [OLD_9] +; MOV WORD PTR DS:[9H * 4],AX +; MOV AX,WORD PTR [OLD_9 + 2] +; MOV WORD PTR DS:[(9H * 4) + 2],AX +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + mov ax,word ptr [old_15] + cmp ax,word ptr [old_15+2] + jne res_15 + cmp ax,-1 + je skip_res +res_15: + mov word ptr ds:[15h*4],ax + mov ax,word ptr [old_15+2] + mov word ptr ds:[(15h*4) +2],ax +; +skip_res: + POP DS + POP AX + MOV [INT_13_BUSY],0 + JMP [OLD_19] + +;** RESET_SYSTEM perform TYPE 1 (/E) driver specific reboot code +; +; This code performs the EMM_ISDRIVER reset function as described +; in EMM.ASM for all EMM_REC structure for this device (offset +; stored in MY_EMM_REC). We use the same LOADALL +; method described at BLKMOV to address the EMM_CTRL sector +; at the start of extended memory and perform our changes in +; place. +; +; NOTE: RESET_SYSTEM ALSO defines the start of ANOTHER piece of +; driver TYPE specific code that TYPE 2 drivers +; will have to swap in a different piece of code for. +; +; ENTRY +; NONE +; EXIT +; NONE +; USES +; NONE +; +; This code is specific to TYPE 1 drivers +; + +RESET_SYSTEM: +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING + JMP SHORT TRUE_START + +MY_EMM_REC DW 0 ; Offset into 1K EMM_CTRL of my record + +TRUE_START: + PUSHA + mov cs:[reboot_flg],0ffh ; set the reboot flag + cmp cs:[my_emm_rec],0 ; was an emm record allocated? + je reset_skip + PUSH DS + PUSH ES +; +; reset base_addr to be address of emm ctrl sector +; + mov ax,cs:[emm_ctrl_addr] + mov dx,cs:[emm_ctrl_addr+2] + mov word ptr cs:[base_addr],ax + mov word ptr cs:[base_addr+2],dx + ; + ; read 1k emm control sector into track buffer, I want to keep memory + ; access methods separate from driver code. We end up wasting a lot of + ; time here but is reboot code anyway so thats okay + ; + mov bx,cs + mov es,bx ; + mov di,cs:[track_buffer_ptr] + mov cx,512 + xor ax,ax + xor dx,dx + mov bh,0 ; read + push es + push di + call blkmov + pop di + pop es + jc finish_reset +; +; fix the flags for my emm record so that it is no longer in use +; + mov bx,cs:[my_emm_rec] + add bx,di + and es:[bx.emm_flags],not emm_isdriver +; +; write out the modified emm record out to memory +; + xor ax,ax + xor dx,dx + mov bh,1 ; write + call blkmov +finish_reset: + POP ES + POP DS +reset_skip: + POPA + RET + +; +; The following label defines the end of the +; Driver TYPE specific RESET_SYSTEM code which will have to be replaced +; for different driver TYPEs as the code between RESET_SYSTEM and +; RESET_INCLUDE. Swapped in code MUST FIT between RESET_SYSTEM and +; RESET_INCLUDE. +; +RESET_INCLUDE LABEL BYTE + +; +; This data is only used at INIT, but it must be protected from overwrite +; by the DO_INIT code. +; +TERM_ADDR LABEL DWORD ; Address to return as break address in INIT packet + DW ? ; Computed at INIT time + DW ? ; INT13 CS filled in at INIT + +; +; THIS CODE MUST BE IN RESIDENT PORTION BECAUSE IT WRITES IN THE AREA +; OCCUPIED BY THE DISPOSABLE INIT CODE. +; + +;** DO_INIT - Initialize cache structures to "empty" +; +DO_INIT: +ASSUME DS:INT13CODE + MOV AX,[SECTRACK] + MOV CL,9 + SHL AX,CL ; AX is bytes per track buffer + MOV BX,[CACHE_CONTROL_PTR] + MOV CX,[TTRACKS] + MOV [CACHE_HEAD],BX + MOV [BX.BACK_LRU_LNK],-1 + MOV WORD PTR [BX.BASE_OFFSET],0 + MOV WORD PTR [BX.BASE_OFFSET+2],0 + MOV [BX.TRACK_FLAGS],TRACK_FREE + MOV DI,BX + ADD BX,SIZE CACHE_CONTROL ; Next structure + DEC CX ; One less to do + JCXZ SETDONE ; one buffer in cache +SETLOOP: + MOV [DI.FWD_LRU_LNK],BX + MOV [BX.BACK_LRU_LNK],DI + MOV [BX.TRACK_FLAGS],TRACK_FREE + MOV DX,WORD PTR [DI.BASE_OFFSET] + ADD DX,AX + MOV WORD PTR [BX.BASE_OFFSET],DX + MOV DX,WORD PTR [DI.BASE_OFFSET+2] + ADC DX,0 + MOV WORD PTR [BX.BASE_OFFSET+2],DX + MOV DI,BX + ADD BX,SIZE CACHE_CONTROL ; Next structure + LOOP SETLOOP +SETDONE: + MOV [DI.FWD_LRU_LNK],-1 + MOV [CACHE_TAIL],DI ; That is the tail +; +; NOTE FALL THROUGH!!!!!!! +; + +;** SETBPB - Set INIT packet I/O return values +; +; This entry is used to set the INIT packet Break address +; +; ENTRY +; TERM_ADDR set to device end +; EXIT +; through DEVEXIT +; USES +; DS, BX, CX +; +; COMMON TO TYPE 1, 2 drivers +; + +SETBPB: +ASSUME DS:NOTHING + ; + ; 7. Set the return INIT I/O packet values + ; + LDS BX,[PTRSAV] + MOV CX,WORD PTR [TERM_ADDR] + MOV WORD PTR [BX.INIT_BREAK],CX ;SET BREAK ADDRESS + MOV CX,WORD PTR [TERM_ADDR + 2] + MOV WORD PTR [BX.INIT_BREAK + 2],CX + JMP DEVEXIT + + + EVEN ; Make sure we get word alignment of the track + ; buffer. + +; +; The following items define the "track buffer". When we want to I/O a track +; this is where we do it. We cannot I/O the track directly into extended +; memory because we have no way to specify a 24 bit address to INT 13. We +; Cannot I/O direct to expanded memory because DMA into the expanded memory +; window is not supported. This buffer also "holds" one track, so we keep +; track of the last track that was in here because it is faster to access +; it here than through extended/expanded memory. A value of -1 in the +; "currency" fields indicates that there is currently nothing interesting +; in the track buffer. NOTE: It is ASSUMED that the track buffer always +; represents a track that is IN the cache, therefore one must be sure to +; invalidate the track buffer when the cache element it represents is +; discarded. The offset of the track buffer is dynamic. Never talk about +; OFFSET TRACK_BUFFER. Always get the track buffer address out of +; TRACK_BUFFER_PTR. The initialization code "moves" the track buffer so +; that it does not cause a DMA Boundary error which would slow things +; down quite a bit. +; + +; +; Cylinder and hd/drv of track in track buffer +; +TRACK_BUFFER_CYLN DW -1 +TRACK_BUFFER_HDDR DW -1 + +; +; Pointer to track buffer. May be adjusted for DMA boundary error prevention. +; +TRACK_BUFFER_PTR DW OFFSET TRACK_BUFFER + +; +; Cache structure pointers +; + +; +; Pointer to cache structures. This ends up being right after TRACK_BUFFER. +; +CACHE_CONTROL_PTR DW ? + +; +; Cache head and tail pointers +; +CACHE_HEAD DW ? +CACHE_TAIL DW ? + +; +; This is the "in the 1Meg address space" track buffer. Its TRUE start +; may be adjusted for DMA boundary violation error prevention, and its +; Size may be adjusted depending on how many sectors per track there +; are. WARNING! This buffer must be AT LEAST 1024 bytes for /E driver +; init code (buffer for 1K EMM control sector). +; +TRACK_BUFFER DB (512 * 2 + 16) DUP(0) + ; we really don't need those 16 bytes, i + ; am just paranoid +; +; The TERM_ADDR for the device will be set somewhere "around" here +; by the init code +; + +BREAK + +;** DISPOSABLE INIT DATA +; +; INIT data which need not be part of resident image +; + +U_SWITCH db 0 ;; upper extended memory requested on 6300 PLUS + +EXT_K DW ? ; Size in K of Extended memory. + +NUM_ARG DB 1 ; Counter for numeric + ; arguments bbbb. + +GOTSWITCH DB 0 ; Bit map of switches seen + + SWITCH_E EQU 00000001B + SWITCH_A EQU 00000010B ; Only switch allowed + SWITCH_T EQU 00000100B + SWITCH_D EQU 00001000B + SWITCH_WT EQU 00010000B + SWITCH_WC EQU 00100000B + SWITCH_R EQU 01000000B + SWITCH_C EQU 10000000B +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +sys_det proc near +; +; author: sunilp, august 1, 1987. thanks to rickha for most of this +; routine. +; +; purpose: to determine whether extended memory cache can be installed +; on this system. also to determine and store in the system +; flag the machine identification. +; +; inputs: none +; +; outputs: CY set if this machine doesn't allow extended memory cache. +; CY clear if this machine allows extended memory cache and +; the system flag is set according to the machine type. +; +; registers used: ax,es,flags +;---------------------------------- +; Clear the state of the system flag +; +assume ds:int13code,es:nothing,ss:nothing + xor ax,ax ; 0000 into AX + mov [sys_flg],al ; clear system flag +;---------------------------------- +; Determine if 8086/8088 system. If so we should abort immediately. +; + push ax ; ax has 0 + popf ; try to put that in the flags + pushf + pop ax ; look at what really went into flags + and ax,0F000h ; mask off high flag bits + cmp ax,0F000h ; Q: was high nibble all ones ? + je cpu_err ; Y: it's an 8086 (or 8088) +;---------------------------------- +; Determine if 80286/80386 machine. +; + mov ax,0F000h ; N: try to set the high bits + push ax + popf ; ... in the flags + pushf + pop ax ; look at actual flags + and ax,0F000h ; Q: any high bits set ? + je cpu_286 ; N: it's an 80286 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; It is a 386 cpu. We should next try to determine if the ROM is +; B0 or earlier. We don't want these guys. +; +cpu_386: + pushf ; clear + pop ax ; NT + and ax,not 0F000h ; and + push ax ; IOPL + popf ; bits +;---------------------------------- +; the next three instructions were removed because we are loaded +; in real mode. So there is no need to check for virtual mode. +; +; smsw ax ;check for Virtual Mode +; test ax,0001 ; Q: Currently in Virtual Mode ? +; jnz cpu_exit ; Y: quit with error message +;---------------------------------- + ; N: check 386 stepping for B0 + call is_b0 ; Q: B0 ? + jc cpu_err ; Y: abort +;---------------------------------- +; We have a valid 386 guy. Set the flag to indicate this. +; + or [sys_flg],M_386 ; set 386 bit + jmp short PS2Test + +;---------------------------------- +; This is a 286 guy. Check for AT model byte. We don't want non-ATs. +; Set 286 bit if AT type. Then check for PS/2 +; +cpu_286: + mov ax,0ffffh + mov es,ax + cmp byte ptr es:[0eh],0fch ; AT model byte + jne cpu_err ; if not abort +; + or [sys_flg],M_286 ; set 286 flag bit +; +; +; Determine if this is a PS/2 system +; +PS2Test: + call IsPS2Machine + or ax,ax + jz NCRTest + or [sys_flg],M_PS2 + +NCRTest: + call IsNCRMachine + or ax,ax + jz cpu_suc + + ; We're on an NCR machine, send D7 and D5 to the 8042 in order + ; to toggle A20 instead of the DF and DD we usually send. + ; ChipA 06-16-88 + mov cs:[A20On],0D790h + mov cs:[A20Off],0D500h + +;---------------------------------- +; success exit:-- +cpu_suc: + clc + ret + +;---------------------------------- +; error exit:-- +cpu_err: + stc + ret +; +sys_det endp + + +;*--------------------------------------------------------------------------* +;* * +;* IsPS2Machine HARDWARE DEP. * +;* * +;* Check for PS/2 machine * +;* * +;* ARGS: None * +;* RETS: AX = 1 if we're on a valid PS/2 machine, 0 otherwise * +;* REGS: AX and Flags clobbered * +;* * +;*--------------------------------------------------------------------------* + +IsPS2Machine proc near + + mov ah,0C0h ; Get System Description Vector + stc + int 15h + jc short IPMNoPS2 ; Error? Not a PS/2. + + ; Are we on a PS/2 Model 35? + cmp es:[bx+2],09FCh + je short IPMFoundIt ; Yup, use the PS/2 method + + ; Do we have a "Micro Channel" computer? + mov al,byte ptr es:[bx+5] ; Get "Feature Information Byte 1" + test al,00000010b ; Test the "Micro Channel Implemented" bit + jz short IPMNoPS2 + +IPMFoundIt: mov ax,1 + ret + +IPMNoPS2: xor ax,ax + ret + +IsPS2Machine endp + + +;*--------------------------------------------------------------------------* +;* * +;* IsNCRMachine HARDWARE DEP. * +;* * +;* Check for NCR machine * +;* * +;* ARGS: None * +;* RETS: AX = 1 if we're on a valid NCR machine, 0 otherwise * +;* REGS: AX and Flags clobbered * +;* * +;*--------------------------------------------------------------------------* + +; Look for 'NC' at F000:FFEA + +IsNCRMachine proc near + + mov ax,0F000h + mov es,ax + mov ax,word ptr es:[0FFEAh] + cmp ax,'CN' + je INMFoundIt + xor ax,ax + ret + +INMFoundIt: mov ax,1 + ret + +IsNCRMachine endp + + +;****************************************************************************** +; IS_B0 - check for 386-B0 +; +; This routine takes advantage of the fact that the bit INSERT and +; EXTRACT instructions that existed in B0 and earlier versions of the +; 386 were removed in the B1 stepping. When executed on the B1, INSERT +; and EXTRACT cause an INT 6 (invalid opcode) exception. This routine +; can therefore discriminate between B1/later 386s and B0/earlier 386s. +; It is intended to be used in sequence with other checks to determine +; processor stepping by exercising specific bugs found in specific +; steppings of the 386. +; +; ENTRY: REAL MODE on 386 processor (CPU ID already performed) +; EXIT: CF = 0 if B1 or later +; CF = 1 if B0 or prior +; +; ENTRY: +; EXIT: +; USED: AX, flags +; STACK: +;------------------------------------------------------------------------------ +is_b0 proc near + push bx + push cx + push dx + push ds + + xor bx,bx + mov ds,bx ; DS = 0000 (real mode IDT) +assume ds:R_Mode_IDT + push [bx+(6*4)] + pop cs:[int6_save] ; save old INT 6 offset + push [bx+(6*4)+2] + pop cs:[int6_save+2] ; save old INT 6 segment + + mov word ptr [bx+(6*4)],offset int6 + mov [bx+(6*4)+2],cs ; set vector to new INT 6 handler +; +; Attempt execution of Extract Bit String instruction. Execution on +; B0 or earlier with length (CL) = 0 will return 0 into the destination +; (CX in this case). Execution on B1 or later will fail and dummy INT 6 +; handler will return execution to the instruction following the XBTS. +; CX will remain unchanged in this case. +; + xor ax,ax + mov dx,ax + mov cx,0FF00h ; Extract length (CL)=0, CX=non-zero + db 0Fh,0A6h,0CAh ; XBTS CX,DX,AX,CL + + xor bx,bx + mov ds,bx ; DS = 0000 (real mode IDT) + push cs:[int6_save] ; restore original INT 6 offset + pop [bx+(6*4)] ; + push cs:[int6_save+2] ; restore original INT 6 segment + pop [bx+(6*4)+2] + + or cx,cx ; Q: CX = 0 (meaning <=B0) ? + jz ib_exit ; Y: exit (carry clear) + stc ; N: set carry to indicate >=B1 +ib_exit: + cmc ; flip carry tense + pop ds + pop dx + pop cx + pop bx + ret ; *** RETURN *** +is_b0 endp +; +; Temporary INT 6 handler - assumes the cause of the exception was the +; attempted execution of an XTBS instruction. +; +int6 proc near + push bp + mov bp,sp + add word ptr [bp+2],3 ; bump IP past faulting instruction + pop bp + iret ; *** RETURN *** +int6_save dw 0000,0000 +int6 endp +;*************************************************************************** + +;** PRINT - Print a "$" terminated message on stdout +; +; This routine prints "$" terminated messages on stdout. +; It may be called with only the DX part of the DS:DX message +; pointer set, the routine puts the correct value in DS to point +; at the INT13 messages. +; +; ENTRY: +; DX pointer to "$" terminated message (INT13CODE relative) +; EXIT: +; NONE +; USES: +; AX +; +; COMMON TO TYPE 1, 2, 3, 4 drivers +; + +PRINT: +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING + PUSH DS + PUSH CS + POP DS + MOV AH,Std_Con_String_Output + INT 21H + POP DS + RET + +;** ITOA - Print Decimal Integer on stdout +; +; Print an unsigned 16 bit value as a decimal integer on stdout +; with leading zero supression. Prints from 1 to 5 digits. Value +; 0 prints as "0". +; +; Routine uses divide instruction and a recursive call. Maximum +; recursion is four (five digit number) plus one word on stack +; for each level. +; +; ENTRY AX has binary value to be printed +; EXIT NONE +; USES AX,CX,DX,FLAGS +; +; COMMON TO TYPE 1, 2, 3, 4 drivers +; + +ITOA: +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING + + MOV CX,10 + XOR DX,DX + DIV CX ; DX is low digit, AX is higher digits + OR AX,AX + JZ PRINT_THIS_DIGIT ; No more higher digits + PUSH DX ; Save this digit + CALL ITOA ; Print higher digits first + POP DX ; Recover this digit +PRINT_THIS_DIGIT: + ADD DL,"0" ; Convert to ASCII + MOV AH,Std_CON_Output + INT 21H + RET + + +;** INT13$INIT - Device Driver Initialization routine +; +; INT13 Initialization routine. This is the COMMON initialization +; code used by ALL driver TYPEs. Its jobs are to: +; +; 1. Initialize various global values +; 2. Check for correct DOS version and do changes to the device +; based on the DOS version if needed. +; 3. Set OLD_13, OLD_1C and Parse the command line and set values accordingly +; 4. Set up the cache parameters and +; Call a TYPE specific INIT routine based on the Parse +; to set up a specific driver TYPE. +; 5. Print out report of INT13 parameters +; 6. Set the return INIT I/O packet values +; +; The first two lines perform step 1. Step two starts after and +; goes through VER_OK. Step 3 starts at VER_OK and goes through +; ARGS_DONE. Step 4 starts at ARGS_DONE and goes through I001. +; Step 5 starts at I001 and goes through DRIVE_SET. Step 6 starts +; at DRIVE_SET and goes through SETBPB. Step 7 starts at SETBPB +; and ends at the JMP DEVEXIT 10 lines later. +; +; At any time during the above steps an error may be detected. When +; this happens one of the error messages is printed and INT13 +; de-installs itself. It does this at DEVABORT_NOMES by changing +; the Device attributes to a BLOCK DEVICE and setting its size to NULL. +; All INT13 needs to do is make sure any INT vectors it changed +; (INT 9 and INT 19 and INT 13) get restored to what they were +; when INT13 first started. If an EMM_CTRL sector is being +; used (TYPE 1) and one of the EMM_REC structures has been +; marked EMM_ISDRIVER by this driver, it must turn that bit back off +; since the driver did not install. A TYPE 2 driver must make sure it +; ABOVE_DEALLOCs any memory it allocated from the EMM device. The duty +; of reclaiming EMM_CTRL or Above Board memory and re-setting vectors +; is done by the DISK_ABORT routine which may be called by either +; this COMMON INIT code, or the TYPE specific INIT code. +; +; Step 1 initializes the segment part of TERM_ADDR to the correct +; value for type 1, 2 drivers. +; +; Step 2 checks to make sure that we are running on a DOS in the +; 2.X or 3.X series which this driver is restricted to. If running +; on a 2.X series the device header attribute word and device command +; table are patched to exclude those device calls that don't exist +; on DOS 2.X. +; +; Step 3 uses the "DEVICE = xxxxxxxxx" line pointer provided by +; DOS to look for the various device parameters. NOTE: This pointer +; IS NOT DOCUMENTED in the DOS 2.X tech ref material, but it does +; exist in the same way as 3.X. This code is simple even though +; it looks rather long. First it skips over the device name field +; to get to the arguments. In then parses the arguments as they are +; encountered. All parameter errors are detected here. NOTE THAT +; THIS ROUTINE IS NOT RESPONSIBLE FOR SETTING DEFAULT VALUES OF +; PARAMETER VARIABLES. This is accomplished by static initialization +; of the parameter variables. +; +; Step 4 calls a device TYPE specific initialization routine based +; on the parse in step 3 (presence or absense of /E and /A switches). +; NOTE that one of the prime jobs of these device TYPE specific +; routines is to set all of the variables that are needed by Step +; 5 and 6 that haven't been set by the COMMON init code: +; +; DEV_SIZE set to TRUE size of device +; BASE_ADDR set to TRUE start of device so BLKMOV +; can be called +; BASE_RESET set so DISK_ABORT can be called +; TERM_ADDR set to correct end of device +; +; Step 5 makes the status report display of DEVICE SIZE and other info. +; +; Step 6 sets the INIT I/O packet return values for Break address. +; +; +; SEE ALSO +; MS-DOS Technical Reference manual section on +; Installable Device Drivers +; +; ENTRY from INT13$IN +; EXIT Through DEVEXIT +; USES ALL +; +; COMMON TO TYPE 1, 2 drivers +; + +INT13$INIT: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + ; + ; 1. Initialize various global values + ; + MOV WORD PTR [TERM_ADDR + 2],CS + ; + ; 2. Check for correct DOS version and do changes to the device + ; based on the DOS version if needed. + ; + CLD + MOV AH,GET_VERSION + INT 21H + XCHG AH,AL + CMP AX,(2 SHL 8) + 00 + JB BADVER ; Below 2.00, BAD + CMP AX,(3 SHL 8) + 00 + JB VER2X ; 2.X requires some patches + CMP AX,(4 SHL 8) + 00 + JBE VER_OK ; 3.X or 4.0 OK +BADVER: + MOV DX,OFFSET BADVERMES + JMP DEVABORT + +VER2X: + AND [DEVATS],NOT DEVOPCL ; No such bit in 2.X + MOV BYTE PTR [INT13TBL],11 ; Fewer functions too +VER_OK: + +;; +;; 2.5 Check here for 6300 PLUS machine. First look for Olivetti copyright, +;; and if found, check id byte at f000:fffd. +;; + + push es ;; Olivetti Machine? + mov ax,0fc00h ;; Look for 'OL' at fc00:50 + mov es,ax + cmp es:[0050h],'LO' + jnz notS5 ;; not found + mov ax,0f000h + mov es,ax + cmp word ptr es:[0fffdh],0fc00h ;; look for 6300 plus + jnz notS5 + mov [S5_FLAG],S_OLIVETTI ;; yep, set flag +notS5: + +;; Check here for an HP Vectra machine. Look for HP id byte. +;; + mov ax,0f000H + mov es,ax + cmp es:[0f8H],'PH' + jnz notHP + mov [S5_FLAG],S_VECTRA +notHP: + pop es + +; +; 3. Set OLD_13, OLD_1C and Parse the command line and set values accordingly +; + MOV AX,(Get_Interrupt_Vector SHL 8) OR 13H + INT 21H + MOV WORD PTR [OLD_13],BX + MOV WORD PTR [OLD_13 + 2],ES + MOV AX,(Get_Interrupt_Vector SHL 8) OR 1CH + INT 21H + MOV WORD PTR [OLD_1C],BX + MOV WORD PTR [OLD_1C + 2],ES + LDS SI,[PTRSAV] +ASSUME DS:NOTHING + MOV DX,OFFSET HEADERMES + CALL PRINT + LDS SI,[SI.INIT_BPB] ; DS:SI points to config.sys +SKIPLP1: ; Skip leading delims to start of name + LODSB + CMP AL," " + JZ SKIPLP1 + CMP AL,9 + JZ SKIPLP1 + CMP AL,"," + JZ SKIPLP1 + JMP SHORT SKIPNM + +ARGS_DONEJ: + JMP ARGS_DONE + +SWITCHJ: + JMP SWITCH + +SKIPLP2: ; Skip over device name + LODSB +SKIPNM: + CMP AL,13 + JZ ARGS_DONEJ + CMP AL,10 + JZ ARGS_DONEJ + CMP AL," " + JZ FIRST_ARG + CMP AL,9 + JZ FIRST_ARG + CMP AL,"," + JZ FIRST_ARG + CMP AL,0 ; Need this for 2.0 2.1 + JNZ SKIPLP2 +SCAN_LOOP: ; PROCESS arguments + LODSB +FIRST_ARG: + OR AL,AL ; Need this for 2.0 2.1 + JZ ARGS_DONEJ + CMP AL,13 + JZ ARGS_DONEJ + CMP AL,10 + JZ ARGS_DONEJ + CMP AL," " + JZ SCAN_LOOP + CMP AL,9 + JZ SCAN_LOOP + CMP AL,"," + JZ SCAN_LOOP + CMP AL,"/" + JZ SWITCHJ + CMP AL,"0" + JB BAD_PARMJ + CMP AL,"9" + JA BAD_PARMJ + DEC SI + CALL GETNUM + CMP [NUM_ARG],1 + JA BAD_PARMJ ; Only 1 numeric argument +SET_SIZE: + CMP BX,128 + JB BAD_PARMJ + CMP BX,8192 + JA BAD_PARMJ + MOV [DEV_SIZE],BX +;A + mov [current_dev_size],bx +;A + JMP SHORT NUM_DONE + +BAD_PARMJ: + JMP SHORT BAD_PARM + +NUM_DONE: + INC [NUM_ARG] ; Next numeric argument +SCAN_LOOPJ: + JMP SCAN_LOOP + +BAD_PARM: + MOV DX,OFFSET ERRMSG1 +DEVABORT: + CALL PRINT +DEVABORT_NOMES: +; INC [NULDEV] ;Indicate NUL device +; MOV WORD PTR [TERM_ADDR],OFFSET ERROR_END ;Minimul null device +; JMP SETBPB ;and return + LDS BX,[PTRSAV] + MOV WORD PTR [BX].INIT_NUM,0 + MOV WORD PTR [BX].INIT_BREAK[0],0 + MOV WORD PTR [BX].INIT_BREAK[2],CS + MOV [DEVATS],0 + JMP DEVEXIT + +SWITCH: + LODSB + OR AL,20H + +if WINDOWS_SWITCHES eq 0 + CMP AL,"e" + JNZ ABOVE_TEST +EXT_SET: + TEST [GOTSWITCH],SWITCH_E + SWITCH_A + JNZ BAD_PARM + OR [GOTSWITCH],SWITCH_E + MOV [DRIVER_SEL],0 + JMP SCAN_LOOP + +ABOVE_TEST: + +endif ; WINDOWS_SWITCHES eq 0 + +;; Added for /u switch + cmp al,'u' ;; Look for U switch for PLUS + jnz A_TEST + cmp [S5_FLAG],S_OLIVETTI ;; No good unless PLUS + jne bad_parm + TEST [GOTSWITCH],SWITCH_A ;; Already have switch A ? + JNZ BAD_PARM + cmp [U_SWITCH],0 + jne bad_parm + dec [U_SWITCH] + jmp scan_loop +A_TEST: +;; + CMP AL,"a" + +if WINDOWS_SWITCHES + jnz bad_parm +else + JNZ DIS_TEST +endif ;WINDOWS_SWITCHES + +ABOVE_SET: + TEST [GOTSWITCH],SWITCH_A ; Was SWITCH_E + SWITCH_A + JNZ BAD_PARM +;; added for /u switch + cmp [U_SWITCH],0 + jne bad_parm +;; + OR [GOTSWITCH],SWITCH_A + MOV [DRIVER_SEL],1 + JMP SCAN_LOOP + +if WINDOWS_SWITCHES eq 0 + +DIS_TEST: + CMP AL,"d" + JNZ W_TEST +DIS_SET: + TEST [GOTSWITCH],SWITCH_D + JNZ BAD_PARM + OR [GOTSWITCH],SWITCH_D + MOV [ENABLE_13],0 + JMP SCAN_LOOP + +W_TEST: + CMP AL,"w" + JNZ T_TEST + LODSW + OR AL,20H + CMP AX,":c" + JNZ WT_TEST + LODSW + OR AX,2020H + CMP AX,"fo" + JNZ BAD_PARM + LODSB + OR AL,20H + CMP AL,"f" + JNZ BAD_PARMJX +WC_SET: + TEST [GOTSWITCH],SWITCH_WC + JNZ BAD_PARMJX + OR [GOTSWITCH],SWITCH_WC + MOV [WRITE_BUFF],0 + JMP SCAN_LOOP + +WT_TEST: + CMP AX,":t" + JNZ BAD_PARMJX + LODSW + OR AX,2020H + CMP AX,"no" + JNZ BAD_PARMJX +WT_SET: + TEST [GOTSWITCH],SWITCH_WT + JNZ BAD_PARMJX + OR [GOTSWITCH],SWITCH_WT + MOV [WRITE_THROUGH],1 + JMP SCAN_LOOP + +BAD_PARMJX: + JMP BAD_PARM + +T_TEST: + CMP AL,"t" + JNZ R_TEST + LODSW + CMP AL,":" + JNZ BAD_PARMJX + CMP AH,"0" + JB BAD_PARMJX + CMP AH,"9" + JA BAD_PARMJX + DEC SI + CALL GETNUM +T_SET: + TEST [GOTSWITCH],SWITCH_T + JNZ BAD_PARMJX + OR [GOTSWITCH],SWITCH_T + MOV [TICK_SETTING],BX + JMP SCAN_LOOP + +R_TEST: + CMP AL,"r" + JNZ C_TEST + LODSW + OR AH,20H + CMP AX,"o:" + JNZ BAD_PARMJX + LODSB + OR AL,20H + CMP AL,"n" + JNZ BAD_PARMJX + TEST [GOTSWITCH],SWITCH_R + JNZ BAD_PARMJX + OR [GOTSWITCH],SWITCH_R + MOV [REBOOT_FLUSH],1 + JMP SCAN_LOOP + +C_TEST: + CMP AL,"c" + JNZ BAD_PARMJX + LODSW + OR AH,20H + CMP AX,"o:" + JNZ BAD_PARMJX + LODSB + OR AL,20H + CMP AL,"n" + JNZ BAD_PARMJX + TEST [GOTSWITCH],SWITCH_C + JNZ BAD_PARMJX + OR [GOTSWITCH],SWITCH_C + MOV [ALL_CACHE],1 + JMP SCAN_LOOP +endif ;WINDOWS_SWITCHES eq 0 + +ARGS_DONE: +; +; 4. Call a TYPE specific INIT routine based on the Parse +; to set up a specific driver TYPE. +; + PUSH CS + POP DS +ASSUME DS:INT13CODE + MOV AL,[DRIVER_SEL] ; Find out which init to call + OR AL,AL + JNZ NEXTV + CALL AT_EXT_INIT + JMP SHORT INI_RET + +NEXTV: + CALL ABOVE_INIT +INI_RET: + JNC I001 + JMP DEVABORT_NOMES + +I001: +DRIVE_SET: + ; + ; update the current device size + ; + mov ax,[dev_size] + mov [current_dev_size],ax + ; + ; 6. Print out report of INT13 parameters + ; + MOV DX,OFFSET STATMES1 + CALL PRINT + MOV AX,[DEV_SIZE] + CALL ITOA + MOV DX,OFFSET STATMES1E + CMP [DRIVER_SEL],0 + JZ PTYPX + MOV DX,OFFSET STATMES1A +PTYPX: + CALL PRINT + MOV DX,OFFSET STATMES2 + CALL PRINT + MOV AX,[TTRACKS] + CALL ITOA + MOV DX,OFFSET STATMES3 + CALL PRINT + MOV AX,[SECTRACK] + CALL ITOA + MOV DX,OFFSET STATMES4 + CALL PRINT + +ifdef OMTI + mov dx,offset omti_msg + call print +endif +IF DEBUG + MOV DX,OFFSET STATMES5 + CALL PRINT + MOV AX,CS + CALL ITOA + MOV DX,OFFSET STATMES6 + CALL PRINT +ENDIF + ; + ; Turn on the cache by chaining INT 13, and INT 1C + ; + MOV DX,OFFSET INT_13_HANDLER + MOV AX,(Set_Interrupt_Vector SHL 8) OR 13H + INT 21H +; MOV DX,OFFSET INT_1C_HANDLER +; MOV AX,(Set_Interrupt_Vector SHL 8) OR 1CH +; INT 21H + JMP DO_INIT + +;** DRIVEPARMS Initialize drive related cache parameters +; +; ENTRY +; Stuff set so that BLKMOV can be used to access cache memory +; DEV_SIZE set to TRUE cache size in K +; EXIT +; Carry Set +; Error, message already printed +; Carry clear +; TRACK_BUFFER_PTR adjusted for DMA error prevention +; CACHE_CONTROL_PTR set +; TERM_ADDR set +; TTRACKS set +; SECTRACK set +; SECTRKARRAY set +; HDARRAY set (SUNILP) +; USES +; ALL but DS +; +; COMMON TO TYPE 1, 2 drivers +; +; +NO_HARDFILES: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + MOV DX,OFFSET NOHARD +PEER: + CALL PRINT + STC + RET + +TRACK_TOO_BIG: + MOV DX,OFFSET BIGTRACK + JMP PEER + +DRIVEPARMS: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + ; + ; First figure out sec/track of any hardfiles + ; + MOV DL,80H + MOV AH,8 + INT 13H + JC NO_HARDFILES + OR DL,DL + JZ NO_HARDFILES + AND CL,00111111B + MOV [SECTRKARRAY],CL + mov [hdarray],dh + XOR CH,CH + MOV [SECTRACK],CX + MOV CL,DL + DEC CX + JCXZ FINISHED + CMP CX,MAX_HARD_FILES - 1 + JBE DNUM_OK + MOV CX,MAX_HARD_FILES - 1 +DNUM_OK: + MOV DL,81H +PARMLOOP: + PUSH CX + PUSH DX + MOV AH,8 + INT 13H + JC IGNORE_DRIVE + AND CL,00111111B + POP BX + PUSH BX + AND BX,0000000001111111B + MOV [BX.SECTRKARRAY],CL + mov [bx.hdarray],dh + XOR CH,CH + CMP CX,[SECTRACK] + JBE IGNORE_DRIVE + MOV [SECTRACK],CX +IGNORE_DRIVE: + POP DX + INC DL + POP CX + LOOP PARMLOOP +FINISHED: + ; + ; Figure out number of full tracks that fit in cache + ; + MOV AX,[SECTRACK] + MOV CX,512 + MUL CX ; DX:AX = Bytes per track + OR DX,DX + JNZ TRACK_TOO_BIG + MOV BX,AX ; BX is bytes per track + MOV AX,[DEV_SIZE] + MOV CX,1024 + MUL CX ; DX:AX = size of cache in bytes + DIV BX ; AX is full tracks in cache + MOV [TTRACKS],AX + ; + ; Figure out if we have a DMA boundary problem + ; + mov DX,DS ; Check for 64k boundary error + shl DX,1 + shl DX,1 + shl DX,1 + shl DX,1 ; Segment converted to absolute address + add DX,[TRACK_BUFFER_PTR] ; Combine with offset + add DX,511 ; simulate a one sector transfer + ; And set next divide for round up +; +; If carry is set, then we are within 512 bytes of the end of the DMA segment. +; Adjust TRACK_BUFFER_PTR UP by 512 bytes. +; + jnc NotWithin512 + add [TRACK_BUFFER_PTR],512 ; adjust + jmp short SetCachest + +NotWithin512: +; +; DX is the physical low 16 bits of the proposed track buffer plus 511. +; See how many sectors fit up to boundary. +; + shr DH,1 ; DH = number of sectors in DMA segment + ; till start of buffer rounded up + mov AH,128 ; AH = max number of sectors in DMA segment + sub AH,DH +; +; AH is now the number of sectors that we can successfully transfer using this +; address without a DMA boundary problem. If this number is above or equal to +; the track buffer size, then buffer is OK. Otherwise, we adjust buffer UP +; till it is after the boundary by adding ((AH+1)*512) to the buffer address. +; + mov al,ah + xor ah,ah + cmp AX,[SECTRACK] ; can we fit it in? + jae SetCachest ; yes, buffer is OK + inc ax ; Add 1 + mov cl,9 ; Mult by 512 + shl ax,cl + add [TRACK_BUFFER_PTR],ax ; Adjust +SetCachest: + ; + ; Set pointer to cache control structures + ; + mov bx,[SECTRACK] + mov cl,9 ; Mult by 512 + shl bx,cl ; AX is bytes in Track buffer + add bx,[TRACK_BUFFER_PTR] ; First byte after track buffer + mov [CACHE_CONTROL_PTR],bx + mov cx,SIZE CACHE_CONTROL + mov ax,[TTRACKS] + MUL cx + add bx,ax + ; + ; Set TERM_ADDR + ; + mov word ptr [TERM_ADDR],bx + CLC + RET + +;** GETNUM - Read an unsigned integer +; +; This routine looks at DS:SI for a decimal unsigned integer. +; It is up to the caller to make sure DS:SI points to the start +; of a number. If it is called without DS:SI pointing to a valid +; decimal digit the routine will return 0. Any non decimal digit +; defines the end of the number and SI is advanced over the +; digits which composed the number. Leading "0"s are OK. +; +; THIS ROUTINE DOES NOT CHECK FOR NUMBERS LARGER THAN WILL FIT +; IN 16 BITS. If it is passed a pointer to a number larger than +; 16 bits it will return the low 16 bits of the number. +; +; This routine uses the MUL instruction to multiply the running +; number by 10 (initial value is 0) and add the numeric value +; of the current digit. Any overflow on the MUL or ADD is ignored. +; +; ENTRY: +; DS:SI -> ASCII text of number +; EXIT: +; BX is binary for number +; SI advanced to point to char after number +; USES: +; AX,BX,DX,SI +; +; COMMON TO TYPE 1, 2, 3, 4 drivers +; + +GETNUM: +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING + + XOR BX,BX +GETNUM1: + LODSB + SUB AL,"0" + JB NUMRET + CMP AL,9 + JA NUMRET + CBW + XCHG AX,BX + MOV DX,10 + MUL DX + ADD BX,AX + JMP GETNUM1 + +NUMRET: + DEC SI + RET + +BREAK + +;** flag to signify valid emm control record +; +valid_emm db 0 + +;** INITIAL EMM_CTRL sector +; +; This is a datum which represents a correct initial EMM_CTRL +; sector as discussed in the EMM_CTRL documentation. It is used +; to check for the presense of a valid EMM_CTRL by comparing +; the signature strings, and for correctly initializing the +; EMM_CTRL sector if needed. +; +; The DWORD at BASE_RESET, which is the EMM_BASE of the NULL +; 0th EMM_REC structure, is used as a storage location of +; the address of the EMM_CTRL sector (PLUS 1024!!!!!!). +; This value can be used if it is necessary to re-address the +; EMM_CTRL sector during initialization. See the DISK_ABORT routine. +; NOTE THAT BASE_RESET CAN NOT BE USED AT RUNTIME AS THIS DATUM +; IS NOT PART OF THE RESIDENT IMAGE. +; +; This data is appropriate to TYPE 1 drivers +; + +EMM_CONTROL LABEL BYTE + DB "MICROSOFT EMM CTRL VERSION 1.00 CONTROL BLOCK " + DW 0 + DW 0 + ; NULL 0th record + DW EMM_ALLOC + EMM_ISDRIVER + DW EMM_EMM +;; Note: When using upper extended memory on the PLUS, the value +;; at BASE_RESET + 2 is patched to FA during initialization. +;; +BASE_RESET LABEL DWORD ; RESMEM driver must patch this value + DW EXTMEM_LOW + 1024 + DW EXTMEM_HIGH + DW 0 + + DB 950 DUP(0) + DB "ARRARRARRA" + + +BREAK + +;** DISK_ABORT - De-install INT13 after init +; +; This routine MUST BE CALLED to de-install a INT13 cache +; if the de-installation takes place: +; +; AFTER INT 19/INT 9 vectors are replaced +; AFTER ABOVE_PID is valid for TYPE 2 +; AFTER an EMM_REC structure in the EMM_CTRL sector +; has been marked EMM_ISDRIVER for TYPE 1. +; +; In all cases the INT 9 and INT 19 vectors are replaced if the +; value of both words of OLD_19 is NOT -1. This is why the initial value +; of this datum is -1. In the event that the INT 9 and INT 19 +; vectors are replaced, this datum takes on some value other than -1. +; +; If this is a TYPE 1 driver the EMM_ISDRIVER bit is +; turned off in the EMM_REC pointed to by MY_EMM_REC. +; NOTE THAT A TYPE 1 DRIVER MAY USE THIS ROUTINE +; IF IT HAS NOT "TURNED ON" AN EMM_ISDRIVER BIT IN ONE OF THE EMM_REC +; STRUCTURES. This is OK because the initial 0 value of MY_EMM_REC +; is checked, and nothing is done if it is still 0. +; +; If this is a TYPE 2 driver, an ABOVE_DEALLOC call is made on +; ABOVE_PID. +; +; ENTRY: +; BASE_RESET valid if TYPE 1 +; ABOVE_PID valid if TYPE 2 +; EXIT: +; NONE +; USES: +; ALL but DS +; +; COMMON TO TYPE 1, 2 drivers +; + +DISK_ABORT: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + + CMP [DRIVER_SEL],1 + JNZ NOT_ABOVE +AGAIN: + ; + ; TYPE 2, De-alloc the Above Board memory + ; + MOV DX,[ABOVE_PID] + MOV AH,ABOVE_DEALLOC + INT 67H + CMP AH,ABOVE_ERROR_BUSY + JZ AGAIN + JMP SHORT RET002 + +NOT_ABOVE: + CMP [MY_EMM_REC],0 ; Need to turn off bit? + JZ RET002 ; No + ; + ; TYPE 1, turn off EMM_ISDRIVER at MY_EMM_REC + ; + MOV AX,WORD PTR [BASE_RESET] + MOV DX,WORD PTR [BASE_RESET + 2] + SUB AX,1024 ; Backup to EMM_CTRL + SBB DX,0 + MOV WORD PTR [BASE_ADDR],AX + MOV WORD PTR [BASE_ADDR + 2],DX + XOR BH,BH ; READ + CALL CTRL_IO ; Get EMM_CTRL + JC RET002 + MOV DI,OFFSET TRACK_BUFFER + ADD DI,[MY_EMM_REC] + AND [DI.EMM_FLAGS],NOT EMM_ISDRIVER ; Undo install + MOV BH,1 ; WRITE + CALL CTRL_IO ; EMM_CTRL back out +RET002: + ; + ; Reset INT 9, and/or INT 19 if OLD_19 is not -1 + ; + PUSH DS + LDS DX,[OLD_19] +ASSUME DS:NOTHING + MOV AX,DS + CMP AX,-1 + JNZ RESET_VECS + CMP AX,DX + JZ NO_VECS +RESET_VECS: + MOV AX,(Set_Interrupt_Vector SHL 8) OR 19H + INT 21H +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; removed from smartdrv +; LDS DX,[OLD_9] +; MOV AX,(Set_Interrupt_Vector SHL 8) OR 9H +; INT 21H +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + lds dx,[old_15] + cmp ax,-1 + jne reset_15 + cmp ax,dx + je no_vecs +reset_15: + mov ax,(set_interrupt_vector shl 8) or 15h + int 21h +NO_VECS: + POP DS + RET + +;** CTRL_IO - Read/Write the first 1024 bytes at BASE_ADDR +; +; This routine is used at INIT time to read the first 1024 +; bytes at BASE_ADDR. If TYPE 1 and BASE_ADDR points +; to the EMM_CTRL address (initial value), the EMM_CTRL sector +; is read/written. If TYPE 1 and BASE_ADDR has been set +; to the start of the cache, the first 1024 bytes of the cache +; are read/written. If TYPE 2, the first 1024 bytes of +; the cache are read/written. All this routine does is +; set inputs to BLKMOV to transfer 1024 bytes at offset 0 to/from +; TRACK_BUFFER. +; +; ENTRY: +; BH = 0 for READ, 1 for WRITE +; EXIT: +; TRACK_BUFFER filled in with 1024 bytes at BASE_ADDR +; USES: +; ALL but DS +; +; COMMON TO TYPE 1, 2 drivers +; + +CTRL_IO: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + XOR DX,DX + MOV AX,DX ; Offset 0 + MOV CX,512 ; 1024 bytes + PUSH CS + POP ES + MOV DI,OFFSET TRACK_BUFFER + PUSH DS + CALL BLKMOV ; Read in EMM_CTRL + POP DS + RET + +;** MM_SETDRIVE - Look for/Init EMM_CTRL and DOS volume +; +; This routine is used by TYPE 1 drivers to check for/initialize +; the EMM_CTRL sector. +; +; This routine reads the EMM_CTRL sector in to TRACK_BUFFER +; CALLS FIND_VDRIVE to check out and alloc or find an EMM_REC +; Sets BASE_ADDR to point to the start of the INT13 cache memory +; Writes the updated EMM_CTRL back out from TRACK_BUFFER +; +; ENTRY: +; BASE_ADDR initialized to point at START of extended memory +; so that the EMM_CTRL sector can be accessed by +; doing I/O at offset 0. +; EXT_K is set to size of extended memory +; DEV_SIZE is set to user requested device size +; EXIT: +; CARRY SET - error, message already printed +; CARRY CLEAR +; BASE_ADDR set for this drive +; DEV_SIZE set to TRUE size +; +; USES +; ALL but DS +; +; Used by TYPE 1 drivers +; + +MM_SETDRIVE: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + XOR BH,BH ; READ + CALL CTRL_IO ; Get EMM_CTRL + MOV DX,OFFSET INIT_IO_ERR + JC ERR_RET2 + CALL FIND_VDRIVE ; Snoop + JC RET001 + PUSH ES ; Save EMM_BASE from EMM_REC + PUSH DI +; modification sunilp + cmp [u_switch],0 ; we shall use ol' microsoft standard for this + je mm_s$1 ; if we are using int15 scheme no need to write + ; out emm control record +; end modification sp + MOV BH,1 ; WRITE + CALL CTRL_IO ; Write EMM_CTRL back out + MOV DX,OFFSET INIT_IO_ERR + JC ERR_RET2P +mm_s$1: + POP WORD PTR [BASE_ADDR] ; Set final correct BASE_ADDR + POP WORD PTR [BASE_ADDR + 2] + CLC +RET001: + RET + +ERR_RET2P: + ADD SP,4 +ERR_RET2: + CALL PRINT + STC + RET + +;** FIND_VDRIVE - Check out EMM_CTRL and alloc +; +; This code checks for a valid EMM_CTRL and sets up +; an initial one if there isn't. It then performs the +; algorithm described in the EMM_CTRL documentation +; to either allocate a NEW EMM_REC of type EMM_APPLICATION, +; or find an existing EMM_REC which is EMM_APPLICATION and has +; its EMM_ISDRIVER bit clear. In the later case it +; checks to see if DEV_SIZE is consistent with EMM_KSIZE +; and tries to make adjustments to EMM_KSIZE or DEV_SIZE +; if they are not consistent. +; +; First the EMM_CTRL signature strings are checked. +; If they are not valid we go to SETCTRL to set up a new +; empty EMM_CTRL in SECTOR_BUFFER. +; If the signatures are valid, EMM_TOTALK is checked +; against EXT_K. If they are the same, the EMM_CTRL sector is +; valid and we skip to SCAN_DEV. Otherwise we initialize the +; EMM_CTRL sector at SETCTRL. All we need to do to set up the initial +; EMM_CTRL sector is transfer the record at EMM_CONTROL into +; TRACK_BUFFER and set EMM_TOTALK and EMM_AVAILK to EXT_K - 1. +; +; In either case, finding a valid EMM_CTRL or setting up a correct +; initial one, we end up at SCAN_DEV. This code performs the +; scan of the EMM_REC structures looking for a "free" one +; or an allocated one which is EMM_APPLICATION and has its EMM_ISDRIVER +; bit clear as described in the EMM_CTRL sector documentation. +; +; If we find a "free" EMM_REC structure we go to GOT_FREE_REC +; and try to allocate some memory. This attempt will fail if +; EMM_AVAILK is less than 16K. We then call SET_RESET to do +; the INT 9/INT 19 setup. We adjust DEV_SIZE to equal the +; available memory if DEV_SIZE is > EMM_AVAILK. Then all we do +; is set EMM_AVAILK and all of the fields in the EMM_REC structure +; as described in the EMM_CTRL sector documentation. +; +; Call SET_RESET to do INT 9/INT 19 setup. +; IF the EMM_REC structure we found is the LAST EMM_REC structure +; we cannot edit any sizes and whatever the EMM_KSIZE +; is we stuff it into DEV_SIZE and set the EMM_ISDRIVER +; bit, and we're done. +; NOTE: We DO NOT check that EMM_KSIZE is at least +; 16K as we know this EMM_REC was created +; by some PREVIOUS INT13 program who +; DID make sure it was at least 16K +; ELSE +; IF EMM_KSIZE == DEV_SIZE +; set EMM_ISDRIVER and we're done +; IF EMM_KSIZE < DEV_SIZE +; either the user has edited his DEVICE = line since +; the last time the system was re-booted, or at the +; time we initially allocated this region EMM_AVAILK +; was less than DEV_SIZE and we had to trim the device +; size back. +; This case is handled at INSUFF_MEM. +; IF the next EMM_REC structure is not allocated +; IF EMM_AVAILK == 0 +; We can't do anything, so set DEV_SIZE +; to EMM_KSIZE and we're done. +; ELSE +; allocate appropriate amount off of EMM_AVAILK +; and add it to EMM_KSIZE and we're done. +; ELSE +; We can't do anything, so set DEV_SIZE +; to EMM_KSIZE and we're done. +; ELSE +; This is the EMM_KSIZE > DEV_SIZE case, it means the +; user MUST have edited his DEVICE = line. +; IF next EMM_REC is NOT free +; We can't shrink the allocation block, +; but we'll leave DEV_SIZE set to the user +; specification and let him waste memory. +; ELSE +; SHRINK the allocation block by adding +; the extra memory back onto EMM_AVAILK +; and subtracting it from EMM_KSIZE and +; we're done +; +; ENTRY: +; SECTOR_BUFFER containes POSSIBLE EMM_CTRL sector +; MUST BE CHECKED +; EXT_K is set to size of extended memory +; DEV_SIZE is set to user requested device size +; EXIT: +; CARRY SET +; Error, message already printed +; CARRY CLEAR +; ES:DI = BASE_ADDR for this drive from EMM_BASE of EMM_REC +; EMM_REC is marked EMM_ISDRIVER +; TRACK_BUFFER must be written out, it contains an updated +; EMM_CTRL sector +; DEV_SIZE set to TRUE size +; MY_EMM_REC is the offset in the 1k EMM_CTRL sector of the +; record we allocated. +; +; USES: +; ALL but DS +; +; Specific to TYPE 1 drivers +; +; substancial modification to this routine, would have totally changed +; if it weren't for the olivetti memory +; +; we are going to be int15 guys from now except for the olivetti memory +; +FIND_VDRIVE: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + PUSH CS + POP ES + MOV DI,OFFSET TRACK_BUFFER + MOV SI,OFFSET EMM_CONTROL + MOV CX,50 + CLD + REPE CMPSB + jnz no_emm_rec +; JNZ SETCTRL ; No EMM_CTRL + ADD SI,EMM_TAIL_SIG - 50 + ADD DI,EMM_TAIL_SIG - 50 + MOV CX,10 + REPE CMPSB + jnz no_emm_rec +; JNZ SETCTRL ; No EMM_CTRL +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; with int15 guys around this is not feasible +; MOV DI,OFFSET TRACK_BUFFER +; MOV AX,[EXT_K] +; DEC AX ; Size in EMM_CTRL doesn't include EMM_CTRL +; CMP AX,[DI.EMM_TOTALK] +; JZ SCAN_DEV ; EMM_CTRL is valid +;SETCTRL: +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; modification sunilp +; + dec [valid_emm] ; signal prescence of emm record +no_emm_rec: + cmp [u_switch],0h ; is it a u driver + jne old_st ; if not go to install acc to new int15 + jmp new_st ; standard +; +; for olivetti u memory we still have to install according to ol' microsoft st +; +old_st: + cmp [valid_emm],0h ; do we have a valid emm + jne scan_dev ; if yes go to scan structures +set_ctrl: ; else we have to install a new one + MOV DI,OFFSET TRACK_BUFFER + PUSH DI + MOV SI,OFFSET EMM_CONTROL + MOV CX,1024/2 + REP MOVSW ; Move in initial EMM_CTRL + POP DI + MOV AX,[EXT_K] + DEC AX ; Size in EMM_CTRL doesn't include EMM_CTRL + MOV [DI.EMM_TOTALK],AX + MOV [DI.EMM_AVAILK],AX +SCAN_DEV: + MOV SI,OFFSET TRACK_BUFFER ; DS:SI points to EMM_CTRL + MOV DI,SI + ADD DI,EMM_RECORD ; DS:DI points to EMM records + MOV CX,EMM_NUMREC +LOOK_REC: + TEST [DI.EMM_FLAGS],EMM_ALLOC + JNZ CHECK_SYS + JMP GOT_FREE_REC ; Must alloc new region + +CHECK_SYS: + CMP [DI.EMM_SYSTEM],EMM_APPLICATION + JNZ NEXTREC ; Not correct type + TEST [DI.EMM_FLAGS],EMM_ISDRIVER + JNZ NEXTRECI ; Driver already in + CALL SET_RESET ; Set up INT 19,9 + MOV AX,[DI.EMM_KSIZE] + CMP CX,1 + JBE OK_SET_DEV ; If this is last record, must + ; select this size + CMP AX,[DEV_SIZE] + JZ OK_SET_DEV ; Exact match, Okay + JB INSUFF_MEM ; User asked for more + ; Size of found block is bigger than requested size. + ; User MUST have edited CONFIG.SYS. + PUSH DI + ADD DI,SIZE EMM_REC + TEST [DI.EMM_FLAGS],EMM_ALLOC + POP DI + JZ SHRINK_BLOCK ; Next block is free, shrink + MOV AX,[DEV_SIZE] + JMP SHORT SET_2 + +SHRINK_BLOCK: + SUB AX,[DEV_SIZE] ; AX is amount to shrink + ADD [SI.EMM_AVAILK],AX + MOV AX,[DEV_SIZE] + MOV [DI.EMM_KSIZE],AX + JMP SHORT SET_2 + +INSUFF_MEM: ; Size of found block is smaller + ; than requested size. + PUSH DI + ADD DI,SIZE EMM_REC + TEST [DI.EMM_FLAGS],EMM_ALLOC + POP DI + JNZ OK_SET_DEV ; Next block is NOT free, can't grow +TRY_TO_GROW_BLOCK: + CMP [SI.EMM_AVAILK],0 + JZ OK_SET_DEV ; Need SPECIAL check for this case + SUB AX,[DEV_SIZE] + NEG AX ; AX is amount we would like to grow + SUB [SI.EMM_AVAILK],AX + JNC GOT_THE_MEM + ADD AX,[SI.EMM_AVAILK] ; AX is MAX we can grow + MOV [SI.EMM_AVAILK],0 ; We take all that's left +GOT_THE_MEM: + ADD [DI.EMM_KSIZE],AX + MOV AX,[DI.EMM_KSIZE] +SET_2: +OK_SET_DEV: + MOV [DEV_SIZE],AX + OR [DI.EMM_FLAGS],EMM_ISDRIVER + MOV [MY_EMM_REC],DI + SUB [MY_EMM_REC],OFFSET TRACK_BUFFER ; Make start of EMM_CTRL relative + LES DI,[DI.EMM_BASE] + XOR AX,AX ; Set zero, clear carry + RET + +NEXTRECI: +NEXTREC: + ADD DI,SIZE EMM_REC ; Next record + LOOP LOOK_RECJ +VERROR: + MOV DX,OFFSET ERRMSG2 + CALL PRINT + STC + RET + +LOOK_RECJ: + JMP LOOK_REC + +GOT_FREE_REC: + MOV AX,[SI.EMM_AVAILK] + CMP AX,16 + JB VERROR ; 16K is smallest device + CALL SET_RESET ; Set INT 19,9 + CMP AX,[DEV_SIZE] + JBE GOTSIZE ; Not enough for user spec + MOV AX,[DEV_SIZE] ; User size is OK +GOTSIZE: + MOV [DEV_SIZE],AX + SUB [SI.EMM_AVAILK],AX + MOV [DI.EMM_KSIZE],AX + MOV [DI.EMM_SYSTEM],EMM_APPLICATION + MOV [DI.EMM_FLAGS],EMM_ALLOC + EMM_ISDRIVER + MOV [MY_EMM_REC],DI + SUB [MY_EMM_REC],OFFSET TRACK_BUFFER ; Make start of EMM_CTRL relative + PUSH DI + SUB DI,SIZE EMM_REC ; Look at prev record to compute base + MOV AX,[DI.EMM_KSIZE] + LES BX,[DI.EMM_BASE] + MOV DI,ES ; DI:BX is prev base + MOV CX,1024 + MUL CX ; Mult size by 1024 to get # bytes + ADD AX,BX ; Add size onto base to get next base + ADC DX,DI + POP DI + MOV WORD PTR [DI.EMM_BASE],AX + MOV WORD PTR [DI.EMM_BASE + 2],DX + LES DI,[DI.EMM_BASE] + XOR AX,AX ; Set zero, clear carry + INC AX ; RESET zero + RET + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; the new int15 standard +; +new_st: + mov bx,[ext_k] ; contiguous memory reported by int15 + cmp [valid_emm],0 ; is there a valid emm record + je no_adjust ; if not there no need to adjust + ; the memory available +; else we have to find how much memory is already allocated by the microsoft +; emm control block and subtract this from the amount that is available. the +; memory allocated is totalk - availk + 1 +; + sub bx,1 ; subtract the emm ctrl record size + mov di,offset track_buffer ; set up to address the ctrl record + ; read in + mov ax,[di.emm_totalk] ; ax <- totalk + sub ax,[di.emm_availk] ; ax <- totalk - availk + sub bx,ax ; adjust memory available + jc verror ; if no memory go to abort +; + cmp bx,128 ; is it the minimum required + jb verror ; if less go to abort +; +; the memory available has been found and is in bx. now compare it with +; requested device size and take the minimum of the two +; +no_adjust: + cmp [dev_size],bx ; + jb skip_adj_dev_size ; if enough space we don't need to adj + ; dev_size + mov [dev_size],bx ; else we have compromise on dev size +skip_adj_dev_size: +; +; now that we have the correct dev size we should proceed with the installation +; of a new int 15 handler which will account for the memory grabbed by this guy +; + mov bx,[ext_k] ; get memory which was reported by int15 + add bx,[special_mem] ; account for olivetti guys + sub bx,[dev_size] ; + mov [int15_size],bx ; this is the size thaat will be reported + ; by the int 15 handler +; now install the int15 handler +; + push ax + push dx + push bx + push es + mov ax,(get_interrupt_vector shl 8) or 15h + int 21h + mov word ptr [old_15],bx + mov word ptr [old_15+2],es + mov dx,offset int_15 + mov ax,(set_interrupt_vector shl 8) or 15h + int 21h + pop es + pop bx + pop dx + pop ax +; +; set up int19 vector +; + call set_reset +; +; now fill device base address in es:di +; + mov ax,[ext_k] + sub ax,[dev_size] ; this now has memory left + mov cx,1024 ; we are going to find size in bytes + mul cx ; dx:ax = ax * 1024 + add ax,word ptr [base_addr] ; + adc dx,word ptr [base_addr+2] ; + mov es,dx ; + mov di,ax ; + ret + +;** SET_RESET - Set up INT 19/INT 9 vectors +; +; This routine will install the INT 9 and INT 19 +; code by saving the current INT 9 and INT 19 +; vectors in OLD_9 and OLD_19 (NOTE: the change in the value of OLD_19 +; to something other than -1 indicates that the vectors have been +; replaced), setting the vectors to point to INT_9 and INT_19. +; +; ENTRY: +; NONE +; EXIT: +; NONE +; USES: +; None +; +; COMMON TO TYPE 1, 2 drivers +; + +SET_RESET: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + cmp U_SWITCH,0 ;; don't do this for at&t 6300 plus + jnz ret005 + PUSH AX + PUSH DX + PUSH BX + PUSH ES + MOV AX,(Get_Interrupt_Vector SHL 8) OR 19H + INT 21H + MOV WORD PTR [OLD_19],BX + MOV WORD PTR [OLD_19 + 2],ES + MOV DX,OFFSET INT_19 + MOV AX,(Set_Interrupt_Vector SHL 8) OR 19H + INT 21H + MOV AX,(Get_Interrupt_Vector SHL 8) OR 9H + INT 21H + MOV WORD PTR [OLD_9],BX + MOV WORD PTR [OLD_9 + 2],ES +; MOV DX,OFFSET INT_9 +; MOV AX,(Set_Interrupt_Vector SHL 8) OR 9H +; INT 21H + POP ES + POP BX + POP DX + POP AX +RET005: + RET + +BREAK + +;** AT_EXT_INIT - Perform /E (TYPE 1) specific initialization +; +; This code does the drive TYPE specific initialization for TYPE 1 +; drivers. +; +; Make sure running on 80286 IBM PC-AT compatible system by +; making sure the model byte at FFFF:000E is FC. +; Get the size of extended memory by using 8800H call to INT 15. +; and make sure it is big enough to accomodate thr driver. +; Limit DEV_SIZE to the available memory found in the previous step +; by making DEV_SIZE smaller if necessary. +; Initialize the GLOBAL parts of the LOADALL information which +; are not set by each call to BLKMOV. +; CALL MM_SETDRIVE to look for EMM_CTRL and perform all the +; other initialization tasks. +; Call DRIVEPARMS to set TERM_ADDR and other drive specific cache parms +; +; ENTRY: +; Invokation line parameter values set. +; EXIT: +; CARRY SET +; Error, message already printed. Driver not installed. +; EMM_CTRL not marked (but MAY be initialized if +; a valid one was not found). +; CARRY CLEAR +; BASE_ADDR set for this drive from EMM_BASE of EMM_REC +; BASE_RESET set from BASE_ADDR +; TERM_ADDR set +; EMM_REC is marked EMM_ISDRIVER +; MY_EMM_REC set +; DEV_SIZE set to TRUE size +; RESET_SYSTEM code and INT 9/INT 19 code included, +; INT 19 and 9 vector patched. +; +; USES: +; ALL but DS +; +; Code is specific to TYPE 1 driver +; + +AT_EXT_INIT: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + push ds + call sys_det ; new routine to do more comprehensive + pop ds + jnc at001 ; checks than before + MOV DX,OFFSET BAD_AT +ERR_RET: + CALL PRINT + STC + RET + +AT001: + +;; If upper extended memory is used on the PLUS, it is necessary to +;; patch the values of base_reset and base_addr to get the addressing right. +;; + cmp [U_SWITCH],0 ;; patch the code for /U option + jz AT001A + mov ax,00fah + mov word ptr [emm_ctrl_addr+2],ax ;; in resident part for reset code + mov word ptr [base_reset+2],ax ;; patching upper address + mov word ptr [base_addr+2],ax ;; to FA from 10 +AT001A: + MOV AX,8800H + INT 15H ; Get extended memory size + MOV DX,OFFSET NO_MEM + OR AX,AX + JZ ERR_RET + +;; If running on a 6300 PLUS, it is necessary to subtract any upper extended +;; memory from the value obtained by int 15 to determine the correct memory +;; available for a type /E RAMDrive. If loading a /U RAMDrive, it is necessary +;; to find out if there IS any upper extended memory. + + cmp [U_SWITCH],0 ;; did we ask for upper extended memory + jz olstuff ;; no + call UpperMemCheck ;; yes, see if anything there + jc ERR_RET ;; no, quit + mov ax,384 ;; yes, but max allowed is 384K + jmp short at001b +olstuff: + cmp [S5_FLAG],S_OLIVETTI ;; if not 6300 PLUS, go on + jne at001b + call UpperMemCheck ;; yes, see if 384K is there + jc at001b ;; no, so int 15h is right + sub ax,384 ;; yes, subtract 384K + mov [special_mem],384 ;; store special memory size +AT001B: + + MOV DX,OFFSET ERRMSG2 + CMP AX,128 ; 128k min cache + JB ERR_RET + MOV [EXT_K],AX + MOV BX,AX +; DEC BX ; BX is MAX possible cache size + CMP [DEV_SIZE],BX + JBE AT002 ; DEV_SIZE OK + MOV [DEV_SIZE],BX ; Limit DEV_SIZE to available +AT002: +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; 386 modification + test [sys_flg],M_386 + je loadall_setup + mov ax,cs + mov word ptr [cod_seg],ax +; set cs descriptor + mov cx,16 + mul cx + mov si,offset cs_des + mov [si].bas_0_15,ax + mov [si].bas_16_23,dl + mov [si].bas_24_31,dh +; set gdt base + mov si,offset emm_gdt + add ax,offset start_gdt + adc dx,0 + mov [si].gdt_base_0,ax + mov [si].gdt_base_2,dx + jmp short common_setup + ; + ; Init various pieces of LOADALL info + ; +;;;; SMSW [LDSW] +;;;; SIDT QWORD PTR [IDTDES] +;;;; SGDT QWORD PTR [GDTDES] +;;;; ; +;;;; ; NOW The damn SXXX instructions store the desriptors in a +;;;; ; different order than LOADALL wants +;;;; ; +;;;; MOV SI,OFFSET IDTDES +;;;; CALL FIX_DESCRIPTOR +;;;; MOV SI,OFFSET GDTDES +;;;; CALL FIX_DESCRIPTOR +loadall_setup: + MOV [LCSS],CS + MOV SI,OFFSET CSDES + MOV AX,CS + CALL SEG_SET +common_setup: + CALL MM_SETDRIVE + JC RETXXX + CALL DRIVEPARMS + JNC RETXXX + CALL DISK_ABORT + STC +RETXXX: + RET + +;;* UpperMemCheck - Called by 6300 PLUS to verify existence of +;; upper extended memory of 384K at FA0000h +;; +;; Returns carry set if no upper extended memory. +;; +;; This routine is called only by a 6300 PLUS, and +;; it reads the hardware switch DSW2 to do the job. +;; +UpperMemCheck: + push ax + in al,66h + and al,00001111b + cmp al,00001011b + pop ax + jnz nomem + clc + ret +nomem: + stc + ret + +BREAK + +;** EMM device driver name +; +; The following datum defines the Above Board EMM 8 character +; device driver name that is looked for as part of TYPE 2 +; specific initialization. +; +; This datum is specific to TYPE 2 drivers +; + +ABOVE_DEV_NAME DB "EMMXXXX0" + +;** ABOVE_INIT - Perform /A (TYPE 2) specific initialization +; +; This code performes the driver specific initialization for +; type 2 drivers. +; +; Swap ABOVE_BLKMOV code in for TYPE 1 code at BLKMOV +; Swap ABOVE_RESET code in for TYPE 1 code at RESET_SYSTEM +; Check to make sure EMM Above Board device driver is installed +; by looking for device name relative to INT 67H segment +; address. This is method 2 described on page 36 and 37 +; of the Expanded Memory Manager Programming Specification. +; +; WARNING! If run on a version of DOS where all INT vectors +; are managed by the kernel, or on a system where some +; foreign program (not EMM.SYS) is also using INT 67H, this +; method will fail to find the EMM device driver. +; The reason this method was used rather than the more portable +; method 1 described on pages 33 and 34 of the EMM Programming +; Specification is that the DOS Installable Device Driver +; document makes a statement about which DOS system calls +; may be made in a device initialization routine, and +; OPEN, IOCTL, and CLOSE are not included in the allowed +; set. Adherance to the Installable Device Driver document, +; therefore, excludes the use of method 1. +; +; Check the EMM device status +; Get the EMM map window address and set BASE_ADDR +; Get the available Above Board memory +; Adjust DEV_SIZE to be consistent with the available memory if needed, +; and also round DEV_SIZE up so that it is a multiple of the 16K +; granularity of the Above Board memory. +; Allocate DEV_SIZE worth of Above Board memory and set ABOVE_PID. +; After this point we can use CTRL_IO and/or BLKMOV to +; read/write the memory we have allocated. +; Install the INT 9 and INT 19 code by calling SET_RESET. +; Call DRIVEPARMS to set TERM_ADDR and other drive specific cache parms +; +; SEE ALSO +; INTEL Expanded Memory Manager Programming Specification +; +; ENTRY: +; Invokation line parameter values set. +; EXIT: +; ABOVE_BLKMOV code swapped in at BLKMOV +; ABOVE_RESET code swapped in at RESET_SYSTEM +; CARRY SET +; Error, message already printed. Driver not installed. +; No Above Board memory allocated. +; CARRY CLEAR +; BASE_ADDR set to segment address of Above Board map window +; ABOVE_PID contains PID of allocated above board memory +; DEV_SIZE set to TRUE size +; TERM_ADDR set +; +; USES: +; ALL but DS +; +; Code is specific to TYPE 2 driver +; + +ABOVE_INIT: +ASSUME DS:INT13CODE,ES:NOTHING,SS:NOTHING + ; + ; Swap above code into place + ; + PUSH CS + POP ES + MOV SI,OFFSET ABOVE_CODE + MOV DI,OFFSET DRIVE_CODE + MOV CX,OFFSET DRIVE_END - OFFSET DRIVE_CODE + REP MOVSB + MOV SI,OFFSET ABOVE_RESET + MOV DI,OFFSET RESET_SYSTEM + MOV CX,OFFSET RESET_INCLUDE - OFFSET RESET_SYSTEM + REP MOVSB + ; + ; Check for presence of Above board memory manager + ; + MOV AX,(Get_Interrupt_Vector SHL 8) OR 67H + INT 21H + MOV DI,SDEVNAME + MOV SI,OFFSET ABOVE_DEV_NAME + MOV CX,8 + REPE CMPSB + JZ GOT_MANAGER + MOV DX,OFFSET NO_ABOVE +ABOVE_ERR: + CALL PRINT + STC + RET + +GOT_MANAGER: + ; + ; Check memory status + ; + MOV CX,8000H +STLOOP: + MOV AH,ABOVE_STATUS + INT 67H + CMP AH,ABOVE_SUCCESSFUL + JZ MEM_OK + CMP AH,ABOVE_ERROR_BUSY + LOOPZ STLOOP +ST_ERR: + MOV DX,OFFSET BAD_ABOVE + JMP ABOVE_ERR + +MEM_OK: + ; + ; Get base address of map region and set BASE_ADDR + ; + MOV AH,ABOVE_GET_SEG + INT 67H + CMP AH,ABOVE_ERROR_BUSY + JZ MEM_OK + CMP AH,ABOVE_SUCCESSFUL + JNZ ST_ERR + MOV WORD PTR [BASE_ADDR],0 + MOV WORD PTR [BASE_ADDR + 2],BX + ; + ; Allocate drive memory + ; +GET_AVAIL: + MOV AH,ABOVE_GET_FREE + INT 67H + CMP AH,ABOVE_ERROR_BUSY + JZ GET_AVAIL + CMP AH,ABOVE_SUCCESSFUL + JNZ ST_ERR + MOV AX,DX ; AX is total 16K pages + ; BX is un-allocated 16K pages + MOV DX,OFFSET NO_MEM + OR AX,AX + JZ ABOVE_ERR + MOV DX,OFFSET ERRMSG2 +; +; change in allocation strategy new default is all of available pages +; < 8192K. +; +; algorithm: if (free_pages < 8) then error(); +; else { +; if (free_pages > 200h) then free_pages = 200h; +; if (num_arg == 1) then dev_size = free_pages; +; else dev_size = min (dev_size,free_pages) + + + + CMP BX,8 ; 128K = 16K * 8 = Min cache size + JB ABOVE_ERR + cmp bx,0200h ; 8192K = Max cache size + jbe ab0$1 ; if less or equal fine + mov bx,0200h ; else limit it to 8192K +ab0$1: + mov cx,4 ; to convert number of pages into no of k + shl bx,cl + cmp [num_arg],1 ; is numeric argument 1 ( means none ) + jne ab0$2 ; cache size has been requested + mov [dev_size],bx ; else use all of available cache + jmp short ab001 ; +ab0$2: + cmp [dev_size],bx ; minimum of dev size and bx + jb ab001 + mov [dev_size],bx ; + + +ab001: + mov bx,[dev_size] + mov [current_dev_size],bx ; Initialize current device size + ; + ; BX is K we want to allocate (limited by available K) + ; BX is at least 16 + ; + MOV AX,BX + MOV CX,4 ; Convert back to # of 16K pages + SHR BX,CL + TEST AX,0FH ; Even???? + JZ OKAYU ; Yes + INC BX ; Gotta round up + PUSH BX + MOV CX,4 + SHL BX,CL + MOV [DEV_SIZE],BX ; Correct dev size too by rounding it up to + ; next multiple of 16K, no sense wasting + ; part of a page. +;A + mov [current_dev_size],bx ; Correct current device size also +;A + POP BX +OKAYU: + MOV AH,ABOVE_ALLOC + INT 67H + CMP AH,ABOVE_ERROR_BUSY + JZ OKAYU + CMP AH,ABOVE_SUCCESSFUL + JZ GOT_ID + CMP AH,ABOVE_ERROR_MAP_CNTXT + JZ ST_ERRJ + CMP AH,ABOVE_ERROR_OUT_OF_PIDS + JB ST_ERRJ + MOV DX,OFFSET ERRMSG2 + JMP ABOVE_ERR + +ST_ERRJ: + JMP ST_ERR + +GOT_ID: + MOV [ABOVE_PID],DX + ; + ; INSTALL ABOVE RESET handler + ; + CALL SET_RESET + ; + ; We are now in good shape. + ; + CALL DRIVEPARMS + JNC RETYYY + CALL DISK_ABORT + STC +RETYYY: + RET + +BREAK + +; +; This label defines the start of the code swapped in at DRIVE_CODE +; +ABOVE_CODE LABEL WORD + +; +; WARNING DANGER!!!!!!! +; +; This code is tranfered over the /E driver code at DRIVE_CODE +; +; ALL jmps etc. must be IP relative. +; ALL data references must be to cells at the FINAL, TRUE location +; (no data cells may be named HERE, must be named up at BLKMOV). +; OFFSET of ABOVE_BLKMOV relative to ABOVE_CODE MUST be the same as +; the OFFSET of BLKMOV relative to DRIVE_CODE. +; SIZE of stuff between ABOVE_CODE and ABOVE_END MUST be less than +; or equal to size of stuff between DRIVE_CODE and DRIVE_END. + +IF2 + IF((OFFSET ABOVE_BLKMOV - OFFSET ABOVE_CODE) NE (OFFSET BLKMOV - OFFSET DRIVE_CODE)) + %out ERROR BLKMOV, ABOVE_BLKMOV NOT ALIGNED + ENDIF + IF((OFFSET ABOVE_END - OFFSET ABOVE_CODE) GT (OFFSET DRIVE_END - OFFSET DRIVE_CODE)) + %out ERROR ABOVE CODE TOO BIG + ENDIF +ENDIF + + DD ? ; 24 bit address of start of this RAMDRV +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;** ABOVE_BLKMOV - Perform transfer for TYPE 2 driver +; +; This routine is the transfer routine for moving bytes +; to and from the Above Board memory containing the cache. +; +; The Above Board is implemented as 4 16K windows into the Above +; Board memory, giving a total window of 64K wich starts on some +; 16K boundary of the Above Board memory. Given that a DOS I/O +; request is up to 64K bytes starting on some sector boundary, +; the most general I/O picture is: +; +; |------------|------------|------------|------------|------------| +; | Above Brd | Above Brd | Above Brd | Above Brd | Above Brd | +; |Log page n |Log page n+1|Log page n+2|log page n+3|Log page n+4| +; |------------|------------|------------|------------|------------| +; |---|---| | | +; | | |---------------- 64K bytes of sectors -------------| +; Byte | | | +; offset|------------------|------------------------| | +; of first| Number of words in | | +; byte of | first part of I/O that |---|---| +; I/O in | can be performed once Number +; first | logical pages n - n+3 of words +; Log page| are mapped into physical in tail +; | pages 0 - 3 part of I/O +; Location of that have +; first byte to be done +; of sector M, once logical +; the start sector page n+4 is +; of the I/O mapped into +; physical page +; 0 +; +; One or both of "Byte offset of first byte of I/O in first page" and +; "Number of words in tail part of I/O" may be zero depending on the +; size of the I/O and its start offset in the first logical page it is +; possible to map. +; +; WARNING: IF A PRE-EMPTIVE MULTITASKING SYSTEM SCHEDULES A TASK WHICH +; IS USING THE ABOVE BOARD DURING THE TIME THIS DRIVER IS IN THE +; MIDDLE OF PERFORMING AN I/O, THE SYSTEM HAD BETTER MANAGE THE A +; BOARD MAPPING CONTEXT CORRECTLY OR ALL SORTS OF STRANGE UNPLEASANT +; THINGS WILL OCCUR. +; +; SEE ALSO +; INTEL Expanded Memory Manager Programming Specification +; +; ENTRY: +; ES:DI is packet transfer address. +; CX is number of words to transfer. +; DX:AX is 32 bit start byte offset (0 = start of cache) +; BH is 1 for WRITE, 0 for READ +; +; BASE_ADDR set to point to Above Board mapping window in main memory +; This "input" is not the responsibility of the caller. It +; is up to the initialization code to set it up when the +; device is installed +; +; EXIT: +; Carry Clear +; OK, operation performed successfully +; Carry Set +; Error during operation, AL is error number +; +; USES: +; ALL +; +; This routine is specific to TYPE 2 driver +; +above_blkmov: +assume ds:int13code,es:nothing,ss:nothing +; +; save mapping context and return with error if save fails +; + save_mapping_context + jnc ab_blk$1 + ret +; +; find logical page number, offset of i/o in first page +; +ab_blk$1: + push cx + mov cx,1024*16 ; 16k bytes / page + div cx ; dx:ax / 16k --> log page numb in ax + ; --> offset of i/o in dx + mov si,dx ; transfer offset to si + mov dx,ax ; store the page number in dx + pop cx +; +; find case and dispatch accordingly +; +; case 0 : user buffer below page map, can use aaron's code +; case 1 : user buffer above page map, can use aaron's code +; case 2 : user buffer totally within page map, use pai's code +; case 3 : user buffer partly in page map partly below, error +; case 4 : user buffer partly in page map partly above, error +; + push bx + push cx +; +; if( final_user_off < pm_base_addr ) then case 0 +; + mov ax,di ; get user buffer initial offset into ax + shr ax,1 ; convert to word offset + dec cx ; convert word count to 0 based number + add ax,cx ; user buffer final word offset + shr ax,1 ; convert to segment + shr ax,1 ; + shr ax,1 ; + mov bx,es ; get segment of buffer + add ax,bx ; now we have the segment of the user buffer + ; with offset < 16 + sub ax,word ptr [base_addr+2] ; compare against page map + jc aar_cd ; if below page map then execute old code +; +; if( initial_user_off < pm_base_addr ) then error +; + mov cx,4 + mov bp,di ; get initial offset in bp + shr bp,cl ; + add bp,bx ; + sub bp,word ptr [base_addr +2] + jc ab_error ; +; +; if ( initial_user_off >= pm_end_addr ) then case1 +; + cmp bp,4*1024 ; + jae aar_cd ; +; +; if ( final_addr >= pm_end_addr ) then error +; + cmp ax,4*1024 + jae ab_error +; +; case 2 +; +within_pm: jmp new_code ; user buffer in page map + ; so we need to execute new code +ab_error: + add sp,4 + mov al,0bbh ; general failure + stc + jmp short REST_CONT ; RESTORE CONTEXT!!! +aar_cd: + pop cx + pop bx +; +; Referring back to the diagram given above the following routine is +; to take care of transfer of the most general case. +; What this routine does is break every I/O down into the above parts. +; The first or main part of the I/O is performed by mapping 1 to 4 +; sequential logical pages into the 4 physical pages and executing one +; REP MOVSW. If the tail word count is non-zero then the fith sequential +; logical page is mapped into physical page 0 and another REP MOVSW is +; executed. +; +; METHOD: +; Break I/O down as described above into main piece and tail piece +; Map the appropriate number of sequential pages (up to 4) +; into the page window at BASE_ADDR to set up the main piece +; of the I/O. +; Set appropriate seg and index registers and CX to perform the +; main piece of the I/O into the page window +; REP MOVSW +; IF there is a tail piece +; Map the next logical page into physical page 0 +; Reset the appropriate index register to point at phsical page 0 +; Move tail piece word count into CX +; REP MOVSW +; Restore Above Board page mapping context +; + XOR BP,BP ; No tail page + PUSH BX + ; + ; DX is first page #, SI is byte offset of start of I/O in first page + ; + MOV AX,DX + MOV BX,SI + SHR BX,1 ; # Words in first 16k page which are not part + ; of I/O + PUSH CX + ADD BX,CX ; # of words we need to map to perform I/O + MOV DX,BX + AND DX,1FFFH ; DX is number of words to transfer last page + ; remainder of div by words in 16K bytes + MOV CL,13 ; Div by # words in 16K + SHR BX,CL ; BX is number of pages to map (may need round up) + OR DX,DX ; Remainder? + JZ NO_REM + INC BX ; Need one more page +NO_REM: + MOV CX,BX ; CX is total pages we need to map + MOV BX,AX ; BX is first logical page + CMP CX,4 ; We can map up to 4 pages + JBE NO_TAIL + MOV BP,DX ; Words to move in tail page saved in BP + DEC CX ; Need second map for the 5th page + POP AX + SUB AX,DX ; Words to move in first 4 pages is input + ; word count minus words in tail page + PUSH AX ; Count for first mapping back on stack +NO_TAIL: + ; Map CX pages + MOV DX,[ABOVE_PID] + MOV AX,ABOVE_MAP SHL 8 ; Physical page 0 + PUSH AX +MAP_NEXT: + POP AX ; Recover correct AX register + PUSH AX + PUSH BX + PUSH DX + INT 67H ; Damn call ABOVE_MAP zaps BX,DX,AX + POP DX + POP BX + OR AH,AH + JNZ MAP_ERR1 ; error +IF2 + IF (ABOVE_SUCCESSFUL) + %out ASSUMPTION IN CODE THAT ABOVE_SUCCESSFUL = 0 IS INVALID + ENDIF +ENDIF +NEXT_PAGE: + INC BX ; Next logical page + POP AX + INC AL ; Next physical page + PUSH AX + LOOP MAP_NEXT + POP AX ; Clean stack + POP CX ; Word count for first page mapping + POP AX ; Operation in AH + ; + ; BX has # of next logical page (Tail page if BP is non-zero) + ; BP has # of words to move in tail page (0 if no tail) + ; CX has # of words to move in current mapping + ; SI is offset into current mapping of start of I/O + ; AH indicates READ or WRITE + ; + PUSH AX ; Save op for possible second I/O + OR AH,AH + JZ READ_A + ; + ; WRITE + ; + PUSH ES + PUSH DI + MOV DI,SI ; Start page offset to DI + POP SI ; DS:SI is transfer addr + POP DS +ASSUME DS:NOTHING + MOV ES,WORD PTR [BASE_ADDR + 2] ; ES:DI -> start + JMP SHORT FIRST_MOVE + +READ_A: +ASSUME DS:INT13CODE + MOV DS,WORD PTR [BASE_ADDR + 2] ; DS:SI -> start +ASSUME DS:NOTHING +FIRST_MOVE: + REP MOVSW + OR BP,BP ; Tail? + JNZ TAIL_IO ; Yup +ALL_DONE: + POP AX + CLC +REST_CONT: + ; Restore page mapping context + PUSH AX ; Save possible error code + PUSHF ; And carry state +REST_AGN: + MOV DX,[ABOVE_PID] + MOV AH,ABOVE_RESTORE_MAP_PID + INT 67H + OR AH,AH + JZ ROK +IF2 + IF (ABOVE_SUCCESSFUL) + %out ASSUMPTION IN CODE THAT ABOVE_SUCCESSFUL = 0 IS INVALID + ENDIF +ENDIF + CMP AH,ABOVE_ERROR_BUSY + JZ REST_AGN + CMP AH,ABOVE_ERROR_NO_CNTXT + JZ ROK ; Ignore the invalid PID error + POP DX + POP DX ; Clean stack + MOV AL,0BBH ; General failure + STC + RET + +ROK: + POPF ; Recover carry state + POP AX ; and possible error code + RET + +TAIL_IO: + MOV DX,[ABOVE_PID] +MAP_AGN: + MOV AX,ABOVE_MAP SHL 8 ; map logical page BX to phys page 0 + PUSH BX + PUSH DX + INT 67H ; Damn call ABOVE_MAP zaps BX,DX,AX + POP DX + POP BX + OR AH,AH + JNZ MAP_ERR2 ; Error +IF2 + IF (ABOVE_SUCCESSFUL) + %out ASSUMPTION IN CODE THAT ABOVE_SUCCESSFUL = 0 IS INVALID + ENDIF +ENDIF +SECOND_MOVE: + POP AX ; Recover Op type + PUSH AX + OR AH,AH + JZ READ_SEC + ; + ; WRITE + ; + XOR DI,DI ; ES:DI -> start of tail + JMP SHORT SMOVE + +READ_SEC: + XOR SI,SI ; DS:SI -> start of tail +SMOVE: + MOV CX,BP + REP MOVSW + JMP ALL_DONE + +MAP_ERR1: + CMP AH,ABOVE_ERROR_BUSY ; Busy? + JZ MAP_NEXT ; Yes, wait till not busy (INTs are ON) + ADD SP,6 ; Clean stack + JMP SHORT DNR_ERR + +MAP_ERR2: + CMP AH,ABOVE_ERROR_BUSY + JZ MAP_AGN + ADD SP,2 +DNR_ERR: + MOV AL,0AAH ; Drive not ready + STC + JMP REST_CONT +; +; +; this code has been written to handle te cases of overlapping usage +; of the above board page frame segment by the cache and user buffer +; assumption: in dos tracks cannot be more than 64 sectors long so +; in the worst case we shall have the user buffer occupying three +; pages is the page frame. we attempt to find the page that is +; available for the cache and use it repeatedly to access the cache +;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +; the algorithm is: +; ****************************************************** +; [STEP1: determine the page we can use for the cache] +; +; if (initial_para_offset_user in page 1 or above ) then { +; physical_cache_page = 0; +; cache_segment = above board segment; +; } +; else { +; physical_cache_page = 3; +; cache_segment = above_board_segment + 3*1024; +; } +; +; ****************************************************** +; [STEP2: initial setup] +; +; count = user_count_requested; +; number_to_be_transferred = min ( count, (16K - si) >> 2 ); +; exchange source and destination if necessary; +; +; ******************************************************* +; [STEP3: set up transfer and do it] +; +; count = count - number_to_be_transferred; +; map_page cache_handle,physical_cache_page,logical_cache_page +; mov data +; +; ******************************************************* +; [STEP4: determine if another transfer needed and setup if so] +; +; if ( count == 0 ) then exit; +; if ( operation == read ) then source_offset = 0; +; else dest_offset = 0; +; number_to_be_transferred = min ( count, 8*1024 ); +; logical_page_number++ ; +; +; ******************************************************* +; [STEP5: go to do next block] +; +; goto [STEP3] +;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +; +new_code: + assume ds:int13code,es:nothing,ss:nothing +; +; input parameters: +; +; bp : start para offset of user buffer in physical page frame +; ax : end para offset of user buffer in physical page frame +; di : transfer offset of user buffer +; es : transfer segment of user buffer +; dx : logical page number in cache +; si : offset from start in logical page number +; +; on stack { cx,bx } where cx = number of words, bx = read / write status +; +; [STEP1: finding physical cache page and page frame] +; + ; + ; assume is physical page 0 + ; + xor al,al ; use page 0 for cache + mov bx,word ptr [base_addr+2] + ; + ; see if this assumption valid + ; + cmp bp,1024 ; is initial in page 1 or above + jae ab$30 ; if so or assumption is valid + ; + ; else we have to correct our assumption + ; + mov al,3 ; use page 3 for cache + add bx,3*1024 ; + ; + ; initialise page frame segment + ; +ab$30: + mov ds,bx + ; +assume ds:nothing +; +; [STEP2: initialising transfer parameters] +; + ; + pop bp ; bp will have count of words left to be transferred + pop bx ; read / write status + push bx ; save it back again + push dx ; save this too + ; + ; initially si offset into logical page, so we can only do 16*1024 - si + ; byte transfer + ; + mov cx,16*1024 + sub cx,si + shr cx,1 ; convert to word count + ; + ; number to be transferred is the minimum of this and the user requested + ; count + ; + cmp cx,bp + jb ab$31 + mov cx,bp + ; +ab$31: + ; + ; see if write, then we have to switch source with destination + ; + or bh,bh + je ab$32 ; if read we don't have to do anything + ; else we have to switch + src_dest_switch +ab$32: + ; + ; set direction flag so that we don't have to do it repeatedly + ; + cld +; +; [STEP3: set up transfer and do it] +; +ab$33: + ; + ; update count of words still left to be transferred after this + ; + sub bp,cx + ; + ; map the logical page in cache to the physical page selected + ; + mov bx,dx ; get logical page into bx + ; al already holds the physical page # + map_page + jnc ab$34 ; suceeded ? + ; + ; else report error + ; + add sp,4 + stc + jmp short restore_mp ; and go to restore page map +ab$34: + ; + ; succeeded, do the transfer + ; +rep movsw + ; +; +; [STEP4: check if transfer done, if not set up for next block] +; [STEP5: go back to STEP3] + ; + ; check if done + ; + or bp,bp ; count 0 + je ab$40 ; yes, go to finish up + ; + ; recover original dx and bx, increment dx and then save both again + ; + pop dx + pop bx + inc dx + push bx + push dx + ; + ; words to be transferred minimum of count and 8*1024 words + ; + mov cx,8*1024 ; 8k words in a page + cmp cx,bp ; + jbe ab$35 ; if below or equal this is what we want + ; + mov cx,bp ; else we can transfer the whole count +ab$35: + ; + ; see whether cache src or dest and accordingly reset either si or di + ; + or bh,bh ; read? + jne ab$36 ; if write go to modify + ; + ; read, zero si and go back to step3 + ; + xor si,si + jmp short ab$33 ; to step 3 +ab$36: + ; + ; write, zero di and go back to step3 + ; + xor di,di + jmp short ab$33 ; to step 3 +; +; finishing up we have to restore the page map +; +ab$40: + add sp,4 + clc +restore_mp: + restore_mapping_context + ret + + DW ? ; SPACE for ABOVE_PID + +; +; This label defines the end of the code swapped in at DRIVE_CODE +; +ABOVE_END LABEL WORD + +BREAK + + +; +; WARNING DANGER!!!!!!! +; +; This code is tranfered over the /E driver code at RESET_SYSTEM +; +; ALL jmps etc. must be IP relative. +; ALL data references must be to cells at the FINAL, TRUE location +; (no data cells may be named HERE, must be named up at RESET_SYSTEM). +; SIZE of stuff between ABOVE_RESET and ABOVE_RESET_END MUST be less than +; or equal to size of stuff between RESET_SYSTEM and RESET_INCLUDE. +; +; NOTE: EACH ABOVE BOARD driver has an INT 19 and 9 handler. This is +; different from /E and RESMEM in which only the first +; driver has an INT 19 and 9 handler. +; + +IF2 + IF((OFFSET ABOVE_RESET_END - OFFSET ABOVE_RESET) GT (OFFSET RESET_INCLUDE - OFFSET RESET_SYSTEM)) + %out ERROR ABOVE_RESET CODE TOO BIG + ENDIF +ENDIF + +;** ABOVE_RESET perform TYPE 2 (/A) driver specific reboot code +; +; This code issues an ABOVE_DEALLOC call for the memory +; associated with this particular TYPE 2 cache since the +; system is being re-booted and the driver is "gone". +; +; ENTRY +; NONE +; EXIT +; NONE +; USES +; NONE +; +; This code is specific to TYPE 2 drivers +; + +ABOVE_RESET: +ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING + PUSH AX + PUSH DX +AGAIN_RESET: + MOV DX,[ABOVE_PID] + MOV AH,ABOVE_DEALLOC ; Close PID + INT 67H + CMP AH,ABOVE_ERROR_BUSY + JZ AGAIN_RESET + POP DX + POP AX + RET + +; +; This label defines the end of the code swapped in at RESET_SYSTEM +; +ABOVE_RESET_END LABEL BYTE + +BREAK + +;** Message texts and common data +; +; Init data. This data is disposed of after initialization. +; it is mostly texts of all of the messages +; +; COMMON to TYPE 1 and 2 drivers +; +; THIS IS THE START OF DATA SUBJECT TO TRANSLATION + +NO_ABOVE db "SMARTDrive : Expanded Memory Manager not present",13,10,"$" +BAD_ABOVE db "SMARTDrive : Expanded Memory Status shows error",13,10,"$" +BAD_AT db "SMARTDrive : Cannot run on this computer",13,10,"$" +NO_MEM db "SMARTDrive : No extended memory available",13,10,"$" +ERRMSG1 db "SMARTDrive : Invalid parameter",13,10,"$" +ERRMSG2 db "SMARTDrive : Insufficient memory",13,10,"$" +INIT_IO_ERR db "SMARTDrive : I/O error accessing cache memory",13,10,"$" +NOHARD db "SMARTDrive : No hard drives on system",13,10,"$" +BIGTRACK db "SMARTDrive : Too many bytes per track on hard drive",13,10,"$" +BADVERMES db 13,10,"SMARTDrive : Incorrect DOS version",13,10,"$" + +; +; This is the Int13 header message. +; +HEADERMES db 13,10,"Microsoft SMARTDrive Disk Cache v2.10",13,10,"$" + +; +; This is the status message used to display INT13 configuration +; it is: +; +; STATMES1STATMES2<# tracks in cache>STATMES3 +; STATMES4 +; +; It is up to translator to move the message text around the numbers +; so that the message is printed correctly when translated +; +STATMES1 db " Cache size: $" +STATMES1A db "K in Expanded Memory$" +STATMES1E db "K in Extended Memory$" +STATMES2 db 13,10," Room for $" +STATMES3 db " tracks of $" +STATMES4 db " sectors each",13,10,13,10,"$" +ifdef OMTI +omti_msg db " OMTI controller release",13,10,"$" +endif + +;----------------------------------------------------------------------- +; +; END OF DATA SUBJECT TO TRANSLATION +; + +IF DEBUG +STATMES5 db "Device CS = $" +STATMES6 db " decimal",13,10,"$" +s5flagmsg db " = S5 flag",13,10,"$" +U_msg db " = U Switch", 13,10,'$' +ENDIF + + db "This program is the property of Microsoft Corporation." + +INT13_END LABEL BYTE + +INT13CODE ENDS + END + \ No newline at end of file diff --git a/v4.0/src/DEV/SMARTDRV/SMARTDRV.LNK b/v4.0/src/DEV/SMARTDRV/SMARTDRV.LNK new file mode 100644 index 0000000..be9d1c2 --- /dev/null +++ b/v4.0/src/DEV/SMARTDRV/SMARTDRV.LNK @@ -0,0 +1,3 @@ +int13 +int13.exe +int13.map -map; diff --git a/v4.0/src/DEV/SMARTDRV/SYSCALL.ASM b/v4.0/src/DEV/SMARTDRV/SYSCALL.ASM new file mode 100644 index 0000000..3f6d712 --- /dev/null +++ b/v4.0/src/DEV/SMARTDRV/SYSCALL.ASM @@ -0,0 +1,147 @@ +BREAK + +Abort EQU 0 ; 0 0 +Std_Con_Input EQU 1 ; 1 1 +Std_Con_Output EQU 2 ; 2 2 +Std_Aux_Input EQU 3 ; 3 3 +Std_Aux_Output EQU 4 ; 4 4 +Std_Printer_Output EQU 5 ; 5 5 +Raw_Con_IO EQU 6 ; 6 6 +Raw_Con_Input EQU 7 ; 7 7 +Std_Con_Input_No_Echo EQU 8 ; 8 8 +Std_Con_String_Output EQU 9 ; 9 9 +Std_Con_String_Input EQU 10 ; 10 A +Std_Con_Input_Status EQU 11 ; 11 B +Std_Con_Input_Flush EQU 12 ; 12 C +Disk_Reset EQU 13 ; 13 D +Set_Default_Drive EQU 14 ; 14 E +FCB_Open EQU 15 ; 15 F +FCB_Close EQU 16 ; 16 10 +Dir_Search_First EQU 17 ; 17 11 +Dir_Search_Next EQU 18 ; 18 12 +FCB_Delete EQU 19 ; 19 13 +FCB_Seq_Read EQU 20 ; 20 14 +FCB_Seq_Write EQU 21 ; 21 15 +FCB_Create EQU 22 ; 22 16 +FCB_Rename EQU 23 ; 23 17 +Get_Default_Drive EQU 25 ; 25 19 +Set_DMA EQU 26 ; 26 1A +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; +Get_Default_DPB EQU 31 ; 31 1F +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +FCB_Random_Read EQU 33 ; 33 21 +FCB_Random_Write EQU 34 ; 34 22 +Get_FCB_File_Length EQU 35 ; 35 23 +Get_FCB_Position EQU 36 ; 36 24 +Set_Interrupt_Vector EQU 37 ; 37 25 +Create_Process_Data_Block EQU 38 ; 38 26 +FCB_Random_Read_Block EQU 39 ; 39 27 +FCB_Random_Write_Block EQU 40 ; 40 28 +Parse_File_Descriptor EQU 41 ; 41 29 +Get_Date EQU 42 ; 42 2A +Set_Date EQU 43 ; 43 2B +Get_Time EQU 44 ; 44 2C +Set_Time EQU 45 ; 45 2D +Set_Verify_On_Write EQU 46 ; 46 2E +; Extended functionality group +Get_DMA EQU 47 ; 47 2F +Get_Version EQU 48 ; 48 30 +Keep_Process EQU 49 ; 49 31 +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; +Get_DPB EQU 50 ; 50 32 +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +Set_CTRL_C_Trapping EQU 51 ; 51 33 +Get_InDOS_Flag EQU 52 ; 52 34 +Get_Interrupt_Vector EQU 53 ; 53 35 +Get_Drive_Freespace EQU 54 ; 54 36 +Char_Oper EQU 55 ; 55 37 +International EQU 56 ; 56 38 +; Directory Group +MKDir EQU 57 ; 57 39 +RMDir EQU 58 ; 58 3A +CHDir EQU 59 ; 59 3B +; File Group +Creat EQU 60 ; 60 3C +Open EQU 61 ; 61 3D +Close EQU 62 ; 62 3E +Read EQU 63 ; 63 3F +Write EQU 64 ; 64 40 +Unlink EQU 65 ; 65 41 +LSeek EQU 66 ; 66 42 +CHMod EQU 67 ; 67 43 +IOCtl EQU 68 ; 68 44 +XDup EQU 69 ; 69 45 +XDup2 EQU 70 ; 70 46 +Current_Dir EQU 71 ; 71 47 +; Memory Group +Alloc EQU 72 ; 72 48 +Dealloc EQU 73 ; 73 49 +Setblock EQU 74 ; 74 4A +; Process Group +Exec EQU 75 ; 75 4B +Exit EQU 76 ; 76 4C +Get_Return_Code EQU 77 ; 77 4D +Find_First EQU 78 ; 78 4E +; Special Group +Find_Next EQU 79 ; 79 4F +; SPECIAL SYSTEM GROUP +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; +Set_Current_PDB EQU 80 ; 80 50 +Get_Current_PDB EQU 81 ; 81 51 +Get_In_Vars EQU 82 ; 82 52 +SetDPB EQU 83 ; 83 53 +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +Get_Verify_On_Write EQU 84 ; 84 54 +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; +Dup_PDB EQU 85 ; 85 55 +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +Rename EQU 86 ; 86 56 +File_Times EQU 87 ; 87 57 +AllocOper EQU 88 ; 88 58 +; Network extention system calls +GetExtendedError EQU 89 ; 89 59 +CreateTempFile EQU 90 ; 90 5A +CreateNewFile EQU 91 ; 91 5B +LockOper EQU 92 ; 92 5C Lock and Unlock +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +; C A V E A T P R O G R A M M E R ; +; ; +ServerCall EQU 93 ; 93 5D CommitAll, ServerDOSCall, + ; CloseByName, CloseUser, + ; CloseUserProcess, + ; GetOpenFileList +; ; +; C A V E A T P R O G R A M M E R ; +;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----; +UserOper EQU 94 ; 94 5E Get and Set +AssignOper EQU 95 ; 95 5F On, Off, Get, Set, Cancel +xNameTrans EQU 96 ; 96 60 +PathParse EQU 97 ; 97 61 +GetCurrentPSP EQU 98 ; 98 62 +Hongeul EQU 99 ; 99 63 + +Set_Oem_Handler EQU 248 ; 248 F8 +OEM_C1 EQU 249 ; 249 F9 +OEM_C2 EQU 250 ; 250 FA +OEM_C3 EQU 251 ; 251 FB +OEM_C4 EQU 252 ; 252 FC +OEM_C5 EQU 253 ; 253 FD +OEM_C6 EQU 254 ; 254 FE +OEM_C7 EQU 255 ; 255 FF + \ No newline at end of file diff --git a/v4.0/src/DEV/VDISK/MAKEFILE b/v4.0/src/DEV/VDISK/MAKEFILE new file mode 100644 index 0000000..cbbf7ed --- /dev/null +++ b/v4.0/src/DEV/VDISK/MAKEFILE @@ -0,0 +1,33 @@ +#************************ Makefile for vdisk ************************** + +inc =..\..\inc +msg =..\..\messages +dos =..\..\dos +hinc =..\..\hinc + +# +####################### Dependencies begin here. ####################### +# + +all: vdisk.sys + +vdisk.ctl: vdisk.skl \ + $(msg)\$(COUNTRY).msg \ + makefile + + +vdisksys.obj: vdisksys.asm \ + vdisksys.inc \ + vdisk.ctl \ + vdisk.cl2 \ + vdisk.cla \ + vdisk.cl1 \ + $(inc)\msgserv.asm \ + $(inc)\sysmsg.inc \ + makefile + +vdisk.sys: vdisksys.obj \ + vdisk.lnk + link @vdisk.lnk + exe2bin vdisk.exe vdisk.sys + del vdisk.exe diff --git a/v4.0/src/DEV/VDISK/SLM.INI b/v4.0/src/DEV/VDISK/SLM.INI new file mode 100644 index 0000000..be11bcd --- /dev/null +++ b/v4.0/src/DEV/VDISK/SLM.INI @@ -0,0 +1,4 @@ +project = 340 +slm root = //WINSRC/CORE +user root = //D:WINBLD1-D/MSDOS/340/SRC +sub dir = /dev/VDISK diff --git a/v4.0/src/DEV/VDISK/VDISK.ASM b/v4.0/src/DEV/VDISK/VDISK.ASM new file mode 100644 index 0000000..5994111 --- /dev/null +++ b/v4.0/src/DEV/VDISK/VDISK.ASM @@ -0,0 +1,2221 @@ + PAGE ,132 + TITLE VDISK - Virtual Disk Device Driver + +;VDISK simulates a disk drive, using Random Access Memory as the storage medium. + +;This program is meant to serve as an example of a device driver. It does not +;reflect the current level of VDISK.SYS. + +;(C) Copyright 1988 Microsoft +;Licensed Material - Program Property of Microsoft + +;Add the following statement to CONFIG.SYS +; DEVICE=[d:][path]VDISK.SYS bbb sss ddd [/E:m] + +; where: bbb is the desired buffer size (in kilobytes) +; minimum 1KB, maximum is size of available memory, +; default is 64KB. + +; VDISK will leave at least 64KB of available memory, +; although subsequent device drivers (other than VDISK) +; other programs that make themselves resident, and +; COMMAND.COM will result in less than 64KB as shown +; by CHKDSK. + +; Must be large enough for 1 boot sector + FAT sectors +; + 1 directory sector + at least 1 data cluster, +; or the device driver won't be installed. + +; sss is the desired sector size (in bytes) +; 128, 256, or 512, default is 128. +; Will be adjusted if number of FAT entries > 0FE0H + +; ddd is the desired number of directory entries +; Minimum 2, maximum 512, default 64. +; Will be rounded upward to sector size boundary. + +; /E may only be used if extended memory above 1 megabyte +; is to be used. INT 15H functions 87H and 88H are used +; to read and write this extended memory. +; The m parameter in the /E option specifies the maximum +; number of sectors that the VDISK will transfer at a time. +; Optional values are 1,2,3,4,5,6,7 or 8 sectors, the default +; is 8 sectors. + +; Brackets indicate optional operands. + + +; Samples: +; DEVICE=\path\VDISK.SYS 160 512 64 +; results in a 160KB VDISK, with 512 byte sectors, 64 directory entries + +; DEVICE=VDISK.SYS Buffersize 60 Sectorsize 128 Directory entries 32 +; (since only numbers are interpreted, you may comment the line with +; non-numeric characters) + + SUBTTL Structure Definitions + PAGE +;-----------------------------------------------------------------------; +; Request Header (Common portion) ; +;-----------------------------------------------------------------------; +RH EQU DS:[BX] ;addressability to Request Header structure + +RHC STRUC ;fields common to all request types + DB ? ;length of Request Header (including data) + DB ? ;unit code (subunit) +RHC_CMD DB ? ;command code +RHC_STA DW ? ;status + DQ ? ;reserved for DOS +RHC ENDS ;end of common portion + +CMD_INPUT EQU 4 ;RHC_CMD is INPUT request + +;status values for RHC_STA + +STAT_DONE EQU 01H ;function complete status (high order byte) +STAT_CMDERR EQU 8003H ;invalid command code error +STAT_CRC EQU 8004H ;CRC error +STAT_SNF EQU 8008H ;sector not found error +STAT_BUSY EQU 0200H ;busy bit (9) for Removable Media call +;-----------------------------------------------------------------------; +; Request Header for INIT command ; +;-----------------------------------------------------------------------; +RH0 STRUC + DB (TYPE RHC) DUP (?) ;common portion +RH0_NUN DB ? ;number of units + ;set to 1 if installation succeeds, + ;set to 0 to cause installation failure +RH0_ENDO DW ? ;offset of ending address +RH0_ENDS DW ? ;segment of ending address +RH0_BPBO DW ? ;offset of BPB array address +RH0_BPBS DW ? ;segment of BPB array address +RH0_DRIV DB ? ;drive code (DOS 3 only) +RH0 ENDS + +RH0_BPBA EQU DWORD PTR RH0_BPBO ;offset/segment of BPB array address +;Note: RH0_BPBA at entry to INIT points to all after DEVICE= on CONFIG.SYS stmt + +;-----------------------------------------------------------------------; +; Request Header for MEDIA CHECK Command ; +;-----------------------------------------------------------------------; +RH1 STRUC + DB (TYPE RHC) DUP (?) ;common portion + DB ? ;media descriptor +RH1_RET DB ? ;return information +RH1 ENDS +;-----------------------------------------------------------------------; +; Request Header for BUILD BPB Command ; +;-----------------------------------------------------------------------; +RH2 STRUC + DB (TYPE RHC) DUP(?) ;common portion + DB ? ;media descriptor + DW ? ;offset of transfer address + DW ? ;segment of transfer address +RH2_BPBO DW ? ;offset of BPB table address +RH2_BPBS DW ? ;segment of BPB table address +RH2 ENDS +;-----------------------------------------------------------------------; +; Request Header for INPUT, OUTPUT, and OUTPUT with verify ; +;-----------------------------------------------------------------------; +RH4 STRUC + DB (TYPE RHC) DUP (?) ;common portion + DB ? ;media descriptor +RH4_DTAO DW ? ;offset of transfer address +RH4_DTAS DW ? ;segment of transfer address +RH4_CNT DW ? ;sector count +RH4_SSN DW ? ;starting sector number +RH4 ENDS + +RH4_DTAA EQU DWORD PTR RH4_DTAO ;offset/segment of transfer address + +;-----------------------------------------------------------------------; +; Segment Descriptor (part of Global Descriptor Table) ; +;-----------------------------------------------------------------------; +DESC STRUC ;data segment descriptor +DESC_LMT DW 0 ;segment limit (length) +DESC_BASEL DW 0 ;bits 15-0 of physical address +DESC_BASEH DB 0 ;bits 23-16 of physical address + DB 0 ;access rights byte + DW 0 ;reserved +DESC ENDS + + SUBTTL Equates and Macro Definitions + PAGE + +MEM_SIZE EQU 12H ;BIOS memory size determination INT + ;returns system size in KB in AX + +EM_INT EQU 15H ;extended memory BIOS interrupt INT +EM_BLKMOVE EQU 87H ;block move function +EM_MEMSIZE EQU 88H ;memory size determination in KB + +BOOT_INT EQU 19H ;bootstrap DOS + +DOS EQU 21H ;DOS request INT +DOS_PCHR EQU 02H ;print character function +DOS_PSTR EQU 09H ;print string function +DOS_VERS EQU 30H ;get DOS version + +TAB EQU 09H ;ASCII tab +LF EQU 0AH ;ASCII line feed +CR EQU 0DH ;ASCII carriage return +BEL EQU 07H ;ASCII bell + +PARA_SIZE EQU 16 ;number of bytes in one 8088 paragraph +DIR_ENTRY_SIZE EQU 32 ;number of bytes per directory entry +MAX_FATE EQU 0FE0H ;largest number of FAT entries allowed + +;default values used if parameters are omitted + +DFLT_BSIZE EQU 64 ;default VDISK buffer size (KB) +DFLT_SSZ EQU 128 ;default sector size +DFLT_DIRN EQU 64 ;default number of directory entries +DFLT_ESS EQU 8 ;default maximum sectors to transfer + +MIN_DIRN EQU 2 ;minimum number of directory entries +MAX_DIRN EQU 512 ;maximum number of directory entries + +STACK_SIZE EQU 512 ;length of stack during initialization + +;-----------------------------------------------------------------------; +; MSG invokes the console message subroutine ; +;-----------------------------------------------------------------------; + +MSG MACRO TEXT + PUSH DX ;;save DX across call + MOV DX,OFFSET TEXT ;;point to message + CALL SHOW_MSG ;;issue message + POP DX + ENDM + + + SUBTTL Resident Data Area + PAGE +;-----------------------------------------------------------------------; +; Map INT 19H vector in low storage ; +;-----------------------------------------------------------------------; +INT_VEC SEGMENT AT 00H + ORG 4*BOOT_INT +BOOT_VEC LABEL DWORD +BOOT_VECO DW ? ;offset +BOOT_VECS DW ? ;segment +INT_VEC ENDS + + +CSEG SEGMENT PARA PUBLIC 'CODE' + ASSUME CS:CSEG +;-----------------------------------------------------------------------; +; Resident data area. ; +; ; +; All variables and constants required after initialization ; +; part one are defined here. ; +;-----------------------------------------------------------------------; + +START EQU $ ;begin resident VDISK data & code + +;DEVICE HEADER - must be at offset zero within device driver + DD -1 ;becomes pointer to next device header + DW 0800H ;attribute (IBM format block device) + ;supports OPEN/CLOSE/RM calls + DW OFFSET STRATEGY ;pointer to device "strategy" routine + DW OFFSET IRPT ;pointer to device "interrupt handler" + DB 1 ;number of block devices + DB 7 DUP (?) ;7 byte filler (remainder of 8-byte name) +;END OF DEVICE HEADER + +;This volume label is placed into the directory of the new VDISK +;This constant is also used to determine if a previous extended memory VDISK +;has been installed. + +VOL_LABEL DB 'VDISK ' ;00-10 volume name (shows program level) + DB 28H ;11-11 attribute (volume label) + DT 0 ;12-21 reserved + DW 6000H ;22-23 time=12:00 noon + DW 0986H ;24-25 date=12/06/84 +VOL_LABEL_LEN EQU $-VOL_LABEL ;length of volume label + +;The following field, in the first extended memory VDISK device driver, +;is the 24-bit address of the first free byte of extended memory. +;This address is not in the common offset/segment format. +;The initial value, 10 0000H, is 1 megabyte. + +AVAIL_LO DW 0 ;address of first free byte of +AVAIL_HI DB 10H ;extended memory + +;The INT 19H vector is "stolen" by the first VDISK installed in extended memory. +;The original content of the interrupt vector is saved here. + +INTV19 LABEL DWORD +INTV19O DW ? ;offset +INTV19S DW ? ;segment + + +PARAS_PER_SECTOR DW ? ;number of 16-byte paragraphs in one sector + +START_BUFFER_PARA DW ? ;segment address of start of VDISK buffer + ;for extended memory, this segment address + ;is the end of the VDISK device driver. + +EM_SW DB 0 ;non-zero if Extended Memory + +EM_STAT DW 0 ;AX from last unsuccessful extended memory I/O + +START_EM_LO DW ? ;24-bit address of start of VDISK buffer +START_EM_HI DB ? ;(extended memory only) + +WPARA_SIZE DW PARA_SIZE ;number of bytes in one paragraph + +MAX_CNT DW ? ;(0FFFFH/BPB_SSZ) truncated, the maximum + ;number of sectors that can be transferred + ;without worrying about 64KB wrap + +SECT_LEFT DW ? ;sectors left to transfer + +IO_SRCA LABEL DWORD ;offset/segment of source +IO_SRCO DW ? ;offset +IO_SRCS DW ? ;segment + +IO_TGTA LABEL DWORD ;offset/segment of target +IO_TGTO DW ? ;offset +IO_TGTS DW ? ;segment + +;-----------------------------------------------------------------------; +; BIOS Parameter Block (BPB) ; +;-----------------------------------------------------------------------; +;This is where the characteristics of the virtual disk are established. +;A copy of this block is moved into the boot record of the virtual disk. +;DEBUG can be used to read sector zero of the virtual disk to examine the +;boot record copy of this block. + +BPB LABEL BYTE ;BIOS Parameter Block (BPB) +BPB_SSZ DW 0 ;number of bytes per disk sector +BPB_AUSZ DB 1 ;sectors per allocation unit +BPB_RES DW 1 ;number of reserved sectors (for boot record) +BPB_FATN DB 1 ;number of File Allocation Table (FAT) copies +BPB_DIRN DW 0 ;number of root directory entries +BPB_SECN DW 1 ;total number of sectors + ;computed from buffer size and sector size + ;(this includes reserved, FAT, directory, + ;and data sectors) +BPB_MCB DB 0FEH ;media descriptor byte +BPB_FATSZ DW 1 ;number of sectors occupied by a single FAT + ;computed from BPBSSZ and BPBSECN +BPB_LEN EQU $-BPB ;length of BIOS parameter block + +BPB_PTR DW BPB ;BIOS Parameter Block pointer array (1 entry) +;-----------------------------------------------------------------------; +; Request Header (RH) address, saved here by "strategy" routine ; +;-----------------------------------------------------------------------; +RH_PTRA LABEL DWORD +RH_PTRO DW ? ;offset +RH_PTRS DW ? ;segment +;-----------------------------------------------------------------------; +; Global Descriptor Table (GDT), used for extended memory moves ; +;-----------------------------------------------------------------------; +;Access Rights Byte (93H) is +; P=1 (segment is mapped into physical memory) +; E=0 (data segment descriptor) +; D=0 (grow up segment, offsets must be <= limit) +; W=1 (data segment may be written into) +; DPL=0 (privilege level 0) + +GDT LABEL BYTE ;begin global descriptor table + DESC <> ;dummy descriptor + DESC <> ;descriptor for GDT itself +SRC DESC <,,,93H,> ;source descriptor +TGT DESC <,,,93H,> ;target descriptor + DESC <> ;BIOS CS descriptor + DESC <> ;stack segment descriptor + + SUBTTL INT 19H (boot) interrupt handler + PAGE +;-----------------------------------------------------------------------; +; INT 19H Interrupt Handler routine ; +;-----------------------------------------------------------------------; +;The INT 19H vector is altered by VDISK initialization to point to this +;routine within the first extended memory VDISK device driver. + +;The vector points to the device driver so that subsequent VDISKs installed +;in extended memory can find the first one to determine what memory has +;already been allocated to VDISKs. + +;This routine restores the original INT 19H vector's content, then jumps +;to the original routine. + +;INT 19H, the "Boot" INT, is always altered when DOS is booted. + +;This routine is entered with interrupts disabled. + +VDISK_INT19 PROC ;INT 19H received + PUSH DS ;save registers we're going to alter + PUSH AX + + XOR AX,AX + MOV DS,AX ;set DS = 0 + ASSUME DS:INT_VEC + + MOV AX,CS:INTV19O ;get offset of saved vector + MOV DS:BOOT_VECO,AX ;store offset in interrupt vector + + MOV AX,CS:INTV19S ;get segment of saved vector + MOV DS:BOOT_VECS,AX ;store segment in interrupt vector + + POP AX + POP DS + + JMP CS:INTV19 ;go to original interrupt routine + +VDISK_INT19 ENDP + + ASSUME DS:NOTHING + + SUBTTL Device Strategy & interrupt entry points + PAGE +;-----------------------------------------------------------------------; +; Device "strategy" entry point ; +; ; +; Retain the Request Header address for use by Interrupt routine ; +;-----------------------------------------------------------------------; +STRATEGY PROC FAR + MOV CS:RH_PTRO,BX ;offset + MOV CS:RH_PTRS,ES ;segment + RET +STRATEGY ENDP +;-----------------------------------------------------------------------; +; Table of command processing routine entry points ; +;-----------------------------------------------------------------------; +CMD_TABLE LABEL WORD + DW OFFSET INIT_P1 ; 0 - Initialization + DW OFFSET MEDIA_CHECK ; 1 - Media check + DW OFFSET BLD_BPB ; 2 - Build BPB + DW OFFSET INPUT_IOCTL ; 3 - IOCTL input + DW OFFSET INPUT ; 4 - Input + DW OFFSET INPUT_NOWAIT ; 5 - Non destructive input no wait + DW OFFSET INPUT_STATUS ; 6 - Input status + DW OFFSET INPUT_FLUSH ; 7 - Input flush + DW OFFSET OUTPUT ; 8 - Output + DW OFFSET OUTPUT_VERIFY ; 9 - Output with verify + DW OFFSET OUTPUT_STATUS ;10 - Output status + DW OFFSET OUTPUT_FLUSH ;11 - Output flush + DW OFFSET OUTPUT_IOCTL ;12 - IOCTL output + DW OFFSET DEVICE_OPEN ;13 - Device OPEN + DW OFFSET DEVICE_CLOSE ;14 - Device CLOSE +MAX_CMD EQU ($-CMD_TABLE)/2 ;highest valid command follows + DW OFFSET REMOVABLE_MEDIA ;15 - Removable media + +;-----------------------------------------------------------------------; +; Device "interrupt" entry point ; +;-----------------------------------------------------------------------; +IRPT PROC FAR ;device interrupt entry point + PUSH DS ;save all registers Revised + PUSH ES + PUSH AX + PUSH BX + PUSH CX + PUSH DX + PUSH DI + PUSH SI + ;BP isn't used, so it isn't saved + CLD ;all moves forward + + LDS BX,CS:RH_PTRA ;get RH address passed to "strategy" into DS:BX + + MOV AL,RH.RHC_CMD ;command code from Request Header + CBW ;zero AH (if AL > 7FH, next compare will + ;catch that error) + + CMP AL,MAX_CMD ;if command code is too high + JA IRPT_CMD_HIGH ;jump to error routine + + MOV DI,OFFSET IRPT_CMD_EXIT ;return addr from command processor + PUSH DI ;push return address onto stack + ;command routine issues "RET" + + ADD AX,AX ;double command code for table offset + MOV DI,AX ;put into index register for JMP + + XOR AX,AX ;initialize return to "no error" + +;At entry to command processing routine: + +; DS:BX = Request Header address +; CS = VDISK code segment address +; AX = 0 + +; top of stack is return address, IRPT_CMD_EXIT + + JMP CS:CMD_TABLE[DI] ;call routine to handle the command + + +IRPT_CMD_ERROR: ;CALLed for unsupported character mode commands + +INPUT_IOCTL: ;IOCTL input +INPUT_NOWAIT: ;Non-destructive input no wait +INPUT_STATUS: ;Input status +INPUT_FLUSH: ;Input flush + +OUTPUT_IOCTL: ;IOCTL output +OUTPUT_STATUS: ;Output status +OUTPUT_FLUSH: ;Output flush + + POP AX ;pop return address off stack + +IRPT_CMD_HIGH: ;JMPed to if RHC_CMD > MAX_CMD + MOV AX,STAT_CMDERR ;"invalid command" and error + +IRPT_CMD_EXIT: ;return from command routine + ;AX = value to OR into status word + LDS BX,CS:RH_PTRA ;restore DS:BX as Request Header pointer + OR AH,STAT_DONE ;add "done" bit to status word + MOV RH.RHC_STA,AX ;store status into request header + POP SI ;restore registers + POP DI + POP DX + POP CX + POP BX + POP AX + POP ES + POP DS + RET +IRPT ENDP + + SUBTTL Command Processing routines + PAGE +;-----------------------------------------------------------------------; +; Command Code 1 - Media Check ; +; At entry, DS:BX point to request header, AX = 0 ; +;-----------------------------------------------------------------------; +MEDIA_CHECK PROC + MOV RH.RH1_RET,1 ;indicate media not changed + RET ;AX = zero, no error +MEDIA_CHECK ENDP +;-----------------------------------------------------------------------; +; Command Code 2 - Build BPB ; +; At entry, DS:BX point to request header, AX = 0 ; +;-----------------------------------------------------------------------; +BLD_BPB PROC + MOV RH.RH2_BPBO,OFFSET BPB ;return pointer to our BPB + MOV RH.RH2_BPBS,CS + RET ;AX = zero, no error +BLD_BPB ENDP +;-----------------------------------------------------------------------; +; Command Code 13 - Device Open ; +; Command Code 14 - Device Close ; +; Command Code 15 - Removable media ; +; At entry, DS:BX point to request header, AX = 0 ; +;-----------------------------------------------------------------------; +REMOVABLE_MEDIA PROC + MOV AX,STAT_BUSY ;set status bit 9 (busy) + ;indicating non-removable media +DEVICE_OPEN: ;NOP for device open +DEVICE_CLOSE: ;NOP for device close + RET +REMOVABLE_MEDIA ENDP ;fall thru to return +;-----------------------------------------------------------------------; +; Command Code 4 - Input ; +; Command Code 8 - Output ; +; Command Code 9 - Output with verify ; +; At entry, DS:BX point to request header, AX = 0 ; +;-----------------------------------------------------------------------; +INOUT PROC +INPUT: +OUTPUT: +OUTPUT_VERIFY: + +;Make sure I/O is entirely within the VDISK sector boundaries + + MOV CX,CS:BPB_SECN ;get total sector count + MOV AX,RH.RH4_SSN ;starting sector number + CMP AX,CX ;can't exceed total count + JA INOUT_E1 ;jump if start > total + + ADD AX,RH.RH4_CNT ;start + sector count + CMP AX,CX ;can't exceed total count + JNA INOUT_A ;jump if start + count <= total + +INOUT_E1: ;I/O not within VDISK sector boundaries + MOV RH.RH4_CNT,0 ;set sectors transferred to zero + MOV AX,STAT_SNF ;indicate 'Sector not found' error + RET ;return with error status in AX + +INOUT_A: ;I/O within VDISK bounds + MOV AX,RH.RH4_CNT ;get sector count + MOV CS:SECT_LEFT,AX ;save as sectors left to process + + CMP CS:EM_SW,0 ;extended memory mode? + JNE INOUT_EM ;jump to extended memory I/O code + +;Compute offset and segment of VDISK buffer for starting segment in CX:SI + + MOV AX,RH.RH4_SSN ;starting sector number + MUL CS:PARAS_PER_SECTOR ;* length of one sector in paragraphs + ADD AX,CS:START_BUFFER_PARA ;+ segment of VDISK buffer sector 0 + MOV CX,AX ;segment address to CX + XOR SI,SI ;offset is zero + +;Compute address of caller's Data Transfer Addr in DX:AX with smallest offset, +;so that there is no possibility of overflowing a 64KB boundary moving MAX_CNT +;sectors. + + MOV AX,PARA_SIZE ;16 + MUL RH.RH4_DTAS ;* segment of caller's DTA in DX,AX + ADD AX,RH.RH4_DTAO ;+ offset of caller's DTA + ADC DL,0 ;carry in from addition + DIV CS:WPARA_SIZE ;AX is segment of caller's DTA + ;DX is smallest offset possible + ;AX:DX = DTA address + +;AX:DX is caller's DTA segment:offset, CX:SI is VDISK buffer segment:offset + +;If this is an OUTPUT request, exchange the source and target addresses + + CMP RH.RHC_CMD,CMD_INPUT ;INPUT operation? + JE INOUT_B ;jump if INPUT operation + + XCHG AX,CX ;swap source and target segment + XCHG DX,SI ;swap source and target offset + +INOUT_B: ;CX:SI is source, AX:DX is target + MOV CS:IO_SRCS,CX ;save source segment + MOV CS:IO_SRCO,SI ;save source offset + MOV CS:IO_TGTS,AX ;save target segment + MOV CS:IO_TGTO,DX ;save target offset + + JMP SHORT INOUT_E ;AX := SECT_LEFT, test for zero +INOUT_C: ;SECT_LEFT in AX, non-zero + +; Compute number of sectors to transfer in a single move, +; AX = minimum of (SECT_LEFT, MAX_CNT) + +; MAX_CNT is the maximum number of sectors that can be moved without +; spanning a 64KB boundary (0FFFFH / Sector size, remainder truncated) + + MOV CX,CS:MAX_CNT ;MAX sectors with one move + CMP AX,CX ;if SECT_LEFT cannot span 64KB boundary + JBE INOUT_D ;then move SECT_LEFT sectors + + MOV AX,CX ;else move MAX_CNT sectors +INOUT_D: + SUB CS:SECT_LEFT,AX ;reduce number of sectors left to move + +;Move AX sectors from source to target + + MUL CS:BPB_SSZ ;sectors * sector size = byte count + ;(cannot overflow into DX) + SHR AX,1 ;/2 = word count + MOV CX,AX ;word count to CX for REP MOVSW + + LDS SI,CS:IO_SRCA ;source segment/offset to DS:SI + LES DI,CS:IO_TGTA ;target segment/offset to ES:DI + + REP MOVSW ;move MOV_CNT sectors + +;Update source and target paragraph addresses +;AX has number of words moved + + SHR AX,1 ;words moved / 8 = paragraphs moved + SHR AX,1 + SHR AX,1 + + ADD CS:IO_SRCS,AX ;add paragraphs moved to source segment + ADD CS:IO_TGTS,AX ;add paragraphs moved to target segment + +;Determine if more sectors need to be transferred + +INOUT_E: ;do while SECT_LEFT <> zero + MOV AX,CS:SECT_LEFT ;get sectors left to transfer + OR AX,AX ;set flags + JNZ INOUT_C ;go back to transfer some sectors + RET ;AX = zero, all sectors transferred + + SUBTTL Extended Memory I/O routine + PAGE +;-----------------------------------------------------------------------; +; Extended Memory I/O routine ; +;-----------------------------------------------------------------------; +INOUT_EM: ;Extended memory I/O routine + ;change to larger stack + MOV SI,SS ;save old SS in SI + MOV DX,SP ;save old SP in DX + CLI ;disable interrupts + MOV AX,CS + MOV SS,AX ;set SS = CS + MOV SP,OFFSET EM_STACK ;point to new stack + STI ;enable interrupts + PUSH SI ;save old SS at top of new stack + PUSH DX ;save old SP on new stack + + MOV SI,RH.RH4_DTAO ;caller's DTA offset + +;Compute 24-bit address of VDISK sector in CX (hi) and SI (low) + + MOV AX,RH.RH4_SSN ;starting sector number + MUL CS:BPB_SSZ ;* sector size = offset within buffer + ADD AX,CS:START_EM_LO ;+ base address of this VDISK buffer + ADC DL,CS:START_EM_HI + MOV CX,DX ;save high byte + MOV SI,AX ;save low word + +;Compute 24-bit address of caller's DTA in DX (hi) and AX (low) + + MOV AX,PARA_SIZE ;16 + MUL RH.RH4_DTAS ;* segment of caller's DTA + ADD AX,RH.RH4_DTAO ;+ offset of caller's DTA + ADC DL,0 ;carry in from addition + +;Caller's DTA address is in CX,SI, VDISK buffer address is in DX,AX. + +;If this is an OUTPUT request, exchange the source and target addresses + + CMP RH.RHC_CMD,CMD_INPUT ;INPUT operation? + JE INOUT_EM_B ;jump if INPUT operation + + XCHG DX,CX ;swap source and target high byte + XCHG AX,SI ;swap source and target low word + +INOUT_EM_B: ;CX,SI is source, DX,AX is target + + MOV SRC.DESC_BASEL,SI ;low 16 bits of source address + MOV SRC.DESC_BASEH,CL ;high 8 bits of source address + + MOV TGT.DESC_BASEL,AX ;low 16 bits of target address + MOV TGT.DESC_BASEH,DL ;high 8 bits of target address + + JMP SHORT INOUT_EM_E ;AX := SECT_LEFT, test for zero +INOUT_EM_C: ;SECT_LEFT in AX, non-zero + +; Compute number of sectors to transfer in a single move, +; AX = minimum of (SECT_LEFT, MAX_CNT) + +; MAX_CNT is the maximum number of sectors that can be moved without +; spanning a 64KB boundary (0FFFFH / Sector size, remainder truncated) + + MOV CX,CS:MAX_CNT ;MAX sectors with one move + CMP AX,CX ;if SECT_LEFT cannot span 64KB boundary + JBE INOUT_EM_D ;then move SECT_LEFT sectors + + MOV AX,CX ;else move MAX_CNT sectors +INOUT_EM_D: + SUB CS:SECT_LEFT,AX ;reduce number of sectors left to move + +;Move AX sectors from source to target + + MUL CS:BPB_SSZ ;sectors * sector size = byte count + ;(cannot overflow into DX) + MOV TGT.DESC_LMT,AX ;store segment limit (byte count) + MOV SRC.DESC_LMT,AX + + PUSH AX ;preserve byte count on stack + + SHR AX,1 ;/2 = word count + MOV CX,AX ;word count to CX + + PUSH CS + POP ES ;set ES = CS + MOV SI,OFFSET GDT ;ES:SI point to GDT + + MOV AH,EM_BLKMOVE ;function is block move + INT EM_INT ;move an even number of words + + POP CX ;get byte count back from stack + + OR AH,AH ;get error code + + JNZ INOUT_EM_XE ;jump if I/O error encountered + +;Update source and target addresses + + ADD SRC.DESC_BASEL,CX ;add bytes moved to source + ADC SRC.DESC_BASEH,0 ;pick up any carry + + ADD TGT.DESC_BASEL,CX ;add bytes moved to target + ADC TGT.DESC_BASEH,0 ;pick up any carry + +;Determine if more sectors need to be transferred + +INOUT_EM_E: ;do while SECT_LEFT <> zero + MOV AX,CS:SECT_LEFT ;get sectors left to transfer + OR AX,AX ;set flags + JNZ INOUT_EM_C ;go back to transfer some sectors + +INOUT_EM_X2: ;revert to original stack + POP DI ;get old SP + POP SI ;get old SS + CLI ;disable interrupts + MOV SS,SI ;restore old SS + MOV SP,DI ;restore old SP + STI ;enable interrupts + RET ;return to IRPT_EXIT + +INOUT_EM_XE: ;some error with INT 15H + MOV CS:EM_STAT,AX ;save error status for debugging + MOV RH.RH4_CNT,0 ;indicate no sectors transferred + MOV AX,STAT_CRC ;indicate CRC error + JMP INOUT_EM_X2 ;fix stack and exit +INOUT ENDP + + DW 40 DUP (?) ;stack for extended memory I/O +EM_STACK LABEL WORD + + SUBTTL Boot Record + PAGE +;-----------------------------------------------------------------------; +; Adjust the assembly-time instruction counter to a paragraph ; +; boundary ; +;-----------------------------------------------------------------------; + + IF ($-START) MOD 16 + ORG ($-START) + 16 - (($-START) MOD 16) + ENDIF + +VDISK EQU $ ;start of virtual disk buffer +VDISKP EQU ($-START) / PARA_SIZE ;length of program in paragraphs +;-----------------------------------------------------------------------; +; If this VDISK is in extended memory, this address is passed ; +; back to DOS as the end address that is to remain resident. ; +; ; +; It this VDISK is not in extended memory, the VDISK buffer ; +; begins at this address, and the address passed back to DOS ; +; as the end address that is to remain resident is this address ; +; plus the length of the VDISK buffer. ; +;-----------------------------------------------------------------------; + +BOOT_RECORD LABEL BYTE ;Format of Boot Record documented in + ;DOS Technical Reference Manual + DB 0,0,0 ;3-byte jump to boot code (not bootable) + DB 'VDISK ' ;8-byte vendor identification +BOOT_BPB LABEL BYTE ;boot record copy of BIOS parameter block + DW ? ;number of bytes per disk sector + DB ? ;sectors per allocation unit + DW ? ;number of reserved sectors (for boot record) + DB ? ;number of File Allocation Table (FAT) copies + DW ? ;number of root directory entries + DW ? ;total number of sectors + DB ? ;media descriptor byte + DW ? ;number of sectors occupied by a single FAT +;end of boot record BIOS Parameter block + +;The following three words mean nothing to VDISK, they are placed here +;to conform to the DOS standard for boot records. + DW 8 ;sectors per track + DW 1 ;number of heads + DW 0 ;number of hidden sectors +;The following word is the 16-bit kilobyte address of the first byte in +;extended memory that is not occupied by a VDISK buffer +;It is placed into this location so that other users of extended memory +;may find where all the VDISKs end. + +;This field may be accessed by moving the boot record of the First extended +;memory VDISK from absolute location 10 0000H. Before assuming that the +;value below is valid, the vendor ID (constant VDISK) should be verified +;to make sure that SOME VDISK has been installed. + +;For example, if two VDISKs are installed, one 320KB and one 64KB, the +;address calculations are as follows: + +;Extended memory start address = 100000H (1024KB) +;Start addr of 1st VDISK buffer = 100000H (1024KB) +;Length of 1st VDISK buffer = 050000H ( 320KB) +;End addr of 1st VDISK buffer = 14FFFFH +;Start addr of 2nd VDISK buffer = 150000H (1344KB) +;Length of 2nd VDISK buffer = 010000H ( 64KB) +;End addr of 2nd VDISK buffer = 15FFFFH +;First byte after all VDISKs = 160000H (1408KB) +;Divide by 1024 = 0580H (1408D) + +;Content of BOOT_EM = 0580H + +BOOT_EM_OFF EQU $-BOOT_RECORD ;offset from 10 0000H of the following word +BOOT_EM DW 1024 ;KB addr of first free byte of extended memory +;-----------------------------------------------------------------------; +; Part 2 of Initialization (executed last) ; +;-----------------------------------------------------------------------; +;Initialization is divided into two parts. + +;INIT_P1 is overlaid by the virtual disk buffer + +;INIT_P1 is executed first, then jumps to INIT_P2. INIT_P2 returns to caller. + +;Exercise caution if extending the initialization part 2 code. +;It overlays the area immediately following the boot sector. +;If this section of code must be expanded, make sure it fits into the minimum +;sector size of 128 bytes. +;Label TEST_LENGTH must equate to a non-negative value (TEST_LENGTH >= 0). +;If this code it must be extended beyond the 128 byte length of the boot sector, +;move all of INIT_P2 before label VDISK. + +;Registers at entry to INIT_P2 (set up at end of INIT_P1): +; BL = media control byte from BPB (for FAT) +; CX = number of FAT copies +; DX = number of bytes in one FAT - 3 +; SI = OFFSET of Volume Label field +; ES:DI = VDISK buffer address of first FAT sector +; CS = DS = VDISK code segment + +INIT_P2 PROC ;second part of initialization + ASSUME DS:CSEG ;DS set in INIT_P1 + +;Initialize File Allocation Table(s) (FATs) + +INIT_P2_FAT: ;set up one FAT, sector number in AX + + PUSH CX ;save loop counter on stack + MOV AL,BL ;media control byte + STOSB ;store media control byte, increment DI + MOV AX,0FFFFH ;bytes 2 and 3 of FAT are 0FFH + STOSW + + MOV CX,DX ;FAT size in bytes - 3 + XOR AX,AX ;value to store in remainder of FAT + REP STOSB ;clear remainder of FAT + + POP CX ;get loop counter off stack + LOOP INIT_P2_FAT ;loop for all copies of the FAT + +;Put the volume label in the first directory entry + + MOV CX,VOL_LABEL_LEN ;length of volume directory entry + REP MOVSB ;move volume id to directory + +;Zero the remainder of the directory + + MOV AX,DIR_ENTRY_SIZE ;length of 1 directory entry + MUL BPB_DIRN ;* number entries = bytes of directory + SUB AX,VOL_LABEL_LEN ;less length of volume label + MOV CX,AX ;length of rest of directory + XOR AX,AX + REP STOSB ;clear directory to nulls + RET ;return with AX=0 +INIT_P2 ENDP + +PATCH_AREA DB 5 DUP ('PATCH AREA ') +TEST_LENGTH EQU 128-($-VDISK) ;if negative, boot record has too much + ;data area, move some fields below VDISK +;-----------------------------------------------------------------------; +; All fields that must remain resident after device driver ; +; initialization must be defined before this point. ; +;-----------------------------------------------------------------------; + DB 'MS DOS Version 4.00 - Virtual Disk Device Driver' + DB '-------- Licensed Material ---------' + DB 'Program Property of Microsoft Corporation. ' + DB '(C)Copyright 1988 Microsoft' + DB 'Thank You For Your ' + DB ' Support ' + +MAXSEC_TRF DW 0 ;maximum number of sectors to transfer when + ;in extended memory + +BUFF_SIZE DW 0 ;desired VDISK buffer size in kilobytes + +MIN_MEMORY_LEFT DW 64 ;minimum amount of system memory (kilobytes) + ;that must remain after VDISK is installed + +FIRST_EM_SW DB ? ;0FFH if this is the first device driver + ;to be installed in extended memory + ;00H if another VDISK extended memory driver + ;has been installed + +FIRST_VDISK DW ? ;segment address of 1st VDISK device driver +PARA_PER_KB DW 1024/PARA_SIZE ;paragraphs in one kilobyte +C1024 DW 1024 ;bytes in one kilobyte +DIRE_SIZE DW DIR_ENTRY_SIZE ;bytes in one directory entry +DIR_SECTORS DW ? ;number of sectors of directory + +ERR_FLAG DB 0 ;error indicators to condition messages +ERR_BSIZE EQU 80H ;buffer size adjusted +ERR_SSZ EQU 40H ;sector size adjusted +ERR_DIRN EQU 20H ;number of directory entries adjusted +ERR_PASS EQU 10H ;some adjustment made that requires + ;recomputation of values previously computed +ERR_SSZB EQU ERR_SSZ+ERR_PASS ;sector size altered this pass +ERR_SYSSZ EQU 08H ;system storage too small for VDISK +ERR_SWTCH EQU 04H ;invalid switch character +ERR_EXTSW EQU 02H ;extender card switches don't match memory size +ERR_ESIZE EQU 01H ;Transfer size adjusted + +; additional errors added - kwc + +major_version equ 4 ;Major DOS version +minor_version equ 00 ;Minor DOS Version + +expected_version equ (MINOR_VERSION SHL 8)+MAJOR_VERSION + +err_flag2 db 0 +err_baddos equ 01h ; Invalid DOS Version + + SUBTTL Initialization, Part one + PAGE +;-----------------------------------------------------------------------; +; Command Code 0 - Initialization ; +; At entry, DS:BX point to request header, AX = 0 ; +;-----------------------------------------------------------------------; +;Initialization is divided into two parts. +;This part, executed first, is later overlaid by the VDISK buffer. + +INIT_P1 PROC ;first part of initialization + MOV DX,SS ;save stack segment register + MOV CX,SP ;save stack pointer register + CLI ;inhibit interrupts while changing SS:SP + MOV AX,CS ;move CS to SS through AX + MOV SS,AX + MOV SP,OFFSET MSGEND ;end of VDISKMSG + ADD SP,STACK_SIZE ;+ length of our stack + STI ;allow interrupts + PUSH DX ;save old SS register on new stack + PUSH CX ;save old SP register on new stack + + push bx ;secure registers before DOS int + push cx ;secure registers before DOS int + +; add version check - kwc + + mov ah,030h + int 21h + pop cx ;restore pointer values + pop bx ;restore pointer values + cmp ax,expected_version + je okdos + + or cs:err_flag2,err_baddos + +okdos: + CALL GET_PARMS ;get parameters from CONFIG.SYS line + + PUSH CS + POP DS ;set DS = CS + ASSUME DS:CSEG + + CALL APPLY_DEFAULTS ;supply any values not specified + CALL DETERMINE_START ;compute start address of VDISK buffer + CALL VALIDATE ;validate parameters + CALL COPY_BPB ;Copy BIOS Parameter Block to boot record + + CALL VERIFY_EXTENDER ;Verify that extender card switches are right + + TEST ERR_FLAG,ERR_EXTSW ;are switches wrong? + JNZ INIT_P1_A ;if so, exit with messages + + test CS:err_flag2,err_baddos + jnz init_p1_a + + CMP EM_SW,0 ;extended memory requested? + JE INIT_P1_A ;jump if not + + TEST ERR_FLAG,ERR_SYSSZ ;is system too small for VDISK? + JNZ INIT_P1_A ;if so, don't do extended memory init + + CALL UPDATE_AVAIL ;update AVAIL_HI and AVAIL_LO to reflect + ;addition of extended memory VDISK + CALL FORMAT_VDISK ;construct a boot record, FATs and + ;directory in storage immediately + ;following this device driver + CALL MOVE_VDISK ;move formatted boot record, FATs, + ;and directory to extended memory + CALL UPDATE_BOOT ;place the end address of ALL VDISKs + ;in the boot record of the first VDISK + CMP FIRST_EM_SW,0 ;is this the first extended memory VDISK? + JE INIT_P1_A ;no, exit + + CALL STEAL_INT19 ;point INT 19H to this VDISK +INIT_P1_A: + CALL FILL_RH ;fill in INIT request header + CALL WRITE_MESSAGES ;display all messages + POP CX ;get old SP from stack + POP DX ;get old SS from stack + CLI ;disable interrupts while changing SS:SP + MOV SS,DX ;restore stack segment register + MOV SP,CX ;restore stack pointer register + STI ;enable interrupts +;-----------------------------------------------------------------------; +; INIT_P2 must be short enough to fit into the boot sector ; +; (minimum size of boot sector is 128 bytes), so we set up ; +; as many pointers as we can to help keep INIT_P2 short. ; +; ; +; ES:DI = storage address of first FAT sector ; +; BL = media control byte ; +; CX = number of FAT copies ; +; DX = number of bytes in one FAT, less 3 ; +; SI = offset of VOL label field ; +;-----------------------------------------------------------------------; + MOV ES,START_BUFFER_PARA ;start paragraph of VDISK buffer + + MOV AX,BPB_RES ;number of reserved sectors + MUL BPB_SSZ ;* sector size + MOV DI,AX ;ES:DI point to FAT start + + MOV BL,BPB_MCB ;media control byte + + MOV CL,BPB_FATN ;number of FAT copies + XOR CH,CH + + MOV AX,BPB_FATSZ ;FAT size in sectors + MUL BPB_SSZ ;* sector size = total FAT bytes + + SUB AX,3 ;-3 (FEFFFF stored by code) + MOV DX,AX + + MOV SI,OFFSET VOL_LABEL ;point to VOL label directory entry + JMP INIT_P2 ;jump to second part of initialization + ;this is redundant if the VDISK is in + ;extended memory, but is executed anyway + + SUBTTL GET_PARMS Parameter Line Scan + PAGE +;-----------------------------------------------------------------------; +;GET_PARMS gets the parameters from the CONFIG.SYS statement ; +; ; +;Register usage: ; +; DS:SI indexes parameter string ; +; AL contains character from parameter string ; +; CX value from GET_NUMBER ; +;-----------------------------------------------------------------------; + ASSUME DS:NOTHING ;DS:BX point to Request Header +GET_PARMS PROC ;get parameters from CONFIG.SYS line + PUSH DS ;save DS + LDS SI,RH.RH0_BPBA ;DS:SI point to all after DEVICE= + ;in CONFIG.SYS line + XOR AL,AL ;not at end of line + +;Skip until first delimiter is found. There may be digits in the path string. + +;DS:SI points to \pathstring\VDISK.SYS nn nn nn +;The character following VDISK.SYS may have been changed to a null (00H). +;All letters have been changed to uppercase. + +GET_PARMS_A: ;skip to DOS delimiter character + CALL GET_PCHAR ;get parameter character into AL + JZ GET_PARMS_X ;get out if end of line encountered + OR AL,AL ;test for null + JZ GET_PARMS_C ; + CMP AL,' ' + JE GET_PARMS_C ; + CMP AL,',' + JE GET_PARMS_C ; + CMP AL,';' + JE GET_PARMS_C ; + CMP AL,'+' + JE GET_PARMS_C ; + CMP AL,'=' + JE GET_PARMS_C ; + CMP AL,TAB + JNE GET_PARMS_A ;skip until delimiter or CR + + + +GET_PARMS_C: + PUSH SI ;save to rescan + MOV CS:EM_SW,0 ;indicate no /E found + JMP GET_SLASH ;see if current character is an slash + +GET_PARMS_D: ;scan for / + CALL GET_PCHAR + JZ GET_PARMS_B ;exit if end of line + +GET_SLASH: ;check for slash + CMP AL,'/' ;found slash? + JNE GET_PARMS_D ;no, continue scan + + CALL GET_PCHAR ;get char following slash + CMP AL,'E' ;don't have to test for lower case E, + ;letters have been changed to upper case + JNE GET_PARMS_E ;not 'E' + MOV CS:EM_SW,AL ;indicate /E found + + CALL GET_PCHAR ;get char following E + CMP AL,':' ;is it a delimeter ? + JNE GET_PARMS_D ;not a ':' + + + CALL GET_MAXSIZE ;get maximum sector size + + + JMP GET_PARMS_D ;continue forward scan + +GET_PARMS_E: ;/ found, not 'E' + OR CS:ERR_FLAG,ERR_SWTCH ;indicate invalid switch character + JMP GET_PARMS_D ;continue scan + + + +GET_PARMS_B: ;now pointing to first delimiter + POP SI ;get pointer, used to rescan for /E + XOR AL,AL ;not at EOL now + CALL GET_PCHAR ;get first character + CALL SKIP_TO_DIGIT ;skip to first digit + JZ GET_PARMS_X ;found EOL, no digits remain + + CALL GET_NUMBER ;extract digits, convert to binary + MOV CS:BUFF_SIZE,CX ;store buffer size + + CALL SKIP_TO_DIGIT ;skip to next digit + JZ GET_PARMS_X ;found EOL, no digits remain + + CALL GET_NUMBER ;extract digits, convert to binary + MOV CS:BPB_SSZ,CX ;store sector size + + CALL SKIP_TO_DIGIT ;skip to next digit + JZ GET_PARMS_X ;found EOL, no digits remain + + CALL GET_NUMBER ;extract digits, convert to binary + MOV CS:BPB_DIRN,CX ;store number of directory entries + + + +GET_PARMS_X: ;premature end of line + POP DS ;restore DS + RET + + + +GET_MAXSIZE PROC ;get maximum sector size + + CALL GET_PCHAR ;get next character + CALL CHECK_NUM ;is it a number ? + JZ GET_NEXTNUM ;yes, go get next number + OR CS:ERR_FLAG,ERR_ESIZE ;indicate invalid sector size + RET ; +GET_NEXTNUM: ;get next number + CALL GET_NUMBER ;extract digits and convert to binary + MOV CS:MAXSEC_TRF,CX ;save maximum sector size to transfer + RET +GET_MAXSIZE ENDP + + + +GET_PCHAR PROC ;internal proc to get next character into AL + CMP AL,CR ;carriage return already encountered? + JE GET_PCHAR_X ;don't read past end of line + CMP AL,LF ;line feed already encountered? + JE GET_PCHAR_X ;don't read past end of line + LODSB ;get char from DS:SI, increment SI + CMP AL,CR ;is the char a carriage return? + JE GET_PCHAR_X ;yes, set Z flag at end of line + CMP AL,LF ;no, is it a line feed? +GET_PCHAR_X: ;attempted read past end of line + RET +GET_PCHAR ENDP ;returns char in AL + + +CHECK_NUM PROC ;check AL for ASCII digit + CMP AL,'0' ;< '0'? + JB CHECK_NUM_X ;exit if it is + + CMP AL,'9' ;> '9'? + JA CHECK_NUM_X ;exit if it is + + CMP AL,AL ;set Z flag to indicate numeric +CHECK_NUM_X: + RET ;Z set if numeric, NZ if not numeric +CHECK_NUM ENDP + + +SKIP_TO_DIGIT PROC ;skip to first numeric character + CALL CHECK_NUM ;is current char a digit? + JZ SKIP_TO_DIGIT_X ;if so, skip is complete + + CALL GET_PCHAR ;get next character from line + JNZ SKIP_TO_DIGIT ;loop until first digit or CR or LF + RET ;character is CR or LF + +SKIP_TO_DIGIT_X: + CMP AL,0 ;digit found, force NZ + RET +SKIP_TO_DIGIT ENDP + +C10 DW 10 +GN_ERR DB ? ;zero if no overflow in accumulation + +GET_NUMBER PROC ;convert string of digits to binary value + XOR CX,CX ;accumulate number in CX + MOV CS:GN_ERR,CL ;no overflow yet +GET_NUMBER_A: ;accumulate next digit + SUB AL,'0' ;convert ASCII to binary + CBW ;clear AH + XCHG AX,CX ;previous accumulation in AX, new digit in CL + MUL CS:C10 ;DX:AX := AX*10 + OR CS:GN_ERR,DL ;set GN_ERR <> 0 if overflow + ADD AX,CX ;add new digit from + XCHG AX,CX ;number now in CX + DEC SI ;back up to prior entry + MOV AL,' ' ;blank out prior entry + MOV [SI],AL ; + INC SI ;set to current entry + CALL GET_PCHAR ;get next character + CALL CHECK_NUM ;see if it was numeric + JZ GET_NUMBER_A ;continue accumulating + CMP CS:GN_ERR,0 ;did we overflow? + JE GET_NUMBER_B ;if not, we're done + XOR CX,CX ;return zero (always invalid) if overflow +GET_NUMBER_B: + RET ;number in CX, next char in AL +GET_NUMBER ENDP + +GET_PARMS ENDP + + SUBTTL APPLY_DEFAULTS + PAGE +;-----------------------------------------------------------------------; +; APPLY_DEFAULTS supplies any parameter values that the user ; +; failed to specify ; +;-----------------------------------------------------------------------; + ASSUME DS:CSEG +APPLY_DEFAULTS PROC + XOR AX,AX + CMP BUFF_SIZE,AX ;is buffer size zero? + JNE APPLY_DEFAULTS_A ;no, user specified something + + MOV BUFF_SIZE,DFLT_BSIZE ;supply default buffer size + OR ERR_FLAG,ERR_BSIZE ;indicate buffersize adjusted + +APPLY_DEFAULTS_A: + CMP BPB_SSZ,AX ;is sector size zero? + JNE APPLY_DEFAULTS_B ;no, user specified something + + MOV BPB_SSZ,DFLT_SSZ ;supply default sector size + OR ERR_FLAG,ERR_SSZ ;indicate sector size adjusted + +APPLY_DEFAULTS_B: + CMP BPB_DIRN,AX ;are directory entries zero? + JNE APPLY_DEFAULTS_C ;no, user specified something + + MOV BPB_DIRN,DFLT_DIRN ;supply default directory entries + OR ERR_FLAG,ERR_DIRN ;indicate directory entries adjusted + +APPLY_DEFAULTS_C: ; + CMP EM_SW,0 ;extended memory ? + JE APPLY_DEFAULTS_D ;no, jump around + CMP MAXSEC_TRF,AX ;is maximum sectors zero? + JNE APPLY_DEFAULTS_D ;no, user specified something + + MOV MAXSEC_TRF,DFLT_ESS ;supply default maximum number of + ;sector to transfer + OR ERR_FLAG,ERR_ESIZE ;indicate transfer size adjusted +APPLY_DEFAULTS_D: + RET +APPLY_DEFAULTS ENDP + + SUBTTL DETERMINE_START address of VDISK buffer + PAGE +;-----------------------------------------------------------------------; +; DETERMINE_START figures out the starting address of the VDISK ; +; buffer ; +;-----------------------------------------------------------------------; + ASSUME DS:CSEG +DETERMINE_START PROC + +;If extended memory is NOT being used, the VDISK buffer immediately +;follows the resident code. + +;If extended memory IS being used, START_BUFFER_PARA becomes the +;end of device driver address passed back to DOS. + + MOV AX,CS ;start para of VDISK code + ADD AX,VDISKP ;+ length of resident code + MOV START_BUFFER_PARA,AX ;save as buffer start para + + CMP EM_SW,0 ;is extended memory requested? + JE DETERMINE_START_X ;if not, we're done here + +;If this is the first extended memory VDISK device driver to be installed, +;the start address for I/O is 1 megabyte. + +;If one or more extended memory VDISK device drivers have been installed, +;the start address for I/O for THIS device driver is acquired from the +;fields AVAIL_LO and AVAIL_HI in the FIRST VDISK device driver. + +;The first extended memory VDISK device driver is located by INT 19H's vector. + + MOV FIRST_EM_SW,0FFH ;indicate first VDISK device driver + MOV FIRST_VDISK,CS ;segment addr of first VDISK + + PUSH DS ;preserve DS + XOR AX,AX + MOV DS,AX ;set DS = 0 + ASSUME DS:INT_VEC + + MOV AX,DS:BOOT_VECS ;get segment addr of INT 19H routine + MOV DS,AX ;to DS + ASSUME DS:NOTHING + + PUSH CS + POP ES ;set ES = CS + MOV SI,OFFSET VOL_LABEL ;DS:SI point to VOL label field + ;in first VDISK (if present) + MOV DI,SI ;ES:DI point to VOL label field of + ;this VDISK + + MOV CX,VOL_LABEL_LEN ;length of volume label + REP CMPSB ;does INT 19H vector point to a VDISK + ;device driver? + JNE DETERMINE_START_A ;jump if this is the first VDISK + +;Another extended memory VDISK device driver has been installed. +;Its AVAIL_LO and AVAIL_HI are the first free byte of extended memory. + + MOV CS:FIRST_EM_SW,0 ;indicate not first device driver + MOV CS:FIRST_VDISK,DS ;save pointer to 1st device driver + +;Copy AVAIL_LO and AVAIL_HI from first VDISK to this VDISK + + MOV SI,OFFSET AVAIL_LO ;DS:SI point to AVAIL_LO in first VDISK + MOV DI,SI ;ES:DI point to AVAIL_LO in this VDISK + MOVSW ;copy AVAIL_LO from first to this VDISK + MOVSB ;copy AVAIL_HI + +DETERMINE_START_A: ;copy AVAIL_LO and AVAIL_HI to START_EM + POP DS ;set DS = CS + + MOV SI,OFFSET AVAIL_LO ;source offset + MOV DI,OFFSET START_EM_LO ;destination offset + + MOVSW ;move AVAIL_LO to START_EM_LO + MOVSB ;move AVAIL_HI to START_EM_HI +DETERMINE_START_X: + RET +DETERMINE_START ENDP + + SUBTTL VALIDATE parameters + PAGE +;-----------------------------------------------------------------------; +; VALIDATE adjusts parameters as necessary ; +;-----------------------------------------------------------------------; +VAL_SSZ_TBL LABEL WORD ;table of valid sector sizes +VAL_SSZ_S DW 128 ;smallest valid sector size + DW 256 +VAL_SSZ_L DW 512 ;largest valid sector size +VAL_SSZ_N EQU ($-VAL_SSZ_TBL)/2 ;number of table entries + + ASSUME DS:CSEG +VALIDATE PROC ;validate parameters + MOV BPB_AUSZ,1 ;initial allocation unit is 1 sector + + CALL VAL_BSIZE ;validate buffer size + + CALL VAL_SSZ ;validate (adjust if necessary) BPB_SSZ + +VALIDATE_A: + AND ERR_FLAG,255-ERR_PASS ;indicate nothing changed this pass + + MOV AX,BPB_SSZ ;sector size + CWD ;clear DX for division + DIV WPARA_SIZE ;sector size/para size + MOV PARAS_PER_SECTOR,AX ;number of paragraphs/sector + + MOV AX,BUFF_SIZE ;requested buffersize in KB + MUL C1024 ;DX:AX = buffer size in bytes + DIV BPB_SSZ ;/sector size = # sectors + MOV BPB_SECN,AX ;store number of sectors + + CALL VAL_DIRN ;validate number of directory entries + + TEST ERR_FLAG,ERR_PASS ;may have reset sector size + JNZ VALIDATE_A ;recompute directory & FAT sizes + + CALL VAL_FAT ;compute FAT entries, validity test + + TEST ERR_FLAG,ERR_PASS ;if cluster size altered this pass + JNZ VALIDATE_A ;recompute directory & FAT sizes + +;Make certain buffer size is large enough to contain: +; boot sector(s) +; FAT sector(s) +; directory sector(s) +; at least 1 data cluster + + MOV AL,BPB_FATN ;number of FAT copies + CBW ;clear AH + MUL BPB_FATSZ ;* sectors for 1 FAT = FAT sectors + ADD AX,BPB_RES ;+ reserved sectors + ADD AX,DIR_SECTORS ;+ directory sectors + MOV CL,BPB_AUSZ ;get sectors/cluster + XOR CH,CH ;CX = sectors in one cluster + ADD AX,CX ;+ one data cluster + CMP BPB_SECN,AX ;compare with sectors available + JAE VALIDATE_X ;jump if enough sectors + + CMP DIR_SECTORS,1 ;down to 1 directory sector? + JBE VALIDATE_C ;can't let it go below 1 + + MOV AX,BPB_SSZ ;sector size + CWD ;clear DX for division + DIV DIRE_SIZE ;sectorsize/dir entry size = entries/sector + SUB BPB_DIRN,AX ;reduce directory entries by 1 sector + + OR ERR_FLAG,ERR_DIRN ;indicate directory entries adjusted + JMP VALIDATE_A ;retry with new directory entries number + +VALIDATE_C: ;not enough space for any VDISK + OR ERR_FLAG,ERR_SYSSZ +VALIDATE_X: + RET + + SUBTTL VAL_BSIZE Validate buffer size + PAGE +;-----------------------------------------------------------------------; +; VAL_BSIZE adjusts the buffer size as necessary ; +;-----------------------------------------------------------------------; +VAL_BSIZE PROC + CALL GET_MSIZE ;determine memory available to VDISK + ;returns available KB in AX + OR AX,AX ;is any memory available at all? + JNZ VAL_BSIZE_B ;yes, continue + + OR ERR_FLAG,ERR_SYSSZ ;indicate system too small for VDISK + MOV BUFF_SIZE,1 ;set up minimal values to continue init + MOV AX,VAL_SSZ_S ;smallest possible sector size + MOV BPB_SSZ,AX + MOV BPB_DIRN,4 ;4 directory entries + RET + +VAL_BSIZE_B: ;some memory is available + CMP AX,BUFF_SIZE ;is available memory >= requested? + JAE VAL_BSIZE_C ;if so, we're done + + MOV BUFF_SIZE,AX ;give all available memory + OR ERR_FLAG,ERR_BSIZE ;indicate buffersize adjusted +VAL_BSIZE_C: + RET + + +GET_MSIZE PROC ;determine memory available to VDISK + ;returns KB available in AX + CMP EM_SW,0 ;extended memory? + JE GET_MSIZE_2 ;use non-extended memory routine + + MOV AH,EM_MEMSIZE ;function code to AH + INT EM_INT ;get extended memory size in AX + JC GET_MSIZE_Z ;if error, no extended memory installed + + MUL C1024 ;DX,AX = bytes of extended memory + ADD DX,10H ;DX,AX = high addr of extended memory+1 + SUB AX,AVAIL_LO ;- address of first available byte + SBB DL,AVAIL_HI ;is number of free bytes + DIV C1024 ;AX = number of whole free kilobytes + RET + +GET_MSIZE_2: ;non-extended memory size determination + +;Compute AX = total system size, - (VDISK end address + 64KB) + + MOV AX,START_BUFFER_PARA ;paragraph end of VDISK code + XOR DX,DX ;clear for division + DIV PARA_PER_KB ;KB address of load point + ADD DX,0FFFFH ;round upward to KB boundary + ADC AX,MIN_MEMORY_LEFT ;pick up CY and the 64KB we should leave + PUSH AX ;save across interrupt + INT MEM_SIZE ;get total system size + POP DX ;amount of total that we can't use + SUB AX,DX ;available space to VDISK + JNC GET_MSIZE_X ;exit if positive + +GET_MSIZE_Z: + XOR AX,AX ;indicate no memory available +GET_MSIZE_X: ;exit from memory size determination + RET +GET_MSIZE ENDP + +VAL_BSIZE ENDP + + SUBTTL VAL_SSZ Validate Sector Size + PAGE +;-----------------------------------------------------------------------; +; VAL_SSZ validates sector size, adjusting if necessary ; +;-----------------------------------------------------------------------; +VAL_SSZ PROC ;validate sector size + CMP CS:EM_SW,0 ;extended memory ? + JE VAL_SSZ_ST ;no,go check sector size + MOV BX,MAXSEC_TRF ;move number of sectors to transfer + CMP BX,1 ;> or equal to 1 ? + JB DFLT_TRF ;set default if it is + CMP BX,8 ;> than 8 ? + JA DFLT_TRF ;set default if it is + JMP VAL_SSZ_ST ;continue processing + +DFLT_TRF: ;set default + MOV MAXSEC_TRF,DFLT_ESS ; + MOV BX,MAXSEC_TRF ; + OR CS:ERR_FLAG,ERR_ESIZE ;indicate transfer size adjusted + +VAL_SSZ_ST: ;validate sector size + MOV MAX_CNT,BX ;initialize maximum number of sectors + ;to transfer for extended memory case + MOV BX,BPB_SSZ ;requested sector size + MOV CX,VAL_SSZ_N ;number of table entries + MOV SI,OFFSET VAL_SSZ_TBL ;DS:SI point to table start +VAL_SSZ_A: + LODSW ;get table entry, step table pointer + CMP AX,BX ;is value in table? + JE VAL_SSZ_X ;exit if value found + LOOP VAL_SSZ_A ;loop until table end + + MOV BX,DFLT_SSZ ;get default sector size + MOV BPB_SSZ,BX ;set sector size to default value + OR ERR_FLAG,ERR_SSZ ;indicate sector size adjusted +VAL_SSZ_X: + +;Compute the maximum number of sectors that can be moved in 64KB (less one) +;Restricting moves to this amount avoids 64KB boundary problems. + + CMP CS:EM_SW,0 ;extended memory ? + JNE SIZE_DONE ;yes, we are done + XOR DX,DX + MOV AX,0FFFFH ;64KB - 1 + DIV BX ;/sector size + MOV MAX_CNT,AX ;max sectors in one move +SIZE_DONE: + RET +VAL_SSZ ENDP + + SUBTTL VAL_DIRN Validate number of directory entries + PAGE +;-----------------------------------------------------------------------; +; VAL_DIRN validates and adjusts the number of directory entries. ; +; ; +; Minimum is MIN_DIRN, maximum is MAX_DIRN. If outside these ; +; limits, DFLT_DIRN is used. ; +; ; +; The number of directory entries is rounded upward to fill ; +; a sector ; +;-----------------------------------------------------------------------; +VAL_DIRN PROC + MOV AX,BPB_DIRN ;requested directory entries + CMP AX,MIN_DIRN ;if less than minimum + JB VAL_DIRN_A ;use default instead + + CMP AX,MAX_DIRN ;if <= maximum + JBE VAL_DIRN_B ;accept value as provided + +VAL_DIRN_A: + MOV AX,DFLT_DIRN ;use default directory entries + OR ERR_FLAG,ERR_DIRN ;indicate directory entries adjusted +VAL_DIRN_B: ;AX is number of directory entries + MUL DIRE_SIZE ;* 32 = bytes of directory requested + DIV BPB_SSZ ;/ sector size = # of directory sectors + OR DX,DX ;test remainder for zero + JZ VAL_DIRN_C ;jump if exact fit + + INC AX ;increment directory sectors + OR ERR_FLAG,ERR_DIRN ;indicate directory entries adjusted +VAL_DIRN_C: ;make sure enough sectors available + MOV DX,BPB_SECN ;total sectors on media + SUB DX,BPB_RES ;less reserved sectors + SUB DX,2 ;less minimum FAT and 1 data sector + CMP AX,DX ;if directory sectors <= available + JLE VAL_DIRN_D ;use requested amount + + MOV AX,1 ;use only one directory sector + OR ERR_FLAG,ERR_DIRN ;indicate directory entries adjusted +VAL_DIRN_D: + MOV DIR_SECTORS,AX ;save number of directory sectors + MUL BPB_SSZ ;dir sectors * sector size = dir bytes + DIV DIRE_SIZE ;dir bytes / entry size = entries + MOV BPB_DIRN,AX ;store adjusted directory entries + RET +VAL_DIRN ENDP + + SUBTTL VAL_FAT Validate File Allocation Table (FAT) + PAGE +;-----------------------------------------------------------------------; +;VAL_FAT computes: ; +;BPB_FATSZ, the number of sectors required per FAT copy ; +; ; +;Each FAT entry is 12 bits long, for a maximum of 4095 FAT entries. ; +;(A few FAT entries are reserved, so the highest number of FAT entries ; +;we permit is 0FE0H.) With large buffer sizes and small sector sizes, ; +;we have more allocation units to describe than a 12-bit entry will ; +;describe. If the number of FAT entries is too large, the sector size ; +;is increased (up to a maximum of 512 bytes), and then the allocation ; +;unit (cluster) size is doubled, until we have few enough allocation ; +;units to be properly described in 12 bits. ; +; ; +;This computation is slightly conservative in that the FAT entries ; +;necessary to describe the FAT sectors are included in the computation. ; +;-----------------------------------------------------------------------; +VAL_FAT PROC + MOV AX,BPB_SECN ;total number of sectors + SUB AX,BPB_RES ;don't count boot sector(s) + SUB AX,DIR_SECTORS ;don't count directory sectors + JG VAL_FAT_A ;jump if some remaining + MOV BPB_SSZ,DFLT_SSZ ;force default sector size + OR ERR_FLAG,ERR_SSZ+ERR_PASS ;indicate sector size adjusted + JMP SHORT VAL_FAT_X ;recompute all values +VAL_FAT_A: + XOR DX,DX ;clear DX for division + MOV CL,BPB_AUSZ ;CX = sectors/cluster + XOR CH,CH + DIV CX ;whole number of clusters in AX + ADD DX,0FFFFH ;set carry if remainder + ADC AX,0 ;increment AX if remainder + CMP AX,MAX_FATE ;number of FAT entries too large? + JBE VAL_FAT_C ;no, continue + + MOV AX,BPB_SSZ ;pick up current sector size + CMP AX,VAL_SSZ_L ;already at largest permitted? + JE VAL_FAT_B ;yes, can't make it any larger + + SHL BPB_SSZ,1 ;double sector size + OR ERR_FLAG,ERR_SSZB ;indicate sector size adjusted + JMP SHORT VAL_FAT_X ;recompute all sizes with new BPBSSZ + +VAL_FAT_B: ;sector size is at maximum + SHL BPB_AUSZ,1 ;double allocation unit size + OR ERR_FLAG,ERR_PASS ;indicate another pass required + JMP SHORT VAL_FAT_X ;recompute values + +VAL_FAT_C: ;FAT size = 1.5 * number of clusters + MOV CX,AX ;number of clusters + SHL AX,1 ;* 2 + ADD AX,CX ;* 3 + SHR AX,1 ;* 1.5 + ADC AX,3 ;add 3 bytes for first 2 FAT entries + ;(media descriptor and FFFFH), and CY + XOR DX,DX ;clear DX for division + DIV BPB_SSZ ;FAT size/sector size + ADD DX,0FFFFH ;set carry if remainder + ADC AX,0 ;round upward + MOV BPB_FATSZ,AX ;number of sectors for 1 FAT copy +VAL_FAT_X: + RET +VAL_FAT ENDP + + +VALIDATE ENDP + + SUBTTL COPY_BPB Copy BPB to Boot Record + PAGE +;-----------------------------------------------------------------------; +; COPY_BPB copies the BIOS Parameter Block (BPB) ; +; to the VDISK Boot Record ; +;-----------------------------------------------------------------------; + ASSUME DS:CSEG +COPY_BPB PROC ;Copy BBP to Boot Record + PUSH DS + POP ES ;set ES = DS + + MOV CX,BPB_LEN ;length of BPB + MOV SI,OFFSET BPB ;source offset + MOV DI,OFFSET BOOT_BPB ;target offset + REP MOVSB ;copy BPB to boot record + RET +COPY_BPB ENDP + + SUBTTL VERIFY_EXTENDER + PAGE +;-----------------------------------------------------------------------; +; VERIFY_EXTENDER makes sure that if an Expansion Unit is ; +; installed, the memory size switches on the Extender Card ; +; are correctly set. ; +;-----------------------------------------------------------------------; + + + ASSUME DS:CSEG +EXT_P210 EQU 0210H ;write to latch expansion bus data + ;read to verify expansion bus data +EXT_P213 EQU 0213H ;Expansion Unit status + +VERIFY_EXTENDER PROC + + NOP + + MOV DX,EXT_P210 ;Expansion bus data port address + + MOV AX,5555H ;set data pattern + OUT DX,AL ;write 55H to control port + PUSH DX + POP DX + + JMP SHORT $+2 ;Let the I/O circuits catch up + IN AL,020h ;Clear the CMOS bus drivers! + + IN AL,DX ;recover data + CMP AH,AL ;did we recover the same data? + JNE VERIFY_EXTENDER_X ;if not, no extender card + + NOT AX ;set AX = 0AAAAH + OUT DX,AL ;write 0AAH to control port + PUSH DX ;load data line + POP DX ;load data line + + JMP SHORT $+2 ;Let the I/O circuits catch up + IN AL,020h ;Clear the CMOS bus drivers! + + IN AL,DX ;recover data + CMP AH,AL ;did we recover the same data? + JNE VERIFY_EXTENDER_X ;if not, no extender card + +;Expansion Unit is present. + +;Determine what the switch settings should be on the Extender Card + + INT MEM_SIZE ;get system memory size in KB in AX + ADD AX,63D ;memory size + 63K + MOV CL,6 ;2^6 = 64 + SHR AX,CL ;divide by 64 + ;AX is highest segment address + MOV AH,AL ;save number of segments + +;Read Expander card switch settings + + MOV DX,EXT_P213 ;expansion unit status + IN AL,DX ;read status + ;bits 7-4 (hi nibble) are switches + MOV CL,4 ;shift count + SHR AL,CL ;shift switches to bits 3-0 of AL + + CMP AH,AL ;do switches match memory size? + JE VERIFY_EXTENDER_X ;yes, exit normally + + OR ERR_FLAG,ERR_EXTSW ;indicate switch settings are wrong + +VERIFY_EXTENDER_X: + RET +VERIFY_EXTENDER ENDP + + SUBTTL UPDATE_AVAIL + PAGE +;-----------------------------------------------------------------------; +; UPDATE_AVAIL updates the address of the first byte in extended ; +; memory not used by any VDISK buffer ; +;-----------------------------------------------------------------------; +UPDATE_AVAIL PROC ;update AVAIL_LO and AVAIL_HI of first VDISK + MOV AX,BUFF_SIZE ;number of KB of VDISK buffer + MUL C1024 ;DX,AX = number of bytes of VDISK buffer + + PUSH DS + MOV DS,FIRST_VDISK ;set DS to first VDISK + ADD DS:AVAIL_LO,AX ;update first available byte location + ADC DS:AVAIL_HI,DL + POP DS + RET +UPDATE_AVAIL ENDP + + SUBTTL FORMAT_VDISK + PAGE +;-----------------------------------------------------------------------; +; This Request Header is used by MOVE_VDISK to move the ; +; first few sectors of the virtual disk (boot, FAT, and ; +; Directory) into extended memory. ; +;-----------------------------------------------------------------------; + +MOVE_RH DB MOVE_RH_L ;length of request header + DB 0 ;sub unit + DB 8 ;output operation + DW 0 ;status + DQ ? ;reserved for DOS + DB ? ;media descriptor byte +MOVE_RHO DW ? ;offset of data transfer address +MOVE_RHS DW ? ;segment of data transfer address +MOVE_RHCNT DW ? ;count of sectors to transfer + DW 0 ;starting sector number +MOVE_RH_L EQU $-MOVE_RH ;length of request header + +;-----------------------------------------------------------------------; +; FORMAT_VDISK formats the boot sector, FAT, and directory of an ; +; extended memory VDISK in storage immediately following ; +; VDISK code, in preparation for moving to extended memory. ; +;-----------------------------------------------------------------------; +FORMAT_VDISK PROC ;format boot record, FATs and directory + + MOV AX,CS ;compute 20-bit address + MUL WPARA_SIZE ;16 * segment + ADD AX,OFFSET MSGEND ;+ offset + ADC DL,0 ;pick up carry + ADD AX,STACK_SIZE ;plus stack size + ADC DL,0 ;pick up carry + + DIV WPARA_SIZE ;split into segment(AX)&offset(DX) + MOV MOVE_RHS,AX ;save in Request Header for move + MOV MOVE_RHO,DX + + MOV DI,DX ;offset to DI + MOV ES,AX ;segment to ES + +;copy the boot record + + MOV SI,OFFSET BOOT_RECORD ;point to source field + MOV AX,BPB_RES ;number of reserved sectors + MUL BPB_SSZ ;* sector size = length of boot records + MOV CX,AX ;length to CX for move + REP MOVSB ;move boot record(s) + +;format the FAT(s) + + MOV CL,BPB_FATN ;number of FATs + XOR CH,CH +FORMAT_VDISK_A: ;set up one FAT + PUSH CX ;save loop counter on stack + MOV AL,BPB_MCB ;media control byte + STOSB ;store media control byte, increment DI + MOV AX,0FFFFH ;bytes 2 and 3 of FAT are 0FFH + STOSW + MOV AX,BPB_FATSZ ;number of sectors per FAT + MUL BPB_SSZ ;* sector size = length of FAT in bytes + SUB AX,3 ;less the 3 bytes we've stored + MOV CX,AX ;count to CX + XOR AX,AX + REP STOSB ;clear remainder of FAT + POP CX ;get loop counter off stack + LOOP FORMAT_VDISK_A ;loop for all copies of the FAT + +;Format the directory + + MOV SI,OFFSET VOL_LABEL ;point to volume label + MOV CX,VOL_LABEL_LEN ;length of volume directory entry + REP MOVSB ;move volume id to directory + MOV AX,DIR_ENTRY_SIZE ;length of 1 directory entry + MUL BPB_DIRN ;* number entries = bytes of directory + SUB AX,VOL_LABEL_LEN ;less length of volume label + MOV CX,AX ;CX = length of rest of directory + XOR AX,AX + REP STOSB ;clear directory to nulls + RET +FORMAT_VDISK ENDP + + SUBTTL MOVE_VDISK + PAGE +;-----------------------------------------------------------------------; +; MOVE_VDISK moves the formatted boot sector, FAT, and directory ; +; into extended memory. ; +;-----------------------------------------------------------------------; + +MOVE_VDISK PROC + MOV AL,BPB_FATN ;number of FAT copies + CBW ;clear AH + MUL BPB_FATSZ ;number of FAT sectors + ADD AX,BPB_RES ;+ reserved sectors + ADD AX,DIR_SECTORS ;+ directory sectors + MOV MOVE_RHCNT,AX ;store as I/O length + + MOV BX,OFFSET MOVE_RH ;DS:BX point to request header + PUSH DS ;make sure DS gets preserved + CALL INOUT ;move to extended memory + POP DS + RET +MOVE_VDISK ENDP + + SUBTTL UPDATE_BOOT + PAGE +;-----------------------------------------------------------------------; +; UPDATE_BOOT updates the BOOT_EM word in the first extended ; +; memory VDISK (address 10 001EH) to show the kilobyte address ; +; of the first extended memory byte not used by any VDISK buffer. ; +;-----------------------------------------------------------------------; +UPDATE_BOOT PROC + PUSH DS + MOV DS,FIRST_VDISK ;set DS to first VDISK + MOV AX,DS:AVAIL_LO ;24-bit end address of all VDISKs + MOV DL,DS:AVAIL_HI + XOR DH,DH + POP DS + DIV C1024 ;address / 1024 + MOV BOOT_EM,AX ;store in temporary location + + MOV AX,2 ;length of block move is 2 bytes + MOV TGT.DESC_LMT,AX + MOV SRC.DESC_LMT,AX + + MOV AX,PARA_SIZE ;16 + MOV CX,CS ;our segment address + MUL CX ;16 * segment address + ADD AX,OFFSET BOOT_EM ;+ offset of source data + ADC DL,0 ;pick up any carry + + MOV SRC.DESC_BASEL,AX ;store source base address + MOV SRC.DESC_BASEH,DL + + MOV TGT.DESC_BASEL,BOOT_EM_OFF ;offset of BOOT_EM + MOV TGT.DESC_BASEH,10H ;1 megabyte + + MOV CX,1 ;move 1 word + + PUSH CS + POP ES + MOV SI,OFFSET GDT ;ES:DI point to global descriptor table + + MOV AH,EM_BLKMOVE ;function code + INT EM_INT ;move BOOT_EM to 10 001EH + RET +UPDATE_BOOT ENDP + + SUBTTL STEAL_INT19 + PAGE +;-----------------------------------------------------------------------; +; STEAL_INT19 changes the INT 19H vector to point to this VDISK ; +; so that subsequent extended memory VDISKS may locate the ; +; AVAIL_HI and AVAIL_LO fields to determine their buffer start ; +; addresses. ; +;-----------------------------------------------------------------------; +STEAL_INT19 PROC + PUSH DS + XOR AX,AX + MOV DS,AX ;set DS = 0 + ASSUME DS:INT_VEC + CLI ;disable interrupts + LES DI,DS:BOOT_VEC ;get original vector's content + MOV CS:INTV19O,DI ;save original vector + MOV CS:INTV19S,ES + MOV DS:BOOT_VECO,OFFSET VDISK_INT19 ;offset of new INT routine + MOV DS:BOOT_VECS,CS ;segment of new INT routine + STI ;enable interrupts again + POP DS ;restore DS + RET +STEAL_INT19 ENDP + + SUBTTL FILL_RH Fill in Request Header + PAGE +;-----------------------------------------------------------------------; +; FILL_RH fills in the Request Header returned to DOS ; +;-----------------------------------------------------------------------; + ASSUME DS:CSEG +FILL_RH PROC ;fill in INIT Request Header fields + MOV CX,START_BUFFER_PARA ;segment end of VDISK resident code + MOV AX,PARAS_PER_SECTOR ;paragraphs per sector + MUL BPB_SECN ;* number of sectors + ADD AX,CX ;+ starting segment + MOV DX,AX ;DX is segment of end VDISK buffer + CMP EM_SW,0 ;if extended memory not requested + JE FILL_RH_A ;skip DX adjustment + + MOV DX,CX ;end of code segment addr +FILL_RH_A: ;DX is proper ending segment address + MOV AL,1 ;number of units + test CS:err_flag2,err_baddos + jnz dont_install + + TEST ERR_FLAG,ERR_SYSSZ+ERR_EXTSW ;if bypassing install + JZ FILL_RH_B ;jump if installing driver + +dont_install: + MOV DX,CS ;segment of end address + XOR AL,AL ;number of units is zero +FILL_RH_B: + PUSH DS ;preserve DS + LDS BX,RH_PTRA ;get Request Header addr in DS:BX + MOV RH.RH0_NUN,AL ;store number of units (0 or 1) + MOV RH.RH0_ENDO,0 ;end offset is always zero + MOV RH.RH0_ENDS,DX ;end of VDISK or end of buffer + MOV RH.RH0_BPBO,OFFSET BPB_PTR + MOV RH.RH0_BPBS,CS ;BPB array address + POP DS ;restore DS + RET +FILL_RH ENDP + + SUBTTL WRITE_MESSAGES and associated routines + PAGE +;-----------------------------------------------------------------------; +; WRITE_MESSAGE writes a series of messages to the standard ; +; output device showing the VDISK parameter values actually used. ; +;-----------------------------------------------------------------------; + +CHAR4 DB 'nnnn$' ;build 4 ASCII decimal digits + + ASSUME DS:CSEG +WRITE_MESSAGES PROC ;display all messages + + MSG IMSG ;'VDISK virtual disk $' + + test CS:err_flag2,err_baddos + jz check_dos_version + + msg errm8 + ret + +;If DOS Version 3.x is in use, the Request Header contains a drive code +;that is displayed to show which drive letter was assigned to this +;VDISK. This field is not present in the DOS Version 2 Request Header. + +check_dos_version: + MOV AH,DOS_VERS ;get DOS version call + INT DOS ;invoke DOS + + CMP AL,3 ;DOS Version 3 or greater? + JB WRITE_MESSAGES_A ;no, bypass drive letter + + PUSH DS ;preserve DS + LDS BX,RH_PTRA ;get Request Header Address + MOV DL,RH.RH0_DRIV ;get drive code + ADD DL,'A' ;convert to drive letter + POP DS ;restore DS + + MOV AH,DOS_PCHR ;function code to write character in DL + INT DOS ;display drive letter + + MOV DL,':' ;display trailing colon + INT DOS + +WRITE_MESSAGES_A: + MSG MSGCRLF ;end the first line + +;If any of the user specified values has been adjusted, issue an +;appropriate message + + TEST ERR_FLAG,ERR_BSIZE ;was buffersize adjusted? + JZ WRITE_MESSAGES_B ;if not, skip message + + MSG ERRM1 ;buffer size adjusted + +WRITE_MESSAGES_B: + TEST ERR_FLAG,ERR_SSZ ;was sector size adjusted? + JZ WRITE_MESSAGES_C ;if not, skip message + + MSG ERRM2 ;sector size adjusted + +WRITE_MESSAGES_C: + TEST ERR_FLAG,ERR_DIRN ;were directory entries adjusted? + JZ WRITE_MESSAGES_D0 ;if not, skip message + + MSG ERRM3 ;directory entries adjusted + +WRITE_MESSAGES_D0: + TEST ERR_FLAG,ERR_ESIZE ;was transfer size adjusted? + JZ WRITE_MESSAGES_D ;if not, skip message + + MSG ERRM7 ;transfer size adjusted + +WRITE_MESSAGES_D: + TEST ERR_FLAG,ERR_SWTCH ;was an invalid switch character found? + JZ WRITE_MESSAGES_E ;if not, skip message + + MSG ERRM5 ;invalid switch character + +WRITE_MESSAGES_E: + TEST ERR_FLAG,ERR_SYSSZ ;is system size too small to install? + JZ WRITE_MESSAGES_F ;if not, bypass error message + + MSG ERRM4 ;too large for system storage + RET ;skip messages showing adjusted sizes + +WRITE_MESSAGES_F: + TEST ERR_FLAG,ERR_EXTSW ;extender card switches wrong? + JZ WRITE_MESSAGES_G ;if not, bypass error message + + MSG ERRM6 ;extender card switches wrong msg + RET ;skip remaining messages + +WRITE_MESSAGES_G: ;display adjusted size messages + MSG MSG1 ;buffer size: + + MOV DX,BUFF_SIZE ;buffer size in binary + CALL STOR_SIZE ;convert binary to ASCII decimal + MSG CHAR4 ;print 4 decimals + MSG MSG2 ;KB,CR,LF + + MSG MSG3 ;sector size: + MOV DX,BPB_SSZ + CALL STOR_SIZE ;convert binary to ASCII decimal + MSG CHAR4 ;print 4 decimals + MSG MSGCRLF ;finish off line + + MSG MSG4 ;directory entries: + MOV DX,BPB_DIRN ;number of directory entries + CALL STOR_SIZE + MSG CHAR4 ;print 4 decimals + MSG MSGCRLF ;finish off the line + + CMP CS:EM_SW,0 ;extended memory ? + JE END_LINE ; + MSG MSG5 ;transfer size: + MOV DX,MAXSEC_TRF + CALL STOR_SIZE ;convert binary to ASCII decimal + MSG CHAR4 ;print 4 decimals + MSG MSGCRLF ;finish off line + +END_LINE: + MSG MSGCRLF ;one more blank line to set it off + RET ;return to INIT_P1 + +;SHOW_MSG displays a string at DS:DX on the standard output device +;String is terminated by a $ + +SHOW_MSG PROC ;display string at DS:DX + PUSH AX ;preserve AX across call + MOV AH,DOS_PSTR ;DOS function code + INT DOS ;invoke DOS print string function + POP AX ;restore AX + RET +SHOW_MSG ENDP + +;STOR_SIZE converts the content of DX to 4 decimal characters in CHAR4 +;(DX must be <= 9999) + +STOR_SIZE PROC ;convert DX to 4 decimals in CHAR4 + ;develop 4 packed decimal digits in AX + XOR AX,AX ;clear result register + MOV CX,16 ;shift count +STOR_SIZE_B: + SHL DX,1 ;shift high bit into carry + ADC AL,AL ;double AL, carry in + DAA ;adjust for packed decimal + XCHG AL,AH + ADC AL,AL ;double high byte, carry in + DAA + XCHG AL,AH + LOOP STOR_SIZE_B ;AX contains 4 packed decimal digits + + PUSH CS + POP ES ;point ES:DI to output string + MOV DI,OFFSET CHAR4 + + MOV CX,1310H ;10H in CL is difference between blank and zero + ;13H in CH is decremented and ANDed to force + ;last character not to be zero suppressed + PUSH AX ;save AX on stack + MOV DL,AH ;2 decimals to DL + CALL STOR_SIZE_2 ;display DL as 2 decimal characters + POP DX ;bring low 2 decimals into DL +STOR_SIZE_2: ;display DL as 2 decimal characters + MOV DH,DL ;save 2 decimals in DH + SHR DL,1 ;shift high order decimal right to low position + SHR DL,1 + SHR DL,1 + SHR DL,1 + CALL STOR_SIZE_1 ;display low nibble of DL + MOV DL,DH ;get low decimal from pair +STOR_SIZE_1: ;display low nibble of DL as 1 decimal char + AND DL,0FH ;clear high nibble + JZ STOR_SIZE_Z ;if digit is significant, + XOR CL,CL ;defeat zero suppression +STOR_SIZE_Z: + DEC CH ;decrement zero suppress counter + AND CL,CH ;always display least significant digit + OR DL,'0' ;convert packed decimal to ASCII + SUB DL,CL ;zero suppress (nop or change '0' to ' ') + MOV AL,DL ;char to DL + STOSB ;store char at ES:DI, increment DI + RET +STOR_SIZE ENDP + +WRITE_MESSAGES ENDP + +INIT_P1 ENDP ;end of INIT part one + +;-----------------------------------------------------------------------; +; VDISK Message definitions ; +;-----------------------------------------------------------------------; + +IMSG DB 'VDISK virtual disk ','$' + +ERRM1 DB ' Buffer size adjusted',CR,LF,'$' +ERRM2 DB ' Sector size adjusted',CR,LF,'$' +ERRM3 DB ' Directory entries adjusted',CR,LF,'$' +ERRM4 DB ' VDISK not installed - insufficient memory' + DB CR,LF,CR,LF,BEL,'$' +ERRM5 DB ' Invalid switch character',CR,LF,'$' +ERRM6 DB ' VDISK not installed - Extender Card switches' + DB CR,LF + DB ' do not match system memory size' + DB CR,LF,CR,LF,BEL,'$' +ERRM7 DB ' Transfer size adjusted',CR,LF,'$' +ERRM8 DB ' VDISK not installed - Incorrect DOS version' + DB CR,LF,CR,LF,BEL,'$' + +MSG1 DB ' Buffer size: $' +MSG2 DB ' KB' +MSGCRLF DB CR,LF,'$' +MSG3 DB ' Sector size: $' +MSG4 DB ' Directory entries: $' +MSG5 DB ' Transfer size: $' +MSGEND LABEL BYTE ; End of message text + +CSEG ENDS + END diff --git a/v4.0/src/DEV/VDISK/VDISK.INC b/v4.0/src/DEV/VDISK/VDISK.INC new file mode 100644 index 0000000..202a008 --- /dev/null +++ b/v4.0/src/DEV/VDISK/VDISK.INC @@ -0,0 +1,28 @@ +EMS_STATUS EQU 40H +EMS_GET_NUM_PAGES EQU 42H +EMS_ALLOC_PAGES EQU 43H +EMS_MAP_HANDLE EQU 44H +EMS_VERSION EQU 46H +EMS_SAVE_STATE EQU 47H +EMS_RESTORE_STATE EQU 48H +EMS_GET_FRAME_ADDR EQU 5100H +EMS_INT EQU 67H + +EMS_EXPECTED_VERSION EQU 34H +EMS_LOW_ERROR EQU 80H +EMS_INSTALLED_FLAG EQU -1 + +EMS_ALLOC_ERROR EQU -1 ; ***RPS ?? +SINGLE_SEGMENT EQU 1 +DOS_PAGE1 EQU 0FEH +DOS_PAGE2 EQU 0FFH +DOS_PAGE_SZ EQU 16 + +GET_PAGE_FRAME_STRUC STRUC + START_PAGE DB ? + NUM_PAGE DB ? + FRAME_SEGMENT DW ? +GET_PAGE_FRAME_STRUC ENDS +BUFFER_ENTRY_SIZE EQU TYPE GET_PAGE_FRAME_STRUC + + \ No newline at end of file diff --git a/v4.0/src/DEV/VDISK/VDISK.LNK b/v4.0/src/DEV/VDISK/VDISK.LNK new file mode 100644 index 0000000..74989ed --- /dev/null +++ b/v4.0/src/DEV/VDISK/VDISK.LNK @@ -0,0 +1,3 @@ +VDISKSYS.OBJ +VDISK.EXE; + \ No newline at end of file diff --git a/v4.0/src/DEV/VDISK/VDISK.SKL b/v4.0/src/DEV/VDISK/VDISK.SKL new file mode 100644 index 0000000..9555298 --- /dev/null +++ b/v4.0/src/DEV/VDISK/VDISK.SKL @@ -0,0 +1,36 @@ +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; VDISK Message Skeleton file +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +:util VDISK ;AN000; + +:class 2 ;AN000; +:use PARSE1 ;AN000; +:use PARSE2 ;AN000; +:use PARSE3 ;AN000; +:use PARSE4 ;AN000; +:use PARSE6 ;AN000; +:use PARSE7 ;AN000; +:use PARSE8 ;AN000; + +:class A ;AN000; +:use 1 COMMON1 ;AN000; "Incorrect DOS version" +:def 2 "Insufficient memory",CR,LF ;AN000; "Insufficient memory" + +:def 3 "VDISK Version 4.00 virtual disk %1",CR,LF ;AN000; +:def 4 " Buffer size adjusted",CR,LF ;AN000; +:def 5 " Sector size adjusted",CR,LF ;AN000; +:def 6 " Directory entries adjusted",CR,LF ;AN000; +:def 7 " Invalid switch character",CR,LF ;AN000; +:def 8 " Transfer size adjusted",CR,LF ;AN000; +:def 9 " Buffer size: %1 KB",CR,LF ;AN000; +:def 10 " Sector size: %1",CR,LF ;AN000; +:def 11 " Directory entries: %1",CR,LF ;AN000; +:def 12 " Transfer size: %1",CR,LF ;AN000; +:def 13 "VDISK not installed - " ;AN000; +:def 14 " Extender Card switches",CR,LF ;AN000; + "do not match system memory size",CR,LF,CR,LF ;AN000; + +:end ;AN000; + + diff --git a/v4.0/src/DEV/VDISK/VDISKMSG.ASM b/v4.0/src/DEV/VDISK/VDISKMSG.ASM new file mode 100644 index 0000000..4b43a31 --- /dev/null +++ b/v4.0/src/DEV/VDISK/VDISKMSG.ASM @@ -0,0 +1,27 @@ + PAGE ,132 + TITLE VDISKMSG - VDISK message library + +;All messages issued by VDISK are defined here for ease in +;translation for international use. + +;Each message should end with a '$' to delimit the end of the string. + +CSEG SEGMENT PARA PUBLIC 'CODE' + + PUBLIC IMSG + PUBLIC ERRM1,ERRM2,ERRM3,ERRM4,ERRM5,ERRM6,ERRM7,errm8 + PUBLIC MSG1,MSG2,MSG3,MSG4,MSG5,MSGCRLF + PUBLIC MSGEND + +;ASCII equates + +BEL EQU 07H ;alarm +LF EQU 0AH ;line feed +CR EQU 0DH ;carriage return + + +include vdiskmsg.inc + +MSGEND LABEL BYTE ;must be last in module +CSEG ENDS + END diff --git a/v4.0/src/DEV/VDISK/VDISKSYS.ASM b/v4.0/src/DEV/VDISK/VDISKSYS.ASM new file mode 100644 index 0000000..544c610 --- /dev/null +++ b/v4.0/src/DEV/VDISK/VDISKSYS.ASM @@ -0,0 +1,3024 @@ + PAGE ,132 + TITLE VDISK - Virtual Disk Device Driver, Version 4.00 + +;VDISK simulates a disk drive, using Random Access Memory as the storage medium. + +;(C) Copyright Microsoft Corporation, 1984 - 1988 +;Licensed Material - Program Property of Microsoft Corp. + +;Add the following statement to CONFIG.SYS +; DEVICE=[d:][path]VDISK.SYS bbb sss ddd [/E:m] + +; where: bbb is the desired buffer size (in kilobytes) +; minimum 1KB, maximum is size of available memory, +; default is 64KB. + +; VDISK will leave at least 64KB of available memory, +; although subsequent device drivers (other than VDISK) +; other programs that make themselves resident, and +; COMMAND.COM will result in less than 64KB as shown +; by CHKDSK. + +; Must be large enough for 1 boot sector + FAT sectors +; + 1 directory sector + at least 1 data cluster, +; or the device driver won't be installed. + +; sss is the desired sector size (in bytes) +; 128, 256, or 512, default is 128. +; Will be adjusted if number of FAT entries > 0FE0H + +; ddd is the desired number of directory entries +; Minimum 2, maximum 512, default 64. +; Will be rounded upward to sector size boundary. + +; /E may only be used if extended memory above 1 megabyte +; is to be used. INT 15H functions 87H and 88H are used +; to read and write this extended memory. +; The m parameter in the /E option specifies the maximum +; number of sectors that the VDISK will transfer at a time. +; Optional values are 1,2,3,4,5,6,7 or 8 sectors, the default +; is 8 sectors. + +; Brackets indicate optional operands. + + +; Samples: +; DEVICE=\path\VDISK.SYS 160 512 64 +; results in a 160KB VDISK, with 512 byte sectors, 64 directory entries + +; DEVICE=VDISK.SYS Buffersize 60 Sectorsize 128 Directory entries 32 +; (since only numbers are interpreted, you may comment the line with +; non-numeric characters) +; +;========================================================================= +; Change List +; +; AN000 - ver 4.0 specified changes +; AN001 - DCR 377 Modify VDISK Extended Memory allocation technique +; The allocation technique have been modified to +; allocate EM from the top down. To notify other +; users that EM has been used by VDISK, VDISK +; hooks function 88h, INT 15h. +; +; AN002 - PTM3214 EMS VDISK needed to be modified for two errors. +; AC002 The first related to VDISK returning the +; "Insufficient Memory" message when in fact +; there was enough EMS memory to support the +; requested VDISK. +; The second related to an EMS VDISK hanging when +; a program was invoked from an EMS VDISK with a +; non-standard sector size, i.e.; 128 bytes/sector, +; etc. This error was caused by the incorrect +; calculation of sectors per EMS page. +; +; AN003 - PTM3276 EMS VDISK causes a "Divide Overflow" message. +; AC003 This is caused by a byte divide that should +; be performed as a word divide. +; +; AN004 - PTM3301 EMS VDISK does not properly adjust the buffer +; size when too much EMS memory is requested. +; The code in UPDATE_AVAIL pertaining to EMS +; space allocation has been modified. +; +; AN005 - DCR474 Convert VDISK to support /E for extended memory +; and /X for expanded memory. +; +; AN006 - PTM4729 Enable VDISK for the INT 2F call to determine +; the reserved EMS page for VDISK and FASTOPEN +; +;========================================================================= + +;Message text for VDISK is in module VDISKMSG. +.xlist + INCLUDE VDISKSYS.INC + INCLUDE SYSMSG.INC + MSG_UTILNAME +.list + SUBTTL Structure Definitions + PAGE +;-----------------------------------------------------------------------; +; Request Header (Common portion) ; +;-----------------------------------------------------------------------; +RH EQU DS:[BX] ;addressability to Request Header structure + +RHC STRUC ;fields common to all request types + DB ? ;length of Request Header (including data) + DB ? ;unit code (subunit) +RHC_CMD DB ? ;command code +RHC_STA DW ? ;status + DQ ? ;reserved for DOS +;;;;; DW ? ;reserved for BIOS message flag ;an006; dms; +RHC ENDS ;end of common portion + +CMD_INPUT EQU 4 ;RHC_CMD is INPUT request + +;status values for RHC_STA + +STAT_DONE EQU 01H ;function complete status (high order byte) +STAT_CMDERR EQU 8003H ;invalid command code error +STAT_CRC EQU 8004H ;CRC error +STAT_SNF EQU 8008H ;sector not found error +STAT_BUSY EQU 0200H ;busy bit (9) for Removable Media call +;-----------------------------------------------------------------------; +; Request Header for INIT command ; +;-----------------------------------------------------------------------; +RH0 STRUC + DB (TYPE RHC) DUP (?) ;common portion +RH0_NUN DB ? ;number of units + ;set to 1 if installation succeeds, + ;set to 0 to cause installation failure +RH0_ENDO DW ? ;offset of ending address +RH0_ENDS DW ? ;segment of ending address +RH0_BPBO DW ? ;offset of BPB array address +RH0_BPBS DW ? ;segment of BPB array address +RH0_DRIV DB ? ;drive code (DOS 3 only) +RH0_FLAG DW 0 ;initialized to no error ;an000; dms; +RH0 ENDS + +RH0_BPBA EQU DWORD PTR RH0_BPBO ;offset/segment of BPB array address +;Note: RH0_BPBA at entry to INIT points to all after DEVICE= on CONFIG.SYS stmt + +;-----------------------------------------------------------------------; +; Request Header for MEDIA CHECK Command ; +;-----------------------------------------------------------------------; +RH1 STRUC + DB (TYPE RHC) DUP (?) ;common portion + DB ? ;media descriptor +RH1_RET DB ? ;return information +RH1 ENDS +;-----------------------------------------------------------------------; +; Request Header for BUILD BPB Command ; +;-----------------------------------------------------------------------; +RH2 STRUC + DB (TYPE RHC) DUP(?) ;common portion + DB ? ;media descriptor + DW ? ;offset of transfer address + DW ? ;segment of transfer address +RH2_BPBO DW ? ;offset of BPB table address +RH2_BPBS DW ? ;segment of BPB table address +RH2 ENDS +;-----------------------------------------------------------------------; +; Request Header for INPUT, OUTPUT, and OUTPUT with verify ; +;-----------------------------------------------------------------------; +RH4 STRUC + DB (TYPE RHC) DUP (?) ;common portion + DB ? ;media descriptor +RH4_DTAO DW ? ;offset of transfer address +RH4_DTAS DW ? ;segment of transfer address +RH4_CNT DW ? ;sector count +RH4_SSN DW ? ;starting sector number +RH4 ENDS + +RH4_DTAA EQU DWORD PTR RH4_DTAO ;offset/segment of transfer address + +;-----------------------------------------------------------------------; +; Segment Descriptor (part of Global Descriptor Table) ; +;-----------------------------------------------------------------------; +DESC STRUC ;data segment descriptor +DESC_LMT DW 0 ;segment limit (length) +DESC_BASEL DW 0 ;bits 15-0 of physical address +DESC_BASEH DB 0 ;bits 23-16 of physical address + DB 0 ;access rights byte + DW 0 ;reserved +DESC ENDS + + SUBTTL Equates and Macro Definitions + PAGE + +MEM_SIZE EQU 12H ;BIOS memory size determination INT + ;returns system size in KB in AX + +EM_INT EQU 15H ;extended memory BIOS interrupt INT +EM_BLKMOVE EQU 87H ;block move function +EM_MEMSIZE EQU 8800H ;memory size determination in KB + +DOS EQU 21H ;DOS request INT +DOS_PCHR EQU 02H ;print character function +DOS_PSTR EQU 09H ;print string function +DOS_VERS EQU 30H ;get DOS version + +TAB EQU 09H ;ASCII tab +LF EQU 0AH ;ASCII line feed +CR EQU 0DH ;ASCII carriage return + +PARA_SIZE EQU 16 ;number of bytes in one 8088 paragraph +DIR_ENTRY_SIZE EQU 32 ;number of bytes per directory entry +MAX_FATE EQU 0FE0H ;largest number of FAT entries allowed + +;default values used if parameters are omitted + +DFLT_BSIZE EQU 64 ;default VDISK buffer size (KB) +DFLT_SSZ EQU 128 ;default sector size +DFLT_DIRN EQU 64 ;default number of directory entries +DFLT_ESS EQU 8 ;default maximum sectors to transfer + +MIN_DIRN EQU 2 ;minimum number of directory entries +MAX_DIRN EQU 512 ;maximum number of directory entries + +STACK_SIZE EQU 512 ;length of stack during initialization + + SUBTTL Resident Data Area + PAGE + +;-----------------------------------------------------------------------; +; Map INT 15H vector in low storage ; +;-----------------------------------------------------------------------; +INT_VEC SEGMENT AT 00H + ORG 4*EM_INT +EM_VEC LABEL DWORD +EM_VECO DW ? ;offset +EM_VECS DW ? ;segment +INT_VEC ENDS + + + +CSEG SEGMENT PARA PUBLIC 'CODE' + ASSUME CS:CSEG +;-----------------------------------------------------------------------; +; Resident data area. ; +; ; +; All variables and constants required after initialization ; +; part one are defined here. ; +;-----------------------------------------------------------------------; + +START EQU $ ;begin resident VDISK data & code + +;DEVICE HEADER - must be at offset zero within device driver + DD -1 ;becomes pointer to next device header + DW 0800H ;attribute (IBM format block device) + ;supports OPEN/CLOSE/RM calls + DW OFFSET STRATEGY ;pointer to device "strategy" routine + DW OFFSET IRPT ;pointer to device "interrupt handler" + DB 1 ;number of block devices + DB 7 DUP (?) ;7 byte filler (remainder of 8-byte name) +;END OF DEVICE HEADER + +;This volume label is placed into the directory of the new VDISK +;This constant is also used to determine if a previous extended memory VDISK +;has been installed. + +VOL_LABEL DB 'VDISK V4.0' ;00-10 volume name (shows program level) + DB 28H ;11-11 attribute (volume label) + DT 0 ;12-21 reserved + DW 6000H ;22-23 time=12:00 noon + DW 0986H ;24-25 date=12/06/84 +VOL_LABEL_LEN EQU $-VOL_LABEL ;length of volume label + +;The following field, in the first extended memory VDISK device driver, +;is the 24-bit address of the first free byte of extended memory. +;This address is not in the common offset/segment format. +;The initial value, 10 0000H, is 1 megabyte. + +AVAIL_LO DW 0 ;address of first free byte of +AVAIL_HI DB 10H ;extended memory + +INTV15 LABEL DWORD +INTV15O DW ? ;offset +INTV15S DW ? ;segment + + +PARAS_PER_SECTOR DW ? ;number of 16-byte paragraphs in one sector + +START_BUFFER_PARA DW ? ;segment address of start of VDISK buffer + +EM_New_Size dw ? ;an001; dms;new size for EM +EM_KSize dw ? ;an001; dms;size of EM currently. + +EM_SW DB 0 ;NON-ZERO IF EXTENDED MEMORY + +EM_STAT DW 0 ;AX from last unsuccessful extended memory I/O + +START_EM_LO DW ? ;24-bit address of start of VDISK buffer +START_EM_HI DB ? ;(extended memory only) + +WPARA_SIZE DW PARA_SIZE ;number of bytes in one paragraph + +MAX_CNT DW ? ;(0FFFFH/BPB_SSZ) truncated, the maximum + ;number of sectors that can be transferred + ;without worrying about 64KB wrap + +SECT_LEFT DW ? ;sectors left to transfer + +IO_SRCA LABEL DWORD ;offset/segment of source +IO_SRCO DW ? ;offset +IO_SRCS DW ? ;segment + +IO_TGTA LABEL DWORD ;offset/segment of target +IO_TGTO DW ? ;offset +IO_TGTS DW ? ;segment + +;-----------------------------------------------------------------------; +; EMS Support ; +;-----------------------------------------------------------------------; + +EM_SW2 DB not EMS_Installed_Flag ;ac006;Default if EMS not installed +EMS_HANDLE DW ? ;AN000; EMS handle for reference +EMS_FRAME_ADDR DW ? ;AN000; EMS handle for reference +EMS_CURR_SECT DW ? ;an000; Current EMS sector being addressed +CURR_EMS_PAGE DW ? ;ac002; Current EMS page number +SECT_LEFT_IN_FRAME DW ? ;AN000; Sectors left to transfer in this frame +SECT_PER_PAGE DW ? ;AN000; Sectors per page +DOS_Page dw ? ;an006; EMS physical page for VDISK + +EMS_SAVE_ARRAY DB 80h dup(0) ;an000; save current state of ems +EMS_SEG_ARRAY DD ? ;an000; save segment array + +CURR_DTA_OFF DW ? ;AN000; DMS;CURRENT OFFSET OF DTA + +PC_386 DB false ;AN000; DMS;386 machine flag + +SUBLIST STRUC ;AN000;SUBLIST STRUCTURE + +SL_SIZE DB ? ;AN000;SUBLIST SIZE +SL_RES DB ? ;AN000;RESERVED +SL_OFFSET DW ? ;AN000;PARM OFFSET +SL_SEGMENT DW ? ;AN000;PARM SEGMENT +SL_ID DB ? ;AN000;NUMBER OF PARM +SL_FLAG DB ? ;AN000;DISPLAY TYPE +SL_MAXW DB ? ;AN000;MAXIMUM FIELD WIDTH +SL_MINW DB ? ;AN000;MINIMUM FIELD WIDTH +SL_PAD DB ? ;AN000;PAD CHARACTER + +SUBLIST ENDS ;AN000;END SUBLIST STRUCTURE + + +BIOS_SYSTEM_DESCRIPTOR struc ;AN000;SYSTEM TYPE STRUC + +bios_SD_leng dw ? ;AN000;VECTOR LENGTH +bios_SD_modelbyte db ? ;AN000;SYSTEM MODEL TYPE +bios_SD_scnd_modelbyte db ? ;AN000; + db ? ;AN000; +bios_SD_featurebyte1 db ? ;AN000; + db 4 dup (?) ;AN000; + +BIOS_SYSTEM_DESCRIPTOR ends ;AN000;END OF STRUC + +;-----------------------------------------------------------------------; +; BIOS Parameter Block (BPB) ; +;-----------------------------------------------------------------------; +;This is where the characteristics of the virtual disk are established. +;A copy of this block is moved into the boot record of the virtual disk. +;DEBUG can be used to read sector zero of the virtual disk to examine the +;boot record copy of this block. + +BPB LABEL BYTE ;BIOS Parameter Block (BPB) +BPB_SSZ DW 0 ;number of bytes per disk sector +BPB_AUSZ DB 1 ;sectors per allocation unit +BPB_RES DW 1 ;number of reserved sectors (for boot record) +BPB_FATN DB 1 ;number of File Allocation Table (FAT) copies +BPB_DIRN DW 0 ;number of root directory entries +BPB_SECN DW 1 ;total number of sectors + ;computed from buffer size and sector size + ;(this includes reserved, FAT, directory, + ;and data sectors) +BPB_MCB DB 0FEH ;media descriptor byte +BPB_FATSZ DW 1 ;number of sectors occupied by a single FAT + ;computed from BPBSSZ and BPBSECN +BPB_LEN EQU $-BPB ;length of BIOS parameter block + +BPB_PTR DW BPB ;BIOS Parameter Block pointer array (1 entry) +;-----------------------------------------------------------------------; +; Request Header (RH) address, saved here by "strategy" routine ; +;-----------------------------------------------------------------------; +RH_PTRA LABEL DWORD +RH_PTRO DW ? ;offset +RH_PTRS DW ? ;segment +;-----------------------------------------------------------------------; +; Global Descriptor Table (GDT), used for extended memory moves ; +;-----------------------------------------------------------------------; +;Access Rights Byte (93H) is +; P=1 (segment is mapped into physical memory) +; E=0 (data segment descriptor) +; D=0 (grow up segment, offsets must be <= limit) +; W=1 (data segment may be written into) +; DPL=0 (privilege level 0) + +GDT LABEL BYTE ;begin global descriptor table + DESC <> ;dummy descriptor + DESC <> ;descriptor for GDT itself +SRC DESC <,,,93H,> ;source descriptor +TGT DESC <,,,93H,> ;target descriptor + DESC <> ;BIOS CS descriptor + DESC <> ;stack segment descriptor + + SUBTTL INT 15H (size) interrupt handler + PAGE +;-----------------------------------------------------------------------; +; INT 15H Interrupt Handler routine ; +;-----------------------------------------------------------------------; + +;========================================================================= +; VDISK_INT15 : This routine traps the INT 15h requests to perform its +; own unique services. This routine provides 1 INT 15h +; service; function 8800h. +; +; Service - Function 8800h: Obtains the size of EM from the word +; value EM_KSize +; Call With: AX - 8800h +; Returns : AX - Kbyte size of EM +; +;========================================================================= +VDISK_INT15 PROC ;an001; dms; + + cmp ah,EM_Size_Get ;an001; dms;function 88h +; $if e ;an001; dms;get size + JNE $$IF1 + mov ax,cs:EM_KSize ;an001; dms;return size + clc ;an001; dms;clear CY +; $else ;an001; dms; + JMP SHORT $$EN1 +$$IF1: + jmp cs:INTV15 ;an001; dms;jump to org. vector +; $endif ;an001; dms; +$$EN1: + + iret ;an001; dms; + +VDISK_INT15 ENDP ;an001; dms; + + + ASSUME DS:NOTHING + + SUBTTL Device Strategy & interrupt entry points + PAGE +;-----------------------------------------------------------------------; +; Device "strategy" entry point ; +; ; +; Retain the Request Header address for use by Interrupt routine ; +;-----------------------------------------------------------------------; +STRATEGY PROC FAR + MOV CS:RH_PTRO,BX ;offset + MOV CS:RH_PTRS,ES ;segment + RET +STRATEGY ENDP +;-----------------------------------------------------------------------; +; Table of command processing routine entry points ; +;-----------------------------------------------------------------------; +CMD_TABLE LABEL WORD + DW OFFSET INIT_P1 ; 0 - Initialization + DW OFFSET MEDIA_CHECK ; 1 - Media check + DW OFFSET BLD_BPB ; 2 - Build BPB + DW OFFSET INPUT_IOCTL ; 3 - IOCTL input + DW OFFSET INPUT ; 4 - Input + DW OFFSET INPUT_NOWAIT ; 5 - Non destructive input no wait + DW OFFSET INPUT_STATUS ; 6 - Input status + DW OFFSET INPUT_FLUSH ; 7 - Input flush + DW OFFSET OUTPUT ; 8 - Output + DW OFFSET OUTPUT_VERIFY ; 9 - Output with verify + DW OFFSET OUTPUT_STATUS ;10 - Output status + DW OFFSET OUTPUT_FLUSH ;11 - Output flush + DW OFFSET OUTPUT_IOCTL ;12 - IOCTL output + DW OFFSET DEVICE_OPEN ;13 - Device OPEN + DW OFFSET DEVICE_CLOSE ;14 - Device CLOSE +MAX_CMD EQU ($-CMD_TABLE)/2 ;highest valid command follows + DW OFFSET REMOVABLE_MEDIA ;15 - Removable media + +;-----------------------------------------------------------------------; +; Device "interrupt" entry point ; +;-----------------------------------------------------------------------; +IRPT PROC FAR ;device interrupt entry point + PUSH DS ;save all registers modified + PUSH ES + PUSH AX + PUSH BX + PUSH CX + PUSH DX + PUSH DI + PUSH SI + ;BP isn't used, so it isn't saved + CLD ;all moves forward + + LDS BX,CS:RH_PTRA ;get RH address passed to "strategy" into DS:BX + + MOV AL,RH.RHC_CMD ;command code from Request Header + CBW ;zero AH (if AL > 7FH, next compare will + ;catch that error) + + CMP AL,MAX_CMD ;if command code is too high + JA IRPT_CMD_HIGH ;jump to error routine + + MOV DI,OFFSET IRPT_CMD_EXIT ;return addr from command processor + PUSH DI ;push return address onto stack + ;command routine issues "RET" + + ADD AX,AX ;double command code for table offset + MOV DI,AX ;put into index register for JMP + + XOR AX,AX ;initialize return to "no error" + +;At entry to command processing routine: + +; DS:BX = Request Header address +; CS = VDISK code segment address +; AX = 0 + +; top of stack is return address, IRPT_CMD_EXIT + + JMP CS:CMD_TABLE[DI] ;call routine to handle the command + + +IRPT_CMD_ERROR: ;CALLed for unsupported character mode commands + +INPUT_IOCTL: ;IOCTL input +INPUT_NOWAIT: ;Non-destructive input no wait +INPUT_STATUS: ;Input status +INPUT_FLUSH: ;Input flush + +OUTPUT_IOCTL: ;IOCTL output +OUTPUT_STATUS: ;Output status +OUTPUT_FLUSH: ;Output flush + + POP AX ;pop return address off stack + +IRPT_CMD_HIGH: ;JMPed to if RHC_CMD > MAX_CMD + MOV AX,STAT_CMDERR ;"invalid command" and error + +IRPT_CMD_EXIT: ;return from command routine + ;AX = value to OR into status word + LDS BX,CS:RH_PTRA ;restore DS:BX as Request Header pointer + OR AH,STAT_DONE ;add "done" bit to status word + MOV RH.RHC_STA,AX ;store status into request header + POP SI ;restore registers + POP DI + POP DX + POP CX + POP BX + POP AX + POP ES + POP DS + RET +IRPT ENDP + + SUBTTL Command Processing routines + PAGE +;-----------------------------------------------------------------------; +; Command Code 1 - Media Check ; +; At entry, DS:BX point to request header, AX = 0 ; +;-----------------------------------------------------------------------; +MEDIA_CHECK PROC + MOV RH.RH1_RET,1 ;indicate media not changed + RET ;AX = zero, no error +MEDIA_CHECK ENDP +;-----------------------------------------------------------------------; +; Command Code 2 - Build BPB ; +; At entry, DS:BX point to request header, AX = 0 ; +;-----------------------------------------------------------------------; +BLD_BPB PROC + MOV RH.RH2_BPBO,OFFSET BPB ;return pointer to our BPB + MOV RH.RH2_BPBS,CS + RET ;AX = zero, no error +BLD_BPB ENDP +;-----------------------------------------------------------------------; +; Command Code 13 - Device Open ; +; Command Code 14 - Device Close ; +; Command Code 15 - Removable media ; +; At entry, DS:BX point to request header, AX = 0 ; +;-----------------------------------------------------------------------; +REMOVABLE_MEDIA PROC + MOV AX,STAT_BUSY ;set status bit 9 (busy) + ;indicating non-removable media +DEVICE_OPEN: ;NOP for device open +DEVICE_CLOSE: ;NOP for device close + RET +REMOVABLE_MEDIA ENDP ;fall thru to return +;-----------------------------------------------------------------------; +; Command Code 4 - Input ; +; Command Code 8 - Output ; +; Command Code 9 - Output with verify ; +; At entry, DS:BX point to request header, AX = 0 ; +;-----------------------------------------------------------------------; +INOUT PROC +INPUT: +OUTPUT: +OUTPUT_VERIFY: +;;;;; PUSH DS ;ICE +;;;;; push bx ;ICE +;;;;; push ax ;ICE + +;;;;; mov bx,0140H ;ICE +;;;;; xor ax,ax ;ICE +;;;;; mov ds,ax ;ICE +;;;;; mov ax,word ptr ds:[bx] ;ICE +;;;;; mov word ptr ds:[bx],ax ;ICE + +;;;;; pop ax ;ICE +;;;;; pop bx ;ICE +;;;;; POP DS ;ICE + +;Make sure I/O is entirely within the VDISK sector boundaries + + MOV CX,CS:BPB_SECN ;get total sector count + MOV AX,RH.RH4_SSN ;starting sector number + CMP AX,CX ;can't exceed total count + JA INOUT_E1 ;jump if start > total + + ADD AX,RH.RH4_CNT ;start + sector count + CMP AX,CX ;can't exceed total count + JNA INOUT_A ;jump if start + count <= total + +INOUT_E1: ;I/O not within VDISK sector boundaries + MOV RH.RH4_CNT,0 ;set sectors transferred to zero + MOV AX,STAT_SNF ;indicate 'Sector not found' error + RET ;return with error status in AX + +INOUT_A: ;I/O within VDISK bounds + MOV AX,RH.RH4_CNT ;get sector count + MOV CS:SECT_LEFT,AX ;save as sectors left to process + + MOV CS:SECT_LEFT_IN_FRAME,AX ;AN000; Save as sectors left to process + + CMP CS:EM_SW,0 ;extended memory mode? + JNE INOUT_EM ;jump to extended memory I/O code + +;Compute offset and segment of VDISK buffer for starting segment in CX:SI + + MOV AX,RH.RH4_SSN ;starting sector number + MUL CS:PARAS_PER_SECTOR ;* length of one sector in paragraphs + ADD AX,CS:START_BUFFER_PARA ;+ segment of VDISK buffer sector 0 + MOV CX,AX ;segment address to CX + XOR SI,SI ;offset is zero + +;Compute address of caller's Data Transfer Addr in DX:AX with smallest offset, +;so that there is no possibility of overflowing a 64KB boundary moving MAX_CNT +;sectors. + + MOV AX,PARA_SIZE ;16 + MUL RH.RH4_DTAS ;* segment of caller's DTA in DX,AX + ADD AX,RH.RH4_DTAO ;+ offset of caller's DTA + ADC DL,0 ;carry in from addition + DIV CS:WPARA_SIZE ;AX is segment of caller's DTA + ;DX is smallest offset possible + ;AX:DX = DTA address + +;AX:DX is caller's DTA segment:offset, CX:SI is VDISK buffer segment:offset + +;If this is an OUTPUT request, exchange the source and target addresses + + CMP RH.RHC_CMD,CMD_INPUT ;INPUT operation? + JE INOUT_B ;jump if INPUT operation + + XCHG AX,CX ;swap source and target segment + XCHG DX,SI ;swap source and target offset + +INOUT_B: ;CX:SI is source, AX:DX is target + MOV CS:IO_SRCS,CX ;save source segment + MOV CS:IO_SRCO,SI ;save source offset + MOV CS:IO_TGTS,AX ;save target segment + MOV CS:IO_TGTO,DX ;save target offset + + JMP SHORT INOUT_E ;AX := SECT_LEFT, test for zero +INOUT_C: ;SECT_LEFT in AX, non-zero + +; Compute number of sectors to transfer in a single move, +; AX = minimum of (SECT_LEFT, MAX_CNT) + +; MAX_CNT is the maximum number of sectors that can be moved without +; spanning a 64KB boundary (0FFFFH / Sector size, remainder truncated) + + MOV CX,CS:MAX_CNT ;MAX sectors with one move + CMP AX,CX ;if SECT_LEFT cannot span 64KB boundary + JBE INOUT_D ;then move SECT_LEFT sectors + + MOV AX,CX ;else move MAX_CNT sectors +INOUT_D: + + CALL INOUT_D_LOW_MEM ;AN000;LOW MEMORY TRANSFER + +;Determine if more sectors need to be transferred + +INOUT_E: ;do while SECT_LEFT <> zero + MOV AX,CS:SECT_LEFT ;get sectors left to transfer + OR AX,AX ;set flags + JNZ INOUT_C ;go back to transfer some sectors + RET ;AX = zero, all sectors transferred + + SUBTTL Extended Memory I/O routine + PAGE +;-----------------------------------------------------------------------; +; Extended Memory I/O routine ; +;-----------------------------------------------------------------------; +INOUT_EM: ;Extended memory I/O routine + ;change to larger stack + MOV SI,SS ;save old SS in SI + MOV DX,SP ;save old SP in DX + CLI ;disable interrupts + MOV AX,CS + MOV SS,AX ;set SS = CS + MOV SP,OFFSET EM_STACK ;point to new stack + STI ;enable interrupts + PUSH SI ;save old SS at top of new stack + PUSH DX ;save old SP on new stack + + MOV SI,RH.RH4_DTAO ;caller's DTA offset + + + CMP EM_SW,EM_Mem ;AC005; Is EM requested? + JE INOUT_EM_A ;AN000; + JMP INOUT_EMS ;AN000; Yes, compute page + +INOUT_EM_A: ;AN000; No, compute 24-bit address + +;Compute 24-bit address of VDISK sector in CX (hi) and SI (low) + + MOV AX,RH.RH4_SSN ;starting sector number + MUL CS:BPB_SSZ ;* sector size = offset within buffer + ADD AX,CS:START_EM_LO ;+ base address of this VDISK buffer + ADC DL,CS:START_EM_HI + MOV CX,DX ;save high byte + MOV SI,AX ;save low word + +;Compute 24-bit address of caller's DTA in DX (hi) and AX (low) + + MOV AX,PARA_SIZE ;16 + MUL RH.RH4_DTAS ;* segment of caller's DTA + ADD AX,RH.RH4_DTAO ;+ offset of caller's DTA + ADC DL,0 ;carry in from addition + +;Caller's DTA address is in CX,SI, VDISK buffer address is in DX,AX. + +;If this is an OUTPUT request, exchange the source and target addresses + + CMP RH.RHC_CMD,CMD_INPUT ;INPUT operation? + JE INOUT_EM_B ;jump if INPUT operation + + XCHG DX,CX ;swap source and target high byte + XCHG AX,SI ;swap source and target low word + +INOUT_EM_B: ;CX,SI is source, DX,AX is target + + MOV SRC.DESC_BASEL,SI ;low 16 bits of source address + MOV SRC.DESC_BASEH,CL ;high 8 bits of source address + + MOV TGT.DESC_BASEL,AX ;low 16 bits of target address + MOV TGT.DESC_BASEH,DL ;high 8 bits of target address + + JMP SHORT INOUT_EM_E ;AX := SECT_LEFT, test for zero +INOUT_EM_C: ;SECT_LEFT in AX, non-zero + +; Compute number of sectors to transfer in a single move, +; AX = minimum of (SECT_LEFT, MAX_CNT) + +; MAX_CNT is the maximum number of sectors that can be moved without +; spanning a 64KB boundary (0FFFFH / Sector size, remainder truncated) + + MOV CX,CS:MAX_CNT ;MAX sectors with one move + CMP AX,CX ;if SECT_LEFT cannot span 64KB boundary + JBE INOUT_EM_D ;then move SECT_LEFT sectors + + MOV AX,CX ;else move MAX_CNT sectors +INOUT_EM_D: + SUB CS:SECT_LEFT,AX ;reduce number of sectors left to move + +;Move AX sectors from source to target + + MUL CS:BPB_SSZ ;sectors * sector size = byte count + ;(cannot overflow into DX) + MOV TGT.DESC_LMT,AX ;store segment limit (byte count) + MOV SRC.DESC_LMT,AX + + PUSH AX ;preserve byte count on stack + + SHR AX,1 ;/2 = word count + MOV CX,AX ;word count to CX + + PUSH CS + POP ES ;set ES = CS + MOV SI,OFFSET GDT ;ES:SI point to GDT + + MOV AH,EM_BLKMOVE ;function is block move + INT EM_INT ;move an even number of words + + POP CX ;get byte count back from stack + + OR AH,AH ;get error code + + JZ INOUT_UPDATE ; + JMP INOUT_EM_XE ;jump if I/O error encountered + +INOUT_UPDATE: + +;Update source and target addresses + + ADD SRC.DESC_BASEL,CX ;add bytes moved to source + ADC SRC.DESC_BASEH,0 ;pick up any carry + + ADD TGT.DESC_BASEL,CX ;add bytes moved to target + ADC TGT.DESC_BASEH,0 ;pick up any carry + +;Determine if more sectors need to be transferred + +INOUT_EM_E: ;do while SECT_LEFT <> zero + MOV AX,CS:SECT_LEFT ;get sectors left to transfer + OR AX,AX ;set flags + JNZ INOUT_EM_C ;go back to transfer some sectors + + JMP INOUT_EM_X2 ;AN000; All done . . . exit +;-----------------------------------------------------------------------; +; EMS Support ;RPS; ; +;-----------------------------------------------------------------------; + +INOUT_EMS: ;AN000; + +; Save EMS state in case anyone is using it + PUSH AX ;AN000; DMS;SAVE IT + PUSH BX ;AN000; DMS;SAVE IT + PUSH DX ;AN000; DMS;SAVE IT + push di ;an000; dms;save it + push si ;an000; dms;save it + push ds ;an000; dms;save it + push es ;an000; dms;save it + mov ax,cs ;an000; dms;transfer cs to ds/es + mov ds,ax ;an000; dms; + mov es,ax ;an000; dms; + + mov di,offset cs:EMS_SAVE_ARRAY ;an000; point to save area + mov si,offset cs:EMS_SEG_ARRAY ;an000; point to segment area + mov word ptr cs:EMS_SEG_ARRAY,0001h ;an000; 1 segment to save + mov ax,cs:EMS_Frame_Addr ;an000; get segment + mov word ptr cs:EMS_SEG_ARRAY+2,ax ;an000; segment + MOV AX,EMS_SAVE_STATE ;AN000; Function code to save active handle state + INT EMS_INT ;AN000; + + pop es ;an000; dms;restore + pop ds ;an000; dms;restore + pop si ;an000; dms;restore + pop di ;an000; dms;restore + POP DX ;AN000; DMS;RESTORE + POP BX ;AN000; DMS;RESTORE + POP AX ;AN000; DMS;RESTORE + +; Compute offset and segment of VDISK frame for starting segment in CX:SI +; and page containing VDISK starting sector + + push ds ;an000; dms;save ds + push es ;an000; dms;save es + + mov cs:curr_dta_off,0 ;an000; dms;current offset = 0 + mov ax,rh.rh4_ssn ;an000; dms;get 1st. sector + mov cs:ems_curr_sect,ax ;an000; dms;save it + call ems_page_off_calc ;an000; dms;calc page and off. + call ems_dta_calc ;an000; dms;calc DTA + call ems_src_tgt ;an000; dms;get src & tgt + +; $do ;an000; dms;while sectors left +$$DO4: + call map_frame ;an000; dms;map a page + call ems_trf ;an000; dms;transfer data + dec cs:sect_left ;an000; dms;sect_left - 1 + cmp cs:sect_left,0 ;an000; dms;continue? +; $leave e ;an000; dms;no - exit + JE $$EN4 + ; yes - continue + mov ax,cs:ems_curr_sect ;an000; dms;get current sector + call ems_page_off_calc ;an000; dms;calc page and off. + call ems_dta_adj ;an000; dms;adjust DTA + call ems_src_tgt ;an000; dms;get src & tgt +; $enddo ;an000; dms;end while + JMP SHORT $$DO4 +$$EN4: + + pop es ;an000; dms;restore es + pop ds ;an000; dms;restore ds + +; Restore EMS state in case anyone was using it + ;AN000; No, + PUSH AX ;AN000; DMS;SAVE IT + PUSH BX ;AN000; DMS;SAVE IT + PUSH DX ;AN000; DMS;SAVE IT + PUSH SI ;AN000; DMS;SAVE IT + push ds ;an000; dms;save it + + mov ax,cs ;an000; dms;get cs + mov ds,ax ;an000; dms;put in ds + MOV AX,EMS_RESTORE_STATE ;AN000; Function code to restore active handle state + MOV SI,OFFSET CS:EMS_SAVE_ARRAY ;AN000; POINT TO SAVE ARRAY + INT EMS_INT ;AN000; + + pop ds ;an000; dms;restore + POP SI ;AN000; DMS;RESTORE + POP DX ;AN000; DMS;RESTORE + POP BX ;AN000; DMS;RESTORE + POP AX ;AN000; DMS;RESTORE + +;-----------------------------------------------------------------------; + +INOUT_EM_X2: ;revert to original stack + POP DI ;get old SP + POP SI ;get old SS + CLI ;disable interrupts + MOV SS,SI ;restore old SS + MOV SP,DI ;restore old SP + STI ;enable interrupts + RET ;return to IRPT_EXIT + +INOUT_EM_XE: ;some error with INT 15H + MOV CS:EM_STAT,AX ;save error status for debugging + MOV RH.RH4_CNT,0 ;indicate no sectors transferred + MOV AX,STAT_CRC ;indicate CRC error + JMP INOUT_EM_X2 ;fix stack and exit +INOUT ENDP + + +;========================================================================= +; EMS_PAGE_OFF_CALC : Calculates the current ems page to use and +; the offset of the requested sector in that +; page. +; +; Inputs: AX - Sector for input/output +; SECT_PER_PAGE - # of sectors/ems page +; BPB_SSZ - Size in bytes of a sector +; EMS_FRAME_ADDR - Segment of ems page +; +; Outputs: CURR_EMS_PAGE - Currently active ems page +; CX:SI - Segment:Offset of logical sector +;========================================================================= + +ems_page_off_calc proc near ;an000; dms;calc page/offset + + xor dx,dx ;an002; dms;clear high word + div cs:sect_per_page ;an000; dms;determine page + mov cs:curr_ems_page,ax ;an002; dms;save page + mov ax,dx ;an002; dms;offset calc + mul cs:bpb_ssz ;an000; dms;calc offset + mov si,ax ;an000; dms;save sector offset + mov cx,cs:ems_frame_addr ;an000; dms;obtain sector seg + + ret ;an000; dms; + +ems_page_off_calc endp ;an000; dms; + + +;========================================================================= +; EMS_DTA_CALC : Calculate the DTA buffer to be used. +; +; Inputs: PARA_SIZE - 16 +; RH4_DTAS - Segment of DTA from request packet +; RH4_DTA0 - Offset of DTA from request packet +; WPARA_SIZE- 16 +; +; Outputs: AX:DX - Segment:Offset of DTA buffer +;========================================================================= + +ems_dta_calc proc near ;an000; dms;calc DTA buffer + + xor dx,dx ;an002; dms;clear high word + mov ax,para_size ;an000; dms;get para size + mul rh.rh4_dtas ;an000; dms;times DTA segment + add ax,rh.rh4_dtao ;an000; dms;+ DTA offset + adc dx,0 ;an002; dms;pick up carry + div cs:wpara_size ;an000; dms;/16 + + ret ;an000; dms; + +ems_dta_calc endp ;an000; dms; + + +;========================================================================= +; EMS_DTA_ADJ : Adjust DTA for the number of sectors having +; been transferred. +; +; External Calls : EMS_DTA_CALC +; +; Inputs: CURR_DTA_OFF - Current offset value to be adjusted. +; +; Outputs: CURR_DTA_OFF - Adjusted offset value into DTA +; DX - Adjusted offset value into DTA +;========================================================================= + +ems_dta_adj proc near ;an000; dms;adjust DTA + + call ems_dta_calc ;an000; dms; + push ax ;an000; dms;save reg + mov ax,cs:curr_dta_off ;an000; dms;get current off. + add ax,cs:bpb_ssz ;an000; dms;adjust up + mov cs:curr_dta_off,ax ;an000; dms;save new off + add dx,ax ;an000; dms;set dx to new off + pop ax ;an000; dms;restore reg + ret ;an000; dms; + +ems_dta_adj endp ;an000; dms; + +;========================================================================= +; EMS_SRC_TGT : Determine the source and target segments for +; data transfer. +; +; Inputs: RHC_CMD - Request packet command identifier +; AX:DX - DTA +; CX:SI - EMS page/sector +; +; Outputs: IO_SRCS - Segment of source of trf +; IO_SRCO - Offset of source of trf +; IO_TGTS - Segment of target for trf +; IO_TGTO - Offset of target for trf +;========================================================================= + +ems_src_tgt proc near ;an000; dms;src/tgt calc + + cmp rh.rhc_cmd,cmd_input ;an000; dms;input/output? +; $if ne ;an000; dms; + JE $$IF7 + xchg ax,cx ;an000; dms;swap src/tgt seg + xchg dx,si ;an000; dms;swap src/tgt off +; $endif ;an000; dms; +$$IF7: + + mov cs:io_srcs,cx ;an000; dms;save src seg + mov cs:io_srco,si ;an000; dms;save src off + mov cs:io_tgts,ax ;an000; dms;save tgt seg + mov cs:io_tgto,dx ;an000; dms;save tgt off + ret ;an000; dms; + +ems_src_tgt endp ;an000; dms; + + +;========================================================================= +; EMS_TRF : Perform the sector transfer of data. +; +; Inputs: BPB_SSZ - Sector size +; IO_SRCA - Source address +; IO_TGTA - Target address +; +; Outputs: Transferred data +; EMS_CURR_SECT - Incremented 1 +;========================================================================= + +ems_trf proc near ;an000; dms;transfer data + + mov ax,cs:bpb_ssz ;an000; dms;set to sector size + shr ax,1 ;an000; dms;make words + mov cx,ax ;an000; dms;set loop counter + push ds ;an000; dms;save regs + push es ;an000; dms; + + lds si,cs:io_srca ;an000; dms;get src address + les di,cs:io_tgta ;an000; dms;get tgt address + + CMP CS:PC_386,TRUE ;AN000; DO WE HAVE A 386 MACHINE? +; $IF E ;AN000; YES + JNE $$IF9 + SHR CX,1 ;AN000; /2 = DW COUNT + DB 66H ;AN000; SIMULATE A MOVSDW +; $ENDIF ;AN000; +$$IF9: + rep movsw ;an000; dms;perform transfer + + pop es ;an000; dms;restore regs + pop ds ;an000; dms; + inc cs:ems_curr_sect ;an000; dms;increment sector + + ret ;an000; dms; + +ems_trf endp ;an000; dms; + + + +MAP_FRAME PROC NEAR ;AN000; + + PUSH BX ;AN000; DMS; + mov ax,cs:DOS_Page ;an000; get physical page + MOV AH,EMS_MAP_HANDLE ;AN000; EMS function to map page + MOV BX,CS:CURR_EMS_PAGE ;AN000; Page number + MOV DX,CS:EMS_HANDLE ;AN000; EMS handle + INT EMS_INT ;AN000; + POP BX ;AN000; DMS; + RET ;AN000; + +MAP_FRAME ENDP ;AN000; + + +INOUT_D_LOW_MEM PROC NEAR ;AN000; LOW MEMORY TRANSFER + + SUB CS:SECT_LEFT,AX ;reduce number of sectors left to move + +;Move AX sectors from source to target + + MUL CS:BPB_SSZ ;sectors * sector size = byte count + ;(cannot overflow into DX) + SHR AX,1 ;/2 = word count + MOV CX,AX ;word count to CX for \REP MOVSW + + LDS SI,CS:IO_SRCA ;source segment/offset to DS:SI + LES DI,CS:IO_TGTA ;target segment/offset to ES:DI + + CMP CS:PC_386,TRUE ;AN000; DO WE HAVE A 386 MACHINE? +; $IF E ;AN000; YES + JNE $$IF11 + SHR CX,1 ;AN000; /2 = DW COUNT + DB 66H ;AN000; SIMULATE A MOVSDW +; $ENDIF ;AN000; +$$IF11: + REP MOVSW ;AN000; PERFORM DOUBLE WORD MOVE + +;Update source and target paragraph addresses +;AX has number of words moved + + SHR AX,1 ;words moved / 8 = paragraphs moved + SHR AX,1 + SHR AX,1 + + ADD CS:IO_SRCS,AX ;add paragraphs moved to source segment + ADD CS:IO_TGTS,AX ;add paragraphs moved to target segment + + RET + +INOUT_D_LOW_MEM ENDP + + + + DW 40 DUP (?) ;stack for extended memory I/O +EM_STACK LABEL WORD + + SUBTTL Boot Record + PAGE +;-----------------------------------------------------------------------; +; Adjust the assembly-time instruction counter to a paragraph ; +; boundary ; +;-----------------------------------------------------------------------; + + IF ($-START) MOD 16 + ORG ($-START) + 16 - (($-START) MOD 16) + ENDIF + +VDISK EQU $ ;start of virtual disk buffer +VDISKP EQU ($-START) / PARA_SIZE ;length of program in paragraphs +;-----------------------------------------------------------------------; +; If this VDISK is in extended memory, this address is passed ; +; back to DOS as the end address that is to remain resident. ; +; ; +; It this VDISK is not in extended memory, the VDISK buffer ; +; begins at this address, and the address passed back to DOS ; +; as the end address that is to remain resident is this address ; +; plus the length of the VDISK buffer. ; +;-----------------------------------------------------------------------; + +BOOT_RECORD LABEL BYTE ;Format of Boot Record documented in + ;DOS Technical Reference Manual + DB 0,0,0 ;3-byte jump to boot code (not bootable) + DB 'VDISKx.x' ;8-byte vendor identification +BOOT_BPB LABEL BYTE ;boot record copy of BIOS parameter block + DW ? ;number of bytes per disk sector + DB ? ;sectors per allocation unit + DW ? ;number of reserved sectors (for boot record) + DB ? ;number of File Allocation Table (FAT) copies + DW ? ;number of root directory entries + DW ? ;total number of sectors + DB ? ;media descriptor byte + DW ? ;number of sectors occupied by a single FAT +;end of boot record BIOS Parameter block + +;The following three words mean nothing to VDISK, they are placed here +;to conform to the DOS standard for boot records. + DW 8 ;sectors per track + DW 1 ;number of heads + DW 0 ;number of hidden sectors +;The following word is the 16-bit kilobyte address of the first byte in +;extended memory that is not occupied by a VDISK buffer +;It is placed into this location so that other users of extended memory +;may find where all the VDISKs end. + +;This field may be accessed by moving the boot record of the First extended +;memory VDISK from absolute location 10 0000H. Before assuming that the +;value below is valid, the vendor ID (constant VDISK) should be verified +;to make sure that SOME VDISK has been installed. + +;For example, if two VDISKs are installed, one 320KB and one 64KB, the +;address calculations are as follows: + +;Extended memory start address = 100000H (1024KB) +;Start addr of 1st VDISK buffer = 100000H (1024KB) +;Length of 1st VDISK buffer = 050000H ( 320KB) +;End addr of 1st VDISK buffer = 14FFFFH +;Start addr of 2nd VDISK buffer = 150000H (1344KB) +;Length of 2nd VDISK buffer = 010000H ( 64KB) +;End addr of 2nd VDISK buffer = 15FFFFH +;First byte after all VDISKs = 160000H (1408KB) +;Divide by 1024 = 0580H (1408D) + +;-----------------------------------------------------------------------; +; Part 2 of Initialization (executed last) ; +;-----------------------------------------------------------------------; +;Initialization is divided into two parts. + +;INIT_P1 is overlaid by the virtual disk buffer + +;INIT_P1 is executed first, then jumps to INIT_P2. INIT_P2 returns to caller. + +;Exercise caution if extending the initialization part 2 code. +;It overlays the area immediately following the boot sector. +;If this section of code must be expanded, make sure it fits into the minimum +;sector size of 128 bytes. +;Label TEST_LENGTH must equate to a non-negative value (TEST_LENGTH >= 0). +;If this code it must be extended beyond the 128 byte length of the boot sector, +;move all of INIT_P2 before label VDISK. + +;Registers at entry to INIT_P2 (set up at end of INIT_P1): +; BL = media control byte from BPB (for FAT) +; CX = number of FAT copies +; DX = number of bytes in one FAT - 3 +; SI = OFFSET of Volume Label field +; ES:DI = VDISK buffer address of first FAT sector +; CS = DS = VDISK code segment + +INIT_P2 PROC ;second part of initialization + ASSUME DS:CSEG ;DS set in INIT_P1 + +;Initialize File Allocation Table(s) (FATs) + +INIT_P2_FAT: ;set up one FAT, sector number in AX + + PUSH CX ;save loop counter on stack + MOV AL,BL ;media control byte + STOSB ;store media control byte, increment DI + MOV AX,0FFFFH ;bytes 2 and 3 of FAT are 0FFH + STOSW + + MOV CX,DX ;FAT size in bytes - 3 + XOR AX,AX ;value to store in remainder of FAT + REP STOSB ;clear remainder of FAT + + POP CX ;get loop counter off stack + LOOP INIT_P2_FAT ;loop for all copies of the FAT + +;Put the volume label in the first directory entry + + MOV CX,VOL_LABEL_LEN ;length of volume directory entry + REP MOVSB ;move volume id to directory + +;Zero the remainder of the directory + + MOV AX,DIR_ENTRY_SIZE ;length of 1 directory entry + MUL BPB_DIRN ;* number entries = bytes of directory + SUB AX,VOL_LABEL_LEN ;less length of volume label + MOV CX,AX ;length of rest of directory + XOR AX,AX + REP STOSB ;clear directory to nulls + RET ;return with AX=0 +INIT_P2 ENDP + +PATCH_AREA DB 5 DUP ('PATCH AREA ') +TEST_LENGTH EQU 128-($-VDISK) ;if negative, boot record has too much + ;data area, move some fields below VDISK +;-----------------------------------------------------------------------; +; All fields that must remain resident after device driver ; +; initialization must be defined before this point. ; +;-----------------------------------------------------------------------; + DB ' ' + DB ' ' + DB ' ' + +MAXSEC_TRF DW 0 ;maximum number of sectors to transfer when + ;in extended memory + +BUFF_SIZE DW 0 ;desired VDISK buffer size in kilobytes + +MIN_MEMORY_LEFT DW 100 ;minimum amount of system memory (kilobytes) + ;that must remain after VDISK is installed + +PARA_PER_KB DW 1024/PARA_SIZE ;paragraphs in one kilobyte +C1024 DW 1024 ;bytes in one kilobyte +DIRE_SIZE DW DIR_ENTRY_SIZE ;bytes in one directory entry +DIR_SECTORS DW ? ;number of sectors of directory + +ERR_FLAG DB 0 ;error indicators to condition messages +ERR_BSIZE EQU 80H ;buffer size adjusted +ERR_SSZ EQU 40H ;sector size adjusted +ERR_DIRN EQU 20H ;number of directory entries adjusted +ERR_PASS EQU 10H ;some adjustment made that requires + ;recomputation of values previously computed +ERR_SSZB EQU ERR_SSZ+ERR_PASS ;sector size altered this pass +ERR_SYSSZ EQU 08H ;system storage too small for VDISK +ERR_SWTCH EQU 04H ;invalid switch character +ERR_EXTSW EQU 02H ;extender card switches don't match memory size +ERR_ESIZE EQU 01H ;Transfer size adjusted + +DOS_PG_SZ DB DOS_PAGE_SZ ;AN000; +DOS_Page_Size_Word dw DOS_Page_Sz ;an000; + +err_flag2 db 0 +err_baddos equ 01h ; Invalid DOS Version + +;-----------------------------------------------------------------------; +; SUBLIST definitions and EQUATES for Message Retreiver ; +;-----------------------------------------------------------------------; + ;AN000; Message Number +INCORRECT_DOS EQU 1 ;AN000; +SYS_TOO_SMALL EQU 2 ;AN000; +VDISK_TITLE EQU 3 ;AN000; +BUFFER_ADJUSTED EQU 4 ;AN000; +SECTOR_ADJUSTED EQU 5 ;AN000; +DIR_ADJUSTED EQU 6 ;AN000; +INVALID_SW_CHAR EQU 7 ;AN000; +TRANS_ADJUSTED EQU 8 ;AN000; +BUF_SZ EQU 9 ;AN000; +SEC_SZ EQU 10 ;AN000; +DIR_ENTRIES EQU 11 ;AN000; +TRANS_SZ EQU 12 ;AN000; +VDISK_NOT_INST EQU 13 ;AN000; +EXTEND_CARD_WRONG EQU 14 ;AN000; + +NO_REPLACE EQU 0 ;AN000; CX = 0 -> No replacement +ONE_REPLACE EQU 1 ;AN000; CX = 1 -> One replacement +UNLIMITED_MAX EQU 0 ;AN000; MAX field - unlimited +SMALLEST_MIN EQU 1 ;AN000; MIN field - 1 character long +PAD_BLANK EQU 20H ;AN000; PAD character is a blank + + +DRIVE_CODE DB ? ;AN000; + DB ":",NULL ;AN000; ASCIIZ string for drive code + +; For the message: "VDISK Version 4.00 virtual disk %1",CR,LF + +TITLE_SUBLIST LABEL BYTE + +TT_SIZE DB 11 ;AN000; SUBLIST size (PTR to next SUBLIST) +TT_RESV DB 0 ;AN000; RESERVED +TT_VALUEO DW DRIVE_CODE ;AN000; Offset to ASCIIZ string +TT_VALUES DW ? ;AN000; SEGMENT TO ASCIIZ STRING +TT_ID DB 1 ;AN000; n of %n +TT_FLAG DB Left_Align+Char_Field_ASCIIZ +TT_MAXW DB UNLIMITED_MAX ;AN000; Maximum field width +TT_MINW DB SMALLEST_MIN ;AN000; Minimum field width +TT_PAD DB PAD_BLANK ;AN000; Character for Pad field + +; For the message: "Buffer size: %1 KB",CR,LF + +BUF_SZ_SUBLIST LABEL BYTE + +B_SIZE DB 11 ;AN000; SUBLIST size (PTR to next SUBLIST) +B_RESV DB 0 ;AN000; RESERVED +B_VALUEO DW BUFF_SIZE ;AN000; Offset to binary number +B_VALUES DW ? ;AN000; SEGMENT TO BINARY NUMBER +B_ID DB 1 ;AN000; n of %n +B_FLAG DB Left_Align+Unsgn_Bin_Word +B_MAXW DB UNLIMITED_MAX ;AN000; Maximum field width +B_MINW DB SMALLEST_MIN ;AN000; Minimum field width +B_PAD DB PAD_BLANK ;AN000; Character for Pad field + +; For the message: "Sector size: %1",CR,LF + +SEC_SZ_SUBLIST LABEL BYTE + +S_SIZE DB 11 ;AN000; SUBLIST size (PTR to next SUBLIST) +S_RESV DB 0 ;AN000; RESERVED +S_VALUEO DW BPB_SSZ ;AN000; Offset to binary number +S_VALUES DW ? ;AN000; SEGMENT TO BINARY NUMBER +S_ID DB 1 ;AN000; n of %n +S_FLAG DB Left_Align+Unsgn_Bin_Word +S_MAXW DB UNLIMITED_MAX ;AN000; Maximum field width +S_MINW DB SMALLEST_MIN ;AN000; Minimum field width +S_PAD DB PAD_BLANK ;AN000; Character for Pad field + +; For the message: "Directory entries: %1",CR,LF + +DIR_ENT_SUBLIST LABEL BYTE + +D_SIZE DB 11 ;AN000; SUBLIST size (PTR to next SUBLIST) +D_RESV DB 0 ;AN000; RESERVED +D_VALUEO DW BPB_DIRN ;AN000; Offset to binary number +D_VALUES DW ? ;AN000; SEGMENT TO BINARY NUMBER +D_ID DB 1 ;AN000; n of %n +D_FLAG DB Left_Align+Unsgn_Bin_Word +D_MAXW DB UNLIMITED_MAX ;AN000; Maximum field width +D_MINW DB SMALLEST_MIN ;AN000; Minimum field width +D_PAD DB PAD_BLANK ;AN000; Character for Pad field + +; For the message: "Transfer size: %1",CR,LF + +TRANS_SZ_SUBLIST LABEL BYTE + +T_SIZE DB 11 ;AN000; SUBLIST size (PTR to next SUBLIST) +T_RESV DB 0 ;AN000; RESERVED +T_VALUEO DW MAXSEC_TRF ;AN000; Offset to binary number +T_VALUES DW ? ;AN000; SEGMENT TO BINARY NUMBER +T_ID DB 1 ;AN000; n of %n +T_FLAG DB Left_Align+Unsgn_Bin_Word +T_MAXW DB UNLIMITED_MAX ;AN000; Maximum field width +T_MINW DB SMALLEST_MIN ;AN000; Minimum field width +T_PAD DB PAD_BLANK ;AN000; Character for Pad field + +;-----------------------------------------------------------------------; +; EMS Support ; +;-----------------------------------------------------------------------; + +FRAME_BUFFER DB 10 DUP(0) ;AN000; +VDISK_Name db "VDISK " ;an000; dms; + +four DB 4 + + + SUBTTL Initialization, Part one + PAGE +;-----------------------------------------------------------------------; +; Command Code 0 - Initialization ; +; At entry, DS:BX point to request header, AX = 0 ; +;-----------------------------------------------------------------------; +;Initialization is divided into two parts. +;This part, executed first, is later overlaid by the VDISK buffer. + +INIT_P1 PROC ;first part of initialization + +;;;;; PUSH DS ;ICE +;;;;; push bx ;ICE +;;;;; push ax ;ICE + +;;;;; mov bx,0140H ;ICE +;;;;; xor ax,ax ;ICE +;;;;; mov ds,ax ;ICE +;;;;; mov ax,word ptr ds:[bx] ;ICE +;;;;; mov word ptr ds:[bx],ax ;ICE + +;;;;; pop ax ;ICE +;;;;; pop bx ;ICE +;;;;; POP DS ;ICE + + MOV DX,SS ;save stack segment register + MOV CX,SP ;save stack pointer register + CLI ;inhibit interrupts while changing SS:SP + MOV AX,CS ;move CS to SS through AX + MOV SS,AX + MOV SP,OFFSET MSGEND ;end of VDISKMSG + ADD SP,STACK_SIZE ;+ length of our stack + + STI ;allow interrupts + + PUSH DX ;save old SS register on new stack + PUSH CX ;SAVE OLD SP REGISTER ON NEW STACK + + + + PUSH DS ;AN000;SAVE REGS + PUSH ES ;AN000; + + PUSH CS ;AN000;TRANSFER TO DS + POP DS ;AN000; + PUSH CS ;AN000; + POP ES ;AN000; + + ASSUME DS:CSEG,ES:CSEG ;AN000; + + CALL SYSLOADMSG ;AN000; LOAD messages and do DOS version check + JNC VDISK_CONTINUE_1 ;AN000; Did we load OK? + or cs:err_flag2,err_baddos + + push ds ;an006; dms;save ds + push bx ;an006; dms;save bx + lds bx,cs:RH_Ptra ;an006; dms;point to request header + mov RH.RH0_Flag,-1 ;an006; dms;signal BIO and error occurred + pop bx ;an006; dms;restore bx + pop ds ;an006; dms;restore ds + + MOV AX,VDISK_NOT_INST ;AN000;VDISK UNABLE TO BE INSTALLED + MOV BX,NO_HANDLE ;AN000;NO DISPLAY HANDLE + CALL SYSDISPMSG ;AN000;DISPLAY THE MESSAGE + MOV AX,INCORRECT_DOS ;AN000;BAD DOS VERSION + MOV BX,NO_HANDLE ;AN000;NO DISPLAY HANDLE + CALL SYSDISPMSG ;AN000;DISPLAY THE MESSAGE + +VDISK_CONTINUE_1: ;AN000; + + POP ES ;AN000;RESTORE REGS + POP DS ;AN000; + ASSUME DS:NOTHING,ES:NOTHING ;AN000; + + CALL PC_386_CHK ;AN000;SEE IF WE HAVE A 386 PC + ; Yes, continue + CALL GET_PARMS ;get parameters from CONFIG.SYS line + + PUSH CS + POP DS ;set DS = CS + ASSUME DS:CSEG,ES:CSEG + + CALL APPLY_DEFAULTS ;supply any values not specified + CALL DETERMINE_START ;compute start address of VDISK buffer + CALL VALIDATE ;validate parameters + CALL COPY_BPB ;Copy BIOS Parameter Block to boot record + + CALL VERIFY_EXTENDER ;Verify that extender card switches are right + + TEST ERR_FLAG,ERR_EXTSW ;are switches wrong? + JNZ INIT_P1_A ;if so, exit with messages + + test cs:err_flag2,err_baddos + jnz init_p1_a + + CMP EM_SW,0 ;EXTENDED MEMORY REQUEST? + JE INIT_P1_A ;jump if not + + TEST ERR_FLAG,ERR_SYSSZ ;is system too small for VDISK? + JNZ INIT_P1_A ;if so, don't do extended memory init + + CALL UPDATE_AVAIL ;update AVAIL_HI and AVAIL_LO to reflect + ;addition of extended memory VDISK + CALL FORMAT_VDISK ;construct a boot record, FATs and + ;directory in storage immediately + ;following this device driver + CALL MOVE_VDISK ;move formatted boot record, FATs, + ;and directory to extended memory + +INIT_P1_A: + CALL FILL_RH ;fill in INIT request header + CALL WRITE_MESSAGES ;display all messages + POP CX ;get old SP from stack + POP DX ;get old SS from stack + CLI ;disable interrupts while changing SS:SP + MOV SS,DX ;restore stack segment register + MOV SP,CX ;restore stack pointer register + STI ;enable interrupts +;-----------------------------------------------------------------------; +; INIT_P2 must be short enough to fit into the boot sector ; +; (minimum size of boot sector is 128 bytes), so we set up ; +; as many pointers as we can to help keep INIT_P2 short. ; +; ; +; ES:DI = storage address of first FAT sector ; +; BL = media control byte ; +; CX = number of FAT copies ; +; DX = number of bytes in one FAT, less 3 ; +; SI = offset of VOL label field ; +;-----------------------------------------------------------------------; + MOV ES,START_BUFFER_PARA ;start paragraph of VDISK buffer + + MOV AX,BPB_RES ;number of reserved sectors + MUL BPB_SSZ ;* sector size + MOV DI,AX ;ES:DI point to FAT start + + MOV BL,BPB_MCB ;media control byte + + MOV CL,BPB_FATN ;number of FAT copies + XOR CH,CH + + MOV AX,BPB_FATSZ ;FAT size in sectors + MUL BPB_SSZ ;* sector size = total FAT bytes + + SUB AX,3 ;-3 (FEFFFF stored by code) + MOV DX,AX + + MOV SI,OFFSET VOL_LABEL ;point to VOL label directory entry + JMP INIT_P2 ;jump to second part of initialization + ;this is redundant if the VDISK is in + ;extended memory, but is executed anyway + + + + SUBTTL PC_386_CHK + PAGE +;========================================================================= +; PC_386_CHK : QUERIES THE BIOS TO DETERMINE WHAT TYPE OF +; MACHINE WE ARE ON. WE ARE LOOKING FOR A 386. +; THIS WILL BE USED TO DETERMINE IF A DW MOVE +; IS TO BE PERFORMED. +; +; INPUTS : NONE +; +; OUTPUTS : PC_386 - FLAG SIGNALS IF WE ARE ON A 386 MACHINE. +;========================================================================= + +PC_386_CHK PROC NEAR ;AN000;DETERMINE MACHINE TYPE + + PUSH AX ;AN000;SAVE AFFECTED REGS + PUSH BX ;AN000; + PUSH ES ;AN000; + + MOV CS:PC_386,FALSE ;AN000;INITIALIZE TO FALSE + + MOV AH,0C0H ;AN000;RETURN SYSTEM CONFIGURATION + INT 15H ;AN000; + +; $IF NC ;AN000;IF A GOOD RETURN + JC $$IF13 + CMP AH,0 ;AN000;IS IT NEW FORMAT FOR CONFIG. +; $IF E ;AN000;YES + JNE $$IF14 + MOV AL,ES:[BX.BIOS_SD_MODELBYTE] ;AN000;CHECK MODEL + CMP AL,0F8H ;AN000;IS IT A 386 MACHINE? +; $IF E ;AN000;YES + JNE $$IF15 + MOV CS:PC_386,TRUE ;AN000;SIGNAL A 386 +; $ENDIF ;AN000; +$$IF15: +; $ENDIF ;AN000; +$$IF14: +; $ENDIF ;AN000; +$$IF13: + + POP ES ;AN000;RESTORE REGS. + POP BX ;AN000; + POP AX ;AN000; + + RET ;AN000; + +PC_386_CHK ENDP ;AN000; + + + SUBTTL GET_PARMS Parameter Line Scan + PAGE +;-----------------------------------------------------------------------; +;GET_PARMS gets the parameters from the CONFIG.SYS statement ; +; ; +;Register usage: ; +; DS:SI indexes parameter string ; +; AL contains character from parameter string ; +; CX value from GET_NUMBER ; +;-----------------------------------------------------------------------; + ASSUME DS:NOTHING ;DS:BX point to Request Header +GET_PARMS PROC ;get parameters from CONFIG.SYS line + PUSH DS ;save DS + LDS SI,RH.RH0_BPBA ;DS:SI point to all after DEVICE= + ;in CONFIG.SYS line + XOR AL,AL ;not at end of line + +;Skip until first delimiter is found. There may be digits in the path string. + +;DS:SI points to \pathstring\VDISK.SYS nn nn nn +;The character following VDISK.SYS may have been changed to a null (00H). +;All letters have been changed to uppercase. + +GET_PARMS_A: ;skip to DOS delimiter character + CALL GET_PCHAR ;get parameter character into AL + JZ Get_Parms_X_Exit ;get out if end of line encountered + OR AL,AL ;test for null + JZ GET_PARMS_C ; + CMP AL,' ' + JE GET_PARMS_C ; + CMP AL,',' + JE GET_PARMS_C ; + CMP AL,';' + JE GET_PARMS_C ; + CMP AL,'+' + JE GET_PARMS_C ; + CMP AL,'=' + JE GET_PARMS_C ; + CMP AL,TAB + JNE GET_PARMS_A ;skip until delimiter or CR + + + +GET_PARMS_C: + PUSH SI ;save to rescan + MOV CS:EM_SW,0 ;INDICATE NO /E FOUND + JMP GET_SLASH ;see if current character is an slash + +GET_PARMS_D: ;scan for / + CALL GET_PCHAR + JZ GET_PARMS_B ;exit if end of line + +GET_SLASH: ;check for slash + CMP AL,'/' ;found slash? + JNE GET_PARMS_D ;no, continue scan + + CALL GET_PCHAR ;get char following slash + CMP AL,'E' ;don't have to test for lower case E, + ;letters have been changed to upper case + JNE CHECK_FOR_X ;not 'E' ;AN005; + CMP CS:EM_SW,'X' ;Was /X already defined? ;AN005; + JE GET_PARMS_E ;indicate invalid switch ;AN005; + MOV CS:EM_SW,AL ;indicate /E found ;AN005; + JMP SHORT GOT_E_OR_X ;AN005; + ;AN005; +CHECK_FOR_X: ;AN005; + CMP AL,'X' ;don't have to test for lower case X, ;AN005; + ;letters have been changed to upper case ;AN005; + JNE GET_PARMS_E ;not 'X' ;AN005; + CMP CS:EM_SW,'E' ;Was /E already defined? ;AN005; + JE GET_PARMS_E ;indicate invalid switch ;AN005; + MOV CS:EM_SW,'X' ;indicate /X found ;AN005; + ;AN005; +GOT_E_OR_X: ;AN005; + CALL GET_PCHAR ;get char following E or X ;AN005; + CMP AL,':' ;is it a delimeter ? + JNE GET_PARMS_D ;not a ':' + + + CALL GET_MAXSIZE ;get maximum sector size + + + JMP GET_PARMS_D ;continue forward scan + +GET_PARMS_E: ;/ found, not 'E' + OR CS:ERR_FLAG,ERR_SWTCH ;indicate invalid switch character + JMP GET_PARMS_D ;continue scan + + + +GET_PARMS_B: ;now pointing to first delimiter + POP SI ;get pointer, used to rescan for /E + XOR AL,AL ;not at EOL now + CALL GET_PCHAR ;get first character + CALL SKIP_TO_DIGIT ;skip to first digit + +Get_Parms_X_Exit: + + JZ GET_PARMS_X ;found EOL, no digits remain + + CALL GET_NUMBER ;extract digits, convert to binary + MOV CS:BUFF_SIZE,CX ;store buffer size + + CALL SKIP_TO_DIGIT ;skip to next digit + JZ GET_PARMS_X ;found EOL, no digits remain + + CALL GET_NUMBER ;extract digits, convert to binary + MOV CS:BPB_SSZ,CX ;store sector size + + CALL SKIP_TO_DIGIT ;skip to next digit + JZ GET_PARMS_X ;found EOL, no digits remain + + CALL GET_NUMBER ;extract digits, convert to binary + MOV CS:BPB_DIRN,CX ;store number of directory entries + + + +GET_PARMS_X: ;premature end of line + TEST cs:ERR_FLAG,ERR_SWTCH ;was an invalid switch character found? +; $if nz ;yes - set flag to regular VDISK ;an000; dms; + JZ $$IF19 + ; this is consistent with DOS 3.3 + mov cs:EM_SW,0 ;set flag to regular VDISK ;an000; dms; +; $endif ; ;an000; dms; +$$IF19: + POP DS ;restore DS + RET + + +GET_MAXSIZE PROC ;get maximum sector size + + CALL GET_PCHAR ;get next character + CALL CHECK_NUM ;is it a number ? + JZ GET_NEXTNUM ;yes, go get next number + OR CS:ERR_FLAG,ERR_ESIZE ;indicate invalid sector size + RET ; +GET_NEXTNUM: ;get next number + CALL GET_NUMBER ;extract digits and convert to binary + MOV CS:MAXSEC_TRF,CX ;save maximum sector size to transfer + RET +GET_MAXSIZE ENDP + + + +GET_PCHAR PROC ;internal proc to get next character into AL + CMP AL,CR ;carriage return already encountered? + JE GET_PCHAR_X ;don't read past end of line + CMP AL,LF ;line feed already encountered? + JE GET_PCHAR_X ;don't read past end of line + LODSB ;get char from DS:SI, increment SI + CMP AL,CR ;is the char a carriage return? + JE GET_PCHAR_X ;yes, set Z flag at end of line + CMP AL,LF ;no, is it a line feed? +GET_PCHAR_X: ;attempted read past end of line + RET +GET_PCHAR ENDP ;returns char in AL + + +CHECK_NUM PROC ;check AL for ASCII digit + CMP AL,'0' ;< '0'? + JB CHECK_NUM_X ;exit if it is + + CMP AL,'9' ;> '9'? + JA CHECK_NUM_X ;exit if it is + + CMP AL,AL ;set Z flag to indicate numeric +CHECK_NUM_X: + RET ;Z set if numeric, NZ if not numeric +CHECK_NUM ENDP + + +SKIP_TO_DIGIT PROC ;skip to first numeric character + CALL CHECK_NUM ;is current char a digit? + JZ SKIP_TO_DIGIT_X ;if so, skip is complete + + CALL GET_PCHAR ;get next character from line + JNZ SKIP_TO_DIGIT ;loop until first digit or CR or LF + RET ;character is CR or LF + +SKIP_TO_DIGIT_X: + CMP AL,0 ;digit found, force NZ + RET +SKIP_TO_DIGIT ENDP + +C10 DW 10 +GN_ERR DB ? ;zero if no overflow in accumulation + +GET_NUMBER PROC ;convert string of digits to binary value + XOR CX,CX ;accumulate number in CX + MOV CS:GN_ERR,CL ;no overflow yet +GET_NUMBER_A: ;accumulate next digit + SUB AL,'0' ;convert ASCII to binary + CBW ;clear AH + XCHG AX,CX ;previous accumulation in AX, new digit in CL + MUL CS:C10 ;DX:AX := AX*10 + OR CS:GN_ERR,DL ;set GN_ERR <> 0 if overflow + ADD AX,CX ;add new digit from + XCHG AX,CX ;number now in CX + DEC SI ;back up to prior entry + MOV AL,' ' ;blank out prior entry + MOV [SI],AL ; + INC SI ;set to current entry + CALL GET_PCHAR ;get next character + CALL CHECK_NUM ;see if it was numeric + JZ GET_NUMBER_A ;continue accumulating + CMP CS:GN_ERR,0 ;did we overflow? + JE GET_NUMBER_B ;if not, we're done + XOR CX,CX ;return zero (always invalid) if overflow +GET_NUMBER_B: + RET ;number in CX, next char in AL +GET_NUMBER ENDP + +GET_PARMS ENDP + + SUBTTL APPLY_DEFAULTS + PAGE +;-----------------------------------------------------------------------; +; APPLY_DEFAULTS supplies any parameter values that the user ; +; failed to specify ; +;-----------------------------------------------------------------------; + ASSUME DS:CSEG +APPLY_DEFAULTS PROC + XOR AX,AX + CMP BUFF_SIZE,AX ;is buffer size zero? + JNE APPLY_DEFAULTS_A ;no, user specified something + + MOV BUFF_SIZE,DFLT_BSIZE ;supply default buffer size + OR ERR_FLAG,ERR_BSIZE ;indicate buffersize adjusted + +APPLY_DEFAULTS_A: + CMP BPB_SSZ,AX ;is sector size zero? + JNE APPLY_DEFAULTS_B ;no, user specified something + + MOV BPB_SSZ,DFLT_SSZ ;supply default sector size + OR ERR_FLAG,ERR_SSZ ;indicate sector size adjusted + +APPLY_DEFAULTS_B: + CMP BPB_DIRN,AX ;are directory entries zero? + JNE APPLY_DEFAULTS_C ;no, user specified something + + MOV BPB_DIRN,DFLT_DIRN ;supply default directory entries + OR ERR_FLAG,ERR_DIRN ;indicate directory entries adjusted + +APPLY_DEFAULTS_C: ; + CMP EM_SW,0 ;EXTENDED MEMORY + JE APPLY_DEFAULTS_D ;no, jump around + CMP MAXSEC_TRF,AX ;is maximum sectors zero? + JNE APPLY_DEFAULTS_D ;no, user specified something + + MOV MAXSEC_TRF,DFLT_ESS ;supply default maximum number of + ;sector to transfer + OR ERR_FLAG,ERR_ESIZE ;indicate transfer size adjusted +APPLY_DEFAULTS_D: + RET +APPLY_DEFAULTS ENDP + + SUBTTL DETERMINE_START address of VDISK buffer + PAGE +;-----------------------------------------------------------------------; +; DETERMINE_START figures out the starting address of the VDISK ; +; buffer ; +;-----------------------------------------------------------------------; + ASSUME DS:CSEG +DETERMINE_START PROC + +;If extended memory is NOT being used, the VDISK buffer immediately +;follows the resident code. + +;If extended memory IS being used, START_BUFFER_PARA becomes the +;end of device driver address passed back to DOS. + + MOV AX,CS ;start para of VDISK code + ADD AX,VDISKP ;+ length of resident code + MOV START_BUFFER_PARA,AX ;save as buffer start para + + CMP EM_SW,0 ;IS EXTENDED MEMORY REQUESTED? + JE DETERMINE_START_X ;if not, we're done here + +;-----------------------------------------------------------------------;AN000; +;If EMS is not installed, the calculation to determine the starting address +;of the VDISK will remain the same. + +;If EMS is installed we really don't need this calculation, the EMM will +;manage the expanded memory insuring mutiple VDISKs may reside concurrently. +;-----------------------------------------------------------------------;AN000; + + cmp EM_SW,EMS_Mem ;EMS requested? ;an005; dms; + je Determine_Start_X ;yes - leave routine ;an005; dms; + ;no - continue routine + + clc ;an001; dms;clear carry for INT + MOV AX,EM_MEMSIZE ;an001; dms; get EM memory size + INT EM_INT ;an001; dms; INT 15h + JC Determine_Start_X ;an001; dms; no extended memory installed + or ax,ax ;an001; dms;see if memory returned + jz Determine_Start_X ;an001; dms;signal no memory + + xor dx,dx ;an001; dms;clear dx + sub ax,cs:Buff_Size ;an001; dms;get starting KB location + jc Determine_Start_X ;an001; dms;buffer too large + + mov cs:EM_New_Size,ax ;an001; dms;save new size of EM for later use + mul C1024 ;an001; dms;get total byte count + add ax,cs:Avail_Lo ;an001; dms;add in low word of EM start + adc dl,cs:Avail_Hi ;an001; dms;add in high word of EM start + + mov cs:Avail_Lo,ax ;an001; dms;save new low beginning word + mov cs:Avail_Hi,dl ;an001; dms;save new high beginning word + + mov cs:Start_EM_Lo,ax ;an001; dms;load in new beginning word + mov cs:Start_EM_Hi,dl ;an001; dms;load in new beginning byte + +DETERMINE_START_X: + + RET +DETERMINE_START ENDP + + SUBTTL VALIDATE parameters + PAGE +;-----------------------------------------------------------------------; +; VALIDATE adjusts parameters as necessary ; +;-----------------------------------------------------------------------; +VAL_SSZ_TBL LABEL WORD ;table of valid sector sizes +VAL_SSZ_S DW 128 ;smallest valid sector size + DW 256 +VAL_SSZ_L DW 512 ;largest valid sector size +VAL_SSZ_N EQU ($-VAL_SSZ_TBL)/2 ;number of table entries + + ASSUME DS:CSEG +VALIDATE PROC ;validate parameters +;;ice PUSH DS ;ICE +;;ice push bx ;ICE +;;ice push ax ;ICE + +;;ice mov bx,0140H ;ICE +;;ice xor ax,ax ;ICE +;;ice mov ds,ax ;ICE +;;ice mov ax,word ptr ds:[bx] ;ICE +;;ice mov word ptr ds:[bx],ax ;ICE + +;;ice pop ax ;ICE +;;ice pop bx ;ICE +;;ice POP DS ;ICE + MOV BPB_AUSZ,1 ;initial allocation unit is 1 sector + + CALL VAL_BSIZE ;validate buffer size + + CALL VAL_SSZ ;validate (adjust if necessary) BPB_SSZ + +VALIDATE_A: + AND ERR_FLAG,255-ERR_PASS ;indicate nothing changed this pass + + MOV AX,BPB_SSZ ;sector size + CWD ;clear DX for division + DIV WPARA_SIZE ;sector size/para size + MOV PARAS_PER_SECTOR,AX ;number of paragraphs/sector + + mov ax,EMS_Page_Size ;an002; dms;EMS page size + xor dx,dx ;an002; dms;clear high word + div BPB_SSZ ;an002; dms;get sectors/page + mov Sect_Per_Page,ax ;an002; dms;save sectors/page + +;;;;; MOV AX,BPB_SSZ ;AN000; Sector size +;;;;; xor dx,dx ;an001; clear high word +;;;;; DIV DOS_Page_Size_Word ;an001; Sector size/page size +;;;;; MOV SECT_PER_PAGE,AX ;an001; Number of sectors/page + + MOV AX,BUFF_SIZE ;requested buffersize in KB + MUL C1024 ;DX:AX = buffer size in bytes + DIV BPB_SSZ ;/sector size = # sectors + MOV BPB_SECN,AX ;store number of sectors + + CALL VAL_DIRN ;validate number of directory entries + + TEST ERR_FLAG,ERR_PASS ;may have reset sector size + JNZ VALIDATE_A ;recompute directory & FAT sizes + + CALL VAL_FAT ;compute FAT entries, validity test + + TEST ERR_FLAG,ERR_PASS ;if cluster size altered this pass + JNZ VALIDATE_A ;recompute directory & FAT sizes + +;Make certain buffer size is large enough to contain: +; boot sector(s) +; FAT sector(s) +; directory sector(s) +; at least 1 data cluster + + MOV AL,BPB_FATN ;number of FAT copies + CBW ;clear AH + MUL BPB_FATSZ ;* sectors for 1 FAT = FAT sectors + ADD AX,BPB_RES ;+ reserved sectors + ADD AX,DIR_SECTORS ;+ directory sectors + MOV CL,BPB_AUSZ ;get sectors/cluster + XOR CH,CH ;CX = sectors in one cluster + ADD AX,CX ;+ one data cluster + CMP BPB_SECN,AX ;compare with sectors available + JAE VALIDATE_X ;jump if enough sectors + + CMP DIR_SECTORS,1 ;down to 1 directory sector? + JBE VALIDATE_C ;can't let it go below 1 + + MOV AX,BPB_SSZ ;sector size + CWD ;clear DX for division + DIV DIRE_SIZE ;sectorsize/dir entry size = entries/sector + SUB BPB_DIRN,AX ;reduce directory entries by 1 sector + + OR ERR_FLAG,ERR_DIRN ;indicate directory entries adjusted + JMP VALIDATE_A ;retry with new directory entries number + +VALIDATE_C: ;not enough space for any VDISK + OR ERR_FLAG,ERR_SYSSZ +VALIDATE_X: + RET + + SUBTTL VAL_BSIZE Validate buffer size + PAGE +;-----------------------------------------------------------------------; +; VAL_BSIZE adjusts the buffer size as necessary ; +;-----------------------------------------------------------------------; +VAL_BSIZE PROC + CALL GET_MSIZE ;determine memory available to VDISK + ;returns available KB in AX + OR AX,AX ;is any memory available at all? + JNZ VAL_BSIZE_B ;yes, continue + + OR ERR_FLAG,ERR_SYSSZ ;indicate system too small for VDISK + MOV BUFF_SIZE,1 ;set up minimal values to continue init + MOV AX,VAL_SSZ_S ;smallest possible sector size + MOV BPB_SSZ,AX + MOV BPB_DIRN,4 ;4 directory entries + RET + +VAL_BSIZE_B: ;some memory is available + CMP AX,BUFF_SIZE ;is available memory >= requested? + JAE VAL_BSIZE_C ;if so, we're done + + MOV BUFF_SIZE,AX ;give all available memory + mov cs:EM_New_Size,0 ;an001; dms;save new size of EM for later use + mov ax,cs:Avail_Lo ;an001; dms;get low word of EM start + mov dl,cs:Avail_Hi ;an001; dms;get high byte of EM start + + mov cs:Start_EM_Lo,ax ;an001; dms;load in new beginning word + mov cs:Start_EM_Hi,dl ;an001; dms;load in new beginning byte + OR ERR_FLAG,ERR_BSIZE ;indicate buffersize adjusted +VAL_BSIZE_C: + + + RET + + +GET_MSIZE PROC ;determine memory available to VDISK + ;returns KB available in AX + CMP EM_SW,0 ;EXTENDED MEMORY? + JE GET_MSIZE_2 ;use non-extended memory routine + + cmp EM_SW,EM_Mem ;Extended memory requested? ;an005; dms; + je Use_Extended_Support ;yes ;an005; dms; + ;no - check for EMS availability + + + CALL EMS_CHECK ;AN000; Check if EMS is installed + JC GET_MSIZE_Z ;AN000; Yes, it is installed but in error + ; then notify caller by setting AX to zero + CMP AH,NOT EMS_INSTALLED_FLAG ;AN000; + JE Get_Msize_Z ;ac005; flag an error occurred + MOV EM_SW2,AH ;AN000; Set EMS flag + CALL EMS_GET_PAGES ;AN000; Get count of total number of pages + xor dx,dx ;an002; clear high word + MUL DOS_Page_Size_Word ;ac002; Number of pages * KB per page + RET ;AN000; Return with AX = number of whole free kilobytes + ; +USE_EXTENDED_SUPPORT: ;AN000; No, EMS is not installed + + MOV AX,EM_MEMSIZE ;function code to AH + INT EM_INT ;get extended memory size in AX + JC GET_MSIZE_Z ;if error, no extended memory installed + or ax,ax ;an000; dms;see if memory returned + jz GET_MSIZE_Z ;an000; dms;signal no memory + + RET + +GET_MSIZE_2: ;non-extended memory size determination + +;Compute AX = total system size, - (VDISK end address + 64KB) + + MOV AX,START_BUFFER_PARA ;paragraph end of VDISK code + XOR DX,DX ;clear for division + DIV PARA_PER_KB ;KB address of load point + ADD DX,0FFFFH ;round upward to KB boundary + ADC AX,MIN_MEMORY_LEFT ;pick up CY and the 64KB we should leave + PUSH AX ;save across interrupt + INT MEM_SIZE ;get total system size + POP DX ;amount of total that we can't use + SUB AX,DX ;available space to VDISK + JNC GET_MSIZE_X ;exit if positive + +GET_MSIZE_Z: + XOR AX,AX ;indicate no memory available +GET_MSIZE_X: ;exit from memory size determination + RET +GET_MSIZE ENDP + +VAL_BSIZE ENDP + + + +EMS_CHECK PROC NEAR ;AN000; + + CALL EMS_CHECK1 ;AN000; SEE IF EMS INSTALLED + JNC EMS_INSTALLED ;AN000; No, + MOV AH,NOT EMS_INSTALLED_FLAG ;AN000; Flag EMS not installed + CLC ;AN000; Make sure carry is Clear + JMP SHORT EMS_CHECK_EXIT ;AN000; Leave check routine + +EMS_INSTALLED: ;AN000; Yes, + + push es ;an000; save es - call destroys it + push di ;an006; save di + + mov ah,EMS_2F_Handler ;an006;see if our 2Fh is there + xor al,al ;an006; + int 2Fh ;an006; + cmp al,0ffh ;an006;2Fh handler there? +; $if e ;an006;yes + JNE $$IF21 + mov ah,EMS_2F_Handler ;an006;get EMS page for VDISK + mov al,0FFh ;an006; + mov di,0FEh ;an006; + int 2Fh ;ac006; + + or ah,ah ;an006;page available? +; $if z ;an006;yes + JNZ $$IF22 + mov cs:EMS_Frame_Addr,es ;an006;save segment value + mov cs:DOS_Page,di ;an006;save physical page # + clc ;an006;flag memory available + mov ah,EMS_INSTALLED_FLAG ;an000;signal EMS here +; $else ;an006;no memory avail. + JMP SHORT $$EN22 +$$IF22: + mov ah,not EMS_INSTALLED_FLAG ;an000;signal no EMS + stc ;an006;flag it +; $endif ;an006; +$$EN22: +; $else + JMP SHORT $$EN21 +$$IF21: + mov ah,not EMS_INSTALLED_FLAG ;AN000;signal no EMS + stc ;an006;signal not there +; $endif +$$EN21: + + pop di ;an006;restore di + pop es ;an000;restore es + +EMS_Check_Exit: + + RET ;AN000; Return + +EMS_CHECK ENDP ;AN000; + + + +;========================================================================= +; EMS_CHECK1 : THIS MODULE DETERMINES WHETHER OR NOT EMS IS +; INSTALLED FOR THIS SESSION. +; +; INPUTS : NONE +; +; OUTPUTS : ES:BX - FRAME ARRAY +; CY - EMS NOT AVAILABLE +; NC - EMS AVAILABLE +;========================================================================= + +EMS_CHECK1 PROC NEAR ;AN000;EMS INSTALL CHECK + + push ds ;an000;save ds - we stomp it + mov ax,00h ;an000;set ax to 0 + mov ds,ax ;an000;set ds to 0 + cmp ds:word ptr[067h*4+0],0 ;an000;see if int 67h is there + pop ds ;an000;restore ds +; $IF NE ;AN000;EMS VECTOR CONTAINS DATA + JE $$IF27 + MOV AH,EMS_STATUS ;AN000;see if EMS installed + XOR AL,AL ;AN000;CLEAR AL + INT EMS_INT ;AN000; + OR AH,AH ;AN000;EMS INSTALLED? +; $IF Z ;AN000;YES + JNZ $$IF28 + MOV AH,EMS_VERSION ;AN000;GET VERSION NUMBER + XOR AL,AL ;AN000;CLEAR AL + INT EMS_INT ;AN000; + CMP AL,EMS_VERSION_LEVEL ;AN000;CORRECT VERSION? +; $IF AE ;AN000;YES + JNAE $$IF29 + CLC ;AN000;FLAG IT AS GOOD EMS +; $ELSE ;AN000; + JMP SHORT $$EN29 +$$IF29: + STC ;AN000;BAD EMS +; $ENDIF ;AN000; +$$EN29: +; $ELSE ;AN000; + JMP SHORT $$EN28 +$$IF28: + STC ;AN000;EMS NOT INSTALLED +; $ENDIF ;AN000; +$$EN28: +; $ELSE ;AN000; + JMP SHORT $$EN27 +$$IF27: + STC ;AN000;EMS VECTOR NOT THERE +; $ENDIF ;AN000; +$$EN27: + + RET ;AN000;RETURN TO CALLER + +EMS_CHECK1 ENDP ;AN000; + + +EMS_GET_PAGES PROC NEAR ;AN000; + + MOV AH,EMS_GET_NUM_PAGES ;AN000; Query EMS for page count + INT EMS_INT ;AN000; + OR AH,AH ;AN000; Has EMS returned page count? + JNZ EMS_GET_ERROR ;AN000; Yes, + MOV AX,BX ;AN000; Get number of pages + RET ;AN000; + +EMS_GET_ERROR: ;AN000; + STC ;AN000; + RET ;AN000; + +EMS_GET_PAGES ENDP + + SUBTTL VAL_SSZ Validate Sector Size + PAGE +;-----------------------------------------------------------------------; +; VAL_SSZ validates sector size, adjusting if necessary ; +;-----------------------------------------------------------------------; +VAL_SSZ PROC ;validate sector size + CMP CS:EM_SW,0 ;EXTENDED MEMORY? + JE VAL_SSZ_ST ;no,go check sector size + MOV BX,MAXSEC_TRF ;move number of sectors to transfer + CMP BX,1 ;> or equal to 1 ? + JB DFLT_TRF ;set default if it is + CMP BX,8 ;> than 8 ? + JA DFLT_TRF ;set default if it is + JMP VAL_SSZ_ST ;continue processing + +DFLT_TRF: ;set default + MOV MAXSEC_TRF,DFLT_ESS ; + MOV BX,MAXSEC_TRF ; + OR CS:ERR_FLAG,ERR_ESIZE ;indicate transfer size adjusted + +VAL_SSZ_ST: ;validate sector size + MOV MAX_CNT,BX ;initialize maximum number of sectors + ;to transfer for extended memory case + MOV BX,BPB_SSZ ;requested sector size + MOV CX,VAL_SSZ_N ;number of table entries + MOV SI,OFFSET VAL_SSZ_TBL ;DS:SI point to table start +VAL_SSZ_A: + LODSW ;get table entry, step table pointer + CMP AX,BX ;is value in table? + JE VAL_SSZ_X ;exit if value found + LOOP VAL_SSZ_A ;loop until table end + + MOV BX,DFLT_SSZ ;get default sector size + MOV BPB_SSZ,BX ;set sector size to default value + OR ERR_FLAG,ERR_SSZ ;indicate sector size adjusted +VAL_SSZ_X: + +;Compute the maximum number of sectors that can be moved in 64KB (less one) +;Restricting moves to this amount avoids 64KB boundary problems. + + CMP CS:EM_SW,0 ;EXTENDED MEMORY? + JNE SIZE_DONE ;yes, we are done + XOR DX,DX + MOV AX,0FFFFH ;64KB - 1 + DIV BX ;/sector size + MOV MAX_CNT,AX ;max sectors in one move +SIZE_DONE: + RET +VAL_SSZ ENDP + + SUBTTL VAL_DIRN Validate number of directory entries + PAGE +;-----------------------------------------------------------------------; +; VAL_DIRN validates and adjusts the number of directory entries. ; +; ; +; Minimum is MIN_DIRN, maximum is MAX_DIRN. If outside these ; +; limits, DFLT_DIRN is used. ; +; ; +; The number of directory entries is rounded upward to fill ; +; a sector ; +;-----------------------------------------------------------------------; +VAL_DIRN PROC + MOV AX,BPB_DIRN ;requested directory entries + CMP AX,MIN_DIRN ;if less than minimum + JB VAL_DIRN_A ;use default instead + + CMP AX,MAX_DIRN ;if <= maximum + JBE VAL_DIRN_B ;accept value as provided + +VAL_DIRN_A: + MOV AX,DFLT_DIRN ;use default directory entries + OR ERR_FLAG,ERR_DIRN ;indicate directory entries adjusted +VAL_DIRN_B: ;AX is number of directory entries + MUL DIRE_SIZE ;* 32 = bytes of directory requested + DIV BPB_SSZ ;/ sector size = # of directory sectors + OR DX,DX ;test remainder for zero + JZ VAL_DIRN_C ;jump if exact fit + + INC AX ;increment directory sectors + OR ERR_FLAG,ERR_DIRN ;indicate directory entries adjusted +VAL_DIRN_C: ;make sure enough sectors available + MOV DX,BPB_SECN ;total sectors on media + SUB DX,BPB_RES ;less reserved sectors + SUB DX,2 ;less minimum FAT and 1 data sector + CMP AX,DX ;if directory sectors <= available + JLE VAL_DIRN_D ;use requested amount + + MOV AX,1 ;use only one directory sector + OR ERR_FLAG,ERR_DIRN ;indicate directory entries adjusted +VAL_DIRN_D: + MOV DIR_SECTORS,AX ;save number of directory sectors + MUL BPB_SSZ ;dir sectors * sector size = dir bytes + DIV DIRE_SIZE ;dir bytes / entry size = entries + MOV BPB_DIRN,AX ;store adjusted directory entries + RET +VAL_DIRN ENDP + + SUBTTL VAL_FAT Validate File Allocation Table (FAT) + PAGE +;-----------------------------------------------------------------------; +;VAL_FAT computes: ; +;BPB_FATSZ, the number of sectors required per FAT copy ; +; ; +;Each FAT entry is 12 bits long, for a maximum of 4095 FAT entries. ; +;(A few FAT entries are reserved, so the highest number of FAT entries ; +;we permit is 0FE0H.) With large buffer sizes and small sector sizes, ; +;we have more allocation units to describe than a 12-bit entry will ; +;describe. If the number of FAT entries is too large, the sector size ; +;is increased (up to a maximum of 512 bytes), and then the allocation ; +;unit (cluster) size is doubled, until we have few enough allocation ; +;units to be properly described in 12 bits. ; +; ; +;This computation is slightly conservative in that the FAT entries ; +;necessary to describe the FAT sectors are included in the computation. ; +;-----------------------------------------------------------------------; +VAL_FAT PROC + MOV AX,BPB_SECN ;total number of sectors + SUB AX,BPB_RES ;don't count boot sector(s) + SUB AX,DIR_SECTORS ;don't count directory sectors + + CMP AX,0000h ;an000; dms; fix ptm 112; any left? + JA VAL_FAT_A ;an000; dms; fix ptm 112; yes + +;;;;; JG VAL_FAT_A ;jump if some remaining + MOV BPB_SSZ,DFLT_SSZ ;force default sector size + OR ERR_FLAG,ERR_SSZ+ERR_PASS ;indicate sector size adjusted + JMP SHORT VAL_FAT_X ;recompute all values +VAL_FAT_A: + XOR DX,DX ;clear DX for division + MOV CL,BPB_AUSZ ;CX = sectors/cluster + XOR CH,CH + DIV CX ;whole number of clusters in AX + ADD DX,0FFFFH ;set carry if remainder + ADC AX,0 ;increment AX if remainder + CMP AX,MAX_FATE ;number of FAT entries too large? + JBE VAL_FAT_C ;no, continue + + MOV AX,BPB_SSZ ;pick up current sector size + CMP AX,VAL_SSZ_L ;already at largest permitted? + JE VAL_FAT_B ;yes, can't make it any larger + + SHL BPB_SSZ,1 ;double sector size + OR ERR_FLAG,ERR_SSZB ;indicate sector size adjusted + JMP SHORT VAL_FAT_X ;recompute all sizes with new BPBSSZ + +VAL_FAT_B: ;sector size is at maximum + SHL BPB_AUSZ,1 ;double allocation unit size + OR ERR_FLAG,ERR_PASS ;indicate another pass required + JMP SHORT VAL_FAT_X ;recompute values + +VAL_FAT_C: ;FAT size = 1.5 * number of clusters + MOV CX,AX ;number of clusters + SHL AX,1 ;* 2 + ADD AX,CX ;* 3 + SHR AX,1 ;* 1.5 + ADC AX,3 ;add 3 bytes for first 2 FAT entries + ;(media descriptor and FFFFH), and CY + XOR DX,DX ;clear DX for division + DIV BPB_SSZ ;FAT size/sector size + ADD DX,0FFFFH ;set carry if remainder + ADC AX,0 ;round upward + MOV BPB_FATSZ,AX ;number of sectors for 1 FAT copy +VAL_FAT_X: + RET +VAL_FAT ENDP + + +VALIDATE ENDP + + SUBTTL COPY_BPB Copy BPB to Boot Record + PAGE +;-----------------------------------------------------------------------; +; COPY_BPB copies the BIOS Parameter Block (BPB) ; +; to the VDISK Boot Record ; +;-----------------------------------------------------------------------; + ASSUME DS:CSEG +COPY_BPB PROC ;Copy BBP to Boot Record + PUSH DS + POP ES ;set ES = DS + + MOV CX,BPB_LEN ;length of BPB + MOV SI,OFFSET BPB ;source offset + MOV DI,OFFSET BOOT_BPB ;target offset + REP MOVSB ;copy BPB to boot record + RET +COPY_BPB ENDP + + SUBTTL VERIFY_EXTENDER + PAGE +;-----------------------------------------------------------------------; +; VERIFY_EXTENDER makes sure that if an Expansion Unit is ; +; installed, the memory size switches on the Extender Card ; +; are correctly set. ; +;-----------------------------------------------------------------------; + + + ASSUME DS:CSEG +EXT_P210 EQU 0210H ;write to latch expansion bus data + ;read to verify expansion bus data +EXT_P213 EQU 0213H ;Expansion Unit status + +VERIFY_EXTENDER PROC + + NOP + + MOV DX,EXT_P210 ;Expansion bus data port address + + MOV AX,5555H ;set data pattern + OUT DX,AL ;write 55H to control port + PUSH DX + POP DX + + JMP SHORT $+2 ;Let the I/O circuits catch up + IN AL,020h ;Clear the CMOS bus drivers! + + IN AL,DX ;recover data + CMP AH,AL ;did we recover the same data? + JNE VERIFY_EXTENDER_X ;if not, no extender card + + NOT AX ;set AX = 0AAAAH + OUT DX,AL ;write 0AAH to control port + PUSH DX ;load data line + POP DX ;load data line + + JMP SHORT $+2 ;Let the I/O circuits catch up + IN AL,020h ;Clear the CMOS bus drivers! + + IN AL,DX ;recover data + CMP AH,AL ;did we recover the same data? + JNE VERIFY_EXTENDER_X ;if not, no extender card + +;Expansion Unit is present. + +;Determine what the switch settings should be on the Extender Card + + INT MEM_SIZE ;get system memory size in KB in AX + ADD AX,63D ;memory size + 63K + MOV CL,6 ;2^6 = 64 + SHR AX,CL ;divide by 64 + ;AX is highest segment address + MOV AH,AL ;save number of segments + +;Read Expander card switch settings + + MOV DX,EXT_P213 ;expansion unit status + IN AL,DX ;read status + ;bits 7-4 (hi nibble) are switches + MOV CL,4 ;shift count + SHR AL,CL ;shift switches to bits 3-0 of AL + + CMP AH,AL ;do switches match memory size? + JE VERIFY_EXTENDER_X ;yes, exit normally + + OR ERR_FLAG,ERR_EXTSW ;indicate switch settings are wrong + +VERIFY_EXTENDER_X: + RET +VERIFY_EXTENDER ENDP + + SUBTTL UPDATE_AVAIL + PAGE +;-----------------------------------------------------------------------; +; UPDATE_AVAIL updates the address of the first byte in extended ; +; memory not used by any VDISK buffer ; +;-----------------------------------------------------------------------; +;If EMS is installed, we must allocate memory here and obtain the ; +;handle which we will use throughout our existance. AVAIL_LO and _HI ; +;really mean nothing to us. ; +;-----------------------------------------------------------------------; + +UPDATE_AVAIL PROC + MOV AX,BUFF_SIZE ;number of KB of VDISK buffer + + CMP EM_SW2,EMS_INSTALLED_FLAG ;AN000; Is EMS installed? + JNE USE_INT15_LOGIC ;ac006; Yes, + xor dx,dx ;an003; clear high word + div DOS_Page_Size_Word ;ac003; Calculate number of pages needed + or dx,dx ;an004; remainder? +; $if nz ;an004; yes + JZ $$IF36 + inc ax ;an004; need 1 extra page +; $endif ;an004; +$$IF36: + MOV BX,AX ;AN000; Prepare for EMS call + + MOV AH,EMS_ALLOC_PAGES ;AN000; Allocate requested pages + INT EMS_INT ;AN000; + OR AH,AH ;AN000; Was there an error allocating? + JNZ ALLOC_ERROR ;AN000; No, + MOV EMS_HANDLE,DX ;AN000; Save EMS handle for this VDISK + call EMS_Build_Handle_Name ;an000; dms; + + RET ;AN000; + ;AN000; +ALLOC_ERROR: ;AN000; + MOV ERR_FLAG,EMS_ALLOC_ERROR ;AN000; ?????? *RPS + RET ;AN000; + ;AN000; +USE_INT15_LOGIC: ;AN000; + + call Modify_CMOS_EM ;an001; dms;adjust EM for new size + + RET +UPDATE_AVAIL ENDP + + +;========================================================================= +; Modify_CMOS_EM : This routine modifies the size of extended +; memory. By modifying the size of extended +; memory other users will not have the potential +; to overlay a VDISK residing in EM. +; +; Inputs : EM_New_Size - The new size that EM will be after +; creation of this VDISK. +; Outputs : Modified data in CMOS for EM. Bytes 17h & 18h at +; port 71h. +;========================================================================= + +Modify_CMOS_EM Proc Near ;an001; dms; + + push ax ;an001; dms;save ax + call Steal_Int15 ;an001; dms;get INT 15h vector + + mov ax,word ptr cs:EM_New_Size ;an001; dms;transfer new size + mov word ptr cs:EM_KSize,ax ;an001; dms;set EM size to new size + pop ax ;an001; dms;restore ax + + ret ;an001; dms; + +Modify_CMOS_EM endp ;an001; dms; + +;========================================================================= +; EMS_Build_Handle_Name - This routine will build an EMS handle's +; name as follows: +; VDISK D: +; +; Inputs : DX - Handle to have associated name +; +; Outputs : Handle name +;========================================================================= + +EMS_Build_Handle_Name proc near ;an000; dms; + + push si ;an000; dms;save si + push cx ;an000; dms;save cx + + push ds ;an000; dms;save ds + push bx ;an000; dms;save bx + lds bx,RH_Ptra ;an000; dms;point to request header + mov ch,RH.RH0_Driv ;an000; dms;get drive number + add ch,'A' ;an000; dms;convert to drive letter + pop bx ;an000; dms;restore bx + pop ds ;an000; dms;restore ds + + mov si,offset VDISK_Name ;an000; dms;point to "VDISK " literal + mov byte ptr [si+6],ch ;an000; dms;put drive letter in string + mov byte ptr [si+7],":" ;an000; dms;colon terminate it + + mov ax,EMS_Set_Handle_Name ;an000; dms;set the handle's name + int EMS_INT ;an000; dms; + + pop cx ;an000; dms;restore cx + pop si ;an000; dms;restore si + + ret ;an000; dms; + +EMS_Build_Handle_Name endp ;an000; dms; + + SUBTTL FORMAT_VDISK + PAGE +;-----------------------------------------------------------------------; +; This Request Header is used by MOVE_VDISK to move the ; +; first few sectors of the virtual disk (boot, FAT, and ; +; Directory) into extended memory. ; +;-----------------------------------------------------------------------; + +MOVE_RH DB MOVE_RH_L ;length of request header + DB 0 ;sub unit + DB 8 ;output operation + DW 0 ;status + DQ ? ;reserved for DOS + DB ? ;media descriptor byte +MOVE_RHO DW ? ;offset of data transfer address +MOVE_RHS DW ? ;segment of data transfer address +MOVE_RHCNT DW ? ;count of sectors to transfer + DW 0 ;starting sector number +MOVE_RH_L EQU $-MOVE_RH ;length of request header + +;-----------------------------------------------------------------------; +; FORMAT_VDISK formats the boot sector, FAT, and directory of an ; +; extended memory VDISK in storage immediately following ; +; VDISK code, in preparation for moving to extended memory. ; +;-----------------------------------------------------------------------; +FORMAT_VDISK PROC ;format boot record, FATs and directory + + MOV AX,CS ;compute 20-bit address + MUL WPARA_SIZE ;16 * segment + ADD AX,OFFSET MSGEND ;+ offset + ADC DL,0 ;pick up carry + ADD AX,STACK_SIZE ;plus stack size + ADC DL,0 ;pick up carry + + DIV WPARA_SIZE ;split into segment(AX)&offset(DX) + MOV MOVE_RHS,AX ;save in Request Header for move + MOV MOVE_RHO,DX + + MOV DI,DX ;offset to DI + MOV ES,AX ;segment to ES + +;copy the boot record + + MOV SI,OFFSET BOOT_RECORD ;point to source field + MOV AX,BPB_RES ;number of reserved sectors + MUL BPB_SSZ ;* sector size = length of boot records + MOV CX,AX ;length to CX for move + REP MOVSB ;move boot record(s) + +;format the FAT(s) + + MOV CL,BPB_FATN ;number of FATs + XOR CH,CH +FORMAT_VDISK_A: ;set up one FAT + PUSH CX ;save loop counter on stack + MOV AL,BPB_MCB ;media control byte + STOSB ;store media control byte, increment DI + MOV AX,0FFFFH ;bytes 2 and 3 of FAT are 0FFH + STOSW + MOV AX,BPB_FATSZ ;number of sectors per FAT + MUL BPB_SSZ ;* sector size = length of FAT in bytes + SUB AX,3 ;less the 3 bytes we've stored + MOV CX,AX ;count to CX + XOR AX,AX + REP STOSB ;clear remainder of FAT + POP CX ;get loop counter off stack + LOOP FORMAT_VDISK_A ;loop for all copies of the FAT + +;Format the directory + + MOV SI,OFFSET VOL_LABEL ;point to volume label + MOV CX,VOL_LABEL_LEN ;length of volume directory entry + REP MOVSB ;move volume id to directory + MOV AX,DIR_ENTRY_SIZE ;length of 1 directory entry + MUL BPB_DIRN ;* number entries = bytes of directory + SUB AX,VOL_LABEL_LEN ;less length of volume label + MOV CX,AX ;CX = length of rest of directory + XOR AX,AX + REP STOSB ;clear directory to nulls + RET +FORMAT_VDISK ENDP + + SUBTTL STEAL_INT15 + PAGE +;-----------------------------------------------------------------------; +; STEAL_INT15 changes the INT 15H vector to point to this VDISK ; +; so that subsequent calls to INT15H may determine the actual ; +; size of EM after VDISK's allocation of it. ; +;-----------------------------------------------------------------------; +STEAL_INT15 PROC + PUSH DS + XOR AX,AX + MOV DS,AX ;set DS = 0 + ASSUME DS:INT_VEC + CLI ;disable interrupts + LES DI,DS:EM_VEC ;get original vector's content + MOV CS:INTV15O,DI ;save original vector + MOV CS:INTV15S,ES + MOV DS:EM_VECO,OFFSET VDISK_INT15 ;offset of new INT routine + MOV DS:EM_VECS,CS ;segment of new INT routine + STI ;enable interrupts again + POP DS ;restore DS + RET +STEAL_INT15 ENDP + + + + SUBTTL MOVE_VDISK + PAGE +;-----------------------------------------------------------------------; +; MOVE_VDISK moves the formatted boot sector, FAT, and directory ; +; into extended memory. ; +;-----------------------------------------------------------------------; + +MOVE_VDISK PROC + MOV AL,cs:BPB_FATN ;number of FAT copies + CBW ;clear AH + MUL cs:BPB_FATSZ ;number of FAT sectors + ADD AX,cs:BPB_RES ;+ reserved sectors + ADD AX,cs:DIR_SECTORS ;+ directory sectors + MOV cs:MOVE_RHCNT,AX ;store as I/O length + + MOV BX,OFFSET MOVE_RH ;DS:BX point to request header + PUSH DS ;make sure DS gets preserved + CALL INOUT ;move to extended memory + POP DS + RET +MOVE_VDISK ENDP + + SUBTTL FILL_RH Fill in Request Header + PAGE +;-----------------------------------------------------------------------; +; FILL_RH fills in the Request Header returned to DOS ; +;-----------------------------------------------------------------------; + ASSUME DS:CSEG +FILL_RH PROC ;fill in INIT Request Header fields + MOV CX,START_BUFFER_PARA ;segment end of VDISK resident code + MOV AX,PARAS_PER_SECTOR ;paragraphs per sector + MUL BPB_SECN ;* number of sectors + ADD AX,CX ;+ starting segment + MOV DX,AX ;DX is segment of end VDISK buffer + CMP EM_SW,0 ;AC000; DMS; IF EM NOT REQUESTED +; $IF NE ;AN000; DMS; EM REQUESTED + JE $$IF38 + MOV DX,CX ;AN000; DMS;END OF CODE SEGMENT ADDR +; $ENDIF ;AN000; DMS; +$$IF38: + +FILL_RH_A: ;DX is proper ending segment address + MOV AL,1 ;number of units + test CS:err_flag2,err_baddos + jnz dont_install + + TEST ERR_FLAG,ERR_SYSSZ+ERR_EXTSW ;if bypassing install + JZ FILL_RH_B ;jump if installing driver + +dont_install: + MOV DX,CS ;segment of end address + XOR AL,AL ;number of units is zero +FILL_RH_B: + PUSH DS ;preserve DS + LDS BX,RH_PTRA ;get Request Header addr in DS:BX + MOV RH.RH0_NUN,AL ;store number of units (0 or 1) + MOV RH.RH0_ENDO,0 ;end offset is always zero + MOV RH.RH0_ENDS,DX ;end of VDISK or end of buffer + MOV RH.RH0_BPBO,OFFSET BPB_PTR + MOV RH.RH0_BPBS,CS ;BPB array address + POP DS ;restore DS + RET +FILL_RH ENDP + + SUBTTL WRITE_MESSAGES and associated routines + PAGE +;-----------------------------------------------------------------------; +; WRITE_MESSAGE writes a series of messages to the standard ; +; output device showing the VDISK parameter values actually used. ; +;-----------------------------------------------------------------------; + + ASSUME DS:CSEG +WRITE_MESSAGES PROC ;display all messages + + + test cs:err_flag2,err_baddos ;AN000; + JZ DISPLAY_ALL_MESSAGES ;AN000; + RET + +DISPLAY_ALL_MESSAGES: ;AN000; No, then display messages + + PUSH DS ;preserve DS + LDS BX,RH_PTRA ;get Request Header Address + MOV CL,RH.RH0_DRIV ;get drive code + ADD CL,'A' ;convert to drive letter + POP DS ;restore DS + + MOV AX,VDISK_TITLE ;AN000; 'VDISK Version 3.3 virtual disk $' + LEA SI,TITLE_SUBLIST ;AN000; Specify SUBLIST to use for replacement + MOV DRIVE_CODE,CL ;AN000; Save drive code + MOV CX,ONE_REPLACE ;AN000; Notify SYSDISPMSG of 1 replacement + CALL DISPLAY_MESSAGE ;AN000; Display the message + JNC WRITE_MESSAGES_A ;AN000; Was there an error? + JMP SYSDISP_ERROR ;AN000; YES, display the extended error + +;If any of the user specified values has been adjusted, issue an +;appropriate message + +WRITE_MESSAGES_A: ;AN000; NO, + TEST ERR_FLAG,ERR_BSIZE ;was buffersize adjusted? + JZ WRITE_MESSAGES_B ;if not, skip message + + MOV AX,BUFFER_ADJUSTED ;AN000; "Buffer size adjusted",CR,LF + MOV CX,NO_REPLACE ;AN000; Notify SYSDISPMSG of no replacement + CALL DISPLAY_MESSAGE ;AN000; Display the message + +WRITE_MESSAGES_B: ;AN000; NO, + TEST ERR_FLAG,ERR_SSZ ;was sector size adjusted? + JZ WRITE_MESSAGES_C ;if not, skip message + + MOV AX,SECTOR_ADJUSTED ;AN000; "Sector size adjusted",CR,LF + MOV CX,NO_REPLACE ;AN000; Notify SYSDISPMSG of no replacement + CALL DISPLAY_MESSAGE ;AN000; Display the message + JNC WRITE_MESSAGES_C ;AN000; Was there an error? + JMP SYSDISP_ERROR ;AN000; YES, display the extended error + +WRITE_MESSAGES_C: + TEST ERR_FLAG,ERR_DIRN ;were directory entries adjusted? + JZ WRITE_MESSAGES_D0 ;if not, skip message + + MOV AX,DIR_ADJUSTED ;AN000; "Directory entries adjusted",CR,LF + MOV CX,NO_REPLACE ;AN000; Notify SYSDISPMSG of no replacement + CALL DISPLAY_MESSAGE ;AN000; Display the message + JNC WRITE_MESSAGES_D0 ;AN000; Was there an error? + JMP SYSDISP_ERROR ;AN000; YES, display the extended error + +WRITE_MESSAGES_D0: + TEST ERR_FLAG,ERR_ESIZE ;was transfer size adjusted? + JZ WRITE_MESSAGES_D ;if not, skip message + + MOV AX,TRANS_ADJUSTED ;AN000; "Transfer size adjusted",CR,LF + MOV CX,NO_REPLACE ;AN000; Notify SYSDISPMSG of no replacement + CALL DISPLAY_MESSAGE ;AN000; Display the message + JNC WRITE_MESSAGES_D ;AN000; Was there an error? + JMP SYSDISP_ERROR ;AN000; YES, display the extended error + +WRITE_MESSAGES_D: + TEST ERR_FLAG,ERR_SWTCH ;was an invalid switch character found? + JZ WRITE_MESSAGES_E ;if not, skip message + + MOV AX,INVALID_SW_CHAR ;AN000; "Invalid switch character",CR,LF + MOV CX,NO_REPLACE ;AN000; Notify SYSDISPMSG of no replacement + CALL DISPLAY_MESSAGE ;AN000; Display the message + JNC WRITE_MESSAGES_E ;AN000; Was there an error? + JMP SYSDISP_ERROR ;AN000; YES, display the extended error + +WRITE_MESSAGES_E: + TEST ERR_FLAG,ERR_SYSSZ ;is system size too small to install? + JZ WRITE_MESSAGES_F ;if not, bypass error message + + MOV AX,VDISK_NOT_INST ;AN000; "VDISK not installed - " + MOV CX,NO_REPLACE ;AN000; Notify SYSDISPMSG of no replacement + CALL DISPLAY_MESSAGE ;AN000; Display the message + MOV AX,SYS_TOO_SMALL ;AN000; "Insufficient memory",CR,LF + CALL DISPLAY_MESSAGE ;AN000; Display the message + JNC WRITE_MESSAGES_RET ;AN000; Was there an error? + JMP SYSDISP_ERROR ;AN000; YES, display the extended error +WRITE_MESSAGES_RET: + RET ;skip messages showing adjusted sizes + +WRITE_MESSAGES_F: + TEST ERR_FLAG,ERR_EXTSW ;extender card switches wrong? + JZ WRITE_MESSAGES_G ;if not, bypass error message + + MOV AX,VDISK_NOT_INST ;AN000; "VDISK not installed - " + MOV CX,NO_REPLACE ;AN000; Notify SYSDISPMSG of no replacement + CALL DISPLAY_MESSAGE ;AN000; Display the message + MOV AX,EXTEND_CARD_WRONG ;AN000; "Extender Card switches",CR,LF,"do not match system memory size",CR,LF,CR,LF + CALL DISPLAY_MESSAGE ;AN000; Display the message + JNC WRITE_MESSAGES_RET ;AN000; Was there an error? + JMP SYSDISP_ERROR ;AN000; YES, display the extended error + +WRITE_MESSAGES_G: ;display adjusted size messages + MOV AX,BUF_SZ ;AN000; "Buffer size: %1 KB",CR,LF + LEA SI,BUF_SZ_SUBLIST ;AN000; Specify SUBLIST to use for replacement + MOV CX,ONE_REPLACE ;AN000; Notify SYSDISPMSG of 1 replacement + CALL DISPLAY_MESSAGE ;AN000; Display the message + JC SYSDISP_ERROR ;AN000; + + MOV AX,SEC_SZ ;AN000; "Sector size: %1",CR,LF + LEA SI,SEC_SZ_SUBLIST ;AN000; Specify SUBLIST to use for replacement + CALL DISPLAY_MESSAGE ;AN000; Display the message + JC SYSDISP_ERROR ;AN000; + + MOV AX,DIR_ENTRIES ;AN000; "Directory entries: %1",CR,LF + LEA SI,DIR_ENT_SUBLIST ;AN000; Specify SUBLIST to use for replacement + CALL DISPLAY_MESSAGE ;AN000; Display the message + JC SYSDISP_ERROR ;AN000; + + CMP CS:EM_SW,0 ;extended memory ? + JE END_LINE ; + MOV AX,TRANS_SZ ;AN000; "Transfer size: %1",CR,LF,CR,LF + LEA SI,TRANS_SZ_SUBLIST ;AN000; Specify SUBLIST to use for replacement + CALL DISPLAY_MESSAGE ;AN000; Display the message + JC SYSDISP_ERROR ;AN000; + + +END_LINE: + RET ;return to INIT_P1 + +SYSDISP_ERROR: + + push ds ;an006; dms;save ds + push bx ;an006; dms;save bx + lds bx,cs:RH_Ptra ;an006; dms;point to request header + mov RH.RH0_Flag,-1 ;an006; dms;signal BIO and error occurred + pop bx ;an006; dms;restore bx + pop ds ;an006; dms;restore ds + + ;AN000; Set error conditions + MOV BX,NO_HANDLE ;AN000; Write to NO_HANDLE + MOV CX,NO_REPLACE ;AN000; + MOV DH,EXT_ERR_CLASS ;AN000; + MOV DL,NO_INPUT ;AN000; + + PUSH DS ;AN000;SET UP ADDRESSIBILITY TO MSG + PUSH ES ;AN000; + + PUSH CS ;AN000;TRANSFER CS + POP DS ;AN000; TO DS + PUSH CX ;AN000;TRANSFER CS + POP ES ;AN000; TO ES + + ASSUME DS:CSEG,ES:CSEG ;AN000; + CALL GET_PARM_SEGMENT ;AN000;OBTAIN PARM SEGMENT + + CALL SYSDISPMSG ;AN000; + + POP ES ;AN000;RESTORE REG + POP DS ;AN000;RESTORE REG + ASSUME DS:NOTHING,ES:NOTHING ;AN000; + + RET ;AN000; + +WRITE_MESSAGES ENDP + + +DISPLAY_MESSAGE PROC NEAR + ;AN000; Set default values + MOV BX,NO_HANDLE ;AN000; Output handle is NO_HANDLE + MOV DH,UTILITY_MSG_CLASS ;AN000; Utility class message + MOV DL,NO_INPUT ;AN000; No input is requested + PUSH DS ;AN000;SET UP ADDRESSIBILITY TO MSG + PUSH ES ;AN000; + + PUSH CS ;AN000;TRANSFER CS + POP DS ;AN000; TO DS + PUSH CS ;AN000;TRANSFER CS + POP ES ;AN000; TO ES + + ASSUME DS:CSEG,ES:CSEG ;AN000; + CALL GET_PARM_SEGMENT ;AN000;OBTAIN PARM SEGMENT + + CALL SYSDISPMSG ;AN000; + + POP ES ;AN000;RESTORE REG + POP DS ;AN000;RESTORE REG + ASSUME DS:NOTHING,ES:NOTHING ;AN000; + + RET ;AN000; + +DISPLAY_MESSAGE ENDP + +GET_PARM_SEGMENT PROC ;AN000;OBTAIN PARM SEGMENT + + PUSH CX ;AN000;SAVE CX - WE STOMP IT + PUSH SI ;AN000;SAVE SI - WE STOMP IT + + CMP CX,00H ;AN000;SEE IF REPLACEMENT IS REQUIRED + JE GPS_END ;AN000;END IF ZERO + + GPS_CONTINUE: ;AN000;LOOP CONTINUE + + MOV [SI].SL_SEGMENT,DS ;AN000;SET UP SEGMENT + ADD SI,11 ;AN000;INCREASE SI BY TABLE SZ + + LOOP GPS_CONTINUE ;AN000;CONTINUE LOOP IF CX NOT ZERO + + GPS_END: ;AN000;EXIT POINT + + POP SI ;AN000;RESTORE SI + POP CX ;AN000;RESTORE CX + + RET ;AN000;RETURN TO CALLER + +GET_PARM_SEGMENT ENDP ;AN000; + + + + +INIT_P1 ENDP ;end of INIT part one +.xlist +MSG_SERVICES ;AN000: +MSG_SERVICES ;AN000; +MSG_SERVICES ;AN000; +MSG_SERVICES ;AN000; +.list +MSGEND LABEL BYTE ;AN000; + +CSEG ENDS + END + \ No newline at end of file diff --git a/v4.0/src/DEV/VDISK/VDISKSYS.INC b/v4.0/src/DEV/VDISK/VDISKSYS.INC new file mode 100644 index 0000000..c9a6c30 --- /dev/null +++ b/v4.0/src/DEV/VDISK/VDISKSYS.INC @@ -0,0 +1,37 @@ +EMS_STATUS EQU 40H +EMS_GET_NUM_PAGES EQU 42H +EMS_ALLOC_PAGES EQU 43H +EMS_MAP_HANDLE EQU 44H +EMS_VERSION EQU 46H +EMS_SAVE_STATE EQU 4F00H +EMS_RESTORE_STATE EQU 4F01H +EMS_SET_HANDLE_NAME EQU 5301H +EMS_FRAME_SEG EQU 5800H +EMS_INT EQU 67H +EMS_VERSION_LEVEL EQU 40H +EMS_2F_Handler EQU 1Bh + +EMS_Mem EQU 'X' ;an005; dms; +EM_Mem EQU 'E' ;an005; dms; + +EMS_EXPECTED_VERSION EQU 34H +EMS_LOW_ERROR EQU 80H +EMS_INSTALLED_FLAG EQU 00h ;ac006; dms; + +EMS_ALLOC_ERROR EQU -1 ; ***RPS ?? +SINGLE_SEGMENT EQU 1 +;;;DOS_PAGE1 EQU 0FFH +;;;DOS_PAGE2 EQU 0FEH +DOS_PAGE_SZ EQU 16 +EMS_Page_Size EQU 4000h ;an002; dms; + +EM_Size_Get EQU 88h ;an001; dms; + + +GET_PAGE_FRAME_STRUC STRUC + FRAME_SEGMENT DW ? + START_PAGE DB ? + NUM_PAGE DB ? +GET_PAGE_FRAME_STRUC ENDS +BUFFER_ENTRY_SIZE EQU TYPE GET_PAGE_FRAME_STRUC + diff --git a/v4.0/src/DEV/XMA2EMS/DIAGS.ASM b/v4.0/src/DEV/XMA2EMS/DIAGS.ASM new file mode 100644 index 0000000..6c52a1c --- /dev/null +++ b/v4.0/src/DEV/XMA2EMS/DIAGS.ASM @@ -0,0 +1,1909 @@ +;-----------------------------------------------------------------------; +; DATA THAT IS UNIQUE TO THE DIAGNOSTICS PORTION OF ; +; THE DEVICE DRIVER. THIS AREA WILL NOT REMAIN PRESENT ; +; AFTER INITIALIZATION. ; +;-----------------------------------------------------------------------; +INCLUDE EMS_US.MSG + +MEM_INST DB '1' +ADDR_MODEL_BYTE DD 0F000FFFEH ;ADDRESS IN BIOS OF MODEL BYTE +MODEL DB ? ;SAVE AREA FOR MODEL +TEST_ID DB ? ;SAVE AREA FOR CURRENT TEST ID +CTRLPARM DW ? ;SAVE AREA FOR CONTROL PARM +PAGE_UNDER_TEST DW 0 ;SAVE AREA FOR PAGE UNDER TEST +CUR_SAVE DW ? ;SAVE AREA FOR NEXT AVAILABLE LINE + ;FOR MESSAGES +ACTIVE_PAGE DB ? ;ACTIVE DISPLAY PAGE +TESTABLE_SEGMENTS DW ? + + +PAGE +;-----------------------------------------------------------------------; +; EQUATES THAT ARE UNIQUE TO THE DIAGNOSTICS PORTION OF ; +; THE DEVICE DRIVER. ; +;-----------------------------------------------------------------------; +BASE_REG EQU 31A0H +DMACAPT EQU 31A8H ;I/O ADDRESS OF DMA CAPTURE REG +BLK_ON EQU 11110111B ;MASK FOR ENABLING A BLOCK +BLK_OFF EQU 00001000B ;MASK FOR INHIBITING A BLOCK +VIRT_MODE EQU 00000010B ;MASK FOR VIRTUAL MODE +REAL_MODE EQU 11111101B ;MASK FOR REAL MODE +MAX_TASK_ID EQU 15 ;MAXIMIM TASK ID +ENABLE EQU 01H ;INDICATES THAT BLOCK SHOULD BE ENABLED +TABLEN EQU 1000H ;NUMBER OF ENTRIES IN XLAT TABLE +DMAREQ1 EQU 0009H ;I/O ADDRESS OF DMA CTRL 1 REQ REG +DMAREQ2 EQU 00D2H ;I/O ADDRESS OF DMA CTRL 2 REQ REG +DMAMODE1 EQU 000BH ;I/O ADDRESS OF DMA CTRL 1 MODE REG +DMAMODE2 EQU 00D6H ;I/O ADDRESS OF DMA CTRL 2 MODE REG +PC1 EQU 0FFH ;RESERVED BYTE FOR PC1 +PC_XT EQU 0FEH ;RESERVED BYTE FOR XT +XT_AQUARIUS EQU 0FBH ;RESERVED BYTE FOR XT-AQUARIUS +AT_NMI_REG EQU 70H ;AT NMI REG +AT_NMI_OFF EQU 80H ;AT NMI OFF MASK +AT_NMI_ON EQU 00H ;AT NMI ON MASK +AT_CHCHK_EN_REG EQU 61H ;AT CH CHK ENABLE REG +AT_CHCHK_REG EQU 61H ;AT CH CHK REG +AT_CHCHK_EN EQU 0F7H ;AT CH CHK ENABLE MASK +AT_CHCHK_DIS EQU 08H ;AT CH CHK DISABLE MASK +AT_CHCHK EQU 40H ;AT CH CHK MASK +XT_NMI_REG EQU 0A0H ;XT NMI REG +XT_NMI_OFF EQU 00H ;XT NMI OFF MASK +XT_NMI_ON EQU 80H ;XT NMI ON MASK +XT_CHCHK_EN_REG EQU 61H ;XT CH CHK ENABLE REG +XT_CHCHK_REG EQU 62H ;XT CH CHK REG +XT_CHCHK_EN EQU 0DFH ;XT CH CHK ENABLE MASK +XT_CHCHK_DIS EQU 20H ;XT CH CHK DISABLE MASK +XT_CHCHK EQU 40H ;XT CH CHK MASK +ONE_MEG EQU 16 ;CONSTANT FOR ONE MEG MEMORY CARD +TWO_MEG EQU 32 ;CONSTANT FOR TWO MEG MEMORY CARD +CR EQU 0DH ;CARRIAGE RETURN +LF EQU 0AH ;LINE FEED +PRES_TEST EQU 01 ;PRESENCE TEST ID +REG_TEST EQU 02 ;REG TEST ID +AUTO_INC EQU 03 ;AUTO INC TEST ID +XLAT_TABLE_TEST EQU 04 ;TT TEST ID +LOMEM_TEST EQU 05 ;ABOVE 640K TEST ID +DMA_CAPTURE EQU 06 ;DMA CAPTURE TEST ID +PAGE_TEST EQU 07 ;PAGE TEST ID +MEM_TEST EQU 10 ;MEMORY TEST ID + + +;------------------------------------------------------------------------; +; Diagnostics...on exit if ZF=0 then error ; +;------------------------------------------------------------------------; +DIAGS PROC + + MOV CS:TEST_ID,00H ;CLEAR TEST ID BYTE + MOV CS:CTRLPARM,0100H ;SAVE CONTROL PARM + CALL GETMOD ;FIND OUT WHICH PC THIS IS + CALL CUR_POS ;GET CURSOR READY FOR MESSAGES + CALL REGTST ;TEST XMA REGISTERS + JNE FOUND_ERROR ;JUMP IF ERROR + CALL INCTST + JNE FOUND_ERROR + CALL XLATST + JNE FOUND_ERROR + CALL LOMEMTST ;TEST FOR BELOW 640K + JNE FOUND_ERROR ;JUMP IF ERROR + CALL MEMARRAY ;TEST MEMORY ABOVE 640K + JNE FOUND_ERROR ;JUMP IF ERROR + CALL PAGETST + JNE FOUND_ERROR + CALL CAPTST ;TEST DMA CAPTURE + JNE FOUND_ERROR ;JUMP IF ERROR +FOUND_ERROR: + RET +DIAGS ENDP + + + + +PAGE +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; PRESENCE TEST +; +; DESCRIPTION : This routine will determine if the XMA is in the system. +; It will also determine the amount of memory installed +; on the card in 1Meg increments (up to 4Meg). +; +; FUNCTION/ : See description +; PURPOSE +; +; ENTRY POINT : PRESTST +; +; ENTRY : The assumption is that at least 1MB of memory is installed. +; CONDITIONS If the 2nd, 3rd or 4th MB of memory is installed then the +; TOTAL_XMA_PAGES, TOTAL_PAGES, FREE_PAGES and +; MEM_INST words are Revised accordingly. +; +; +; +; EXIT : (zero flag) = 0 indicates that the XMA is not installed. +; if (zero flag) <> 0 then +; TOTAL_XMA_PAGES, TOTAL_PAGES, FREE_PAGES and +; MEM_INST words are Revised accordingly. +; +; AX,BX,CX,DX ARE DESTROYED +;------------------------------------------------------------------------- +; +PRESTST PROC +; + MOV AL,PRES_TEST + MOV CS:TEST_ID,AL + +;SAVE CONTENTS OF MODE REG + MOV DX,MODE_REG + IN AL,DX + PUSH AX + +; TRANSLATE TABLE ADDRESS AND DATA REGISTERS +; + MOV AX,0AA55H ;DATA PATTERN (IN REAL MODE) + ;BE CERTAIN MODE REG GETS + ;REAL MODE + MOV DX,MODE_REG ;I/O TO MODE REG + OUT DX,AL ;WRITE PATTERN + MOV DX,TTPOINTER + 1 ;I/O TO TT POINTER (ODD ADDR) + XCHG AL,AH ;CHRG BUS WITH INVERSE PATTERN + OUT DX,AL ;WRITE IT + MOV DX,MODE_REG + IN AL,DX ;READ BACK MODE REG + XOR AL,AH + AND AL,0FH ;MASK OFF UNUSED BITS + ;ZERO FLAG = 0 IF ERROR +END_PRES: + POP AX + PUSHF ;SAVE FLAGS + MOV DX,MODE_REG + OUT DX,AL ;RESTORE MODE REG TO INITIAL STATE + POPF ;RESTORE FLAGS + RET ;BACK TO CALLER +; +PRESTST ENDP + + + + +PAGE +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; SAVES CURSOR POSITION +; +; DESCRIPTION : This routine simply saves the cursor location +; in CS:CUR_SAVE. This cursor position +; should be used by the KB_OK routine to insure proper +; format of the screen. +; +; FUNCTION/ : See description +; PURPOSE +; +; +; ENTRY POINT : CUR_POS +; +; ENTRY : +; CONDITIONS +; +; +; EXIT : new cursor position is saved in CS:CUR_SAVE +; +; All registers are preserved +; +;------------------------------------------------------------------------- +; +CUR_POS PROC +; + PUSH AX + PUSH BX + PUSH CX + PUSH DX + PUSH SI + PUSH DI + PUSH DS ;SAVE REGISTERS +; + PUSH CS + POP DS ;GET DS TO THIS CODE SEGMENT + ;MOVE CURSOR TO NEXT AVAILABLE LINE +;IF DOS +; MOV AH,9 ;DOS PRINT STRING +; MOV DX,OFFSET NEXT_LINE + 1 ;OFFSET OF NEXT LINE MSG +; INT 21H ;DISPLAY MESSAGE +;ELSE +; MOV BX,OFFSET NEXT_LINE ;GET OFFSET OF NEXT LINE MSG +; MOV AH,0 ;TELL DCP TO DISPLAY +; INT 82H ;DISPLAY MESSAGE +;ENDIF + ; rsh001 fix scroll problem + ; and remove IF DOS crap + ;READ CURRENT VIDEO PAGE ; rsh001 + MOV AH,15 ;READ CURRENT Video Page + INT 10H ;VIDEO CALL + MOV ACTIVE_PAGE,BH ;SAVE ACTIVE PAGE + + ;READ CURRENT CURSOR POSITION + MOV AH,3 ;READ CURRENT CURSOR POS + INT 10H ;VIDEO CALL + MOV CUR_SAVE,DX ;SAVE CURSOR POSITION + + ;RESTORE ALL REGISTERS + POP DS + POP DI + POP SI + POP DX + POP CX + POP BX + POP AX ;RESTORE ALL REGISTERS + + RET ;RETURN TO CALLER + +CUR_POS ENDP + + + + + +PAGE +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; TEST FOR PRESENCE OF MORE THAN 1 MEGABYTE OF MEMORY +; +; DESCRIPTION : This routine will determine if the 2nd, 3rd or 4th MB is +; installed. Since there are no switches or other indicators +; to be tested, this test will make a "best guess" as to +; the presence of this memory. This test will roll a 0 +; and a 1 through the 1st word of the next Meg and if +; at least 1 bit is consistently good then it is assumed +; that the optional memory is installed. If successful +; then try next Meg. +; +; FUNCTION/ : See description +; PURPOSE +; +; ENTRY POINT : TRY4MEG +; +; ENTRY : none +; CONDITIONS +; +; EXIT : +; +; AX,BX,CX,DX ARE DESTROYED +;------------------------------------------------------------------------- +; +TRY4MEG PROC + +;MEMORY TEST MUST RUN IN PAGE MODE +;BEFORE CARD IS PUT INTO PAGE MODE...MUST SET UP XLAT TABLE TO PASSOVER +;RESERVED MEMORY SPACES (IE.,BIOS, DISPLAY, DISTRIBUTED ROS, ETC) +; + CALL VIRT2REAL + + MOV DX,IDREG ;I/O TO ID REGISTER + MOV AL,0 ;ID = 0 + OUT DX,AL ;SWITCH TO ID = 0 +; + ;DISABLE NMI AND ENABLE I/O CHANNEL CHECK + MOV AL,CS:MODEL ;GET SAVED MODEL BYTE + CMP AL,PC1 ;IS IT A PC1? + JE TR2M1 ;IF NO THEN TRY FOR PC_XT + CMP AL,PC_XT ;IS IT AN XT? + JE TR2M1 ;IF NO THEN TRY FOR AQUARIUS + CMP AL,XT_AQUARIUS ;IS IT AN AQUARIUS? + JE TR2M1 ;IF NO THEN USE AT NMI REGS + ;USE PC-AT NMI REGISTER + MOV DX,AT_NMI_REG ;AT's NMI REGISTER + MOV AL,AT_NMI_OFF ;MASK OFF NMI + OUT DX,AL ;OUTPUT IT + MOV DX,AT_CHCHK_EN_REG ;AT's I/O CH CHK REG + IN AL,DX ;READ IT + OR AL,AT_CHCHK_DIS ;MASK OFF I/O CH CHK ENABLE + OUT DX,AL ;WRITE IT + AND AL,AT_CHCHK_EN ;MASK ON I/O CH CHK ENABLE + OUT DX,AL ;TOGGLE CH CHK LTCH AND LEAVE + ;ENABLED + ;USE PC1, XT, AQUARIUS REGISTERS +TR2M1: + MOV DX,XT_NMI_REG ;XT's NMI REGISTER + MOV AL,XT_NMI_OFF ;MASK OFF NMI + OUT DX,AL ;OUTPUT IT + MOV DX,XT_CHCHK_EN_REG ;XT's I/O CH CHK REG + IN AL,DX ;READ IT + OR AL,XT_CHCHK_DIS ;MASK OFF I/O CH CHK ENABLE + OUT DX,AL ;WRITE IT + AND AL,XT_CHCHK_EN ;MASK ON I/O CH CHK ENABLE + OUT DX,AL ;TOGGLE CH CHK LTCH AND LEAVE + ;ENABLED +; + ;MAP FIRST 64K OF 2ND MEG INTO PC SPACE BEGINNING AT 512K +;***jnw MOV CX,3 ;LOOK FOR PRESENCE OF NEXT 3 MB IN 1MB STEPS + MOV CX,99*1024/16 ;***jnw ;LOOK FOR PRESENCE OF NEXT n MB IN 1MB STEPS + MOV AX,CS:PAGE_FRAME_STA ;SEGMENT AT PAGE FRAME +;***jnw MOV DX,256 ;BEGINNING AT 2ND MEG OF XMA + MOV DX,256+3 ;***jnw ;AT end of 16k + MOV BH,0 ;ASSIGNED TO TASK ID 0 + MOV BL,01H ;ENABLE THIS MEMORY +TR2M1A: + PUSH AX + PUSH BX + PUSH CX + PUSH DX +;***jnw MOV CX,16 ;16 * 4K = 64K BLOCK + MOV CX,1 ;***jnw ;1 * 4K = 4K BLOCK + CALL SETXLAT ;SET TRANSLATE TABLE +; + MOV AX,CS:PAGE_FRAME_STA + MOV DS,AX ;SET SEGMENT AND + MOV SI,0 ;OFFSET TO TEST + MOV BX,0000000000000001B ;ROLL 1 THROUGH WORD + MOV DX,1111111111111110B ;ROLL 0 THROUGH WORD + MOV CX,16 ;16 BITS TO TEST +TR2M2: + MOV [SI],BX ;WRITE ROLLING 1 PATTERN + LOCK MOV [SI+2],DX ;CHARGE BUS INVERSE PATTERN + LOCK MOV AX,[SI] ;READ BACK INITIAL PATTERN + AND AX,BX ;ISOLATE BIT UNDER TEST +;***jnw JZ TR2M3 ;IF ZERO TRY ANOTHER BIT + JZ quit ;IF ZERO quit ***jnw + MOV [SI],DX ;WRITE ROLLING 0 PATTERN + LOCK MOV [SI+2],BX ;CHARGE BUS INVERSE PATTERN + LOCK MOV AX,[SI] ;READ BACK INITIAL PATTERN + AND AX,BX ;ISOLATE BIT UNDER TEST + AND AX,BX ;ISOLATE BIT UNDER TEST +;***jnw JZ TR2M4 ;IF ZERO THEN FOUND GOOD BIT + Jnz quit ;IF nonzero then quit ***jnw +TR2M3: + ROL BX,1 ;ROLL 1 TO NEXT POSITION + ROL DX,1 ;ROLL 0 TO NEXT POSITION + LOOP TR2M2 ;REPEAT FOR 16 BITS + jmp tr2m4 ;all 16 bits passed test ***jnw +quit: ;***jnw +;AT THIS POINT THERE ARE NO GOOD BITS SO END SEARCH FOR NEXT MB + POP DX ;RECOVER THESES REGISTERS + POP CX + POP BX + POP AX + JMP TR2M5 ;EXIT +;AT THIS POINT WE KNOW THERE IS MEMORY IN THIS MEG THAT WAS JUST TESTED +TR2M4: +;***jnw ADD CS:MEM_INST,1 ;ADD 1 MB TO THIS FLAG +;***jnw ADD CS:TOTAL_XMA_PAGES,1024/16 ;ADD 1 MB TO THIS FLAG +;***jnw ADD CS:TOTAL_PAGES,1024/16 ;ADD 1 MB TO THIS FLAG +;***jnw ADD CS:FREE_PAGES,1024/16 ;ADD 1 MB TO THIS FLAG + ADD CS:TOTAL_XMA_PAGES,1 ;Add 16k ***jnw + ADD CS:TOTAL_PAGES,1 ;Add 16k ***jnw + ADD CS:FREE_PAGES,1 ;Add 16k ***jnw + POP DX ;RECOVER THESE REGISTERS + POP CX + POP BX + POP AX +;***jnw ADD DX,256 ;TRY NEXT MB + ADD DX,4 ;TRY NEXT 16k ***jnw + LOOP TR2M1A ;REPEAT LOOP +TR2M5: +;BEFORE NMI IS ENABLED, CLEAR PARITY CHECK LATCH ON XMA + MOV SI,0 + MOV AX,[SI] ;READ 1ST WORD OF THIS SEG + MOV [SI],AX ;WRITE BACK SAME WORD + ;THE WRITE WILL CLEAR PCHK LTCH +;PUT THE XMA CARD BACK INTO REAL MODE + MOV DX,MODE_REG ;READY FOR I/O TO MODE REG + IN AL,DX ;READ IT + AND AL,REAL_MODE ;TURN OFF VIRTUAL BIT + OUT DX,AL ;WRITE IT TO MODE REG +;CLEAR I/O CHANNEL CHECK LATCHES AND ENABLE NMI + MOV AL,CS:MODEL ;GET SAVED MODEL BYTE + CMP AL,PC1 ;IS IT A PC1? + JE TR2M6 ;USE XT REGISTERS + CMP AL,PC_XT ;IS IT AN XT? + JE TR2M6 ;USE XT REGISTERS + CMP AL,XT_AQUARIUS ;IS IT AN AQUARIUS? + JE TR2M6 ;USE XT REGISTERS +;IF NONE OF THE ABOVE THEN... +;USE AT NMI REGISTER + MOV DX,AT_CHCHK_EN_REG ;AT's I/O CH CHK REG + IN AL,DX ;READ IT + OR AL,AT_CHCHK_DIS ;MASK OFF I/O CH CHK ENABLE + OUT DX,AL ;WRITE IT + AND AL,AT_CHCHK_EN ;MASK ON I/O CH CHK ENABLE + OUT DX,AL ;TOGGLE CH CHK LTCH AND LEAVE + ;ENABLED + MOV DX,AT_NMI_REG ;AT's NMI REGISTER + MOV AL,AT_NMI_ON ;MASK ON NMI + OUT DX,AL ;OUTPUT IT +;USE XT/AQUARIUS NMI REGISTER +TR2M6: + MOV DX,XT_CHCHK_EN_REG ;XT's I/O CH CHK REG + IN AL,DX ;READ IT + OR AL,XT_CHCHK_DIS ;MASK OFF I/O CH CHK ENABLE + OUT DX,AL ;WRITE IT + AND AL,XT_CHCHK_EN ;MASK ON I/O CH CHK ENABLE + OUT DX,AL ;TOGGLE CH CHK LTCH AND LEAVE + ;ENABLED + MOV DX,XT_NMI_REG ;XT's NMI REGISTER + MOV AL,XT_NMI_ON ;MASK ON NMI + OUT DX,AL ;OUTPUT IT +; + RET ;RETURN TO CALLER + +TRY4MEG ENDP + + +PAGE +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; REGISTER TESTS +; +; DESCRIPTION : This routine will test the following subset +; of XMA registers: +; 31A0...8 bits +; 31A1...4 bits +; 31A6...4 bits +; 31A7...4 bits (BIT 1 IS HELD LOW TO DISABLE +; THE VIRTUAL MODE) +; +; The test is performed by writing and reading +; AA, 55, FF, 00 from each of the above locations. +; +; NOTE: Regs 31A6 and 31A7 should always return 0 in +; the high nibble. +; +; The remainding registers will be tested in +; subsequent routines. +; +; +; FUNCTION/ : To ensure integrity of XMA registers that will be used +; PURPOSE in subsequent routines. +; +; ENTRY POINT : REGTST +; +; ENTRY : none +; CONDITIONS +; +; EXIT : XMA registers are set to zero +; +; (zero flag) = 0 indicates an error +; (DX) failing register +; (AL) expected data XOR'ed with actual data +; +;------------------------------------------------------------------------- +; +REGTST PROC +; + MOV AL,REG_TEST + MOV CS:TEST_ID,AL + +;SAVE CONTENTS OF MODE REG + MOV DX,MODE_REG + IN AL,DX + PUSH AX + +; TRANSLATE TABLE ADDRESS AND DATA REGISTERS +; + MOV BX,0AA55H ;SET UP INITIAL DATA PATTERN + MOV AX,BX + MOV CX,BX + +R1: + MOV DX,BASE_REG ;FIRST REGISTER PAIR TO WRITE + + OUT DX,AX ;WRITE PATTERN TO REGS + ADD DX,6 ;POINT TO NEXT REG PAIR + XCHG AL,AH ;SETUP INVERSE PATTERN + AND AH,11111101B ;MASK OFF BIT 1 + OUT DX,AX ;BECAUSE AH -> 21B7 +R2: + SUB DX,6 ;POINT TO FIRST REGISTER PAIR + IN AX,DX ;READ REGISTER (21B1 -> AH) + XOR AX,BX ;DATA READ AS EXPECTED ? + AND AX,0FFFH ;MASK OFF UPPER NIBBLE OF 21B1 + JNE R_ERROR ;MISMATCH - GO TO ERROR ROUTINE + XCHG BH,BL ;NEXT PATTERN TO TEST + AND BX,0F0FH ;REGS RETURN 0 IN HI NIBBLE + ADD DX,6 ;POINT TO NEXT REGISTER PAIR + IN AX,DX ;READ IT (21B7 -> AH) + XOR AX,BX ;DATA READ AS EXPECTED ? + AND AX,0DFFH ;MASK OFF BIT 1 IN REG 21B7 + JNE R_ERROR ;MISMATCH - GO TO ERROR ROUTINE +; + CMP CH,CL ;LAST PASS ? + JE R_EXIT ;YES - THEN EXIT REG TEST +; + CMP CX,055AAH ;END OF AA55,55AA PATTERNS? + JNE R3 ; + MOV CX,000FFH ;SET UP NEXT VALUE TO WRITE + JMP R4 +R3: + CMP CX,00FFH ;END OF FF00,00FF PATTERNS? + JNE R4 ; + MOV CX,0 ;YES, THEN SET UP FOR LAST PASS +R4: + XCHG CL,CH ;SET UP INVERSE PATTERN + MOV AX,CX ;SAVE IT + MOV BX,CX ;SAVE IT +R5: + JMP R1 ;CONTINUE TILL ZERO PATTERN + +R_ERROR: +R_EXIT: + POP AX + MOV DX,MODE_REG + OUT DX,AL ;restore mode reg + RET +; +REGTST ENDP + + + + +PAGE +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; MEMORY ARRAY TEST +; +; DESCRIPTION : This routine test all 1Meg (or 2Meg) of XMA memory +; through a 64K window in PC space beginning at PF:0 +; (where PF is the Page Frame Segment) +; This module looks at TOTAL_XMA_PAGES +; to determine the memory size to be tested. +; +; (i) write the Translate Table for the 1st 64K block +; of XMA memory to be mapped into PF:0 in PC space +; (ii) test PF:0 to PF:FFFF +; (iii) if good...write Translate Table to map next 64K block +; into PF:0 +; (iv) repeat 'till all XMA memory is tested +; +; FUNCTION/ : See description +; PURPOSE +; +; +; ENTRY POINT : MEMARRAY +; +; ENTRY : +; CONDITIONS +; +; EXIT : All SMAS memory is set to zero. +; +; (zero flag) = 0 if storage error +; (AX) expected data XOR'ed with actual data +; if AX = 0 and ZF = 0 then parity error +; DS:SI point to failing location +; CS:PAGE_UNDER_TEST point failing 64k block +; +; AX,BX,CX,DX,DS,ES,SI,DI ARE DESTROYED +; +;------------------------------------------------------------------------- + +MEMARRAY PROC + + MOV AL,MEM_TEST + MOV CS:TEST_ID,AL + +;MEMORY TEST MUST RUN IN PAGE MODE + + CALL VIRT2REAL + +;INDICATE 0 KB OK + MOV DX,(640-64)/4 ;CODE FOR 640 KB OK + CALL KB_OK +;SETUP FOR TEST OF SMAS MEMORY ARRAY + MOV AX,CS:PAGE_FRAME_STA ;PAGE MEMORY FROM THIS SEGMENT + MOV ES,AX ;SET UP DEST SEG + MOV DS,AX ;SET UP SOURCE SEG + MOV BL,01H ;ENABLE THIS BLOCK OF MEMORY + MOV BH,0 ;USING ID 0 + MOV DX,(640)/4 ;STARTING BLK IN SMAS ARRAY + ;DETERMINE HOW MUCH MEMORY TO TEST + MOV CX,CS:TOTAL_XMA_PAGES ;GET NUMBER OF 16K PAGES + SHR CX,1 ;CONVERT TO NUMBER + SHR CX,1 ; OF 64K SEGMENTS + SUB CX,640/64 ;SUBTRACT OFF 1ST 640K MEMORY +;BEGIN TEST +MA1: + MOV CS:PAGE_UNDER_TEST,DX ;INDICATE WHICH 64K BLOCK + PUSH AX ;IS UNDER TEST + PUSH BX + PUSH CX + PUSH DX ;SAVE ALL REGISTERS +; + MOV CX,16 ;TEST 64K AT ONE TIME + ;16 x 4K = 64K + CALL SETXLAT ;SET UP XLAT TABLE + CALL STGTST ;TEST 64K OF STORAGE + JNZ MA2 ;WAS THERE AN ERROR + POP DX + POP CX + POP BX + POP AX ;RESTORE REGISTERS +; + PUSHF ;SAVE FLAGS FOR ADDITION + + CALL KB_OK ;INDICATE HOW MUCH + ;MEMORY HAS BEEN TESTED + + + ADD DX,16 ;POINT TO NEXT 64K BLOCK + POPF ;RESTORE FLAGS + LOOP MA1 ;LOOP FOR NEXT 64K + JMP MA3 ;EXIT WHEN COMPLETE +MA2: + POP DX + POP CX + POP BX ;BX IS POPPED TWICE + POP BX ;TO RESTORE STACK WHILE + ;MAINTAINING AX +MA3: + PUSH AX + PUSH DX + PUSHF ;SAVE THESE REGS...THEY CONTAIN + ;USEFULL ERROR INFO +;PUT THE SMAS CARD INTO REAL MODE + MOV DX,MODE_REG ;READY FOR I/O TO MODE REG + IN AL,DX ;READ IT + AND AL,REAL_MODE ;TURN OFF VIRTUAL BIT + OUT DX,AL ;WRITE IT TO MODE REG + POPF + POP DX + POP AX ;RESTORE THESE REGS + RET +; +MEMARRAY ENDP + + + + +PAGE +;--------------------------------------------------------------------- +;--------------------------------------------------------------------- +; LO MEMORY TEST +; +; DESCRIPTION : This routine tests the first 256K or 512K +; of XMA memory depending on the starting +; position of the starting address jumper on +; the card. The memory that is used to +; fill conventional memory space is not tested +; it is tested during POST and may now contain +; parts of COMMAND.COM. +; +; FUNCTION/ : See description +; PURPOSE +; +; ENTRY POINT : LOMEMTST +; +; ENTRY : +; CONDITIONS +; +; EXIT : All tested memory is set to zero +; +; (zero flag) = 0 if storage error +; (AX) = expected data XOR'ed with actual data +; if (AX)=0 and ZF=0 then parity error +; DS:SI point to failing location +; CS:PAGE_UNDER_TEST point to failing 64K block +; +; AX,BX,CX,DX,DI,SI,ES,DS ARE DESTROYED +; +;----------------------------------------------------------------------- +LOMEMTST PROC + + MOV AL,LOMEM_TEST + MOV CS:TEST_ID,AL + +;MEMORY TEST MUST RUN IN PAGE MODE + CALL VIRT2REAL + +;INDICATE 0 KB OK AT START OF TEST + MOV DX,0FFF0H ;code for initial 0 kb + CALL KB_OK + +;DETERMINE HOW MUCH MEMORY TO TEST + MOV AX,CS:START_FILL ;get starting fill segment + XCHG AH,AL + MOV CL,4 + SHR AX,CL ;convert to 64k block number + MOV CS:TESTABLE_SEGMENTS,AX ;save...this is number of 64k blocks + ;that can be tested without + ;destroying DOS +;SET UP FOR TEST OF XMA MEMORY + MOV AX,CS:PAGE_FRAME_STA ;test through page frame + MOV DS,AX ;set up ds + MOV ES,AX ;and es + MOV BL,01H ;enable this block of memory + MOV BH,0 ;using id=0 + XOR DX,DX ;start at block 0 in xma + MOV CX,640/64 ;loop counter is # 64k blocks in + ;conventional memory +LM1: + MOV CS:PAGE_UNDER_TEST,DX ;save page under test + PUSH AX + PUSH BX + PUSH CX + PUSH DX ;save these registers + + MOV CX,16 ;test 64k at one time + ;16 * 4k = 64k + CALL SETXLAT ;set translate table + CMP CS:TESTABLE_SEGMENTS,0 ;if this segment under test is used for + ;fill then read only + JG LM2 ;else do storage test + CALL READ_ONLY + JMP LM3 +LM2: + CALL STGTST +LM3: + JNZ LM4 ;jump if there was an error + POP DX + POP CX + POP BX + POP AX ;recover registers + + PUSHF ;save flags for addition + CALL KB_OK + ;indicate kb ok + ADD DX,16 ;next 64k block + DEC CS:TESTABLE_SEGMENTS ;dec testable pages + POPF ;recover flags + LOOP LM1 ;repeat for next 64k block + JMP LM5 ;exit when complete +LM4: + POP DX ;recover these registers + POP CX + POP BX ;bx is popped twice to restore + POP BX ;satck while maintaining ax +LM5: + PUSH AX ;save these ... they contain + PUSH DX ;useful error information + PUSHF +;PUT CARD BACK TO REAL MODE + MOV DX,MODE_REG ;read mode reg + IN AL,DX + AND AL,REAL_MODE ;turn off virtual bit + OUT DX,AL ;write it to mode reg + POPF + POP DX + POP AX ;restore these registers + RET + + +READ_ONLY PROC ;INTERNAL PROC TO READ MEMORY WITHOUT DESTROYING CONTENTS + XOR SI,SI ;start of segment + XOR CX,CX ;test 64k + + LODSW ;just read each byte + XOR AX,AX ;and set zf=1 for return + RET ;back to caller +READ_ONLY ENDP + +LOMEMTST ENDP + + + +PAGE +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; PAGE TEST +; +; DESCRIPTION : This routine tests that the TASK ID register is +; actually paging in unique segments of memory. +; The test is performed through the page frame segment. +; The test assumes that the memory test has already +; completed successfully. The page test procedes as +; follows: +; (i) 6-64K blocks of XMA memory are mapped into a +; 64K segment of PC space (the page frame) +; These XMA blocks are from 640k to 1024k of XMA memory. +; (ii) Each of these blocks is assigned to a unique +; task ID ranging from 0 to 5. +; (iii) For each task ID, the page frame is filled with +; a pattern that is the same as the task ID. +; (iv) The page frame is then read for each task ID +; and compared with the expected data. +; +; FUNCTION/ : +; PURPOSE +; +; ENTRY POINT : PAGETST +; +; ENTRY : NONE +; CONDITIONS +; +; EXIT : (zero flag) = 0 indicates an error +; (AL) expected data XOR'ed with actual data +; +; AX,BX,CX,DX,ES,DS,SI,DI ARE DESTROYED +;------------------------------------------------------------------------- +; +PAGETST PROC +; + MOV AL,PAGE_TEST + MOV CS:TEST_ID,AL +;MEMORY TEST MUST RUN IN PAGE MODE + CALL VIRT2REAL +;INITIALIZE TRANSLATE TABLE FOR THIS TEST + MOV AX,CS:PAGE_FRAME_STA ;SEMENT OF PAGE FRAME + MOV BL,01H ;ENABLE CODE + MOV BH,0 ;START WITH TASK ID = 0 + MOV DX,640/4 ;START WITH XMA BLOCK 160 + MOV CX,6 ;LOOP COUNT...6 TASK ID's + ;EACH TASK ID IS ASSIGNED 64K + ;FROM 640K TO 1024K +PT1: + PUSH AX + PUSH BX + PUSH CX + PUSH DX ;SAVE ALL REGISTERS +; + MOV CX,16 ;16-4K BLOCKS IN 64K + CALL SETXLAT ;SET TRANSLATE TABLE + POP DX + POP CX + POP BX + POP AX ;RECOVER ALL + INC BH ;POINT TO NEXT TASK ID + ADD DX,16 ;NEXT 64K IN XMA MEMORY + LOOP PT1 ;REPEAT FOR ALL TASK ID's +;FILL MEMORY WITH A UNIQUE PATTERN FOR EACH TASK ID + MOV CX,6 ;6 TASK ID's + MOV DX,IDREG ;READY FOR I/O TO TASK ID REG + MOV AL,0 ;START WITH ID = 0 +PT2: + PUSH AX ;SAVE ID NUMBER + PUSH CX ;SAVE ID COUNT + OUT DX,AL ;SWITCH TASK ID + MOV BX,CS:PAGE_FRAME_STA + MOV ES,BX ;SEGMENT TO 1ST 64K 0F ID + SUB DI,DI ;POINT TO 1ST LOCATION + XOR CX,CX ;WRITE ALL 64K LOCATIONS +PT2X: + STOSB + LOOP PT2X + POP CX ;RECOVER ID COUNT + POP AX ;RECOVER CURRENT ID + INC AL + LOOP PT2 ;REPEAT FOR ALL TASK ID's +;NOW CHECK THAT THERE ARE 16 UNIQUE PATTERNS IN MEMORY + MOV CX,6 ;USE 6 TASK ID's + MOV AH,0 ;START WITH ID = 0 +PT3: + MOV AL,AH ;GET TASK ID IN AL + PUSH AX + PUSH CX ;SAVE ID COUNT + OUT DX,AL ;SWITCH TASK ID + MOV BX,CS:PAGE_FRAME_STA + MOV DS,BX + MOV ES,BX ;SEGMENT AT 1ST 64K + SUB DI,DI ;POINT TO 1ST LOCATION + SUB SI,SI ;POINT TO 1ST LOCATION + XOR CX,CX ;READ ALL 64K LOCATIONS +PT3X: + LODSB + XOR AL,AH ;DATA AS EXPECTED ? + JNE PT4X ;NO - THEN EXIT + STOSB ;AL SHOULD CONTAIN 0...WRITE IT + LOOP PT3X + + POP CX ;RECOVER ID COUNT + POP AX + INC AH ;NEXT TASK ID + LOOP PT3 ;REPEAT FOR ALL TASK ID's + XOR AL,AL ;IF WE GOT THIS FAR THEN + ;NO ERRORS...SET ZF TO + ;INDICATE SUCCESS +PT4: + PUSH AX + PUSH DX + PUSHF ;SAVE THESE REGS...THEY CONTAIN + ;USEFULL ERROR INFO +;PUT THE SMAS CARD INTO REAL MODE + MOV DX,MODE_REG ;READY FOR I/O TO MODE REG + IN AL,DX ;READ IT + AND AL,REAL_MODE ;TURN OFF VIRTUAL BIT + OUT DX,AL ;WRITE IT TO MODE REG +;MAKE SURE WE EXIT WHILE IN TASK ID=0 + MOV DX,IDREG + XOR AL,AL + OUT DX,AL + + POPF + POP DX + POP AX ;RESTORE THESE REGS + RET ;RETURN TO CALLER +PT4X: + POP CX ;ALTERNATE RETURN PATH + POP AX + JMP PT4 ;TO ADJUST STACK +; +PAGETST ENDP + + +PAGE +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; DMA CAPTURE TEST +; +; DESCRIPTION : This routine is a test of the DMA capture logic. +; The test is as follows: +; (i) A bit is rolled through the second entry in the +; DMA cature register file. (The first entry is used +; for refresh on a PC-XT). +; (ii) A bit and address test is performed on the +; remainder of the register file(s). +; (iii) A test is made for the capture of both REQUEST and +; MODE registers of the DMA controller. +; (iv) DMA channel 0 is tested only on the PC-AT +; +; +; FUNCTION/ : To verify the functionality of the DMA capture logic. +; PURPOSE +; +; ENTRY POINT : CAPTST +; +; ENTRY : NONE +; CONDITIONS +; +; EXIT : Each entry in the DMA capture register file is set to 0. +; +; (zero flag) = 0 indicates an error +; '31A8'X points to failing DMA capture reg +; (AL) expected data XOR'ed with actual data +; +; AX,BX,CX,DX,SI,DI ARE DESTROYED +;------------------------------------------------------------------------- +; +; +CAPTST PROC +; + MOV AL,DMA_CAPTURE + MOV CS:TEST_ID,AL +; +;ROLL A BIT THROUGH THE SECOND ENTRY IN THE DMA CAPTURE REGISTER FILE +; + MOV BL,01H ;SET UP INITIAL PATTERN + MOV BH,01H ;SET UP DMA CHANNEL 1 + MOV DI,DMACAPT ;SAVE FOR I/O TO DMA CAPTURE REG + MOV SI,DMAREQ1 ;SAVE FOR I/O TO DMA CTRL 1 REQ REG + MOV CX,4 ;ROLL 4 BIT POSITIONS +C1: + MOV DX,IDREG ;I/O TO ID REG + MOV AL,BL ;PATTERN TO WRITE + OUT DX,AX ;SETUP ID REG WITH DATA PATTERN + MOV DX,SI ;DMA CTRL 1 + MOV AL,BH ;CHANNEL 1 + OUT DX,AL ;SETUP DMA CH 1...CAPT ID IN 2nd ENTRY + MOV DX,DI ;DMA CAPTURE REG + OUT DX,AL ;POINT TO 2nd ENTRY + IN AL,DX ;READ IT + XOR AL,BL ;DATA READ AS EXPECTED ? + JNE CAPT_ERROR ;NO - THEN ERROR + SHL BL,1 ;SHIFT BIT TO NEXT POSITION + LOOP C1 ;REPEAT +; + MOV DI,DMAREQ2 ;SETUP FOR I/O TO DMA CTRL 2 REQ REG + MOV AL,05H ;DATA PATTERN TO CAPTURE + CALL CAPT_FILL ;FILL CAPTURE REGS WITH VALUE +; + MOV AH,05H ;SETUP INITIAL PATTERN + MOV BX,0F0AH ;OTHER PATTERNS TO USE +C2: + CALL CAPT_RMW + JNZ CAPT_ERROR ;ERROR - THEN EXIT + CMP AH,BL ;ZERO PATTERN ? + JE CAPT_EXIT ;EXIT IF YES + MOV AH,BL ;SET UP + MOV BL,BH ; NEXT + MOV BH,0 ; PATTERN + JMP C2 ;REPEAT + +;NOW REPEAT TEST FOR CATPURE OF DMA MODE REGISTERS + MOV SI,DMAMODE1 ;SETUP FOR I/O TO DMA CTRL 1 MODE REG + MOV DI,DMAMODE2 ;SETUP FOR I/O TO DMA CTRL 2 MODE REG + MOV AL,05H ;DATA PATTERN TO CAPTURE + CALL CAPT_FILL ;FILL CAPTURE REGS WITH VALUE +; + MOV AH,05H ;SETUP INITIAL PATTERN + MOV BX,0F0AH ;OTHER PATTERNS TO USE +C3: + CALL CAPT_RMW + JNZ CAPT_ERROR ;ERROR - THEN EXIT + CMP AH,BL ;ZERO PATTERN ? + JE CAPT_EXIT ;EXIT IF YES + MOV AH,BL ;SET UP + MOV BL,BH ; NEXT + MOV BH,0 ; PATTERN + JMP C3 ;REPEAT +CAPT_ERROR: +CAPT_EXIT: + RET + +CAPTST ENDP + + + +PAGE + +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; FILL DMA CAPTURE REG +; +; DESCRIPTION : This routine will fill the entire DMA capture register +; file with the pattern that is passed in AL +; +; FUNCTION/ : See Description. +; PURPOSE +; +; ENTRY POINT : CAPT_FILL +; +; ENTRY : AL contains the value to be captured into +; CONDITIONS the register file. +; SI contains the address of DMA controller 1 +; DI contains the address of DMA controller 2 +; +; EXIT : Each entry in the DMA capture register file is set to +; the value specified in AL. +;------------------------------------------------------------------------- +; +CAPT_FILL PROC NEAR +; + MOV DX,IDREG + OUT DX,AL ;LOAD ID REG WITH PAT TO BE CAPTURED + MOV DX,DI ;GET ADDRESS OF CTRL 2 + MOV CX,3 ;REP FOR CHANNELS 7,6,5 +CF1: + MOV AL,CL ;CL CONTAINS WHICH DMA CHANNEL + OUT DX,AL ;SETUP & CAPTURE DMA CHANNEL + LOOP CF1 ;REPEAT +; + MOV DX,SI ;GET ADDRESS OF CTRL 1 + MOV CX,3 ;REP FOR CHANNELS 3,2,1 +CF2: + MOV AL,CL ;CL CONTAINS WHICH DMA CHANNEL + OUT DX,AL ;SETUP & CAPTURE DMA CHANNEL + LOOP CF2 ;REPEAT + ;DO CHANNEL 0 IF NOT MODEL PC1, XT, AQUARIUS + CMP CS:MODEL,PC1 ;IS THIS A PC1 ? + JE CF3 ;YES - THEN EXIT ELSE TRY PC_XT + CMP CS:MODEL,PC_XT ;IS THIS AN XT ? + JE CF3 ;YES - THEN EXIT ELSE TRY AQUARIUS + CMP CS:MODEL,XT_AQUARIUS ;IS THIS AN AQUARIUS? + JE CF3 ;YES - THEN EXIT ELSE FILL CH 0 CAPT + MOV AL,0 ;INDICATE CHANNEL 0 + OUT DX,AL ;SETUP & CAPTURE DMA CHANNEL +CF3: + RET ;RETURN TO CALLER +; +CAPT_FILL ENDP + + + + +PAGE +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; READ-MODIFY-WRITE DMA CAPTURE REG +; +; DESCRIPTION : This routine will read the a DMA capture register +; and if the correct value is found will cause a capture +; of a new value. The next DMA capture reg is read and +; the process repeated. +; +; FUNCTION/ : See Description. +; PURPOSE +; +; ENTRY POINT : CAPT_RMW +; +; ENTRY : AH contains the value to be compared +; CONDITIONS BL contains the new value to be written +; SI contains the address of DMA controller 1 +; DI contains the address of DMA controller 2 +; +; EXIT : Each entry in the DMA capture register file is set to +; the value specified in BL. +; +; AL,CX,DX,ARE DESTROYED +;------------------------------------------------------------------------- +; +CAPT_RMW PROC NEAR +; + MOV CX,3 ;REP FOR CHANNELS 7,6,5 +RMW1: + MOV DX,DMACAPT ;I/O ADDRESS OF DMA CAPTURE REG + MOV AL,CL ;GET LOW BYTE OF COUNT + ADD AL,4 ;ADD 4 TO POINT TO DMA CAPTURE + CALL RMW + JNZ RMW4 ;EXIT IF ERROR + LOOP RMW1 ;REPEAT FOR CHANNEL 6,5 +; + MOV CX,3 ;REP FOR CHANNELS 3,2,1 + PUSH DI ;SAVE DMA CTRL 2 + MOV DI,SI ;GET DMA CTRL 1 INTO DI FOR PROC RMW +RMW2: + MOV DX,DMACAPT ;I/O ADDRESS OF DMA CAPTURE REG + MOV AL,CL ;GET LOW BYTE OF COUNT + CALL RMW + JNZ RMW3 ;EXIT IF ERROR + LOOP RMW2 ;REPEAT FOR DMA CHANNELS 2,1 + ;DO CHANNEL 0 IF NOT MODEL PC1, XT, AQUARIUS + CMP CS:MODEL,PC1 ;IS THIS A PC1 ? + JE RMW3 ;YES - THEN EXIT ELSE TEST FOR PC_XT + CMP CS:MODEL,PC_XT ;IS THIS AN XT ? + JE RMW3 ;YES - THEN EXIT ELSE TEST FOR AQUARIUS + CMP CS:MODEL,XT_AQUARIUS ;IS THIS AN AQUARIUS? + JE RMW3 ;YES - THEN EXIT ELSE TEST CH 0 + MOV DX,DMACAPT ;I/O ADDRESS OF DMA CAPTURE REG + MOV CL,0 ;INDICATE CHANNEL 0 + MOV AL,CL ;ALSO INTO AL + CALL RMW +RMW3: + POP DI ;RESTORE DI (ADDR OF DMA CTRL 2) +RMW4: + RET ;RETURN TO CALLER +; +CAPT_RMW ENDP +; +RMW PROC +; + OUT DX,AL ;SETUP TO READ FROM DMA CAPTURE REG + IN AL,DX ;READ IT + XOR AL,AH ;DATA AS EXPECTED ? + JNE RMW5 ;NO THEN EXIT + ;DATA WAS GOOD---NOW GET NEXT PATTERN INTO THIS CAPTURE REG + MOV DX,IDREG ;ADDRESS OF ID REG + MOV AL,BL ;NEW PATTERN TO WRITE + OUT DX,AL ;WRITE IT TO ID REG + MOV DX,DI ;ADDRESS OF DMA CTRL 2 + MOV AL,CL ;DMA CHANNEL TO SET UP + OUT DX,AL ;SET UP DMA---THIS CAUSES CAPTURE OF ID +RMW5: + RET ;RETURN TO CALLER +; +RMW ENDP + + + + +PAGE +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; INHIBIT A BLOCK OF MEMORY +; +; DESCRIPTION : This routine will set a block of SMAS memory with +; the code to enable or inhibit it. The user simply +; specifies the starting segment and length of the block in +; PC 'real' address space that is to be enabled/inhibited. +; The appropriate entries in the Translate Table are +; written so that this specified block in 'real' address +; is enabled or protected in all 16 possible TASK ID's. +; +; +; FUNCTION/ : To enable or inhibit SMAS memory in specified areas of +; PURPOSE PC 'real'address space (ie.,diplay buffer, BIOS, +; distributed ROS...) +; +; ENTRY POINT : INHIBLK +; +; ENTRY : (AX) starting segment in PC address space to be +; CONDITIONS protected/enabled. Must be on 4K boundary else +; this routine will round UP to next 4K block. +; +; (CX) number of 4K blocks to be protected +; +; (BL) 01 = ENABLE +; 00 = INHIBIT +; +; EXIT : specified entries in Translate Table are enabled or +; inhibited for all posible task ID's. +; +; AX,BH,CX,DX ARE DESTROYED +;------------------------------------------------------------------------- +; +INHIBLK PROC +; + ;ADJUST SI FOR TRANSLATE TABLE ENTRY + XCHG AL,AH ;ROTATE RIGHT BY 8 + XOR AH,AH ;CLEAR AH + ;AX IS NOW ADJUSTED FOR ENTRY INTO + ;XLAT TABLE FOR TASK ID=0 + PUSH AX ;SAVE IT + PUSH CX ;SAVE COUNT OF 4K BLOCKS +; + MOV SI,TTDATA ;ADDRESS OF TT DATA REG + MOV DI,AIDATA ;ADDRESS OF TT DATA WITH AUTO INC + XOR BH,BH ;BH IS TASK ID +INH1: + MOV DX,TTPOINTER ;ADDRESS OF TT POINTER + POP CX ;RESTORE COUNT + POP AX ;RESTORE TT ENTRY + PUSH AX ;SAVE BOTH + PUSH CX ; OF THEM + MOV AH,BH ;APPEND TASK ID TO TT POINTER + OUT DX,AX ;SET TT POINTER TO STARTING ENTRY +INH2: + MOV DX,SI ;TT DATA REG + IN AX,DX ;READ CURRENT ENTRY + MOV DX,DI ;ADDRESS OF TT DATA WITH AUTO INC + ;DETERMINE IF ENABLE OR INHIBIT BLOCK + CMP BL,ENABLE ;WANT TO ENABLE THIS BLOCK ? + JNE INH3 ;NO - THEN DISABLE IT + AND AH,BLK_ON ;MASK OFF INHIBIT BIT + JMP INH4 +INH3: + OR AH,BLK_OFF ;MASK ON INHIBIT BIT +INH4: + OUT DX,AX ;WRITE IT THEN INC TO NEXT TT ENTRY + LOOP INH2 ;REPEAT FOR EACH BLOCK OF 4K + INC BH ;NEXT TASK ID + CMP BH,MAX_TASK_ID ;COMPLETED FOR ALL TASK ID's ? + JBE INH1 ;NO - THEN LOOP TILL DONE +INHIBLK_EXIT: + POP CX + POP AX + RET +; +INHIBLK ENDP + + + + +PAGE +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; STORAGE TEST +; +; DESCRIPTION : This routine performs a bit and address test on a +; 64K block of storage. +; +; (i) 55AA is written to each location. +; (ii) 55AA is read back +; (iii) if good, write AA55 and point to next location +; (iv) repeat step (iii) for all 64K locations +; (v) repeat steps (ii) to (iv) for AA55, FF00, 0101, 0000 +; (vi) check parity bits +; +; +; FUNCTION/ : See description +; PURPOSE +; +; ENTRY POINT : STGTST +; +; ENTRY : (ES) storage segment to be tested +; CONDITIONS (DS) storage segment to be tested +; +; EXIT : (zero flag) = 0 if storage error +; (AX) expected data XOR'ed with actual data +; if ax = 0 and zf = 0 then parity error +; DS:SI point to failing location +; +; AX,BX,CX,DX,DI,SI ARE DESTROYED +; +;------------------------------------------------------------------------- +; +STGTST PROC +; + CMP CS:WARM_START,'Y' ;is this a warm start? + JNE STG1A ;if no then do mem test + CALL CLEAR_MEM ;if yes then just clear memory + XOR AX,AX ;set zero flag + JMP STG6 ;exit + + + ;DISABLE NMI AND ENABLE I/O CHANNEL CHECK +STG1A: + MOV AL,CS:MODEL ;GET SAVED MODEL BYTE + CMP AL,PC1 ;IS IT A PC1? + JE STG1 ;IF NO THEN TRY FOR PC_XT + CMP AL,PC_XT ;IS IT AN XT? + JE STG1 ;IF NO THEN TRY FOR AQUARIUS + CMP AL,XT_AQUARIUS ;IS IT AN AQUARIUS? + JE STG1 ;IF NO THEN USE AT NMI REGS + ;USE PC-AT NMI REGISTER + MOV DX,AT_NMI_REG ;AT's NMI REGISTER + MOV AL,AT_NMI_OFF ;MASK OFF NMI + OUT DX,AL ;OUTPUT IT + MOV DX,AT_CHCHK_EN_REG ;AT's I/O CH CHK REG + IN AL,DX ;READ IT + OR AL,AT_CHCHK_DIS ;MASK OFF I/O CH CHK ENABLE + OUT DX,AL ;WRITE IT + AND AL,AT_CHCHK_EN ;MASK ON I/O CH CHK ENABLE + OUT DX,AL ;TOGGLE CH CHK LTCH AND LEAVE + ;ENABLED + ;USE PC1, XT, AQUARIUS REGISTERS +STG1: + MOV DX,XT_NMI_REG ;XT's NMI REGISTER + MOV AL,XT_NMI_OFF ;MASK OFF NMI + OUT DX,AL ;OUTPUT IT + MOV DX,XT_CHCHK_EN_REG ;XT's I/O CH CHK REG + IN AL,DX ;READ IT + OR AL,XT_CHCHK_DIS ;MASK OFF I/O CH CHK ENABLE + OUT DX,AL ;WRITE IT + AND AL,XT_CHCHK_EN ;MASK ON I/O CH CHK ENABLE + OUT DX,AL ;TOGGLE CH CHK LTCH AND LEAVE + ;ENABLED + + + + ;ROLL A BIT THROUGH THE FIRST WORD + SUB DI,DI ;FIRST LOCATION + MOV CX,16 ;ROLL 16 BITS + MOV AX,0001H ;FIRST PATTERN TO WRITE + MOV BX,AX ;SAVE IT +STG2: + MOV [DI],AX ;WRITE PATTERN + MOV [DI+2],0FFFFH ;CHARGE BUS + MOV AX,[DI] ;READ PATTERN + XOR AX,BX ;IS IT CORRECT ? + JNE STG_EXIT ;IF NO - THEN EXIT + SHL BX,1 ;SHIFT BIT + MOV AX,BX ;GET IT INTO AX + LOOP STG2 ;REPEAT +; + CLD ;FILL FORWARD + SUB DI,DI ;POINT TO FIRST LOCATION + MOV CX,8000H ;32K WORDS + MOV AX,55AAH ;INITIAL PATTERN TO WRITE + REP STOSW ;FILL ENTIRE SEGMENT +; + MOV BX,55AAH ;PATTERN TO LOOK FOR + MOV DX,0AA55H ;NEXT PATTERN TO WRITE + CALL STG_CNT + JNZ STG_EXIT ;EXIT IF ERROR +; + MOV BX,0AA55H ;PATTERN TO LOOK FOR + MOV DX,0101H ;NEXT PATTERN TO WRITE + CALL STG_CNT + JNZ STG_EXIT ;EXIT IF ERROR +; + MOV BX,0101H ;PATTERN TO LOOK FOR + MOV DX,0000H ;NEXT PATTERN TO WRITE + CALL STG_CNT + JNZ STG_EXIT ;EXIT IF ERROR +; +; MOV BX,0000H ;PATTERN TO LOOK FOR +; MOV DX,0000H ;NEXT PATTERN TO WRITE +; CALL STG_CNT +; JNZ STG_EXIT ;EXIT IF ERROR +; + ;IF TEST REACHES THIS POINT THEN MEMORY IS GOOD + ;NEED TO CHECK PARITY BITS...IF PARITY ERROR EXISTS THEN + ;CAN ASSUME BAD PARITY BIT OR BAD PARITY GENERATOR +; + MOV AL,CS:MODEL ;GET SAVED MODEL BYTE + CMP AL,PC1 ;IS IT A PC1? + JE STG3 ;USE XT REGISTERS + CMP AL,PC_XT ;IS IT AN XT? + JE STG3 ;USE XT REGISTERS + CMP AL,XT_AQUARIUS ;IS IT AN AQUARIUS? + JE STG3 ;USE XT REGISTERS + ;IF NONE OF THE ABOVE THEN... + ;USE AT NMI REGISTER + MOV DX,AT_CHCHK_REG ;AT's I/O CH CHK REG + IN AL,DX ;READ IT + AND AL,AT_CHCHK ;IS CH CHK BIT ON ? + JZ STG4 ;IF NO - THEN EXIT + MOV AX,0 ;ELSE - CLEAR AX TO INDICATE + ;PARITY ERROR + JMP STG4 ;EXIT + ;USE XT/AQUARIUS NMI REGISTER +STG3: + MOV DX,XT_CHCHK_REG ;XT's I/O CH CHK REG + IN AL,DX ;READ IT + AND AL,XT_CHCHK ;IS CH CHK BIT ON ? + JZ STG4 ;IF NO - THEN EXIT + MOV AX,0 ;ELSE - CLEAR AX TO INDICATE + ;PARITY ERROR +STG4: +STG_EXIT: + PUSH AX ;SAVE THESE REGS + PUSH DX ;THEY CONTAIN + PUSH SI + PUSHF ;USEFUL ERROR INFORMATION + ;BEFORE NMI IS ENABLED, CLEAR PARITY CHECK LATCH ON XMA + MOV SI,0 + MOV AX,[SI] ;READ 1ST WORD OF THIS SEG + MOV [SI],AX ;WRITE BACK SAME WORD + ;THE WRITE WILL CLEAR PCHK LTCH + ;CLEAR I/O CHANNEL CHECK LATCHES AND ENABLE NMI + MOV AL,CS:MODEL ;GET SAVED MODEL BYTE + CMP AL,PC1 ;IS IT A PC1? + JE STG5 ;USE XT REGISTERS + CMP AL,PC_XT ;IS IT AN XT? + JE STG5 ;USE XT REGISTERS + CMP AL,XT_AQUARIUS ;IS IT AN AQUARIUS? + JE STG5 ;USE XT REGISTERS + ;IF NONE OF THE ABOVE THEN... + ;USE AT NMI REGISTER + MOV DX,AT_CHCHK_EN_REG ;AT's I/O CH CHK REG + IN AL,DX ;READ IT + OR AL,AT_CHCHK_DIS ;MASK OFF I/O CH CHK ENABLE + OUT DX,AL ;WRITE IT + AND AL,AT_CHCHK_EN ;MASK ON I/O CH CHK ENABLE + OUT DX,AL ;TOGGLE CH CHK LTCH AND LEAVE + ;ENABLED + MOV DX,AT_NMI_REG ;AT's NMI REGISTER + MOV AL,AT_NMI_ON ;MASK ON NMI + OUT DX,AL ;OUTPUT IT + ;USE XT/AQUARIUS NMI REGISTER +STG5: + MOV DX,XT_CHCHK_EN_REG ;XT's I/O CH CHK REG + IN AL,DX ;READ IT + OR AL,XT_CHCHK_DIS ;MASK OFF I/O CH CHK ENABLE + OUT DX,AL ;WRITE IT + AND AL,XT_CHCHK_EN ;MASK ON I/O CH CHK ENABLE + OUT DX,AL ;TOGGLE CH CHK LTCH AND LEAVE + ;ENABLED + MOV DX,XT_NMI_REG ;XT's NMI REGISTER + MOV AL,XT_NMI_ON ;MASK ON NMI + OUT DX,AL ;OUTPUT IT +; + POPF + POP SI + POP DX + POP AX ;RESTORE REGS +STG6: + RET ;RETURN TO CALLER + + + +CLEAR_MEM PROC ;INTERNAL PROC TO CLEAR MEMORY + XOR DI,DI ;start of segment + XOR CX,CX ;clear entire segment + XOR AX,AX ;write zeroes + + STOSB ;just write + RET ;back to caller +CLEAR_MEM ENDP + + +STGTST ENDP + + +PAGE +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; STORAGE TEST SUBROUTINE +; +; DESCRIPTION : This routine performs a bit and address test on a +; 64K block of storage. +; +; (i) a word is read and compared against the value in (BX) +; (ii) if good the value in (DX) is written into that location +; (iii) point to next location and repeat steps (i) to (ii) +; +; +; FUNCTION/ : See description +; PURPOSE +; +; ENTRY POINT : STG_CNT +; +; ENTRY : (ES) storage segment to be tested +; CONDITIONS (DS) storage segment to be tested +; (BX) value to be compared +; (DX) new value to be written +; +; EXIT : (zero flag) = 0 if storage error +; (AX) expected data XOR'ed with actual data +; if ax = 0 and zf = 0 then parity error +; DS:SI point to failing location +;------------------------------------------------------------------------- +; +STG_CNT PROC +; + MOV CX,8000H ;32K WORDS + SUB DI,DI ;FIRST LOCATION + MOV SI,DI ;FIRST LOCATION +SC1: + LODSW ;READ OLD WORD FROM STORAGE + XOR AX,BX ;DATA AS EXPECTED ? + JNE SC2 ;IF NO - THEN EXIT + MOV AX,DX ;GET NEW PATTERN + STOSW ;WRITE IT + LOOP SC1 ;REPEAT +SC2: + RET + +STG_CNT ENDP + + + + +PAGE +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; PRINT MEMORY GOOD +; +; DESCRIPTION : This routine will print to the screen how much memory +; has been tested. +; +; The format will be: xxxx KB TESTED +; +; FUNCTION/ : See description +; PURPOSE +; +; +; ENTRY POINT : KB_OK +; +; ENTRY : (DX) = 1/4 OF GOOD MEMORY + 64K IN KB +; CONDITIONS ex: if (DX) = 16 then +; (16 * 4) + 64 = 128KB is OK +; +; NOTE: if (DX) = FFF0 then 0 KB is OK +; +; +; EXIT : Message is displayed +; +; All registers are preserved +; +;------------------------------------------------------------------------- +; +KB_OK PROC +; + PUSH AX + PUSH BX + PUSH CX + PUSH DX + PUSH SI + PUSH DI + PUSH DS ;SAVE REGISTERS +; + PUSH CS + POP DS ;GET DS TO THIS CODE SEGMENT + ;CONVERT DX TO KILO BYTES + SHL DX,1 + SHL DX,1 ;MULTIPLY BY 4 + ADD DX,64 ;ADJUST BY 64 +; + MOV AX,DX ;GET NUMBER INTO AX + MOV BX,10 ;READY FOR DECIMAL CONVERT + MOV CX,4 ;OF 4 DIGITS +K1: + XOR DX,DX ;CLEAR HI WORD OF DIVIDEND + ;AX IS LOW WORD OF DIVIDEND + DIV BX ;DIVIDE BY 10 + OR DL,30H ;MAKE MODULO INTO ASCII + PUSH DX ;SAVE IT + LOOP K1 ;REPEAT FOR ALL DIGITS +; + XOR SI,SI ;CLEAR SI + MOV CX,4 +K2: + POP AX ;ASCII DIGIT GOES INTO AL + MOV BX,OFFSET MEM_OK + MOV CS:[BX+SI],AL ;BUILD ASCII MESSAGE + INC SI + LOOP K2 + ;MOVE THE CURSOR AND PRINT MESSAGE + MOV DX,CUR_SAVE + MOV BH,ACTIVE_PAGE + MOV AH,2 ;SET CURSOR +IF DOS + INT 10H ;BIOS VIDEO CALL SET CURSOR + MOV AH,9 ;DOS PRINT STRING + MOV DX,OFFSET SIZE_MSG1 + 1 ;OFFSET OF MEM_OK MSG + INT 21H ;DISPLAY MESSAGE +ELSE + INT 85H ;SET CURSOR POSITION + + MOV BX,OFFSET SIZE_MSG1 ;GET OFFSET OF MEM_OK MSG + MOV AX,0905H ;MAGENTA MESSAGE + INT 82H ;DISPLAY MESSAGE +ENDIF + + POP DS + POP DI + POP SI + POP DX + POP CX + POP BX + POP AX ;RESTORE ALL REGISTERS + + RET ;RETURN TO CALLER + +KB_OK ENDP + + +PAGE +;-------------------------------------------------------------------- +;-------------------------------------------------------------------- +; GET MODEL BYTE +; +GETMOD PROC +;GET COPY OF MODEL BYTE INTO THIS SEGMENT +; + PUSH DS ;SAVE DS + LDS SI,ADDR_MODEL_BYTE + MOV AL,[SI] ;GET IT INTO AL + MOV CS:MODEL,AL ;SAVE IT IN THIS SEGMENT + POP DS ;RESTORE DS + RET +; +GETMOD ENDP + + + + +PAGE +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; SET TRANSLATE TABLE +; +; DESCRIPTION : This routine will write the Translate Table so that +; a specified block of PC 'real' address will be mapped +; to a specified block of SMAS physycal memory. Note that +; this routine will map only into CONTIGUOUS blocks of +; SMAS memory. PC memory is referenced by segments +; (must be on 4K boundaries) while SMAS memory is referenced +; by block number (each block is 4K). +; +; EXAMPLE: segment 4000 can be mapped to block 5 +; segment 4100 can be mapped to block 6 +; +; FUNCTION/ : To map PC 'real' addresses into SMAS physical memory. +; PURPOSE +; +; +; ENTRY POINT : SETXLAT +; +; ENTRY : (AX) starting segment in PC address space to be +; CONDITIONS mapped. Must be on 4K boundary else +; this routine will round UP to next 4K block. +; +; (CX) number of 4K blocks translated. +; +; (BH) task ID for this memory allocation +; +; (BL) 01 = ENABLE +; 00 = INHIBIT +; +; (DX) starting block number in SMAS memory +; +; +; EXIT : specified entries in Translate Table are enabled or +; inhibited for all posible task ID's. +; +; +; AX,CX,DX ARE DESTROYED +; +;------------------------------------------------------------------------- +; +SETXLAT PROC +; + ;ADJUST AX FOR TRANSLATE TABLE ENTRY + XCHG AL,AH ;ROTATE RIGHT BY 8 + MOV AH,BH ;TASK ID INTO BH + ;AX IS NOW ADJUSTED FOR ENTRY INTO + ;XLAT TABLE FOR TASK ID=(BH) + PUSH DX ;SAVE STARTING SMAS BLOCK NUMBER +; + MOV DX,TTPOINTER ;ADDRESS OF TT POINTER + OUT DX,AX ;SET TT POINTER TO STARTING ENTRY + POP AX ;GET STARTING BLOCK NUMBER INTO AX +; + MOV DX,AIDATA ;TT DATA REG WITH AUTO INC + ;DETERMINE IF ENABLE OR INHIBIT BLOCK + CMP BL,ENABLE ;WANT TO ENABLE THIS BLOCK ? + JE SETX1 ;YES - THEN SKIP THE DISABLE STEP + OR AH,BLK_OFF ;MASK ON INHIBIT BIT +SETX1: + OUT DX,AX ;WRITE IT THEN INC TO NEXT TT ENTRY + INC AX ;NEXT BLOCK OF SMAS MEMORY + LOOP SETX1 ;REPEAT FOR EACH BLOCK OF 4K +SETXLAT_EXIT: + RET +; +SETXLAT ENDP + + PAGE +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; AUTO-INCREMENT TEST +; +; DESCRIPTION : This routine will test the auto-increment of +; the Translate Table pointer. The test will procede +; in the following manner: +; (i) A basic check of the TT pointer reg is performed +; (ii) The TT pointer is initialized to '00'H +; (iii) The auto increment data reg is written +; (iv) The TT pointer is read and checked for increment +; (v) Repeat until TT pointer wraps from 'FFF'H to '000'H +; (vi) Repeat test for auto-increment for read of data reg +; +; FUNCTION/ : To ensure that the Translate Table pointer can auto +; PURPOSE increment when 31A5 is written or read. +; +; ENTRY POINT : INCTST +; +; ENTRY : NONE +; CONDITIONS +; +; EXIT : +; (zero flag) = 0 indicates an error +; (DX) failing register (ie.,TT pointer reg) +; (AX) expected data XOR'ed with actual data +;------------------------------------------------------------------------- +; +; +INCTST PROC +; + MOV AL,AUTO_INC + MOV CS:TEST_ID,AL +; +;PERFORM SIMPLE TEST OF TTPOINTER REG +; + MOV BX,0AA55H ;SET UP PATTERN TO WRITE + MOV AX,BX + MOV DX,TTPOINTER ;I/O TO TTPOINTER REG + MOV SI,TTDATA ;SAVE FOR I/O TO TTDATA + OUT DX,AX ;WRITE THE REGISTER + XCHG DX,SI ;I/O TO TTDATA REG + XCHG AH,AL ;INVERSE PATTERN + OUT DX,AX ;CHARGE BUS WITH OPPOSITE PATTERN + XCHG DX,SI ;I/O TO TTPOINTER REG + IN AX,DX ;READ TTPOINTER REG + XOR AX,BX ;READ AS EXPECTED + AND AX,0FFFH ;MASK OFF HI NIBBLE (INVALID) + JNE INC_ERROR ;NO - THEN EXIT +; +;CONTINUE WITH AUTO-INC TEST +; + MOV DI,2 ;2 PASSES...1 WRITE , 1 READ +AI1: + MOV SI,AIDATA ;SAVE FOR I/O TO TTDATA WITH AUTO-INC +AI2: + MOV CX,1000H ;TTPOINTER RANGE 0 -> FFF + MOV BX,0001H ;INITIAL COMPARE VALUE + MOV AX,0 ;SET TTPONTER TO ZERO + OUT DX,AX ;TTPOINTER IS INITIALIZED TO ZERO +AI2X: + XCHG DX,SI ;I/O TO TTDATA WITH AUTO-INC +; +;DETERMINE IF WRITE OR READ TEST +; + CMP DI,2 ;DOING A AUTO-INC WRITE TEST ? + JNE AI3 ;NO - THEN MUST BE AUTO-INC READ TEST + OUT DX,AX ;WRITE TO AUTO-INC DATA REG + JMP AI4 ;CONTINUE WITH TEST +AI3: + IN AX,DX ;READ FROM AUTO-INC DATA REG +AI4: + XCHG DX,SI ;I/O TO TTPOINTER REG + IN AX,DX ;READ TTPOINTER (31A1 -> AH) + XOR AX,BX ;DATA AS EXPECTED ? + AND AX,0FFFH ;MASK OFF UPPER NIBBLE (INVALID) + JNE INC_ERROR ;NO - GO TO ERROR + INC BX ;NEXT VALUE TO LOOK FOR + LOOP AI2X ;CONTINUE TIL ALL VALUES ARE TESTED +; + DEC DI + CMP DI,0 ;COMPLETE WITH WRITE AND READ TEST ? + JE INC_EXIT ;YES - THEN EXIT + JMP AI1 ;NO - THEN CONTINUE WITH READ TEST +; +INC_ERROR: +INC_EXIT: RET +; +INCTST ENDP + +PAGE +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; TRANSLATE TABLE TEST +; +; DESCRIPTION : This routine performs a write/read storage test +; on the Translate Table. The test is as follows: +; (i) A bit is rolled through the first word of the TT +; (ii) A bit and address test is performed on the +; remainder of the TT. +; +; FUNCTION/ : To verify the integrity of the Translate Table. +; PURPOSE +; +; ENTRY POINT : XLATST +; +; ENTRY : NONE +; CONDITIONS +; +; EXIT : Entire Translate Table is left with FFF (passover code) +; +; (zero flag) = 0 indicates an error +; (DX) failing register (TT data register) +; (AX) expected data XOR'ed with actual data +; (31A0) address in TT of failure +;------------------------------------------------------------------------- +; +XLATST PROC +; + MOV AL,XLAT_TABLE_TEST + MOV CS:TEST_ID,AL +; +;ROLL A BIT THROUGH THE FIRST BYTE +; + MOV BX,0001H ;SET UP INITIAL PATTERN + MOV SI,TTDATA ;SAVE FOR I/O TO DATA REG + MOV DX,TTPOINTER ;I/O TO TTPOINTER REG + MOV CX,12 ;ROLL 12 BIT POSITIONS + XOR AX,AX ;CLEAR AX (WRITE TO 1st TT LOCATION) + OUT DX,AX ;SET TT POINTER + XCHG DX,SI ;READY FOR I/O TO TTDATA REG +X1: + MOV AX,BX ;GET BIT PATTERN + OUT DX,AX ;WRITE BIT PATTERN TO TT + XCHG DX,SI ;READY FOR I/O TO TTPOINTER REG + XOR AX,AX ;CLEAR AX + OUT DX,AX ;CHARGE BUS WITH 0000 PATTERN + XCHG DX,SI ;READY FOR I/O TO TTDATA REG + IN AX,DX ;READ TT (31A1 -> AH) + XOR AX,BX ;DATA READ AS EXPECTED ? + AND AX,0FFFH ;MASK OFF UPPER NIBBLE (INVALID) + JNE XLA_ERROR ;NO - THEN EXIT + SHL BX,1 ;SHIFT BIT TO NEXT POSITION + LOOP X1 +; +;CONTINUE REMAINDER OF TRANSLATE TABLE +; + MOV DX,AIDATA +; + XCHG DX,SI ;READY FOR I/O TO TTPOINTER + XOR AX,AX ;CLEAR AX + OUT DX,AX ;TTPOINTER AT 1st LOCATION +; + XCHG DX,SI ;READY FOR I/O TO TT DATA W/AUTO-INC + MOV AX,0AA55H ;INITIAL DATA PATTERN + MOV CX,TABLEN ;NUMBER OF TT ENTRIES +X2: + OUT DX,AX ;SETUP INVERSE PATTERN + LOOP X2 ;FILL ENTIRE XLATE TABLE +; + MOV SI,TTDATA ;ADDRESS OF TTDATA WITHOUT INC. + MOV BX,AX ;SAVE VALUE FOR COMPARE + MOV DI,055AAH ;NEXT PATTERN TO WRITE +X3: + MOV CX,TABLEN ;NUMBER OF TT ENTRIES +X4: + XCHG DX,SI ;GET IT INTO DX...SI GETS AUTO-INC + IN AX,DX ;READ TABLE ENTRY (HI BYTE -> AH) + XOR AX,BX ;DATA READ AS EXPECTED ? + AND AX,0FFFH ;MASK OFF HI NIBBLE (INVALID) + JNE XLA_ERROR ;NO - THE EXIT + XCHG DX,SI ;GET TTDATA WITH AUTO-INC + MOV AX,DI ;RECOVER NEXT PATTERN TO WRITE + OUT DX,AX ;WRITE IT THEN INCREMENT + LOOP X4 ;REPEAT TILL TABLE FILLED + + +; + CMP DI,0FFFFH ;LAST PASS ? + JE XLA_EXIT ;YES - THEN EXIT REG TEST +; + XCHG BX,DI ;BX GETS NEXT PATTERN TO TEST +; + CMP BX,055AAH ;LAST PASS FOR AA55,55AA PATTERN? + JNE X5 ;NO + MOV DI,0FF00H ;YES- PREPARE TO WRITE NEW PATTERN + JMP X3 ;DO IT +X5: + CMP BX,0FF00H ;READY TO READ 0FF00 PATTERN + JNE X6 ;NO + MOV DI,00FFH ;YES- PREPARE TO WRITE NEW PATTERN + JMP X3 ;DO IT +X6: + MOV DI,0FFFFH ;PREPARE TO SET ALL OF TT INACTIVE + JMP X3 ;DO IT +; +XLA_ERROR: +XLA_EXIT: RET +; +XLATST ENDP diff --git a/v4.0/src/DEV/XMA2EMS/EMSINIT.INC b/v4.0/src/DEV/XMA2EMS/EMSINIT.INC new file mode 100644 index 0000000..4c2213e --- /dev/null +++ b/v4.0/src/DEV/XMA2EMS/EMSINIT.INC @@ -0,0 +1,886 @@ + +;------------------------------------------------------------------------; +; Initialization... ; +;------------------------------------------------------------------------; + +RESR_EXT_PGS DW 0 ;Ext mem reserved here after EMS taken ;an002; dms; + +MACH_MODEL_PTR DD 0F000FFFEh ;Byte in upper BIOS that indicates @RH1 +MODEL_BYTE DB (?) ; which system you are on. @RH1 +PC1 EQU 0FFh ;Values returned for: PC 1 @RH1 +PC_XT EQU 0FEh ; PC XT @RH1 +XT_AQUARIUS EQU 0FBH ; PC Aquarius @RH1 +PC_AT EQU 0FCh ; PC AT type - AT, PS/2 models @RH1 + ; 50 and 60, etc. +PS2MODEL80 EQU 0F8h ; 386 processor - PS/2 model 80 @RH1 + +INT15_SEC_MOD EQU ES:BYTE PTR [BX+3] ;Secondary model byte @RH2 +SEC_MOD_TB EQU 4 ; PS/2 Model 50 @RH2 +SEC_MOD_RR EQU 5 ; PS/2 Model 60 @RH2 + +START_BACMEM_SEG DW 0 ;Starting and ending segment addrs +END_BACMEM_SEG DW 0 ; of memory backed by the XMA card + +INIT_ERR DW ? ;Initialization error flag @RH4 +NO_ERROR EQU 0 ; @RH4 +ERROR EQU 1 ; @RH4 + ;Ŀ + ; Device driver IOCTL call declares + ; +EMULATOR_DD_NAME DB '386XMAEM',0 ;Device driver names for the Emulator +XMAAVIRT_DD_NAME DB 'INDXMAII',0 ; and WSP's XMA/A init code +DD_FILE_HANDLE DW ? ;File handle from opening either DD + +REQ_PACKET_STRUC STRUC ;Generic IOCTL parameter packet +PACKET_LEN DW 4 ;Packet length (in bytes) +PACKET_FCN DW 0 ;DD defined function number +PACKET_WORD DW 0 ;Data area +REQ_PACKET_STRUC ENDS + +REQ_PACKET REQ_PACKET_STRUC <> ; + + +INIT PROC + + PUSH CS + POP DS ;Get this segment into CS + + MOV DX,SS ;save stack segment + MOV CX,SP ;save stack pointer + CLI ;ints off during swap + MOV AX,CS ;move cs to ss + MOV SS,AX ;through ax + MOV SP,OFFSET TOP_OF_STACK ;sp to end of code + STI ;ints back on + PUSH DX ;save old ss on new stack + PUSH CX ;save old sp on new stack + + + MOV DX,OFFSET WELCOME_MSG ;Print title and copy-right + MOV AH,9 ; + INT 21H + + push ax ;save affected regs ;an000; dms; + push bx ; ;an000; dms; + push cx ; ;an000; dms; + push dx ; ;an000; dms; + push si ; ;an000; dms; + push di ; ;an000; dms; + push ds ; ;an000; dms; + + CALL GET_PARMS ;Get the user parameters + + pop ds ;restore affected regs ;an000; dms; + pop di ; ;an000; dms; + pop si ; ;an000; dms; + pop dx ; ;an000; dms; + pop cx ; ;an000; dms; + pop bx ; ;an000; dms; + pop ax ; ;an000; dms; + + JE PARMS_OK + PUSH CS + POP DS + MOV DX,OFFSET PARM_ERR_MSG ;Print message indicating + MOV AH,9 ; parameter error using + INT 21H ; DOS function call + MOV DX,OFFSET NOT_INSTL_MSG ;Print that the EMS driver + MOV AH,9 ; has not been installed + INT 21H ; + JMP GENERAL_FAILURE ;indicate general failure +PARMS_OK: + + ;Ŀ + ; Does the system use the XMA Emulator? + ; (PS/2 model 80 with 80386 processor) + ; + PUSH DS ; @RH1 + LDS SI,MACH_MODEL_PTR ; DS:SI points to model descriptor @RH1 + MOV AL,DS:BYTE PTR [SI] ; byte (F000:FEEE) @RH1 + MOV MODEL_BYTE,AL ; @RH1 + POP DS ; @RH1 + + CMP MODEL_BYTE,PS2MODEL80 ;If the model byte is for a @RH7 + JE FIND_EMULATOR ; PS/2 model 80 @RH7 + JMP NOT_PS2MODEL80 ; then attempt to open the 80386 @RH7 +FIND_EMULATOR: ; XMA Emulator device driver @RH7 + MOV AX,3D00h ; (INDXMAEM.SYS) @RH7 + LEA DX,EMULATOR_DD_NAME ; @RH7 + INT 21h ;No carry means open successful @RH7 + JNC EMUL_INSTALLED ; and the DD is present @RH7 + PUSH CS ;Else open failed @RH7 + POP DS ;Print message indicating @RH7 + MOV DX,OFFSET NO_EMUL_MSG ; emulator not present @RH7 + MOV AH,9 ;dos prt string @RH7 + INT 21H ;write message @RH7 + MOV DX,OFFSET NOT_INSTL_MSG ;Print that the EMS driver @RH7 + MOV AH,9 ; has not been installed @RH7 + INT 21H ; @RH7 + JMP GENERAL_FAILURE ;indicate general failure @RH7 +EMUL_INSTALLED: ;Emulator is present @RH7 + MOV DD_FILE_HANDLE,AX ;Do IOCTL to find # of XMA blocks @RH7 + MOV BX,AX ;Emulator DD handle in BX @RH7 + MOV AX,440Ch ;Handle generic IOCTL fcn code @RH7 + XOR CH,CH ;CH = 0 means "unknown" @RH7 + MOV CL,60h ;CL = 40h means set device info @RH7 + PUSH CS ; = 60h means get device info @RH7 + POP DS ; @RH7 + LEA DX,REQ_PACKET ;DS:DX -> generic IOCTL packet @RH7 + INT 21h ;Issue the generic IOCTL @RH7 + JNC EMUL_VER_GOOD ;No carry means the right @RH7 + PUSH CS ; version of the Emulator was @RH7 + POP DS ; installed (can handle IOCTL) @RH7 + MOV DX,OFFSET WRONG_EMUL_MSG ;Otherwise print message @RH7 + MOV AH,9 ; indicating incorrect version @RH7 + INT 21H ; of the Emulator detected @RH7 + MOV DX,OFFSET NOT_INSTL_MSG ;Print that the EMS driver @RH7 + MOV AH,9 ; has not been installed @RH7 + INT 21H ; @RH7 + JMP GENERAL_FAILURE ;indicate general failure @RH7 +EMUL_VER_GOOD: + MOV AX,REQ_PACKET.PACKET_WORD ;Get the last available XMA block@RH7 + INC AX ; number from the emulator...add 1 @RH7 + XOR DX,DX ; to calc total XMA blocks and @RH7 + DIV BLOCKS_PER_PAGE ; convert it to EMS pages @RH7 + MOV TOTAL_SYS_PAGES,AX ;Set the number of total 16K pages @RH7 + MOV TOTAL_EMS_PAGES,AX ; (before and after mem backing) @RH7 + MOV FREE_PAGES,AX ; and the pages free for useage @RH7 + MOV START_BACMEM_SEG,0 ;Mark from 0-640K as taken to @RH7 + MOV END_BACMEM_SEG,0A000h ; back conventional memory and @RH7 + CALL BACK_CONV_MEM ; adjust TOTAL_EMS_PAGES @RH7 + MOV AX,3E00h ;Close the XMA Emulator device @RH7 + MOV BX,DD_FILE_HANDLE ; driver @RH7 + MOV MEMCARD_MODE,EMUL_VIRT ;Set flag for hardware used @RH7 + INT 21h ; @RH7 + JMP INT_67_INSTALL ;Install int 67 vector, end init @RH7 + ;Ŀ +NOT_PS2MODEL80: ; Does the system use the XMA\A or XMO card? + ; (PS/2 models 50 and 60) + ; + CMP MODEL_BYTE,PC_AT ;If the model byte is for an 'AT' @RH2 + JE MODEL_AT ; type (80286 processor), check @RH2 + JMP FAMILY_1_MACH ; the secondary model byte to @RH2 +MODEL_AT: ; see if it's a model that uses @RH2 + MOV AH,0C0h ; the XMA/A or XMO card @RH2 + INT 15h ; @RH2 + CMP INT15_SEC_MOD,SEC_MOD_TB; @RH2 + JNE NOT_PS2MODEL50 ; @RH2 + MOV NUM_OF_SLOTS,4 ; PS2/50 has 4 adapter slots @RH2 + JMP PS2_5060 ; Init for XMA/A and XMO @RH2 +NOT_PS2MODEL50: ; @RH2 + CMP INT15_SEC_MOD,SEC_MOD_RR;If 'AT' but not PS/2 50 or 60, @RH2 + JE IS_PS2MODEL60 ; then family 1 (uses XMA 1 card) @RH2 + JMP FAMILY_1_MACH ; @RH2 +IS_PS2MODEL60: + MOV NUM_OF_SLOTS,8 ;PS2/60 has 8 adapter slots @RH2 + ;Ŀ +PS2_5060: ; Machine is a PS/2 Model 50 (TB) or 60 (RR). + ; Check for the Workstation Program's XMA/A + ; virtual mode device driver (INDXMAA.SYS). If + ; present, use only that card in virtual mode. + ; + MOV AX,3D00h ;Attempt to open WSP's XMA/A @RH6 + LEA DX,XMAAVIRT_DD_NAME ; virtual mode device driver @RH6 + INT 21h ;Carry means open failed and the @RH6 + JC PS2_5060_REAL ; DD is not present. Use XMA/A @RH6 + ; in real mode and XMO card. @RH6 +INDXMAA_INSTALLED: ;Else driver found. XMA/A virtual @RH6 + MOV DD_FILE_HANDLE,AX ;Do IOCTL to find # of XMA/A blks @RH6 + MOV BX,AX ;INDXMAA.SYS DD handle in BX @RH6 + MOV AX,440Ch ;Handle generic IOCTL fcn code @RH6 + XOR CH,CH ;CH = 0 means "unknown" @RH6 + MOV CL,60h ;CL = 40h means set device info @RH6 + PUSH CS ; = 60h means get device info @RH6 + POP DS ; @RH6 + LEA DX,REQ_PACKET ;DS:DX -> generic IOCTL packet @RH6 + INT 21h ;Issue the generic IOCTL @RH6 + JNC XMAA_VER_GOOD ;No carry means the right @RH6 + PUSH CS ; version of the XMAA DD was @RH6 + POP DS ; installed (can handle IOCTL) @RH6 + MOV DX,OFFSET WRONG_XMAA_MSG ;Otherwise print message @RH6 + MOV AH,9 ; indicating incorrect version @RH6 + INT 21H ; of the XMAA DD detected @RH6 + MOV DX,OFFSET NOT_INSTL_MSG ;Print that the EMS driver @RH6 + MOV AH,9 ; has not been installed @RH6 + INT 21H ; @RH6 + JMP GENERAL_FAILURE ;indicate general failure @RH6 +XMAA_VER_GOOD: + MOV AX,REQ_PACKET.PACKET_WORD ;Get the last available XMA/A blk@RH6 + INC AX ; number from the XMA/A DD...add 1 @RH6 + XOR DX,DX ; to calc total XMA/A blocks and @RH6 + DIV BLOCKS_PER_PAGE ; convert it to EMS pages @RH6 + MOV TOTAL_SYS_PAGES,AX ;Set the number of total 16K pages @RH6 + MOV TOTAL_EMS_PAGES,AX ; (before and after mem backing) @RH6 + MOV FREE_PAGES,AX ; and the pages free for useage @RH6 + MOV START_BACMEM_SEG,0 ;Mark from 0-640K as taken to @RH6 + MOV END_BACMEM_SEG,0A000h ; back conventional memory and @RH6 + CALL BACK_CONV_MEM ; adjust TOTAL_EMS_PAGES @RH6 + MOV AX,3E00h ;Close the XMA/A virtual mode @RH6 + MOV BX,DD_FILE_HANDLE ; device driver @RH6 + INT 21h ; @RH6 + MOV MEMCARD_MODE,XMAA_VIRT ;Set hardware flag to XMAA virtual @RH6 + JMP INT_67_INSTALL ;Install int 67 vector,end init @RH6 + + ;Ŀ +PS2_5060_REAL: ; PS/2 Model 50 or 60 without XMA/A virtual DD. + ; Use XMA/A card in real mode (Bank ID reg + ; not used) or XMO card. + ; + CALL INIT_MOD_50_60 ;Init for XMA/A and XMO @RH2 + CMP INIT_ERR,ERROR ;If no error then install the @RH2 + JE PS2_5060_ERROR ; int 67 vector, print msgs @RH2 + JMP INT_67_INSTALL ; @RH2 +PS2_5060_ERROR: + ;Else error in intialization @RH2 + PUSH CS ; + POP DS ; + MOV AH,9 ; Barf out 1st part of msg @RH2 + INT 21H ; set by subproc (DX = ptr) @RH2 + MOV DX,OFFSET NOT_INSTL_MSG ;Print that the EMS driver @RH2 + MOV AH,9 ; has not been installed @RH2 + INT 21H ; @RH2 + JMP GENERAL_FAILURE ;indicate general failure @RH2 + + +FAMILY_1_MACH: ;Family 1 machine (pre-PS/2) + mov rom_scan_type,family1 ; set flag for rom scan code - gga + MOV START_BACMEM_SEG,04000h ;Memory is backed from 256K to + MOV END_BACMEM_SEG,0A000h ; 640K on XMA 1 card + CALL PRESTST ;Insure XMA 1 card is present + JE XMA1_FOUND ;Zero flag = 1 means XMA 1 found + PUSH CS ;Else error..get this segment + POP DS ;into ds + MOV DX,OFFSET NOT_FOUND_MSG ;Print message for cannot + MOV AH,9 ; find adapter + INT 21H ;write message + MOV DX,OFFSET NOT_INSTL_MSG ;Print that the EMS driver + MOV AH,9 ; has not been installed + INT 21H ; + JMP GENERAL_FAILURE ;indicate general failure +XMA1_FOUND: + MOV MEMCARD_MODE,XMA1_VIRT ;Indicate an XMA 1 card present @RH2 + CALL TRY4MEG ;determine the size of the XMA memory card + + PUSH CS + POP DS + MOV DX,OFFSET DGS_START_MSG ;start of diagnostics message + MOV AH,9 ;dos prt string + INT 21H ;starting diagnostics message + CALL CUR_POS ;save cursor position for KB OK msg + + MOV DX,MODE_REG ;determine if this is a warm start + IN AL,DX ;read mode reg + AND AL,WARM_MASK ;isolate warm start bit + JZ DO_XMA1DIAG ;If off perform full XMA 1 diags + MOV CS:WARM_START,'Y' ;Else warm start..limited diags +DO_XMA1DIAG: + CALL XMA1DIAGS ;Perform XMA 1 diagnostics + JE XMA1_OK ;Zero flag set means all OK + PUSH CS ;Else error..get this segment + POP DS ;into ds + MOV DX,OFFSET XMA1_ERR_MSG ;'XMA001 Adapter error' + MOV AH,9 ;dos prt string + INT 21H ;write message + MOV DX,OFFSET NOT_INSTL_MSG ;Print that the EMS driver + MOV AH,9 ; has not been installed + INT 21H ; + JMP GENERAL_FAILURE ;indicate general failure +XMA1_OK: + PUSH CS ;get this segment + POP DS ;into ds + MOV DX,OFFSET DGS_END_MSG ;start of message + MOV AH,9 ;dos prt string + INT 21H ;write message + +;Set XMA in virtual mode to look like it was in real mode + CALL VIRT2REAL +;Mark pages used on XMA card to back conventional memory + CALL BACK_CONV_MEM + + +;Set up interrupt 67 vector +INT_67_INSTALL: +;------------------------ +; added by GGA +;------------------------ +;------------------------------------------------------------------- + call romscan ; just for grins + jc ROM_Scan_Fail ; error - prompt user to hit any key ;an000; dms; + jmp Skip_Pars ; continue load of XMA2EMS ;an000; dms; + +ROM_Scan_Fail: + + PUSH CS ;set up addressibility ;an000; dms; + POP DS ; ;an000; dms; + MOV DX,OFFSET Prompt_Msg ;Press any key to continue... ;an000; dms; + MOV AH,9 ;dos prt string ;an000; dms; + INT 21H ; + + mov ah,07h ;keyboard input without ECHO ;an000; dms; + int 21h ;wait until input ;an000; dms; + jmp General_Failure ; +;------------------------------------------------------------------- +skip_pars: +;------------------------ +; end of adds by GGA +;------------------------ + + CALL INIT_PAL ;Initialize the Page Allocation @RH8 + ; linked List RH8 + CALL STEAL_INT67 ; + + + + + ;Ŀ + ; Initialize the entries in the Page Allocation List + ; + MOV CX,TOTAL_SYS_PAGES + + +;write variables into message string + PUSH CS ;get this segment + POP ES ;into es + MOV DI,OFFSET CONV_PAGES ;ascii string for numb fill pgs + MOV AX,END_BACMEM_SEG ;upper limit of fill + SUB AX,START_BACMEM_SEG ;minus lower start of fill + MOV CL,10 + SHR AX,CL ;convert to number 16k blocks + CALL CNVDECAT + + MOV DI,OFFSET RES_PAGES ;ascii string for pinta reserved pages + MOV AX,STARTING_BLOCK ;number of 4k pages res for pinta + SHR AX,1 + SHR AX,1 ;convert to 16k pages + CALL CNVDECAT + + MOV DI,OFFSET EMS_PAGES ;ascii string available ems pages + MOV AX,FREE_PAGES ;free pages + CALL CNVDECAT + + MOV DI,OFFSET PF_START ;ascii string page frame + MOV AX,PAGE_FRAME_STA ;page frame + CALL CNVHEXAT + +;gga MOV DX,OFFSET PAGE_FRAME_MSG ;start of message +;gga MOV AH,9 ;dos prt string +;gga INT 21H ;status msg1 + + CMP STARTING_BLOCK,0 +; $IF A + JNA $$IF117 + MOV DX,OFFSET RESERVE_MSG ;start of message + MOV AH,9 ;dos prt string + INT 21H ;status msg2 +; $ENDIF +$$IF117: + +;gga MOV DX,OFFSET AVAIL_MSG ;start of message +;gga MOV AH,9 ;dos prt string +;gga INT 21H ;status msg3 + +;indicate that the card has been tested + MOV DX,MODE_REG + IN AL,DX ;read mode reg + OR AL,WARM_MASK ;turn on warm start bit + OUT DX,AL ;write it back + + call Calc_INT15_Space ;calculate remaining INT 15h space ;an000; dms; + call Steal_INT15 ;hook INT 15h ;an000; dms; + call Steal_Int13 ;hook INT 13h ;an004; dms; + + JMP COMMON_EXIT_PATH + + +GENERAL_FAILURE: + + LDS BX,CS:RH_PTRA ;ELSE ... + MOV AX,STAT_GENFAIL ;INDICATE A GENERAL FAILURE + MOV RH.RHC_STA,AX ;WRITE IT TO RH STATUS +;------------------------ +; adds by GGA +;------------------------ + xor ax,ax ; zero segment and offset + mov rh.rh0_endo,ax ; offset of ending addr + push cs + pop ax + mov rh.rh0_ends,ax ; segment of ending addr + + mov rh.rh0_err,0ffh ; error flag for DOS + + mov rh.rh0_nun,al ; = 0 causes installation failure + + jmp skip_size +;------------------------ +COMMON_EXIT_PATH: +;move cursor to next line so other messages are clear + PUSH CS ;get cs + POP DS ;into ds + MOV DX,OFFSET NEXT_LINE + 1 ;get offset of string + MOV AH,9 ;dos print string + INT 21H + + LDS BX,CS:RH_PTRA ;ADDRESSABILITY INTO RH + MOV AX,OFFSET RESIDENT + STACK_SIZE + 100H + MOV RH.RH0_ENDO,AX ;OFFSET OF ENDING ADDR + PUSH CS + POP AX + MOV RH.RH0_ENDS,AX ;OFFSET OF ENDING ADDR + +skip_size: ; gga + + POP CX ;recover old ss + POP DX ;recover old sp + CLI ;ints off during swap + MOV SP,CX ;restore old sp + MOV SS,DX ;restore old ss + STI ;ints back on + + + RET +INIT ENDP + +;-----------------------------------------------------------------------; +; STEAL_INT67 changes the INT 67H vector to point to this ; +; Memory Manager to field subsequent calls. ; +;-----------------------------------------------------------------------; +STEAL_INT67 PROC + PUSH DS + XOR AX,AX + MOV DS,AX ;set DS = 0 + ASSUME DS:INT_VEC + CLI ;disable interrupts + LES DI,DS:EMS_VEC ;get addressing into vector + MOV DS:EMS_VECO,OFFSET EMS_INT67 ;offset of new INT routine + MOV DS:EMS_VECS,CS ;segment of new INT routine + STI ;enable interrupts again + POP DS ;restore DS + RET +STEAL_INT67 ENDP + +;-----------------------------------------------------------------------; +; VIRT2REAL puts the XMA into 'virtual' mode with the translate ; +; table written such that memory is mapped just as it was ; +; in 'real' mode. (Either 256-640k or 512-640k reamains fixed ; +; for all ID's) ; +; ; +; all registers are preserved ; +; ; +;-----------------------------------------------------------------------; +VIRT2REAL PROC + PUSH AX + PUSH BX + PUSH CX + PUSH DX + PUSH DS ;save these registers + + PUSH CS ;get this segment + POP DS ;into ds +;inhibit all of XMA memory before going into virtual mode + XOR AX,AX ;start at segment 0 + XOR BL,BL ;inhibit + MOV CX,1024/4 ;all 4k blocks in pc space + CALL INHIBLK +;now map virtual mode to look like real mode + MOV AX,START_BACMEM_SEG ;starting 'fill' segment + MOV DX,AX ;get it into dx + XCHG DH,DL ;and shr 8 to convert it to 4k block # + XOR BH,BH ;start at task ID=0 + MOV BL,1 ;enable + MOV CX,16 ;do for all 16 task ID's +; $DO +$$DO119: + PUSH AX ;save these + PUSH CX ;because they are + PUSH DX ;destroyed by call + MOV CX,160 ;640K = 160*4K blocks + SUB CX,DX ;minus starting 4K block + ;is # 4K blocks to map for this ID + CALL SETXLAT ;write trans table accordingly + POP DX ;recover these registers + POP CX + POP AX + INC BH ;next ID +; $ENDDO LOOP + LOOP $$DO119 + + MOV DX,MODE_REG + IN AL,DX ;read mode reg + OR AL,VIRT_MODE ;turn on virtual bit + OUT DX,AL ;write it back + + POP DS ;restore these registers + POP DX + POP CX + POP BX + POP AX + RET +VIRT2REAL ENDP + + +include romscan.inc ; code to do romscan for hole location/verification +INCLUDE PARMPARS.INC ;Routines to parse the parameters + ; on the CONFIG.SYS line + +;Ŀ +; Subprocedure: BACK_CONV_MEM +; +; Purpose: Called when a portion of the XMA card is used to back +; conventional memory. This is the case on an XMA 1 +; card (256K - 640K disabled on planar) and on the +; XMA/A card when WSP's XMA/A initialization device +; driver has disabled the planar. +; This procedure will mark the Page Allocation List for +; these entries with an ASCII value (for debugging) that +; is above the range of eligible pointer values. +; At the time this proc is called the PAL has not been +; initialized. Initialization will skip these entries. +; +; +BACK_CONV_MEM PROC + MOV AX,END_BACMEM_SEG ;upper segment of backed memory + SUB AX,START_BACMEM_SEG ;subtract seg of backed memory start + MOV CL,10 ;conver # of segments to # of 16 K + SHR AX,CL ; pages used for fill (div by 1024) + SUB TOTAL_EMS_PAGES,AX ;subtract from total EMS pages + ; (but not from TOTAL_SYStem_PAGES) + SUB FREE_PAGES,AX ;subtract from free EMS pages + MOV CX,AX ;Put # of backing pages into CX + PUSH CX ; and save it on stack + + MOV AX,START_BACMEM_SEG ;Convert the segment value for the + MOV CL,10 ; start of backed memory to its + SHR AX,CL ; corresponding page number + MOV DX,TYPE PAGE_ALLOC_LIST ; then convert to the correct @RH8 + MUL DX ; entry in the page alloc list @RH8 + MOV SI,AX ; store PAL offset into SI + POP CX ;recover loop counter for # backed +;mark these pages used in page list but do not assign a handle +BACK_MEM_PAL: + MOV PAGE_LIST_ENTRY,BACMEM_ALLOC ;Mark the PAL with ascii @RH8 + ADD SI,TYPE PAGE_ALLOC_LIST ;Next entry in PAL @RH8 + LOOP BACK_MEM_PAL + ;Remove code here that used to reserve pages for + ; WSP by reading a value on the CONFIG.SYS line. + ; Instead, WSP will make an IOCTL call for the + ; number of pages it needs. +BACK_CONV_MEM ENDP + +;Ŀ +; Subprocedure: INIT_PAL +; +; Purpose: This subprocedure will link the Page Allocation List. +; The head pointer to the list of available pages +; (PAL_FREE_PTR) is initialized to the top EMS page, +; and all available pages are linked from top to bottom. +; All free pages will initially be contiguous, except on +; an XMA 1 system. With XMA 1, 256-640K on the card is +; used to back conventional memory. The free list will +; skip around these pages (pages 16 to 40). +; +; +INIT_PAL PROC + push cs ;set up addressibility ;an000; dms; + pop ds ; ;an000; dms; + + cmp Total_EMS_Pages,0 ;any pages? ;an000; dms; + je Init_Pal_End ;no - exit ;an000; dms; + + mov ax,Total_Sys_Pages ;top of EMS pages = ;an000; dms; + add ax,Resr_Ext_Pgs ; total EMS pages + ;an000; dms; + dec ax ; rsv ext. pages - 1 ;an000; dms; + + + mov si,ax ;ptr to free page ;an000; dms; + shl si,1 ;make an index ;an000; dms; + mov Page_List_Entry,Pal_Null ;set last entry to null ;ac007; dms; + shr si,1 ;convert to ptr value ;an007; dms; + mov di,si ;place in di ;an007; dms; + + dec ax ;next page ;an000; dms; + mov cx,Total_EMS_Pages ;loop for all entries ;an000; dms; + dec cx ; but the last ;an000; dms; + +INIT_PAL_LP: + + cmp cx,0 ;at end? ;an000; dms; + je Init_Pal_Loop_Exit ;yes - exit ;an000; dms; + + mov si,ax ;ptr to next page ;ac007; dms; + shl si,1 ;make an index ;ac007; dms; + cmp Page_Alloc_List[si],BacMem_Alloc ;backfilled memory? ;ac007; dms; + jne Init_Pal_Entry ;no - set up ptr's ;an000; dms; + dec ax ;yes - next ptr value ;an000; dms; + jmp Init_Pal_LP ;keep on looping ;an000; dms; +INIT_PAL_ENTRY: + mov Page_List_Entry,di ;set up ptr value ;ac007; dms; + mov di,si ;next ptr value ;ac007; dms; + shr di,1 ;make a ptr value ;an007; dms; +INIT_PAL_BOT: + dec ax ;get next ptr value ;an000; dms; + dec cx ;dec loop counter ;an000; dms; + jmp INIT_PAL_LP ;continue looping ;an000; dms; + +Init_Pal_Loop_Exit: + mov Pal_Free_Ptr,di ;init free ptr ;an007; dms; + +INIT_PAL_END: + ret ;return to caller ;an000; dms; +INIT_PAL ENDP + +;-----------------------------------------------------------------------; +; This routine will convert a number in (AX) to a ; +; 4 byte ascii string equivalent to a 4 digit decimal ; +; number and write it at the address pointed to ; +; by ES:DI. Leading zeroes are suppressed. ; +; ; +; On entry: (AX) = number to be converted ; +; ES:DI= address where string is to be written ; +; ; +; On exit: all registers are preserved ; +; ; +;-----------------------------------------------------------------------; + +CNVDECAT PROC + + PUSH AX + PUSH CX + PUSH DX + PUSH DI ;save these registers + + MOV CX,4 ;loop counter 4 digits +; $DO +$$DO152: + XOR DX,DX ;clear hi word of dividend + ;ax is low word of dividend + DIV CS:TEN ;divide by 10 + OR DL,30H ;make modulo into ascii digit + PUSH DX ;put it on stack +; $ENDDO LOOP ;repeat for all 4 digits + LOOP $$DO152 + + MOV CX,4 ;recover 4 digits from stack +; $DO +$$DO154: + POP AX ;recover next most sign digit + CMP AL,'0' ;is it a '0' +; $IF NE + JE $$IF155 + PUSH AX ;back on stack for next loop + JMP LEAD_DIGIT ;if not then we found leading non zero +; $ENDIF +$$IF155: +; $ENDDO LOOP ;else continiue til non zero found + LOOP $$DO154 +LEAD_DIGIT: +; $IF NCXZ ;only if cx is non zero + JCXZ $$IF158 +; $DO +$$DO159: + POP AX ;recover next digit + MOV ES:BYTE PTR [DI],AL ;write it to string + INC DI ;point to next byte +; $ENDDO LOOP ;repeat for all digits + LOOP $$DO159 +; $ENDIF +$$IF158: + + POP DI ;recover these registers + POP DX + POP CX + POP AX + + RET ;return to caller +CNVDECAT ENDP + + + +;-----------------------------------------------------------------------; +; This routine will convert a number in (AX) to a ; +; 4 byte ascii string equivalent to a 4 digit hexadecimal ; +; number and write it at the address pointed to ; +; by ES:DI. Leading zeroes are suppressed. ; +; ; +; On entry: (AX) = number to be converted ; +; ES:DI= address where string is to be written ; +; ; +; On exit: all registers are preserved ; +; ; +;-----------------------------------------------------------------------; + +DEC2ASCII DB '0123456789ABCDEF' + + +CNVHEXAT PROC + + PUSH AX + PUSH BX + PUSH CX + PUSH DX + PUSH DI ;save these registers + PUSH DS + + PUSH CS + POP DS + + MOV BX,OFFSET DEC2ASCII + MOV CX,4 ;loop counter 4 digits +; $DO +$$DO162: + XOR DX,DX ;clear hi word of dividend + ;ax is low word of dividend + DIV SIXTEEN ;divide by 10 + + PUSH AX ;save quotient + MOV AX,DX ;get modulo into ax + XLAT DEC2ASCII ;convert al to ascii + MOV DX,AX ;get it into dx + POP AX ;recover quotient + PUSH DX ;put ascii modulo on stack +; $ENDDO LOOP ;repeat for all 4 digits + LOOP $$DO162 + + MOV CX,4 ;recover 4 digits from stack +; $DO +$$DO164: +;gga POP AX ;recover next most sign digit +;gga CMP AL,'0' ;is it a '0' +; $IF NE +;gga JE $$IF165 +;gga PUSH AX ;back on stack for next loop +;gga JMP CNVH1 ;if not then we found leading non zero +; $ENDIF +$$IF165: +; $ENDDO LOOP ;else continiue til non zero found +;gga LOOP $$DO164 +CNVH1: +; $IF NCXZ ;only if cx is non zero + JCXZ $$IF168 +; $DO +$$DO169: + POP AX ;recover next digit + MOV ES:BYTE PTR [DI],AL ;write it to string + INC DI ;point to next byte +; $ENDDO LOOP ;repeat for all digits + LOOP $$DO169 +; $ENDIF +$$IF168: + + POP DS + POP DI ;recover these registers + POP DX + POP CX + POP BX + POP AX + + RET ;return to caller +CNVHEXAT ENDP + +;-----------------------------------------------------------------------; +; STEAL_INT15 changes the INT 15H vector to point to this EMS' ; +; so that subsequent calls to INT15H may determine the actual ; +; size of EM after EMS' allocation of it ; +;-----------------------------------------------------------------------; +STEAL_INT15 PROC + PUSH DS + push ax + + CMP MODEL_BYTE,PS2MODEL80 ;If a PS2/80 treat as XMA memory ;an000; dms; + je Steal_INT15_Exit ;do not hook INT15h ;an000; dms; + + CMP MODEL_BYTE,PC_AT ;If the model byte is for an 'AT' @RH2 + jne Steal_INT15_Hook ; type (80286 processor), check @RH2 + + MOV AH,0C0h ; the XMA/A or XMO card @RH2 + INT 15h ; @RH2 + CMP INT15_SEC_MOD,SEC_MOD_TB; @RH2 + JE Steal_INT15_Hook ; @RH2 + + CMP INT15_SEC_MOD,SEC_MOD_RR;If 'AT' but not PS/2 50 or 60, @RH2 + JE Steal_INT15_Hook ; then family 1 (uses XMA 1 card) @RH2 + JMP Steal_INT15_Exit ; @RH2 + +Steal_INT15_Hook: + + XOR AX,AX + MOV DS,AX ;set DS = 0 + ASSUME DS:INT_VEC15 + CLI ;disable interrupts + LES DI,DS:EM_VEC ;get original vector's content + MOV CS:INTV15O,DI ;save original vector + MOV CS:INTV15S,ES + MOV DS:EM_VECO,OFFSET XMA_INT15 ;offset of new INT routine + MOV DS:EM_VECS,CS ;segment of new INT routine + STI ;enable interrupts again + +Steal_INT15_Exit: + + pop ax + POP DS ;restore DS + RET +STEAL_INT15 ENDP + + +;-----------------------------------------------------------------------; +; Calc_INT15_Space calculates the remaining extended memory for ; +; the system. This value will be used by all subsequent calls ; +; to function 88h, INT 15h. ; +;-----------------------------------------------------------------------; +Calc_INT15_Space proc near ;an000; dms; + + push ax ;save regs ;an000; dms; + push bx ; ;an000; dms; + push cx ; ;an002; dms; + push dx ; ;an000; dms; + + mov ah,EM_Size_Get ;get extended mem ;an000; dms; + int 15h ; ;an000; dms; + + mov cl,4 ;divide by 16 ;an002; dms; + shr ax,cl ; to get page count ;an002; dms; + + sub ax,cs:Total_Sys_Pages ;new extended mem size ;an002; dms; + xor dx,dx ;get K count ;an002; dms; + mov bx,cs:Sixteen ; ;an002; dms; + mul bx ; ;an002; dms; + mov word ptr cs:EM_Ksize,ax ;save new size ;an000; dms; + + pop dx ;restore regs ;an000; dms; + pop cx ; ;an002; dms; + pop bx ; ;an000; dms; + pop ax ; ;an000; dms; + + ret + +Calc_INT15_Space endp ;an000; dms; + + +;-----------------------------------------------------------------------; +; STEAL_INT13 changes the INT 13H vector to point to this EMS' ; +; so that subsequent calls to INT13H may properly handle DMA ; +; to EMS pages. ; +;-----------------------------------------------------------------------; +Steal_Int13 PROC ;an004; dms; + PUSH DS ;an004; dms; + push ax ;an004; dms; + + CMP MODEL_BYTE,PS2MODEL80 ;If not a PS2/80 don't hook INT 13h ;an004; dms; + jne Steal_INT15_Exit ; ;an004; dms; + + XOR AX,AX + MOV DS,AX ;set DS = 0 + ASSUME DS:INT_VEC13 + CLI ;disable interrupts + LES DI,DS:DK_VEC ;get original vector's content + MOV CS:INTV13O,DI ;save original vector + MOV CS:INTV13S,ES + MOV DS:DK_VECO,OFFSET I13_Handler ;offset of new INT routine + MOV DS:DK_VECS,CS ;segment of new INT routine + STI ;enable interrupts again + +Steal_INT13_Exit: + + pop ax + POP DS ;restore DS + RET +STEAL_INT13 ENDP diff --git a/v4.0/src/DEV/XMA2EMS/EMS_US.MSG b/v4.0/src/DEV/XMA2EMS/EMS_US.MSG new file mode 100644 index 0000000..72100b8 --- /dev/null +++ b/v4.0/src/DEV/XMA2EMS/EMS_US.MSG @@ -0,0 +1,110 @@ +LF EQU 0AH ;ASCII line feed +CR EQU 0DH ;ASCII carriage return + +CRLF DB CR,LF ; gga used to skip a blank line + db '$' + +WELCOME_MSG DB 'XMA2EMS: Expanded Memory Manager' + DB CR,LF + DB '(c)Copyright 1988 Microsoft Corporation All rights reserved' + DB CR,LF + DB '$' + +DGS_START_MSG DB CR,LF + DB 'Performing XMA diagnostics: ' + DB '$' + +DGS_END_MSG DB CR,LF + DB 'Diagnostics completed ' + DB CR,LF,LF + DB '$' + +PAGE_FRAME_MSG DB 'Page Frame starts at........................ ' +PF_START DB 'XXXX' + DB ':0' + DB CR,LF + DB 'Pages mapped to conventional memory......... ' +CONV_PAGES DB '0 ' + DB CR,LF + DB '$' +RESERVE_MSG DB 'Pages reserved for 3270 PC Control Program.. ' +RES_PAGES DB '0 ' + DB CR,LF + DB '$' +AVAIL_MSG DB 'Pages available for expanded memory......... ' +EMS_PAGES DB '0 ' + DB CR,LF + DB '$' + +XMA1_ERR_MSG DB CR,LF + DB 'Adapter error ' + DB CR,LF + DB '$' + +NOT_FOUND_MSG DB CR,LF + DB 'Cannot find adapter ' + DB CR,LF + DB '$' + +PARM_ERR_MSG DB CR,LF + DB 'Parameter syntax or value error ' + DB CR,LF + DB '$' + +NO_EMUL_MSG DB CR,LF + DB 'Cannot find XMA Emulator device driver ' + DB CR,LF + DB '$' + +WRONG_EMUL_MSG DB CR,LF + DB 'Incorrect version of XMAEM.SYS ' + DB CR,LF + DB '$' + +WRONG_XMAA_MSG DB CR,LF + DB 'Incorrect version of INDXMAA.SYS ' + DB CR,LF + DB '$' + +REQ_EMS_ERR_MSG DB CR,LF + DB 'Too many EMS pages requested in /X parameter ' + DB CR,LF + DB '$' + +NOT_INSTL_MSG DB 'Expanded Memory Manager has NOT been installed' + DB CR,LF + DB '$' + +CONFLICT_MSG DB 'Specified page address conflicts with installed adapter at address ' +CONFL_ADDRESS DB '0 ' + DB CR,LF + DB '$' + +HOLE_MSG DB 'Possible 16KB page available at address ' +HOLE_ADDRESS DB '0 ' + DB CR,LF + DB '$' + +FRAME_MSG DB CR,LF + DB 'Possible 64KB frame available at address ' +FRAME_ADDRESS DB '0 ' + DB CR,LF + DB '$' + +NO_PAGES_MSG DB 'No page addresses specified' + DB CR,LF + DB '$' + + +SIZE_MSG1 DB SIZE1_END - 2 -$ +MEM_OK DB 4 DUP (?) + DB ' KB OK$' +SIZE1_END EQU $ + +NEXT_LINE DB NXT_LN_END - 2 -$ + DB ' ',CR,LF,'$' +NXT_LN_END EQU $ + +Prompt_Msg db 'Press any key to continue . . .',CR,LF + db '$' + diff --git a/v4.0/src/DEV/XMA2EMS/GENIOCTL.INC b/v4.0/src/DEV/XMA2EMS/GENIOCTL.INC new file mode 100644 index 0000000..1580fce --- /dev/null +++ b/v4.0/src/DEV/XMA2EMS/GENIOCTL.INC @@ -0,0 +1,167 @@ + +GENERIC_IOCTL_P PROC +;͸ +; This routine handles the Generic IOCTL call. The EMS device driver +; provides an interface through the Generic IOCTL call to allocate pages +; for the Workstation Program. Since WSP needs memory off the 'bottom' of +; the XMA card in order to bank switch memory, an IOCTL call is needed to +; mark these pages as allocated in the Page Allocation Table. +; +; The pages for EMS are taken from the linked Page Allocation List. +; The PAL is initialized from top down, meaning pages that correspond to +; the highest physical addresses on the card are at the beginning of the +; free list. Therefore, WSP needs to get the pages from the end of the +; free list. +; +; Programs may load before WSP and allocate and deallocate pages. +; This will work fine for WSP, since these pages will come from the 'top' +; using the standard function 43 allocate call. It will even work if +; an application allocates these bottom pages and then deallocates to +; the EMS pool, since the deallocated pages are returned to the top of +; the free list and linked in reverse order. The allocates and deallocates +; must, however, occur in a stack (LIFO) order or problems will arise. +; For example, suppose the system has 30 EMS pages. Handle A allocs +; 20 pages that come from the 'top' of the memory card. Handle B then +; allocs the bottom 10. Handle A goes counter to LIFO order and deallocs +; its 20. WSP then issues this generic IOCTL call asking for 20 pages. +; The pages are available, but they are not from the bottom physical +; blocks on the card. For this we return error code '91'x (see below). +; +; The call from WSP's loader will be function 0. No other functions are +; supported at this time. If an error is encountered, the return code +; is set in the request packet, but not the device driver header. The +; header error is set by previous versions of the EMS driver that didn't +; handle the IOCTL. +; +;Ĵ +; On entry: ES:BX -> Device driver request header +; +; The IOCTL code will set standard EMS return codes in the packet's function +; field on exit. These include: +; '00'x - Good - Requested pages reserved for WSP +; '80'x - Software malfunction in EMS software +; '84'x - Function code passed is not defined +; '87'x - Insufficient total pages to satisfy request +; '88'x - Insufficient free pages to satisfy request +; '89'x - 0 pages requested +; '90'x - Parameter list has an invalid length (Not an EMS return code) +; '91'x - Allocated pages do not correspond to +; the 'bottom' blocks of XMA memory (Not an EMS return code) +; +;; + +GIP EQU ES:[DI] ;Pointer to the Generic IOCTL packet @RH6 + +GEN_IOCTL_PARM STRUC ; @RH6 +GIO_PLEN DW ? ; Length of the parameter list @RH6 +GIO_FCNRC DW ? ; Function code on call, ret code on ret +GIO_WSPP DW ? ; Number of pages to reserve for WSP @RH6 +GEN_IOCTL_PARM ENDS ; + +GENERIC_IOCTL: ; @RH6 + PUSH ES ;Save pointer to the request header + PUSH BX + LES DI,RH.RH19_RQPK ;Point ES:DI to the Generic IOCTL @RH6 + ; request packet @RH6 + PUSH CS ;Set addressability to our data @RH6 + POP DS ; @RH6 + XOR AH,AH ;Init upper half of user's ret code @RH6 + ;Ŀ + ; First insure the parameter list is long enough + ; to input the number of pages needed by WSP + ; + CMP GIP.GIO_PLEN,4 ;If the length is 4 bytes then OK @RH6 + JE GIO_FCN_CHK ;Else give invalid len ret code @RH6 + MOV AL,90h ; and error exit @RH6 + JMP GIP_EXIT ; @RH6 + ;Ŀ + ; Check for function code 0 (only one available) +GIO_FCN_CHK: ; + CMP GIP.GIO_FCNRC,0 ; @RH6 + JE GIO_REQNOT0_CHK ; @RH6 + MOV AL,EMS_CODE84 ; @RH6 + JMP GIP_EXIT ; @RH6 + ;Ŀ + ; Parm list is OK. Attempt to reserve WSP pages. +GIO_REQNOT0_CHK: ; + MOV BX,GIP.GIO_WSPP ;BX = requested WSP pages @RH6 + CMP BX,0 ;Check that request was not 0 @RH6 + JNE GIO_NOT0 ; @RH6 + MOV AL,EMS_CODE89 ; @RH6 + JMP GIP_EXIT ; @RH6 + +GIO_NOT0: ; @RH6 + CMP BX,TOTAL_EMS_PAGES ;Check for enough total pages @RH6 + JNA GIO_OKTOTAL ; @RH6 + MOV AL,EMS_CODE87 ; @RH6 + JMP GIP_EXIT ; @RH6 + + ;Note: section is not reentrant. It is possible RH8 + ; that between the time FREE_PAGES is loaded and RH8 + ; then changed, an EMS allocate or deallocate RH8 + ; could occur and hose this up. However, since RH8 + ; WSP is loading at this point, it is unlikely. RH8 +GIO_OKTOTAL: + CLI ;Don't allow other alloc or deall @RH8 + CMP BX,FREE_PAGES ;Check for enough free pages @RH6 + JNA GIO_REMOVE_FREE ; If not enough pages free then @RH6 + MOV AX,FREE_PAGES ; return number of free in parm @RH6 + STI ; list and set ret code @RH8 + MOV GIP.GIO_WSPP,AX ; @RH6 + MOV AL,EMS_CODE88 ; @RH6 + JMP GIP_EXIT ; @RH6 + + ;Ŀ + ; Remove WSP pages from the end of the free list + ; +GIO_REMOVE_FREE: + SUB FREE_PAGES,BX + MOV CX,FREE_PAGES + MOV SI,PAL_FREE_PTR + STI + SHL SI,1 + + CMP CX,0 ;WSP LEAVE NOTHING FREE? + JNE GIO_GET_LAST_FREE ;YES SET FREE PTR TO NULL + MOV PAL_FREE_PTR,PAL_NULL + JMP SHORT GIO_MARK_WSP + + +GIO_GET_LAST_FREE: + DEC CX + CMP CX,0 + JE GIO_GOT_LAST_FREE +GIO_LAST_FREE_LOOP: + MOV SI,PAGE_LIST_ENTRY ;BASED OFF SI + SHL SI,1 + LOOP GIO_LAST_FREE_LOOP + + +GIO_GOT_LAST_FREE: + MOV AX,PAGE_LIST_ENTRY ;STORE OFFSET FOR 1ST WSP + MOV PAGE_LIST_ENTRY,PAL_NULL ;THEN MAKE IT END OF FREE LIST + MOV SI,AX ;RESTORE 1ST WSP (TOP) + SHL SI,1 + +GIO_MARK_WSP: + MOV CX,BX ;LOOPR FOR WSP PAGES +GIO_WSP_LOOP: + MOV AX,PAGE_LIST_ENTRY ;STORE INDEX OF NEXT + MOV PAGE_LIST_ENTRY,WSP_ALLOC ;MARK AS WSP + MOV SI,AX ;RESTOER INEX OF NEXT + SHL SI,1 + LOOP GIO_WSP_LOOP + + XOR AX,AX ;Set good return code + +GIP_EXIT: ;GGA + + MOV GIP.GIO_FCNRC,AX ;Store ret code in user's req packet + POP BX ;Restore for ptr to request header @RH6 + POP ES ; @RH6 + MOV RH.RHC_STA,STAT_DONE ; Store done status and good return@RH6 + ; code into request header @RH6 + RET +GENERIC_IOCTL_P ENDP + + \ No newline at end of file diff --git a/v4.0/src/DEV/XMA2EMS/I13HOOK.INC b/v4.0/src/DEV/XMA2EMS/I13HOOK.INC new file mode 100644 index 0000000..2f981c2 --- /dev/null +++ b/v4.0/src/DEV/XMA2EMS/I13HOOK.INC @@ -0,0 +1,449 @@ + +include MSBDS.INC ;include BDS struc ;an000; dms; + + + + +;========================================================================= +; I13_Handler - This routine is the main driver of the +; INT 13h hook. +;========================================================================= + +I13_Handler proc far ; ;an000; dms; + + jmp I13_Handler_Start + + +I13_Max_Head db ? ;max head count on drive ;an000; dms; +I13_SPT db ? ;max sectors/track count ;an000; dms; +I13_BPS dw ? ;max number bytes/sector ;an000; dms; +I13_Bytes_Per_Para dw 10h ;number of bytes per paragraph ;an000; dms; +I13_Bytes_Per_EMS_Page dw 4000h ;bytes per EMS page ;an000; dms; +I13_Paras_Per_Sector dw ? ;paras per sector ;an000; dms; +I13_DD_Per_Sector dw ? ;double words per sector ;an000; dms; +I13_Operation db ? ;INT 13h function ;an000; dms; +I13_Sector_Count db ? ;sector count ;an000; dms; +I13_Track_Number dw ? ;track number ;an000; dms; +I13_Sector_Number db ? ;sector number ;an000; dms; +I13_Head_Number db ? ;head number ;an000; dms; +I13_Drive_Number db ? ;drive number ;an000; dms; +I13_Sectors_To_Trf db 1 ;current sectors to trf ;an000; dms; +I13_Curr_Trf_Cnt db ? ;total transfer count in secs ;an000; dms; +I13_Trf_Off dw ? ;current address for trf ;an000; dms; +I13_Trf_Seg dw ? ;an000; dms; +I13_512_Byte_Buffer db 512 dup(0) ;buffer for sector ;an000; dms; + +I13_Handler_Start: + + sti ;ints on ;an000; dms; + cmp ah,02h ;read operation? ;an000; dms; + je I13_Handler_Get_Parms ;yes - get drive parms ;an000; dms; + + cmp ah,03h ;write operation? ;an000; dms; + je I13_Handler_Get_Parms ;yes - get drive parms ;an000; dms; + + jmp cs:IntV13 ;neither - go to old INT 13h ;an000; dms; + +I13_Handler_Get_Parms: + + call I13_Get_Dev_Parms ;get device parms for this drive;an000; dms; + jnc I13_Handler_Range_Ck ;we have device data ;an000; dms; + jmp cs:IntV13 ;go to old INT 13h vector ;an000; dms; + +I13_Handler_Range_Ck: + + call I13_Target_Source_Range_Ck ;crosses the 640k boundary? ;an000; dms; + jc I13_Handler_Request_Break ;break up the request ;an000; dms; + jmp cs:IntV13 ;go to old INT 13h vector ;an000; dms; + +I13_Handler_Request_Break: + + call I13_Request_Break_Up ;break up I13 request ;an000; dms; + + ret 2 ;return to caller ;an000; dms; + ;clear the flags from the stack + ; and pass back ours +I13_Handler endp ; ;an000; dms; + + + +;========================================================================= +; I13_Target_Source_Range_Ck - This routine determines if the +; target or source resides in an EMS +; page. +; +; Inputs : ES:BX - Source/target address +; +; Outputs : CY - if address resides in an EMS page +; NC - address not in an EMS page +;========================================================================= + + +I13_Target_Source_Range_Ck proc near ; ;an000; dms; + + push ax ;save regs ;an000; dms; + push bx ; ;an000; dms; + push cx ; ;an000; dms; + push si ; ;an000; dms; + push ds ; ;an000; dms; + + mov ax,cs ;get cs addressibility ;an000; dms; + mov ds,ax ; ;an000; dms; + mov si,offset cs:Map_Table ;point to the map table ;an000; dms; + + mov cx,cs:Map_Count ;get the number of phys. pages ;an000; dms; + +I13_Target_Source_Loop: + + cmp cx,0 ;at end? ;an000; dms; + je I13_Target_Source_Not_EMS_Page ;yes - source/target not in pg ;an000; dms; + + mov ax,ds:[si].Phys_Page_Segment ;get the segment value ;an000; dms; + mov bx,es ; ;an000; dms; + cmp bx,ax ;source/target > EMS page? ;an000; dms; + jb I13_Target_Source_Not_EMS_Page ;no - we are OK for old INT 13 ;an000; dms; + ;must be >= EMS page + + add ax,400h ;get end address of EMS page ;an000; dms; + cmp bx,ax ;source/target < end of EMS pg? ;an000; dms; + jb I13_Target_Source_In_EMS_Page ;yes - we are in a page ;an000; dms; + + add si,type Mappable_Phys_Page_Struct ;adjust pointer to next page ;an000; dms; + dec cx ;dec counter ;an000; dms; + + jmp I13_Target_Source_Loop ;continue loop ;an000; dms; + +I13_Target_Source_Not_EMS_Page: + + clc ;flag not in EMS page ;an000; dms; + jmp I13_Target_Source_Exit ;exit routine ;an000; dms; + +I13_Target_Source_In_EMS_Page: + + stc ;flag in an EMS page ;an000; dms; + +I13_Target_Source_Exit: + + pop ds ;restore regs ;an000; dms; + pop si ; ;an000; dms; + pop cx ; ;an000; dms; + pop bx ; ;an000; dms; + pop ax ; ;an000; dms; + + ret ; ;an000; dms; + +I13_Target_Source_Range_Ck endp ; ;an000; dms; + + +;========================================================================= +; I13_Request_Break_Up - Break up the INT 13h request onto 16k +; boundaries. +; +; Inputs : AH - 02 (Read) +; 03 (Write) +; AL - Sector count +; CH - Track number +; CL - Sector number +; DH - Head number +; DL - Drive number +; ES:BX - Buffer address +; +; Outputs : Data transferred +;========================================================================= + + +I13_Request_Break_Up proc near ; ;an000; dms; + + push bx ;save regs ;an000; dms; + push cx ; ;an000; dms; + push dx ; ;an000; dms; + push di ; ;an000; dms; + push si ; ;an000; dms; + push ds ; ;an000; dms; + push es ; ;an000; dms; + + + mov cs:I13_Trf_Seg,es ;save segment ;an000; dms; + mov cs:I13_Trf_Off,bx ;save offset ;an000; dms; + mov cs:I13_Curr_Trf_Cnt,0 ;init transfer count ;an000; dms; + mov cs:I13_Operation,ah ;save operation ;an000; dms; + mov cs:I13_Sector_Count,al ;save sector count ;an000; dms; + + + mov byte ptr cs:I13_Track_Number,ch ;save starting track number ;an000; dms; + mov ch,cl ;xchg bytes ;an000; dms; + shr ch,1 ;shift 6 bits ;an000; dms; + shr ch,1 ; ;an000; dms; + shr ch,1 ; ;an000; dms; + shr ch,1 ; ;an000; dms; + shr ch,1 ; ;an000; dms; + shr ch,1 ; ;an000; dms; + + mov byte ptr cs:I13_Track_Number[+1],ch ;high byte for cylinder ;an000; dms; + and cl,00111111b ;get bits 0-5 for sector number ;an000; dms; + + mov cs:I13_Sector_Number,cl ;save starting sector number ;an000; dms; + mov cs:I13_Head_Number,dh ;save starting head number ;an000; dms; + mov cs:I13_Drive_Number,dl ;save drive number ;an000; dms; + + mov cl,cs:I13_Sector_Count ;while sectors ;an000; dms; + + cmp cs:I13_Operation,02h ;read? ;an000; dms; + jne I13_Request_Write ;must be a write ;an000; dms; + +I13_Request_Read: + + cmp cl,0 ;at end? ;an000; dms; + je I13_Request_Success ;exit we are done ;an000; dms; + + lea bx,cs:I13_512_Byte_Buffer ;point to 512 byte buffer ;an000; dms; + mov ax,cs ;pass cs to es ;an000; dms; + mov es,ax ; ;an000; dms; + + call I13_Invoke ;do the INT 13h to our buffer ;an000; dms; + jc I13_Request_Failed ;signal failure ;an000; dms; + mov ax,cs ;point to our buffer to the ;an000; dms; + mov ds,ax ; transfer ;an000; dms; + mov si,offset cs:I13_512_Byte_Buffer; ;an000; dms; + + mov es,cs:I13_Trf_Seg ;restore seg to target ;an000; dms; + mov di,cs:I13_Trf_Off ;restore off to target ;an000; dms; + + push cx ;save cx across move ;an000; dms; + cld ;do a forward move ;an000; dms; + mov cx,cs:I13_DD_Per_Sector ; for 128 dd's ;an000; dms; + db 66h ;op code for dd word move ;an000; dms; + rep movsw ;do the move - wow that was fast;an000; dms; + pop cx ;restore it ;an000; dms; + + call I13_Adjust ;adjust our pointers ;an000; dms; + + dec cl ;decrease sector counter ;an000; dms; + jmp I13_Request_Read ;continue loop ;an000; dms; + +I13_Request_Write: + + cmp cl,0 ;at end? ;an000; dms; + je I13_Request_Success ;exit we are done ;an000; dms; + + mov ax,cs ;point to 512 byte buffer ;an000; dms; + mov es,ax ; ;an000; dms; + mov di,offset cs:I13_512_Byte_Buffer; ;an000; dms; + + mov ds,cs:I13_Trf_Seg ;get source segment ;an000; dms; + mov si,cs:I13_Trf_Off ;get source offset ;an000; dms; + + push cx ;save cx across move ;an000; dms; + cld ;do a forward move ;an000; dms; + mov cx,cs:I13_DD_Per_Sector ; for 128 dd's ;an000; dms; + db 66h ;op code for dd word move ;an000; dms; + rep movsw ;do the move - wow that was fast;an000; dms; + pop cx ;restore it ;an000; dms; + + lea bx,cs:I13_512_Byte_Buffer ;point to 512 byte buffer ;an000; dms; + mov ax,cs ;pass cs to es ;an000; dms; + mov es,ax ; ;an000; dms; + + call I13_Invoke ;do the INT 13h to our buffer ;an000; dms; + jc I13_Request_Failed ;signal failure ;an000; dms; + call I13_Adjust ;adjust our pointers ;an000; dms; + + dec cl ;decrease sector counter ;an000; dms; + jmp I13_Request_Write ;continue loop ;an000; dms; + +I13_Request_Failed: + + jmp I13_Request_Exit ;exit on error ;an000; dms; + + +I13_Request_Success: + + xor ax,ax ;clear status byte ;an000; dms; + +I13_Request_Exit: + + pop es ;restore regs ;an000; dms; + pop ds ; ;an000; dms; + pop si ; ;an000; dms; + pop di ; ;an000; dms; + pop dx ; ;an000; dms; + pop cx ; ;an000; dms; + pop bx ; ;an000; dms; + + + ret ; ;an000; dms; + +I13_Request_Break_Up endp ; ;an000; dms; + + + +;========================================================================= +; I13_Adjust - This routine adjusts the needed fields for +; the next iteration of INT 13h. +; +; Inputs : I13_Sectors_To_Trf - Sectors just read/written +; I13_Sector_Number - Starting sector number for trf +; I13_Head_Number - Starting head number for trf +; I13_Track_Number - Starting track number for trf +; +; Outputs : I13_Sector_Number - New starting sector for trf +; I13_Head_Number - New starting head for trf +; I13_Track_Number - New starting track for trf +;========================================================================= + + +I13_Adjust proc near ;adjust values ;an000; dms; + + push ax ;save regs ;an000; dms; + + inc cs:I13_Sector_Number ;next sector ;an000; dms; + mov al,cs:I13_Sector_Number ; ;an000; dms; + cmp al,cs:I13_SPT ;> sectors on track? ;an000; dms; + jna I13_Adjust_Exit ;no ;an000; dms; + mov cs:I13_Sector_Number,1 ;yes - start at next ;an000; dms; + inc cs:I13_Head_Number ;next head ;an000; dms; + mov al,cs:I13_Head_Number ; ;an000; dms; + cmp al,cs:I13_Max_Head ;> head count ;an000; dms; + jb I13_Adjust_Exit ;no ;an000; dms; + mov cs:I13_Head_Number,0 ;yes - head 0 ;an000; dms; + inc cs:I13_Track_Number ;next track ;an000; dms; + +I13_Adjust_Exit: + + mov ax,cs:I13_Paras_Per_Sector ;get bytes per sector ;an000; dms; + add cs:I13_Trf_Seg,ax ;adjust segment ;an000; dms; + + pop ax ;restore regs ;an000; dms; + + ret ; ;an000; dms; + +I13_Adjust endp ; ;an000; dms; + + +;========================================================================= +; I13_Invoke - This routine sets up the regs for the INT 13h +; and invokes it for the sector we need. +; +; Inputs : I13_Operation - read/write +; I13_Track_Number - cylinder to read/write +; I13_Sector_Number - starting sector for read/write +; I13_Head_Number - starting head +; I13_Drive_Number - starting drive +; +; Outputs : NC - good read/write +; CY - bad read/write +;========================================================================= + +I13_Invoke proc near ;invoke INT 13h ;an000; dms; + + push bx ;save regs ;an000; dms; + push cx ; ;an000; dms; + push dx ; ;an000; dms; + + mov ah,cs:I13_Operation ;get function call ;an000; dms; + mov al,cs:I13_Sectors_To_Trf ;get sectors to transfer ;an000; dms; + + mov ch,byte ptr cs:I13_Track_Number ;get track number ;an000; dms; + mov cl,byte ptr cs:I13_Track_Number[+1] ;get high 2 bits ;an000; dms; + shl cl,1 ;put bit is positions 6&7 ;an000; dms; + shl cl,1 ; ;an000; dms; + shl cl,1 ; ;an000; dms; + shl cl,1 ; ;an000; dms; + shl cl,1 ; ;an000; dms; + shl cl,1 ; ;an000; dms; + or cl,cs:I13_Sector_Number ;place the sector number in cl ;an000; dms; + + mov dh,cs:I13_Head_Number ;get head number ;an000; dms; + mov dl,cs:I13_Drive_Number ;get drive number ;an000; dms; + pushf + call cs:IntV13 ;go to old vector ;an000; dms; + inc cs:I13_Curr_Trf_Cnt ;increment counter ;an000; dms; + + pop dx ;restore regs ;an000; dms; + pop cx ; ;an000; dms; + pop bx ; ;an000; dms; + + ret ; ;an000; dms; + +I13_Invoke endp ; ;an000; dms; + + +;========================================================================= +; I13_Get_Dev_Parms - This routine obtains the device parameters for +; the drive being accessed for the INT 13h. +; +; Inputs : DL - drive number +; +; Outputs : I13_Max_Head - max head count on drive +; I13_SPT - max sectors/track count for drive +; CY - error +; NC - no error +;========================================================================= + + + +I13_Get_Dev_Parms proc near ;get sectors/track & head cnt. ;an000; dms; + + push ax ;save regs ;an000; dms; + push bx ; ;an000; dms; + push cx ; ;an000; dms; + push dx ; ;an000; dms; + push di ; ;an000; dms; + push ds ; ;an000; dms; + + mov ax,0803h ;get the BDS table ;an000; dms; + int 2fh ; ;an000; dms; + +I13_Get_Dev_Next_Entry: + + cmp ds:[di].Drivenum,dl ;do we have our drive? ;an000; dms; + je I13_Get_Dev_Save_Parms ;yes get data ;an000; dms; + cmp word ptr ds:[di].Link[+0],-1 ;last entry in list? ;an000; dms; + je I13_Get_Dev_Parms_Error_Exit ;yes - did not find drive ;an000; dms; + mov ax,word ptr ds:[di].Link[+0] ;get offset of next entry ;an000; dms; + mov bx,word ptr ds:[di].Link[+2] ;get segment of next entry ;an000; dms; + mov ds,bx ;stuff into ds:di ;an000; dms; + mov di,ax ; ;an000; dms; + jmp I13_Get_Dev_Next_Entry ;continue ;an000; dms; + +I13_Get_Dev_Save_Parms: + + mov ax,ds:[di].BytePerSec ;get byte count per sector ;an000; dms; + mov cs:I13_BPS,ax ; ;an000; dms; + + xor dx,dx ;clear high word ;an000; dms; + div cs:I13_Bytes_Per_Para ;get number of paras in sector ;an000; dms; + mov cs:I13_Paras_Per_Sector,ax ;save it ;an000; dms; + shl ax,1 ;get DD's per sector ;an000; dms; + shl ax,1 ; ;an000; dms; + mov cs:I13_DD_Per_Sector,ax ; ;an000; dms; + + mov ax,ds:[di].SecLim ;get sectors per track ;an000; dms; + mov cs:I13_SPT,al ; ;an000; dms; + + mov ax,ds:[di].HdLim ;get max head count ;an000; dms; + mov cs:I13_Max_Head,al ; ;an000; dms; + + clc ;flag data found ;an000; dms; + + jmp I13_Get_Dev_Parms_Exit ; ;an000; dms; + + +I13_Get_Dev_Parms_Error_Exit: + + stc ;flag no data found ;an000; dms; + +I13_Get_Dev_Parms_Exit: + + pop ds ;restore regs ;an000; dms; + pop di ; ;an000; dms; + pop dx ; ;an000; dms; + pop cx ; ;an000; dms; + pop bx ; ;an000; dms; + pop ax ; ;an000; dms; + + ret ; ;an000; dms; + +I13_Get_Dev_Parms endp ; ;an000; dms; + + diff --git a/v4.0/src/DEV/XMA2EMS/LIM40.INC b/v4.0/src/DEV/XMA2EMS/LIM40.INC new file mode 100644 index 0000000..8cd006c --- /dev/null +++ b/v4.0/src/DEV/XMA2EMS/LIM40.INC @@ -0,0 +1,1792 @@ + page +;------------------------------------------------------------------- +; +; Equates that are specific to LIM 4.0 functions go here +; +;------------------------------------------------------------------- + +null equ 0 ; null value, used everywhere +max_phys_pages equ 255 ; largest allowable phys page + +sf_pm_get equ 0 ; 4f00 - get partial map +sf_pm_set equ 1 ; 4f01 - set partial map +sf_pm_size equ 2 ; 4f02 - get partial map size + +mu_ppn equ 0 ; 5000 - map/unmap multiple +mu_seg equ 1 ; 5001 - map/unmap multiple +mu_max_fcn equ 1 ; 50 - map/unmap multiple + +Hn_Attr_Max_Fcn equ 2 ; 52xx - max subfunction ;an000; dms; + +sf_hn_get equ 0 ; 5300 - get handle name +sf_hn_set equ 1 ; 5301 - set handle name +hn_max_fcn equ 1 ; 53 - handle name sub-functions 00, 01 + +sf_hd_get equ 0 ; 5400 - get handle dir +sf_hd_search equ 1 ; 5401 - search for named handle +sf_hd_total equ 2 ; 5402 - get total number of handles +hd_max_fcn equ 2 ; 54 - get handle directory s-f's 00, 01, 02 + +Add_Get_Array equ 0 ; 5800 - Get Mappable Physical Address Array +Add_Get_Size equ 1 ; 5801 - Get Mappable Physical Address Array Entries + +hi_info equ 0 ; 5900 - hardware info +hi_raw equ 1 ; 5901 - # raw pages + +am_get equ 0 ; 5b00 - get alternate map register set +am_set equ 1 ; 5b01 - set alternate map register set +am_size equ 2 ; 5b02 - get alternate map save array size +am_alloc equ 3 ; 5b03 - allocate alternate map register set +am_dealloc equ 4 ; 5b04 - deallocate alternate map register set +am_dma_alloc equ 5 ; 5b05 - allocate DMA register set +am_dma_enable equ 6 ; 5b06 - enable DMA register set +am_dma_disable equ 7 ; 5b07 - disable DMA register set +am_dma_dealloc equ 8 ; 5b08 - deallocate DMA register set + +os_enable equ 0 ; 5d00 - enable OS/E function +os_disable equ 1 ; 5d01 - disable OS/E function +os_access equ 2 ; 5d02 - "return" access key function + +map_pages_fcn equ 44h ; function code used to map pages +get_free_pages equ 42h ; function code used to get free page count + +read_clock equ 2ch ; function code to read clock +dos_int equ 21h ; interrupt 21 +xor_mask equ 0ffffh ; mask used to confuse the random numbers a little + +ppm_struct STRUC ; define the structure +phys_page_offset dw ? ; offsets into PPM entry +ppm_handle_offset dw ? +ppm_log_page_offset dw ? +ppm_struct ENDS + + page +;------------------------------------------------------------------- +; +; 4F - get/set partial page map +; +; INPUT: +; AL = 00, get partial page map pm_get +; 01, set partial page map pm_set +; 02, get partial page map size pm_size +; +; OUTPUT: +; See individual function headers +; +;------------------------------------------------------------------- +partial_map proc + +; use AL value to select sub-function + + cmp al,sf_pm_get ; al = 00, get partial page map + je pm_get + + cmp al,sf_pm_set ; al = 01, set partial page map + je pm_set + + cmp al,sf_pm_size ; al = 02, get partial page map size + jne pm_invalid_sfcn + jmp pm_size + + +; invalid sub-function, report the error + +pm_invalid_sfcn: + mov ah,ems_code8F ; invalid sub-function code + ret + + page +;------------------------------------------------------------------- +; +; 4F00 - get partial page map +; +; INPUT: +; DS:SI -> partial page map +; +; dw ? ; segment count (number +; ; of following entries) +; dw ? ; segment address to save +; : ; (repeats count times) +; : +; +; ES:DI -> user array for mapping info +; size determined by function 4F02 +; +; +; OUTPUT: +; AH = 00, No error +; 80H, Software error +; 81H, Hardware error +; 84H, Invalid function +; 8FH, Invalid sub-function +; A3H, Contents of control structure are invalid +; +; ES:DI -> saved partial state array +; format for this is un-disclosed to the user +; but will be: +; +; ppm_count dw ? ; number of saved entries +; ppm_phys_page dw ? ; physical page +; ppm_handle dw ? ; handle +; ppm_log_page dw ? ; logical page +; : ; repeats for each requested page +; : +; +; +;------------------------------------------------------------------- +pm_get: + + push bx ; save some regs + push cx + push dx + push di + push si + push ds + + mov di,cs:[bp].IE_Saved_DI_Reg ; restore caller's DI, pointer to mapping control structure + + +;------------------------------------------------------------------- + +; get count from caller's control structure + + mov cx,ds:[si] ; the first word of the control + ; structure holds the # of entries + + cmp cx,0 ; 0 pages requested? ;an000; dms; + je PM_Get_Error_A3 ; yes - flag an error ;an000; dms; + + cmp cx,cs:Map_Count ; do some sanity checking + jbe pm_phys_ok ; requested number is ok, do the copies + +; They asked for more than we can possibly have. Sounds like trouble. + +PM_Get_Error_A3: + + mov ah,ems_codea3 ; bad stuff in the control structure + jmp pm_exit00 ; return the error code + +pm_phys_ok: + mov cx,DS:word ptr [si] ; get count from control structure + mov ES:word ptr [di],cx ; save count in save area + add di,2 ; increment save area pointer + +;------------------------------------------------------------------- +; +; everything is OK so far, copy the entries requested +; +;------------------------------------------------------------------- + +ppm_copies: + + add si,2 ; point to next segment number + mov ax,DS:word ptr [si] ; get segment value from control structure + + push si ; save user's si + push ds ; save user's ds + push cx ; save counter for outer loop + +; ready to do the lookup and copy operation + + push cs ; make DS:SI point to internal data area + pop ds + lea si,map_table + + mov cx,map_count ; number of mappable segments + +ppm_inner_copy_loop: + cmp ax,ds:word ptr [si+phys_page_segment] ; is this entry the requested? + jne ppm_not_yet ; no, try again + + mov cx,ppm_size ; number of bytes to copy + cld ; make sure direction flag is right + add si,2 ; point to phys_page_number + + rep movsb ; copy the entry + + sub si,2 ; reset si + + jmp ppm_entry_done ; done with this copy, go on + +ppm_not_yet: + add si,type mappable_phys_page_struct ; point to next entry + loop ppm_inner_copy_loop ; try some more + + pop cx ; restore counter for outer loop + pop ds ; restore user's ds + pop si ; restore user's si + mov ah,EMS_Code8B ; we have an invalid segment specified ;an000; dms; + jmp PM_Exit00 ; exit the program + +ppm_entry_done: + +; restore pointer to control structure + + pop cx ; restore counter for outer loop + pop ds ; restore user's ds + pop si ; restore user's si + + + loop ppm_copies ; keep going until proper number of + ; entries have been copied + + xor ah,ah ; good return code +;------------------------------------------------------------------- +pm_exit00: + pop ds ; restore these registers + pop si + pop di + pop dx + pop cx + pop bx + + ret ; return to caller + + + + page +;------------------------------------------------------------------- +; +; 4F01 - set partial page map +; +; INPUT: +; DS:SI -> source array +; Format: +; +; ppm_count dw ? ; number of saved entries +; ppm_phys_page dw ? ; physical page +; ppm_handle dw ? ; handle +; ppm_log_page dw ? ; logical page +; : ; repeats ppm_count times +; : +; +; +; OUTPUT: +; AH = 00, No error +; 80H, Software error +; 81H, Hardware error +; 84H, Invalid function +; 8FH, Invalid sub-function +; A3H, Contents of source array invalid +; +;------------------------------------------------------------------- +pm_set: + + push bx ; save some regs + push cx + push dx + push di + push si + push ds + + mov cx,DS:word ptr [si] ; get number of entries in save area + + cmp cx,0 ; is the count zero? + je pm_set_error_A3 ; yes - error ;an000; dms; + + cmp cx,cs:Map_Count ; greater than phys pages avail? ;an000; dms; + jbe count_ok ; no - data not corrupted ;an000; dms; + +pm_set_error_A3: + + mov ah,EMS_CODEA3 ; control structure error + jmp pm_exit01 ; exit + +count_ok: + add si,2 ; point to first entry in save area + +pm01_loop: + + mov ax,DS:word ptr [si+phys_page_offset] ; set up regs for map_l_to_p + mov ah,map_pages_fcn + mov dx,DS:word ptr [si+ppm_handle_offset] + mov bx,DS:word ptr [si+ppm_log_page_offset] + + cmp dx,0ffffh ; is there a real entry? + je no_map ; no, skip the call to map_l_to_p + + call map_l_to_p ; make the mapping call + +no_map: + add si,type ppm_struct ; point to next entry + + loop pm01_loop ; + + xor ah,ah ; good return code +pm_exit01: + + pop ds ; restore these registers + pop si + pop di + pop dx + pop cx + pop bx + + ret ; return to caller + + + page +;------------------------------------------------------------------- +; +; 4F02 - get partial page map size +; +; INPUT: +; AX = 4f02h +; +; BX = number of pages in partial page map +; +; OUTPUT: +; AH = 00, No error +; 80H, Software error +; 81H, Hardware error +; 84H, Invalid function +; 8FH, Invalid sub-function +; +; AL = size of partial page map save array +; number of bytes that will be needed +; to save the requested number of pages +; +;------------------------------------------------------------------- +pm_size: + + push dx ; save dx + + cmp bx,0 ; 0 pages requested? ;an000; dms; + je PM_Size_Error_8B ; yes flag an error ;an000; dms; + + cmp bx,cs:Map_Count ; page count > phys pages? ;an000; dms; + jbe PM_Size_Return ; no - continue ;an000; dms; + +PM_Size_Error_8B: + + mov ah,EMS_Code8B ; signal page count exceeded ;an000; dms; + jmp PM_Exit02 ; exit routine ;an000; dms; + +PM_Size_Return: + + mov dx,bx ; number of pages times ... + mov ax,ppm_size ; * size of an entry ... + mul dx ; = number of bytes in save array + add ax,2 ; increase by 2 to include count word + + xor ah,ah ; good return code + +pm_exit02: + pop dx ; restore dx + + ret ; return to caller + +partial_map endp + + + page +;------------------------------------------------------------------- +; +; 50 - map/unmap multiple handle pages +; +; INPUT: +; AH = 00 physical page numbers +; 01 segment numbers +; +;------------------------------------------------------------------- +map_mult proc + + cmp al,mu_ppn ; is this a map request? + je mu_ppn_fcn ; yes, go do it + + cmp al,mu_seg ; no, is this an unmap request? + je mu_seg_fcn ; yes, go do it + + xor al,al ; clear al, why not? + mov ah,ems_code8f ; no, return invalid sub-function code + ret ; return to caller + +;------------------------------------------------------------------- +; +; 5000 - map/unmap multiple handle pages using physical page numbers +; +; INPUT: +; AX = 5000h +; +; DX = handle +; +; CX = num entries in control structure +; +; DS:SI -> points to control structure +; Format: +; +; log_pg_num dw ? ; logical page number +; phys_pg_num dw ? ; physical page number +; : ; repeats CX times +; : +; +; OUTPUT: +; +; AH = 00, No error +; 80H, Software error +; 81H, Hardware error +; 83H, Invalid handle +; 84H, Invalid function +; 8AH, Invalid logical page +; 8BH, Invalid physical page +; 8FH, Invalid sub-function +; +;------------------------------------------------------------------- + +mu_ppn_fcn: + + push bx ; save regs ;an000; dms; + push cx ; save count + push dx ; ;an000; dms; + push si ; save pointer + + xor ah,ah ; good return code + cmp cx,0 ; is count 0? + je mu_ppn_exit + +mu_ppn_loop: + mov bx,ds:word ptr[si+0] ; get logical page number + mov ax,ds:word ptr[si+2] ; get physical page number + mov ah,map_pages_fcn ; fcn code for mapping + + push cx + call map_l_to_p ; call the mapping routine + pop cx + + cmp ah,0 ; was return code OK + jne mu_ppn_error + + add si,4 ; point to next entry + + loop mu_ppn_loop ; do it again + + xor ah,ah ; good return code + jmp mu_ppn_exit + +mu_ppn_error: +mu_ppn_exit: + pop si ; restore pointer + pop dx ; ;an000; dms; + pop cx ; restore count + pop bx ; restore regs ;an000; dms; + + ret ; return to caller + + +;------------------------------------------------------------------- +; +; 5001 - map/unmap multiple handle pages using segment addresses +; +; INPUT: +; AX = 5001h +; +; DX = handle +; +; CX = num entries in control structure +; +; DS:SI -> points to control structure +; Format: +; +; log_pg_num dw ? ; logical page number +; seg_address dw ? ; physical segment address +; : ; repeats CX times +; : +; +; OUTPUT: +; +; AH = 00, No error +; 80H, Software error +; 81H, Hardware error +; 83H, Invalid handle +; 84H, Invalid function +; 8AH, Invalid logical page +; 8BH, Invalid physical page +; 8FH, Invalid sub-function +; +;------------------------------------------------------------------- + +mu_seg_fcn: + + push bx ; save regs ;an000; dms; + push cx ; save count + push dx ; ;an000; dms; + push si ; save pointer + + xor ah,ah ; good return code + cmp cx,0 ; is count 0? + je mu_seg_exit + +mu_seg_loop: + mov bx,ds:word ptr[si+0] ; get logical page number + + push dx ; save handle + mov dx,ds:word ptr[si+2] ; get physical page number + call Get_Phys_Seg_Page ; convert to logical page circle + mov ax,dx ; must be in AX + pop dx ; restore handle + + mov ah,map_pages_fcn ; fcn code for mapping + + push cx + call map_l_to_p ; call the mapping routine + pop cx + + cmp ah,0 ; was return code OK + jne mu_seg_error + + add si,4 ; point to next entry + + loop mu_seg_loop ; do it again + + xor ah,ah ; good return code + jmp mu_seg_exit + +mu_seg_error: +mu_seg_exit: + pop si ; restore pointer + pop dx ; ;an000; dms; + pop cx ; restore count + pop bx ; restore regs ;an000; dms; + + ret ; return to caller + +map_mult endp + +;------------------------------------------------------------------- +include lim40b.inc +;------------------------------------------------------------------- + + page +;------------------------------------------------------------------- +; +; 52 - get/set handle attributes +; +; The LIM 4.0 spec strongly advises EMS implementers to avoid this +; call. Our current implementation of this function is not to provide +; support. Possibly in future releases it will be supported, if +; the proper hardware becomes available. +; +; DMS 4/29/88 +; +;------------------------------------------------------------------- +handle_attrib proc + + + cmp al,Hn_Attr_Max_Fcn ;maximum subfunction number ;an000; dms; + jbe Handle_Attrib_Cont ;continue routine ;an000; dms; + mov ah,EMS_Code8F ;we have an invalid subfunction ;an000; dms; + jmp Handle_Attrib_Exit ; exit the routine ;an000; dms; + +Handle_Attrib_Cont: + + mov ah,EMS_Code91 ;this function is not supported ;an000; dms; + +Handle_Attrib_Exit: + + RET ; return to caller + +handle_attrib endp + + page +;------------------------------------------------------------------- +; +; 53 - get/set handle name +; +; Virtual Mode Note: The Handle Name functions (53 and 54) will @RH6 +; be handled differently when running on a system in virtual mode. @RH6 +; This is to accommadate the Workstation Program's bank switching. @RH6 +; In this case, handle names and ID's will only be returned for @RH6 +; handles allocated in the same PC bank, or for handles in bank 0. @RH6 +; Bank 0 is for device drivers, system extensions, or applications @RH6 +; that install resident before WSP loads. @RH6 +; When interfacing with handles in bank 0, one must be aware of @RH6 +; the problem of two PC applications running simultaneously that @RH6 +; get the handle ID of the resident program and map its pages. @RH6 +; Data corruption will occur if both map and write to the same page @RH6 +; at the same time. @RH6 +; While these new LIM 4.0 functions will return info only for @RH6 +; bank 0 and the current bank, the existing LIM 3.2 functions will @RH6 +; continue to return total system values. For example, function 4B @RH6 +; will return the number of active handles in all banks. @RH6 +; +; INPUT: +; AL = sub-function code +; 00 = get handle name hn_get +; 01 = set handle name hn_set +; +; DX = handle +; +; ES:DI -> Get caller's name buffer (8 char's) +; DS:SI -> Set caller's name buffer (8 char's) +; +; +; OUTPUT: +; AH = 00, No error +; 80H, Software error +; 81H, Hardware error +; 83H, Handle not found +; 84H, Invalid function +; 8FH, Invalid sub-function +; +; AL = 0 +; +; +; gga 8/21/87 +; +;------------------------------------------------------------------- + + Null_Handle_Name db 8 dup(0) ;null handle value ;an000; dms; + +handle_name proc + + push bx ; save some regs + push cx + push dx + push di + push si + push ds + + PUSH CS ;Set addressability to our tables @RH8 + POP DS ;Must restore DS for Set name @RH8 + + cmp al,hn_max_fcn ; al = 00 or 01, anything else = error + jbe hn_val_sf + +; invalid sub-function, report the error + + mov ah,ems_code8F ; invalid sub-function code + jmp hn_exit ; exit + +; check the handle for valid range + +hn_val_sf: + + cmp dx,num_handles-1 ; handle within range ? + jnae hn_range_ok ; yes, get down to business + + mov ah,ems_code83 ; handle not found + jmp hn_exit ; exit + +;------------------------ +; handle is within valid range, now see if it is valid handle (i.e. in use) + +hn_range_ok: + + push ax ; save fcn code + push dx ; save handle + + MOV AX,DX ;DX = handle id + MOV DX,TYPE H_LOOKUP_STRUC ;DI = entry's offset into + MUL DX ; the handle lookup table + MOV DI,AX ; + POP DX ; restore handle + POP AX ; restore fcn code + + CMP HANDLE_LOOKUP_TABLE.H_PAGES[DI],REUSABLE_HANDLE + JNE HN_IN_USE ;Is this handle valid (in use)? + ; No...error + mov ah,ems_code83 ; handle not found + jmp hn_exit ; return the error code + +HN_IN_USE: ;Check bank ID if in virutal mode + + mov bx,ax ;save ax ;an000; dms; + TEST MEMCARD_MODE,WSP_VIRT ;If using a card in virtual mode @RH6 + JZ HN_VALID ; (i.e. bank swapping), then read @RH6 + MOV DX,IDREG ; the current bank ID. @RH6 + IN AL,DX ; @RH6 + CMP HANDLE_LOOKUP_TABLE.H_BANK[DI],AL ;If handle's bank ID @RH6 + JE HN_VALID ; is 0 (resident) or @RH6 + CMP HANDLE_LOOKUP_TABLE.H_BANK[DI],0 ; = requesters bank @RH6 + JE HN_VALID ; then OK @RH6 + ;Else invalid requester bank @RH6 + MOV AH,EMS_CODE83 ;Indicate handle not found @RH6 + JMP HN_EXIT + +;------------------------ +; find out if get or set operation + +hn_valid: + mov ax,bx ;restore ax ;an000; dms; + cmp al,sf_hn_get ; al = 00 means GET + je hn_get + + cmp al,sf_hn_set ; = 01 means SET + je hn_set + +; invalid sub-function, report the error + + mov ah,ems_code8F ; invalid sub-function code + jmp hn_exit ; exit + + + + page +;------------------------------------------------------------------- +; +; 5300 - GET sub-function +; ES:DI -> User's area where name is stored +;------------------------------------------------------------------- +hn_get: + ;Here DI = offset into h lookup + LEA SI,HANDLE_LOOKUP_TABLE ;Set the source SI to the handle's + ADD SI,DI ; name field in the handle lookup + ADD SI,H_NAME ; lookup table + + MOV DI,cs:[bp].IE_Saved_DI_Reg ;Restore the user's dest where + ; the handle name will be stored + + MOV CX,8 ; want to copy 8 characters + CLD ; make sure direction flag is right + REP MOVSB ; copy the string + + XOR AH,AH ; set good return code + JMP HN_EXIT ; exit + + + page +;------------------------------------------------------------------- +; +; 5301 - SET sub-function +; DS:SI -> User's area where name comes from +; +;------------------------------------------------------------------- + +hn_set: + + POP DS ;Restore the user's source where @RH6 + PUSH DS ; the handle name will come from + + +;------------------------ + push si ;save regs ;an000; dms; + push di ; ;an000; dms; + push cx ; ;an000; dms; + push es ; ;an000; dms; + + push cs ;swap segs for compare ;an000; dms; + pop es ; ;an000; dms; + + mov di,offset cs:Null_Handle_Name ;point to null handle name ;an000; dms; + mov cx,8 ;8 bytes to compare ;an000; dms; + cld + cli ;ints off ;an000; dms; + rep cmpsb ;null string entered? ;an000; dms; + sti ;ints on ;an000; dms; + + pop es ;restore regs ;an000; dms; + pop cx ; ;an000; dms; + pop di ; ;an000; dms; + pop si ; ;an000; dms; + je HN_Set_Null_Entered ;continue - don't look for match ;an000; dms; + + push dx + call hd_named_handle ; find out if name is in use + pop dx + + cmp ah,0 ; is return code good + je name_in_use + +HN_Set_Null_Entered: + +;------------------------ + ;Here DI = offset into h lookup + ADD DI,OFFSET HANDLE_LOOKUP_TABLE ;Set the dest. DI to the @RH6 + ADD DI,OFFSET H_NAME ; handle's name field in @RH6 + ; the handle lookup table @RH6 + + PUSH ES ;Make ES:DI -> destination in + PUSH CS ; the handle lookup table where + POP ES ; the name will be stored + + mov cx,8 ; want to copy 8 characters + cld ; clear DF to auto-increment + rep movsb ; copy the string + +; all done with the SET function, set good return code and exit + + pop es ; restore user's ES + xor ax,ax ; set good return code + jmp hn_exit + + +;------------------------ +name_in_use: + mov ah,ems_codea1 ; name is use error + + +hn_exit: + pop ds ; restore these registers + pop si + pop di + pop dx + pop cx + pop bx + + ret + +handle_name endp + + + + page +;------------------------------------------------------------------- +; +; 54 - get handle directory +; +; SUB-FCNS: +; AL = 00, get handle directory hd_directory +; 01, search for named handle hd_named_handle +; 02, get total handles hd_total_handles +; +;------------------------------------------------------------------- +handle_dir proc + + cmp al,sf_hd_get ; 00 get handle dir + je hd_directory + + cmp al,sf_hd_search ; 01 search for named handle + je hd_named_handle + + cmp al,sf_hd_total ; 02 get total number of handles + jne hd_invalid_sfcn ; must be an invalid function code + + jmp hd_total_handles ; go display total handles + + +; invalid sub-function, report the error + +hd_invalid_sfcn: + mov ah,ems_code8F ; invalid sub-function code + +; invalid sub-function, fall through to exit + +hd_exit: + + ret + + +;------------------------------------------------------------------- +; 5400 - get handle directory +; +; +; INPUT: +; AL = 00, get handle directory +; +; ES:DI -> caller's buffer for handle directory +; +; OUTPUT: +; AH = 00H, no error +; 80H, software error +; 81H, hardware error +; 84H, invalid function +; 8FH, invalid subfunction +; +; AL = number of entries in handle directory +; +; ES:DI -> handle directory +; +; dw ? ; handle number +; db 8 dup(?) ; handle name +; : +; : ; repeats AL times +; +;------------------------------------------------------------------- +hd_directory: + + push bx ; save some regs + push cx + push dx + push di + push si + push ds + + TEST MEMCARD_MODE,WSP_VIRT ;If using a card in virtual mode @RH6 + JZ HD_LOOP_INIT ; (i.e. bank swapping), then read @RH6 + MOV DX,IDREG ; the current bank ID and save it. @RH6 + IN AL,DX ; @RH6 + MOV cs:BANKID,AL + + +; initialize some things for the loop +HD_LOOP_INIT: + mov di,cs:[bp].IE_Saved_DI_Reg ;restore users DI ;an000; dms; + xor al,al ; al = num entries + xor dx,dx ; dx = handle index + mov cx,NUM_HANDLES ; loop enough for all handles + cld ; make sure direction flag cleared + + push cs ; get cs + pop ds ; into ds + XOR SI,SI ; SI = offset into handle lookup @RH6 + ; table +hd_loop: + CMP HANDLE_LOOKUP_TABLE.h_pages[SI],REUSABLE_HANDLE + ; If handle not active, then @RH6 + je hd_next_hndl ; loop and look again +;------------------------- +; Active handle...if in virtual mode check bank ID @RH6 +;------------------------- + + TEST MEMCARD_MODE,WSP_VIRT ;If using a card in virtual mode @RH6 + JZ HD_ACTIVE ; (i.e. bank swapping), then check @RH6 + MOV BL,cs:BANKID ; handle's bank id @RH6 + CMP HANDLE_LOOKUP_TABLE.H_BANK[SI],BL ;If handle's bank ID @RH6 + JE HD_Active ; is 0 (resident) or @RH6 + CMP HANDLE_LOOKUP_TABLE.H_BANK[SI],0 ; = requesters bank @RH6 + JE HD_Active ; then OK @RH6 + jmp HD_Next_Hndl ;Else skip to next one @RH6 + +;------------------------ +; found an active handle, copy info to directory +;------------------------ +hd_active: + mov es:word ptr[di],dx ; put handle number in directory + add di,2 ; move directory table pointer along, + ; must point to area for handle name now + + push cx ; save counter for outer loop + push si ; save si for outer loop + + mov cx,8 ; need to copy 8 chars + add si,offset Handle_LookUp_Table ;point to entry ;an000; dms; + add si,h_name ; make DS:SI -> handle name in lookup table + +rep movsb ; copy the string + + pop si ; restore si for outer loop + pop cx ; restore counter for outer loop + inc al ; increment entry count + +;------------------------ +; done with the copy +;------------------------ + +hd_next_hndl: + inc dx ; update handle index + add si,type h_lookup_struc ; point to next entry in lookup table + loop hd_loop ; look for more + + xor ah,ah ; good return code + +; all done, fall through to exit + +hd_exit00: + + pop ds ;restore these registers + pop si + pop di + pop dx + pop cx + pop bx + + ret + + + + page +;------------------------------------------------------------------- +; +; 5401 - Search for named handle sub-function +; +; +; INPUT: +; AL = 01, search for named handle +; +; DS:SI = Pointer to handle name to search for +; +; +; OUTPUT sub-fcn 01: Search for named handle +; +; AH = 00H, no error +; 80H, software error +; 81H, hardware error +; 84H, invalid function +; 8FH, invalid subfunction +; A0H, no matching handle found +; A1H, duplicate handle found +; +; DX = value of named handle +; +;------------------------------------------------------------------- + +hd_named_handle: + + push bx ; save some regs + push cx + push di + push si + push ds + push es ;an000; dms; + + TEST MEMCARD_MODE,WSP_VIRT ;If using a card in virtual mode @RH6 + JZ HD1_LOOP_INIT ; (i.e. bank swapping), then read @RH6 + MOV DX,IDREG ; the current bank ID and save it. @RH6 + IN AL,DX ; @RH6 + MOV cs:BANKID,AL + + +; initialize some things for the loop +HD1_LOOP_INIT: + xor ah,ah ; good return code + xor dx,dx ; dx = handle index + mov cx,NUM_HANDLES ; loop enough for all handles + cld ; make sure direction flag cleared + + push cs ; get cs + pop es ; into es + XOR DI,DI ; DI = offset into handle lookup @RH6 + ; table @RH6 +hd1_loop: + CMP ES:HANDLE_LOOKUP_TABLE.h_pages[DI],REUSABLE_HANDLE + ; If handle not active, then @RH6 + je hd1_next_hndl ; loop and look again +;------------------------- +; Active handle...if in virtual mode check bank ID @RH6 +;------------------------- + + TEST MEMCARD_MODE,WSP_VIRT ;If using a card in virtual mode @RH6 + JZ HD1_ACTIVE ; (i.e. bank swapping), then check @RH6 + MOV BL,cs:BANKID ; handle's bank id @RH6 + CMP ES:HANDLE_LOOKUP_TABLE.H_BANK[DI],BL ;If handle's bank ID @RH6 + JE HD1_Active ; is 0 (resident) or @RH6 + CMP ES:HANDLE_LOOKUP_TABLE.H_BANK[DI],0 ; = requesters bank @RH6 + JE HD1_Active ; then OK @RH6 + jmp HD1_Next_Hndl ;Else skip to next one @RH6 +;------------------------ +; found an active handle, check the name +;------------------------ + +HD1_ACTIVE: + push cx ; save counter for outer loop + push si ; save si for outer loop + push di ; save di for outer loop + + mov cx,8 ; need to compare 8 chars + add di,offset Handle_LookUp_Table ;point to entry ;an000; dms; + add di,offset H_Name ; must point to area for handle name now;an000; dms; + +rep cmpsb ; compare the strings + + pop di ; restore di for outer loop + pop si ; restore si for outer loop + pop cx ; restore counter for outer loop + je hd_exit01 ; found a match, exit + +;------------------------ +; done with the check +;------------------------ + +hd1_next_hndl: + inc dx ; update handle index + add di,type h_lookup_struc ; point to next entry in lookup table + loop hd1_loop ; look for more + + + +; all done, if we fall through loop without finding a match, +; must report the error + + mov ah,ems_codea0 ; no matching handle + xor dx,dx ; invalid handle + +hd_exit01: + + + pop es ;restore these registers ;an000; dms; + pop ds + pop si + pop di + pop cx + pop bx + + ret + + + + page +;------------------------------------------------------------------- +; +; 5402 - Get total handles sub-function +; +; INPUT: +; AL = 02, get total handles +; +; +; OUTPUT: +; AH = 00H, no error +; 80H, software error +; 81H, hardware error +; 84H, invalid function +; 8FH, invalid subfunction +; +; BX = total number of handles (includes OS handle, 0) +; +;------------------------------------------------------------------- + +hd_total_handles: + + mov bx,NUM_HANDLES ; return number of handles + xor ah,ah ; good return code + +; all done, fall through to exit + +hd_exit02: + + ret ; return to caller + +handle_dir endp + + page +;------------------------------------------------------------------- +; +; 58 - Get mappable physical address array +; +; +; INPUT: +; AX = 5800h +; +; ES:DI -> mappable physical array address +; +; OUTPUT: +; AH = 00, no error +; 80H, software error +; 81H, hardware error +; 84H, invalid function +; 8FH, invalid subfunction +; +; CX = number of entries returned in the table below +; +; ES:DI -> DW ? ; phys_page_segment +; DW ? ; phys_page_number +; : +; : ; repeats CX times +; +;------------------------------------------------------------------- +address_array proc + + cmp al,Add_Get_Array ; subfunction 00 Get Mappable Physical ;an000; dms; + ; Address Array + je Address_Get_Physical_Address + + cmp al,Add_Get_Size ; subfunction 01 Get Mappable Physical ;an000; dms; + ; Address Array Entries + je Address_Get_Size_Entries + + mov ah,EMS_Code8F ; none of the above - invalid sub parm ;an000; dms; + + ret + + +Address_Get_Physical_Address: + + push si ; save some regs + push di ; save di ;an000; dms; + push ds ; save DS + + +; set up some things for the loop + + mov di,cs:[bp].IE_Saved_DI_Reg ; restore caller's DI, pointer to handle area + + mov cx,map_count ; number of entries in table + + push cs ; make DS:SI -> array + pop ds + + lea si,map_table + + cld ; make sure direction flag is right + +copy_address_array: + + mov ax,DS:[si+phys_page_segment] + mov ES:[di],ax + add di,2 ; increment destination pointer + mov ax,DS:[si+phys_page_number] + mov ES:[di],ax + + add si,type mappable_phys_page_struct ; increment pointer + add di,2 ; increment destination pointer + + loop copy_address_array + + mov cx,map_count ; number of entries + xor ah,ah ; good return code + + pop ds ; restore DS + pop di ; restore di + pop si ; restore SI + + RET ; return to caller + +Address_Get_Size_Entries: + + mov cx,cs:Map_Count ; return the number of pages allocated ;an000; dms; + xor ax,ax ; clear error flag ;an000; dms; + ret ; return to caller ;an000; dms; + + +address_array endp + + + + page +;------------------------------------------------------------------- +; +; 59 - Get extended momory hardware information +; +;------------------------------------------------------------------- +hardware_info proc + + cmp ose_functions,ose_enabled ; first, check for fcns enabled + je hi_enabled ; + + + mov ah,EMS_CODEA4 ; access denied + jmp hi_exit ; exit + +hi_enabled: + cmp al,hi_info ; 5900 - hardware info fcn + je hi_info_fcn + + cmp al,hi_raw ; 5901 - unallocated raw page count + je hi_raw_fcn + + mov ah,EMS_CODE8F ; invalid sub-function + +hi_exit: + RET ; return to caller + + + page +;------------------------------------------------------------------- +; +; hi_info_fcn +; +;------------------------------------------------------------------- + +hi_info_fcn: + + mov di,cs:[bp].IE_Saved_DI_Reg ; get di register + + mov es:word ptr[di+0],1024 ; raw page size = 16KB + mov es:word ptr[di+2],0 ; number of alternate register sets + mov es:word ptr[di+4],type H_SAVE_STRUC ; size of save array + mov es:word ptr[di+6],0 ; number of DMA register sets + mov es:word ptr[di+8],1 ; 1 = no special DMA register sets + + xor ah,ah ; good return code + ret ; return to caller + + page +;------------------------------------------------------------------- +; +; hi_raw_fcn +; +;------------------------------------------------------------------- + +hi_raw_fcn: + + mov ah,get_free_pages ; function code to get free pages + + call q_pages ; pass this one through, since our + ; raw pages = 16 KB + ; this fcn returns exacly the same + ; regs as are needed here + + ret ; return to caller + +hardware_info endp + + page +;------------------------------------------------------------------- +; +; 5B - alternate map register set +; +;------------------------------------------------------------------- + + AM_ES_Save dw 0 ;ES save variable ;an000; dms; + AM_DI_Save dw 0 ;DI save variable ;an000; dms; + AM_Set_Flag db 0 ;set called flag ;an000; dms; + +alternate_map proc + + cmp ose_functions,ose_enabled ; first, check for fcns enabled + je am_enabled ; + + + mov ah,EMS_CODEA4 ; access denied + jmp am_exit ; exit + +am_enabled: + cmp al,am_get ; 5b00 - get alternate map register set + je _am_get + + cmp al,am_set ; 5b01 - set alternate map register set + je _am_set + + cmp al,am_size ; 5b02 - get alternate map save array size + je _am_size + + cmp al,am_alloc ; 5b03 - allocate alternate map register set + je _am_alloc + + cmp al,am_dealloc ; 5b04 - deallocate alternate map register set + je _am_dealloc + + cmp al,am_dma_alloc ; 5b05 - allocate DMA register set + je _am_dma_alloc + + cmp al,am_dma_enable ; 5b06 - enable DMA register set + je _am_dma_enable + + cmp al,am_dma_disable ; 5b07 - disable DMA register set + je _am_dma_disable + + cmp al,am_dma_dealloc ; 5b08 - deallocate DMA register set + je _am_dma_dealloc + + mov ah,EMS_CODE8F ; invalid sub-function + +am_exit: + ret ; return to caller + + + page +;------------------------------------------------------------------- +; +; _am_get +; +;------------------------------------------------------------------- +_am_get: + + cmp cs:AM_Set_Flag,0 ;flag set? ;an000; dms; + jne AM_Get_Continue ;yes ;an000; dms; + xor di,di ;signal set has not ;an000; dms; + mov es,di ; been performed ;an000; dms; + xor ah,ah ;signal good exit ;an000; dms; + jmp AM_Get_Exit ;exit routine ;an000; dms; + +AM_Get_Continue: + + mov di,cs:AM_DI_Save + mov es,cs:AM_ES_Save + mov cs:[bp].IE_Saved_DI_Reg,di;set instance table entry ;an000; dms; + + call GET_SUBFCN ; copy the save area info to user's buffer + + xor bl,bl ; bl = 0 for our implementation + ; this indicates to user that ES:DI + ; buffer has been filled in with save + ; area info +AM_Get_Exit: + + ret + + page +;------------------------------------------------------------------- +; +; _am_set +; +;------------------------------------------------------------------- +_am_set: + + push si + push ds + + cmp bl,null ; bl must be 0 for us + jne _am_set_error ; set error code and exit + + mov di,cs:[bp].IE_Saved_DI_Reg ; restore caller's DI, pointer to mapping control structure + + mov cs:AM_ES_Save,es ; save es value ;an000; dms; + mov cs:AM_DI_Save,di ; save di value ;an000; dms; + mov cs:AM_Set_Flag,01 ; flag indicates set performed ;an000; dms; + mov si,di ; restore_pgfrm_map expects DS:SI to point to save area + push es + pop ds + + call RESTORE_PGFRM_MAP + + xor ah,ah ; good return code + + jmp _am_set_exit + +_am_set_error: + mov ah,EMS_CODE9C ; fast regs not supported and BL != 0 + +_am_set_exit: + + pop ds + pop si + + ret + + page +;------------------------------------------------------------------- +; +; _am_size +; +;------------------------------------------------------------------- +_am_size: + + mov dx,type h_save_struc ; get size requirements for save area + + xor ah,ah ; good return code + + ret + + page +;------------------------------------------------------------------- +; +; _am_alloc +; +;------------------------------------------------------------------- +_am_alloc: + + + xor bl,bl ; We don't support this function + ; in hardware, so return 0. + ; This indicates we will do software + ; emulation of these register sets. + + xor ah,ah ; good return code + + ret + + page +;------------------------------------------------------------------- +; +; _am_dealloc - 5b04 +; +;------------------------------------------------------------------- +_am_dealloc: + + xor ah,ah ; assume good return code + + cmp bl,0 ; is this a deallocate for 0? + je _am_dealloc_exit ; yes, goo return code + + mov ah,EMS_CODE9C ; error code for dealloc of unsupported + ; register set + +_am_dealloc_exit: + + ret + + page +;------------------------------------------------------------------- +; +; _am_dma_alloc +; +;------------------------------------------------------------------- +_am_dma_alloc: + + xor ah,ah ; good return code + xor bl,bl ; no DMA sets available + + ret + + page +;------------------------------------------------------------------- +; +; _am_dma_enable +; +;------------------------------------------------------------------- +_am_dma_enable: + + mov ah,EMS_CODE9E ; dedicated DMA not supported + + ret + + page +;------------------------------------------------------------------- +; +; _am_dma_disable +; +;------------------------------------------------------------------- +_am_dma_disable: + + mov ah,EMS_CODE9E ; dedicated DMA not supported + + ret + + page +;------------------------------------------------------------------- +; +; _am_dma_dealloc +; +;------------------------------------------------------------------- +_am_dma_dealloc: + + xor ah,ah ; assume good return code + + cmp bl,null ; is the DMA channel 0? + je _am_dma_de_exit + + mov ah,EMS_CODE9C ; DMA register sets are not + ; supported and bl != 0 + +_am_dma_de_exit: + ret + + +alternate_map endp + + page +;------------------------------------------------------------------- +; +; 5D - enable/disable OS/E functions set functions +; +;------------------------------------------------------------------- +enable_os proc + + cmp al,os_enable ; fcn code for enable + je os_enable_fcn + + cmp al,os_disable ; fcn code for disable + je os_disable_fcn + + cmp al,os_access ; fcn code for access key return + je os_access_fcn + + mov ah,EMS_CODE8F ;invalid sub-function code error + + ret ; return to caller + + page +;------------------------------------------------------------------- +; +; 5d00 - enable OS/E function set +; +; INPUT: +; +; BX,CX = Access key +; +; OUTPUT: +; +; AH = 00h, no error +; 80H, software error +; 81H, hardware error +; 84H, invalid function +; 8FH, invalid subfunction +; A4H, access denied, incorrect access key supplied +; +;------------------------------------------------------------------- +os_enable_fcn: + +; find out if this is the first time + + cmp word ptr access_code[0],0 ; access_code = 0, means enabled + jne ose_check_code ; not 0, must check access code + + cmp word ptr access_code[2],0 ; access_code = 0, means enabled + jne ose_check_code ; not 0, must check access code + + call get_code ; get access code to return + + xor ah,ah ; good return code + jmp ose_exit + +; not the first time, must check access code + +ose_check_code: + + cmp word ptr access_code[0],bx ; does it match? + jne ose_bad ; no, return access denied error + + cmp word ptr access_code[2],cx ; get second word of access code + jne ose_bad ; no, return access denied error + +; access code was OK, enable functions and return no error condition + + mov word ptr ose_functions,ose_enabled ; reset enabled flag + + xor ah,ah ; good return code + jmp ose_exit ; all done, exit + +ose_bad: + mov ah,EMS_CODEA4 ; return access denied error code + +ose_exit: + ret ; return to caller + + + page +;------------------------------------------------------------------- +; +; 5d01 - disable OS/E function set +; +; INPUT: +; +; BX,CX = Access key +; +; OUTPUT: +; +; AH = 00h, no error +; 80H, software error +; 81H, hardware error +; 84H, invalid function +; 8FH, invalid subfunction +; A4H, access denied, incorrect access key supplied +; +;------------------------------------------------------------------- +os_disable_fcn: + +; find out if this is the first time + + cmp word ptr access_code[0],0 ; access_code = 0, means enabled + jne osd_check_code ; not 0, must check access code + + cmp word ptr access_code[2],0 ; access_code = 0, means enabled + jne osd_check_code ; not 0, must check access code + +; yes, first time, must set access code and disable fcns + + call get_code ; get access code to return + + mov word ptr ose_functions,ose_disabled ; disable fcns + + xor ah,ah ; good return code + jmp osd_exit + +; not the first time, must check access code + +osd_check_code: + + cmp word ptr access_code[0],bx ; does it match? + jne osd_bad ; no, return access denied error + + cmp word ptr access_code[2],cx ; get second word of access code + jne osd_bad ; no, return access denied error + +; access code was OK, enable functions and return no error condition + + mov word ptr ose_functions,ose_disabled ; disable functions + + xor ah,ah ; good return code + jmp osd_exit ; all done, exit + +osd_bad: + mov ah,EMS_CODEA4 ; return access denied error code + +osd_exit: + ret ; return to caller + + page +;------------------------------------------------------------------- +; +; 5d02 - return OS/E function set access code +; +; INPUT: +; +; BX,CX = Access key +; +; OUTPUT: +; +; AH = 00h, no error +; 80H, software error +; 81H, hardware error +; 84H, invalid function +; 8FH, invalid subfunction +; A4H, access denied, incorrect access key supplied +; +;------------------------------------------------------------------- +os_access_fcn: + +; check access code + + + cmp word ptr access_code[0],bx ; does it match? + jne osa_bad ; no, return access denied error + + cmp word ptr access_code[2],cx ; get second word of access code + jne osa_bad ; no, return access denied error + +; clear access code and return "no error" return code (AH = 00) + + xor ax,ax ; clear ax + mov word ptr access_code[0],ax ; clear access code + mov word ptr access_code[2],ax ; clear access code + + jmp osa_exit + +osa_bad: + mov ah,ems_codeA4 ; access denied error code + +osa_exit: + ret ; return to caller + + + + + page +;------------------------------------------------------------------- +; +; get_code - returns random access code in cx,dx and stores it in +; system variable access_code. Access_code is a double-word +; which is used to save the bx,cx combination making up the +; "password" for OS/E functions. +; +;------------------------------------------------------------------- + +get_code: + + push dx ; save dx + +; get a "random" number for first word of access code + +redo1: + call get_rand ; returns "random" num in dx + xor dx,xor_mask ; confuse it a little + + cmp dx,0 ; make sure we didn't end up w/0 + je redo1 + + mov word ptr access_code[0],dx ; save it away + mov bx,dx + +; get another one for second word of access code + +redo2: + call get_rand + add dx,dx ; confuse it a little + xor dx,xor_mask + + cmp dx,0 ; make sure we didn't end up w/0 + je redo2 + + mov word ptr access_code[2],dx ; save it away + mov cx,dx ; put second word in cx + + pop dx ; restore + + ret ; return to caller + + +;------------------------------------------------------------------- +; +; get_rand - returns a "random" number in dx +; +;------------------------------------------------------------------- +get_rand: + + push ax ; save some regs + push cx + +redo: + mov ah,read_clock ; function code to read clock + int dos_int ; read the time + ; keep DX since it changes the most + + cmp dx,0 ; did we end up with 0? + je redo ; yes, redo it ... never want 0 + + pop cx ; restore some regs + pop ax + + ret ; return to caller + +enable_os endp + diff --git a/v4.0/src/DEV/XMA2EMS/LIM40B.INC b/v4.0/src/DEV/XMA2EMS/LIM40B.INC new file mode 100644 index 0000000..1e7683f --- /dev/null +++ b/v4.0/src/DEV/XMA2EMS/LIM40B.INC @@ -0,0 +1,3468 @@ + + page +;========================================================================= +; This module contains all the EQU's, STRUC's, data, and routines necessary +; for LIMDMS.INC. +; This module is to be INCLUDE'd as part of LIMDMS.INC. +; +;========================================================================= + +;========================================================================= +;========== Begin EQUate Definitions ===================================== +;========================================================================= + +AAJ_Option_Max equ 1h ;max option value ;an000; dms; +AAJ_Segment equ 1h ;segment request value ;an000; dms; +AAJ_No_Pages_To_Map equ 0h ;0 page map request ;an000; dms; + +MAC_Stack_Status_Request equ 02h ;stack size request ;an000; dms; + +ER_Conv_Memory equ 00h ;conv. memory request ;an000; dms; +ER_EMS_Memory equ 01h ;EMS memory request ;an000; dms; +EMS_Page_Size_In_Bytes equ (16*1024)-1 ;page size in bytes ;an000; dms; +ER_Max_Type equ 01h ;max type possible ;an000; dms; +ER_Max_Function equ 01h ;max function possible ;an000; dms; +ER_Move equ 00h ;move data ;an000; dms; +ER_Exchange equ 01h ;exchange data ;an000; dms; +ER_EMS_Page_FE equ 0FEh ;phys. page FEh ;an000; dms; +ER_EMS_Page_FF equ 0FFh ;phys. page FFh ;an000; dms; +ER_Dest_EMS_Memory equ 01h ;bit 0 set ;an000; dms; +ER_Source_EMS_Memory equ 02h ;bit 1 set ;an000; dms; +ER_Up equ 00h ;signal forward move ;an000; dms; +ER_Down equ 0ffh ;signal reverse move +ER_10H equ 10h ;equ for 10h ;an000; dms; + +AR_Sub_Max equ 01h ;5ah max. sub functions ;an000; dms; + +;========================================================================= +;========== End EQUate Definitions ======================================= +;========================================================================= + + page +;========================================================================= +;========== Begin STRUC Definitions ====================================== +;========================================================================= + +Log_Phys_Map_Struc struc ;page structure ;an000; dms; + + Log_Page_Number dw ? ;logical page number ;an000; dms; + Phys_Page_Number_Seg dw ? ;physical page or seg ;an000; dms; + ; determined by AL +Log_Phys_Map_Struc ends + + +Map_And_Jump_Struc struc ;carries jump info. ;an000; dms; + + Target_Address dd ? ;jump address ;an000; dms; + Log_Phys_Map_Len db ? ;entry count in ;an000; dms; + ; Log_Phys_Map_Struct + Log_Phys_Map_Ptr dd ? ;Log_Phys_Map_Struct ptr;an000; dms; + +Map_And_Jump_Struc ends ;an000; dms; + + +Map_And_Call_Struc struc ;carries jump info. ;an000; dms; + + MAC_Target_Address dd ? ;jump address ;an000; dms; + MAC_New_Page_Map_Len db ? ;entry count in ;an000; dms; + ; Log_Phys_Map_Struct + ; for new map scheme + MAC_New_Page_Map_Ptr dd ? ;Log_Phys_Map_Struc ptr ;an000; dms; + ; for new map scheme + MAC_Old_Page_Map_Len db ? ;entry count in ;an000; dms; + ; Log_Phys_Map_Struc + ; for old map scheme + MAC_Old_Page_Map_Ptr dd ? ;Log_Phys_Map_Struc ptr ;an000; dms; + ; for old map scheme + MAC_Reserved dw 4 DUP (?) ;Used to restore map ;an000; dms; + ; context + +Map_And_Call_Struc ends ;an000; dms; + + +Move_Source_Dest_Struc struc ;structure for move ;an000; dms; + + Region_Length_Low_Word dw ? ; + Region_Length_High_Word dw ? ;length of region ;an000; dms; + + Source_Memory_Type db ? ;conv/EMS ;an000; dms; + Source_Handle dw ? ;handle if EMS, else 0 ;an000; dms; + Source_Initial_Offset dw ? ;offset of source region;an000; dms; + Source_Initial_Seg_Page dw ? ;logical page if EMS ;an000; dms; + ; seg if conv. + Dest_Memory_Type db ? ;conv/EMS ;an000; dms; + Dest_Handle dw ? ;handle if EMS, else 0 ;an000; dms; + Dest_Initial_Offset dw ? ;offset of source region;an000; dms; + Dest_Initial_Seg_Page dw ? ;logical page if EMS ;an000; dms; + ; seg if conv. +Move_Source_Dest_Struc ends ;end structure ;an000; dms; + +Realloc_Struc Struc ;BP addressible struc ;an000; dms; + + Realloc_Reserved db size Instance_Entry_Struc dup (?) ;an000; dms; + Realloc_Alloc_Byte db ? ;reserved ;an000; dms; + Realloc_Reg_DI dw ? ;reserved ;an000; dms; + Realloc_Handle dw ? ;handle ;an000; dms; + + Realloc_Page_Count dw ? ;new page count ;an000; dms; + Realloc_Page_Alloc dw ? ;pages to be allocated ;an000; dms; + Realloc_Page_Dealloc dw ? ;pages to be deallocated ;an000; dms; + + Realloc_Handle_Xref_Index dw ? ;index to end of handle table ;an000; dms; + Realloc_LookUp_Index dw ? ;index to applicable handle ;an000; dms; + Realloc_Mult dw ? ;multiplier ;an000; dms; + +Realloc_Struc Ends ;end structure ;an000; dms; + +AAJ_Struc Struc ;BP addressible struc ;an000; dms; + + AAJ_Reserved db size Instance_Entry_Struc dup (?) ;an000; dms; + AAJ_Xref_Pages dw ? ;save logical page count ;an000; dms; + AAJ_Handle dw ? ;saved handle ;an000; dms; + AAJ_Option db ? ;saved selector state ;an000; dms; + AAJ_LookUp_Index dw ? ;save index ;an000; dms; + AAJ_Mult dw ? ;multiplier ;an000; dms; + +AAJ_Struc Ends ;end structure ;an000; dms; + +MAC_Struc Struc ;BP addressible struc ;an000; dms; + + MAC_Reserved_Area db size Instance_Entry_Struc dup (?) ;an000; dms; + MAC_LookUp_Index dw ? ;save index ;an000; dms; + MAC_Xref_Pages dw ? ;save logical page count ;an000; dms; + MAC_Option db ? ;saved selector state ;an000; dms; + + EMS_Reg_ES dw ? ;ES reg ;an000; dms; + EMS_Reg_DS dw ? ;DS reg ;an000; dms; + EMS_Reg_FL dw ? ;FL reg ;an000; dms; + EMS_Reg_SI dw ? ;SI reg ;an000; dms; + EMS_Reg_DI dw ? ;DI reg ;an000; dms; + EMS_Reg_DX dw ? ;DX reg ;an000; dms; + EMS_Reg_CX dw ? ;CX reg ;an000; dms; + EMS_Reg_BX dw ? ;BX reg ;an000; dms; + + MAC_M_C_Data db size Map_And_Call_Struc dup (?) ;an000; dms; + MAC_M_C_Log db size Log_Phys_Map_Struc*Map_Count_Def dup (?) ;an000; dms; + MAC_Map_Table db size Mappable_Phys_Page_Struct*Map_Count_Def dup (?) ;an000; dms; + MAC_Mult dw ? ;multiplier ;an000; dms; + +MAC_Struc Ends ;end structure ;an000; dms; + + +ER_Struc Struc ;BP addressible struc ;an000; dms; + + ER_Reserved db size Instance_Entry_Struc dup (?) ;an000; dms; + ER_Direction_Flag db ER_Up ;default to forward move;an000; dms; + + ER_Sub_Function db ? ;save subfunction byte ;an000; dms; + + ER_Src_Abs_Beg_Low dw ? ;abs add of src EMS page;an000; dms; + ER_Src_Abs_Beg_High dw ? ; beginning of trf area;an000; dms; + ER_Src_Abs_End_Low dw ? ;abs add of src EMS page;an000; dms; + ER_Src_Abs_End_High dw ? ; end of trf area ;an000; dms; + + ER_Dst_Abs_Beg_Low dw ? ;abs add of src EMS page;an000; dms; + ER_Dst_Abs_Beg_High dw ? ; beginning of trf area;an000; dms; + ER_Dst_Abs_End_Low dw ? ;abs add of src EMS page;an000; dms; + ER_Dst_Abs_End_High dw ? ; end of trf area ;an000; dms; + + ER_Current_Move_Count dw ? ;bytes moved this time ;an000; dms; + + ER_Move_Xchg_Buffer1 db 10h dup (?) ;buffer for move/xchg ;an000; dms; + ER_Move_Xchg_Buffer2 db 10h dup (?) ;buffer for move/xchg ;an000; dms; + + ER_Move_Count_Low dw ? ;low word of count ;an000; dms; + ER_Move_Count_High dw ? ;high word of count ;an000; dms; + + ER_Source_Phys_Page dw ? ;page number of source ;an000; dms; + ER_Dest_Phys_Page dw ? ;page number of dest ;an000; dms; + + ER_Source_Page dw ? ;active source page ;an000; dms; + ER_Dest_Page dw ? ;active dest page ;an000; dms; + + ER_Source_Handle dw ? ;active handle ;an000; dms; + ER_Dest_Handle dw ? ;active handle ;an000; dms; + ; 10h byte moves + + ER_Save_Context_Buffer dw 2*Type Mappable_Phys_Page_Struct dup (0) ;room for 2 pgs;an000; dms; + + ER_Dest_Seg dw ? ;seg value of dest ;an000; dms; + ER_Source_Seg dw ? ;seg value of source ;an000; dms; + + ER_Dest_Off dw ? ;off value of dest ;an000; dms; + ER_Source_Off dw ? ;off value of source ;an000; dms; + + ER_Mem_Type dw ? ;memory type ;an000; dms; + + +ER_Struc Ends ;end structure ;an000; dms; + +;========================================================================= +;========== End STRUC Definitions ======================================== +;========================================================================= + + page +;========================================================================= +;========== Begin Macro Definitions ====================================== +;========================================================================= + + +;========================================================================= +; MAC_Expand_Stack_And_Copy : This routine will place data in the +; instance table by copying the data pointed +; at by ES:DI. +; +; Inputs : AX - Size of stack adjustment +; ES:DI - Pointer to data to be copied to stack +; +; Outputs : BP - data place in instance table +; +;========================================================================= + +MAC_Expand_Stack_And_Copy proc + + mov cx,ax ;get adjustment factor ;an000; dms; + shr cx,1 ;convert to word move ;an000; dms; + mov ax,es ;get data source seg ;an000; dms; + mov ds,ax ;place in ds ;an000; dms; + mov si,di ;get data source off ;an000; dms; + + mov ax,cs ;get dest. seg ;an000; dms; + mov es,ax ;place in es ;an000; dms; + mov di,bx ;get dest. off ;an000; dms; + + cli ;ints off ;an000; dms; + rep movsw ;move data to stack ;an000; dms; + sti ;ints on ;an000; dms; + + ret ;end routine ;an000; dms; + +MAC_Expand_Stack_And_Copy endp + + page +;========================================================================= +; MAC_Shrink_Stack_And_Copy : This routine move data from the instance +; table and place it at ES:DI. +; +; Inputs : AX - Size of stack adjustment +; ES:DI - Pointer to where data is to be copied +; +; Outputs : BP - data removed from instance table +; +;========================================================================= + +MAC_Shrink_Stack_And_Copy proc + + mov cx,ax ;get adjustment factor ;an000; dms; + mov ax,cs ;get data source seg ;an000; dms; + mov ds,ax ;place in ds ;an000; dms; + mov si,bx ;get data source off ;an000; dms; + mov ax,cx ;save count across move ;an000; dms; + shr cx,1 ;convert to word move ;an000; dms; + + cli ;ints off ;an000; dms; + rep movsw ;move data from stack ;an000; dms; + sti ;ints on ;an000; dms; + + ret ;end routine ;an000; dms; + +MAC_Shrink_Stack_And_Copy endp + + +;========================================================================= +;========== End Macro Definitions ======================================== +;========================================================================= + + page +;========================================================================= +;========== Begin Generic PROC Definitions =============================== +;========================================================================= + +;========================================================================= +; Map_Pages : This routine will map the pages being +; requested in the struc pointed to by +; DS:SI. +; +; Inputs : ES:DI - Pointer to data in Log_Phys_Map_Struc format +; CX - Count of data iterations in ES:DI +; DX - handle +; BX - page count for handle +; AL - option +; +; Outputs : Revised map +; AH - 0 = no error +; > 0 = error +;========================================================================= + +Map_Pages proc ; ;an000; dms; + + push si ;save reg ;an000; dms; + + mov si,ax ;save option ;an000; dms; + cmp cx,AAJ_No_Pages_To_Map ;no pages? ;an000; dms; + je Map_Error_Exit ;yes - exit loop ;an000; dms; + +Map_Loop_Continue: + + cmp [di].Log_Page_Number,bx ;logical page out of ;an000; dms; + ; range? + jbe Map_Get_Segment ;no - in range ;an000; dms; + mov ah,EMS_Code8A ;yes - out of range ;an000; dms; + jmp Map_Error_Exit ;exit routine ;an000; dms; + +Map_Get_Segment: + + cmp si,AAJ_Segment ;segment request? ;an000; dms; + mov ax,[di].Phys_Page_Number_Seg ;get physical page ;an000; dms; + jne Map_Page_Request ;no - page request ;an000; dms; + push dx ;save handle + mov dx,[di].Phys_Page_Number_Seg ;get segment ;an000; dms; + call Get_Phys_Seg_Page ;get the associated ;an000; dms; + ; page for the segment + mov ax,dx ;place page in ax ;an000; dms; + pop dx ;restore handle + jnc Map_Page_Request ;no error - continue ;an000; dms; + mov ah,EMS_Code8B ;phys page not found ;an000; dms; + jmp Map_Error_Exit ;exit routine ;an000; dms; + +Map_Page_Request: + + push bx ;save bx across call ;an000; dms; + mov bx,[di].Log_Page_Number ;logical page to map ;an000; dms; + call Map_L_To_P ;map the page ;an000; dms; + pop bx ;restore bx ;an000; dms; + or ah,ah ;error? ;an000; dms; + jnz Map_Error_Exit ;pass error on & exit ;an000; dms; + add di,Type Log_Phys_Map_Struc ;adjust pointer ;an000; dms; + loop Map_Loop_Continue ;continue loop ;an000; dms; + xor ax,ax ;signal good finish ;an000; dms; + +Map_Error_Exit: + + pop si ;restore reg ;an000; dms; + + ret ;return to caller ;an000; dms; + +Map_Pages endp ;end proc ;an000; dms; + + + page +;========================================================================= +; Get_Phys_Seg_Page : This routine will obtain the physical page +; number for a given segment. +; +; Inputs : DX - Segment value +; Outputs : DX - Physical page number +; CY - Error +; NC - No error +;========================================================================= + +Get_Phys_Seg_Page proc ;begin routine ;an000; dms; + + push ax ;save regs ;an000; dms; + push cx ; ;an000; dms; + push di ; ;an000; dms; + + cli ;ints off ;an000; dms; + mov di,offset Map_Table ;point to table map ;an000; dms; + mov cx,Map_Count ;number of table entries;an000; dms; + sti ;ints on ;an000; dms; + +GPSP_Loop: + + cli ;ints off ;an000; dms; + cmp dx,cs:[di].Phys_Page_Segment ;segment match? ;an000; dms; + je GPSP_Got_Segment ;yes ;an000; dms; + add di,Type Mappable_Phys_Page_Struct ;adjust pointer ;an000; dms; + loop GPSP_Loop ;continue search ;an000; dms; + +GPSP_Got_Segment: + + sti ;ints on ;an000; dms; + cmp cx,0 ;data found? ;an000; dms; + je GPSP_Not_Found ;exit with error ;an000; dms; + mov dx,cs:[di].Phys_Page_Number ;exit with page number ;an000; dms; + clc ;clear cy ;an000; dms; + jmp GPSP_Found ;exit ;an000; dms; + +GPSP_Not_Found: + + stc ;signal error ;an000; dms; + +GPSP_Found: ;exit ;an000; dms; + + pop di ;restore regs ;an000; dms; + pop cx ; ;an000; dms; + pop ax ; ;an000; dms; + + ret ;return to caller ;an000; dms; + +Get_Phys_Seg_Page endp ;end proc ;an000; dms; + + +;========================================================================= +;========== End Generic PROC Definitions ================================= +;========================================================================= + + + + page + +;------------------------------------------------------------------- +; Reallocate Pages - Function 18 +; +; Entry - AX = 51?? +; BX = count of new allocation pages +; DX = handle +; +; Exit - AH = status +; BX = new page count +; if error - original page count +;------------------------------------------------------------------- +reallocate proc + + push cx ;save affected regs ;an000; dms; + push dx ; ;an000; dms; + push di ; ;an000; dms; + push si ; ;an000; dms; + + push ds ;save segments ;an000; dms; + push es ; ;an000; dms; + + mov ax,cs ;get code segment ;an000; dms; + mov ds,ax ;put int ds and ;an000; dms; + mov es,ax ; es ;an000; dms; + + + mov cs:[bp].Realloc_Page_Count,bx ;new page count ;an000; dms; + mov cs:[bp].Realloc_Handle,dx ;handle ;an000; dms; + + + + mov ax,cs:[bp].Realloc_Handle ;get handle for search ;an000; dms; + mov cs:[bp].Realloc_Mult,Type H_LookUp_Struc;handle lookup table ;an000; dms; + mul cs:[bp].Realloc_Mult ;obtain index position ;an000; dms; + mov cs:[bp].Realloc_LookUp_Index,ax ;index to handle ;an000; dms; + mov di,ax ;place index in si ;an000; dms; + mov dx,cs:[bp].Realloc_Handle ;get handle number ;an000; dms; + + + cmp dx,Num_Handles-1 ;dx > handle count? ;an000; dms; + jbe Realloc_Handle_Search ;handle within range ;an000; dms; + mov ah,EMS_Code83 ;EMS handle non-existent;an000; dms; + jmp Realloc_Error_Exit ;exit program ;an000; dms; + +Realloc_Handle_Search: + + cmp Handle_LookUp_Table.H_Pages[di],Reusable_Handle ;handle allocated ;an000; dms; + jne Realloc_Status_Of_Handle ;handle good ;an000; dms; + mov ah,EMS_Code83 ;EMS handle not alloc ;an000; dms; + jmp Realloc_Error_Exit ;exit program ;an000; dms; + +Realloc_Status_Of_Handle: + + + mov ax,Handle_LookUp_Table.H_Pages[di] ;get current page count ;an000; dms; + sub ax,cs:[bp].Realloc_Page_Count ;more or less pages? ;an000; dms; + jc Realloc_More_Pages ;more pages to alloc ;an000; dms; + +Realloc_Less_Pages: + + mov bx,ax ;pages to deallocate ;an000; dms; + mov cs:[bp].Realloc_Page_Dealloc,ax ;save dealloc value ;an000; dms; + + mov si,Handle_LookUp_Table.H_Pal_Ptr[di] ;get start of links ;an000; dms; + mov cx,Handle_LookUp_Table.H_Pages[di] ;current pages allocated;an000; dms; + sub cx,bx ;pages to remain alloc ;an000; dms; + + +Realloc_Dealloc_Loop1: + + cmp cx,0 ;pages? ;an000; dms; + je Realloc_Dealloc_Loop1_Exit ;no - exit ;an000; dms; + shl si,1 + mov si,Page_Alloc_List[si] ;get next pointer ;an000; dms; + dec cx ;dec loop count ;an000; dms; + jmp Realloc_Dealloc_Loop1 ;continue ;an000; dms; + +Realloc_Dealloc_Loop1_Exit: + +;***** Adjust pointers ***** + + mov cx,cs:[bp].Realloc_Page_Dealloc ;get dealloc count ;an000; dms; + mov ax,cs:PAL_Free_Ptr ;get the free ptr ;an001; dms; + cmp cx,0 ;0 pages to dealloc? ;an001; dms; + je Realloc_Dealloc_Loop2_Exit1 ;yes - bypass dealloc ;an001; dms; + mov cs:PAL_Free_Ptr,si ;no - set new free ptr ;an001; dms; + dec cx ;don't loop past last pg;an001; dms; + +Realloc_Dealloc_Loop2: + + cmp cx,0 ;end of deallocate? ;an000; dms; + je Realloc_Dealloc_Loop2_Exit ;yes - exit ;an000; dms; + shl si,1 ;get index entry ;an001; dms; + mov si,Page_Alloc_List[si] ;get next ptr ;an001; dms; + dec cx ;decrement counter ;an000; dms; + jmp Realloc_Dealloc_Loop2 + +Realloc_Dealloc_Loop2_Exit: + + shl si,1 ;get index entry ;an001; dms; + mov Page_Alloc_List[si],ax ;pt. last page to orig. ;an001; dms; + ; free ptr. + +Realloc_Dealloc_Loop2_Exit1: + + mov ax,cs:[bp].Realloc_Page_Count ;new page count ;an000; dms; + mov Handle_LookUp_Table.H_Pages[di],ax ; ;an000; dms; + + mov ax,cs:[bp].Realloc_Page_Dealloc ;adj. value ;an000; dms; + add cs:Free_Pages,ax ;free up page ;an000; dms; + + mov bx,cs:[bp].Realloc_Page_Count ;pass back page request ;an000; dms; + xor ah,ah ;clear error ;an000; dms; + jmp Realloc_Exit ;exit ;an000; dms; + +Realloc_More_Pages: + + mov cx,cs:[bp].Realloc_Page_Count ;get page request count ;an000; dms; + mov di,cs:[bp].Realloc_LookUp_Index ;get LookUp Table ptr ;an000; dms; + mov ax,Handle_LookUp_Table.H_Pages[di] ;get current page count ;an000; dms; + sub cx,ax ;get additional pages ;an000; dms; + mov cs:[bp].Realloc_Page_Alloc,cx ;new pages to alloc ;an000; dms; + cmp cx,Free_Pages ;> pages remaining? ;an000; dms; + jbe Realloc_Pages ;reallocate pages ;an000; dms; + mov ah,EMS_Code87 ;Too few pages avail ;an000; dms; + jmp Realloc_Error_Exit ;exit prog ;an000; dms; + +Realloc_Pages: + + mov cx,Handle_LookUp_Table.H_Pages[di] ;current pages allocated;an000; dms; + cmp cx,0 ;any pages? ;an000; dms; + jne Realloc_More_Pages_Cont ;yes ;an000; dms; + cmp cs:[bp].Realloc_Page_Alloc,0 ;any pages requested? ;an000; dms; + je Realloc_Alloc_Loop1_Exit ;continue ;an000; dms; + + mov cx,cs:[bp].Realloc_Page_Alloc ;get new page count ;an001; dms; + cli ;ints off ;an001; dms; + call EMS_Page_Contig_Chk ;contig pages avail? ;an001; dms; + jnc Realloc_New_Pages + mov ah,EMS_Code87 ;Too few pages avail ;an000; dms; + sti ;ints on ;an001; dms; + jmp Realloc_Error_Exit ;exit prog ;an000; dms; + +Realloc_New_Pages: + + call EMS_Link_Set ;set up page list ;an001; dms; + + mov Handle_LookUp_Table.H_Pal_Ptr[di],si ;set table to pointer ;an000; dms; + mov Handle_LookUp_Table.H_Pages[di],cx ;new page count ;an000; dms; + mov bx,cs:[bp].Realloc_Page_Count ;return new page count ;an001; dms; + sub cs:Free_Pages,bx ;new free count ;an000; dms; + sti ;ints on ;an001; dms; + xor ax,ax ;clear error flag ;an001; dms; + + jmp Realloc_Exit ;exit routine ;an001; dms; + + +Realloc_More_Pages_Cont: + + dec cx + mov si,Handle_LookUp_Table.H_Pal_Ptr[di] ;get start of links ;an000; dms; + +Realloc_Alloc_Loop1: + cmp cx,0 ;at end ;an000; dms; + je Realloc_Alloc_Loop1_Exit ;yes ;an000; dms; + shl si,1 ;word entry ;an000; dms; + mov si,Page_Alloc_List[si] ;get next pointer ;an000; dms; + dec cx ;decrement loop count ;an000; dms; + jmp Realloc_Alloc_Loop1 ;continue ;an000; dms; + +Realloc_Alloc_Loop1_Exit: + + mov cx,cs:[bp].Realloc_Page_Alloc ;new pages to alloc ;an000; dms; + cmp cx,0 ;pages requested? ;an001; dms; + je Realloc_Alloc_Exit ;no - exit routine ;an001; dms; + + mov bx,si ;save si ;an001; dms; + cli ;ints off ;an001; dms; + call EMS_Page_Contig_Chk ;contig pages? ;an001; dms; + jnc Realloc_Next_Pages ;yes ;an001; dms; + mov ah,EMS_Code87 ;Too few pages avail ;an000; dms; + sti ;ints on ;an001; dms; + jmp Realloc_Error_Exit ;exit prog ;an000; dms; + +Realloc_Next_Pages: + +;;;; mov ax,si ;ptr to new list ;an001; dms; +;;;; inc ax ;contig to new links? ;an001; dms; +;;;; cmp ax,bx ; ;an001; dms; +;;;; je Realloc_Next_Pages1 ;yes continue ;an001; dms; +;;;; mov ah,EMS_Code87 ;Too few pages avail ;an000; dms; +;;;; sti ;ints on ;an001; dms; +;;;; jmp Realloc_Error_Exit ;exit prog ;an000; dms; + +Realloc_Next_Pages1: + + call EMS_Link_Set ;set up page list ;an001; dms; + mov ax,si ;ptr to new list ;an001; dms; + mov si,bx ;end of old list ;an001; dms; + shl si,1 ;index entry ;an001; dms; + mov Page_Alloc_List[si],ax ;pick up new links ;an001; dms; + +Realloc_Alloc_Exit: + + mov bx,cs:[bp].Realloc_Page_Alloc ;additional pages ;an001; dms; + sub cs:Free_Pages,bx ;new free count ;an000; dms; + mov bx,cs:[bp].Realloc_Page_Count ;pass back page request ;an000; dms; + mov Handle_LookUp_Table.H_Pages[di],bx ;new page count ;an000; dms; + sti ;ints on ;an001; dms; + xor ah,ah ;clear ah ;an000; dms; + jmp Realloc_Exit ;exit ;an000; dms; + + +Realloc_Error_Exit: + + cli ;ints off ;an000; dms; + mov si,cs:[bp].Realloc_LookUp_Index ;get handle index ;an000; dms; + mov bx,Handle_LookUp_Table.H_Pages[si] ;get orig. count ;an000; dms; + mov Handle_LookUp_Table.H_Pages[si],bx ;new page count ;an000; dms; + sti ;ints on ;an000; dms; + +Realloc_Exit: + + pop es ;restore segments ;an000; dms; + pop ds ; ;an000; dms; + + pop si ;restore regs ;an000; dms; + pop di ; ;an000; dms; + pop dx ; ;an000; dms; + pop cx ; ;an000; dms; + + ret ;return to caller ;an000; dms; + +reallocate endp + + + + page +;========================================================================= +;=============== Function 55h Logic - Alter Page Map & Jump ============= +;========================================================================= +;========================================================================= +; Alter_And_Jump - This routine alters the page map and jumps +; to the specified address. +; +; Inputs : AH - 55h (Alter page map & jump) +; AL - Physical page number/segment selector +; 0 = Physical page numbers specified +; 1 = Segment addresses specified in lieu of +; physical page numbers +; DX - handle number +; DS:SI - Pointer to map and jump structure +; (see Map_And_Jump_Struct above) +; +; Outputs : Revised map +; AH - Non-zero if error +; +;========================================================================= +Alter_And_Jump proc ;modify map ;an000; dms; + + push bx ;save regs for jump ;an000; dms; + push cx ; ;an000; dms; + push di ; ;an000; dms; + push si ; ;an000; dms; + + pushf ;save flags ;an000; dms; + push ds ;save segments ;an000; dms; + push es ; ;an000; dms; + + mov bx,cs ;get code segment ;an000; dms; + mov es,bx ; es ;an000; dms; + + mov cs:[bp].AAJ_Handle,dx ;save handle ;an000; dms; + mov cs:[bp].AAJ_Option,al ;save selector option ;an000; dms; + + + + cmp dx,Num_Handles-1 ;dx > handle count ;an000; dms; + jbe AAJ_Check_Reusable ;continue test ;an000; dms; + mov ah,EMS_Code83 ;EMS handle bad ;an000; dms; + jmp AAJ_Error_Exit ;exit routine ;an000; dms; + +AAJ_Check_Reusable: + + mov ax,dx ;get handle ;an000; dms; + mov cs:[bp].AAJ_Mult,Type H_LookUp_Struc ;handle lookup table ;an000; dms; + mul cs:[bp].AAJ_Mult ;obtain index position ;an000; dms; + mov cs:[bp].AAJ_LookUp_Index,ax ;index to handle ;an000; dms; + mov di,ax ;place index in di ;an000; dms; + + cli ;ints off ;an000; dms; + mov ax,Handle_LookUp_Table.H_Pages[di] ;get logical page count ;an000; dms; + mov cs:[bp].AAJ_Xref_Pages,ax ;save logical page count;an000; dms; + sti ;ints on ;an000; dms; + cmp Handle_LookUp_Table.H_Pages[di],Reusable_Handle ;handle allocated ;an000; dms; + jne AAJ_Good_Handle ;handle good ;an000; dms; + mov ah,EMS_Code83 ;EMS handle bad ;an000; dms; + jmp AAJ_Error_Exit ;exit routine ;an000; dms; + +AAJ_Good_Handle: + + cmp cs:[bp].AAJ_Option,AAJ_Option_Max ;option in range? ;an000; dms; + jbe AAJ_Good_Option ;option good ;an000; dms; + mov ah,EMS_Code8F ;bad option ;an000; dms; + jmp AAJ_Error_Exit ;exit routine ;an000; dms; + +AAJ_Good_Option: + + les di,[si].Log_Phys_Map_Ptr ;point to map data ;an000; dms; + xor cx,cx ;clear loop counter ;an000; dms; + mov cl,[si].Log_Phys_Map_Len ;get loop count ;an000; dms; + mov dx,cs:[bp].AAJ_Handle ;get handle for call ;an000; dms; + mov bx,cs:[bp].AAJ_Xref_Pages ;logical page count ;an000; dms; + xor ah,ah ;clear high word ;an000; dms; + mov al,cs:[bp].AAJ_Option ;option selected ;an000; dms; + call Map_Pages ;map the pages requested;an000; dms; + or ah,ah ;error? ;an000; dms; + jnz AAJ_Error_Exit ;exit with error cond. ;an000; dms; + +AAJ_Loop_Exit: + + pop es ;restore regs ;an000; dms; + pop ds ; ;an000; dms; + popf ; ;an000; dms; + pop si ; ;an000; dms; + pop di ; ;an000; dms; + pop cx ; ;an000; dms; + pop bx ; ;an000; dms; + + mov cs:[bp].IE_Alloc_Byte,Unallocated ;deallocate instance ;an000; dms; + + jmp dword ptr [si].Target_Address ;jump to address & run ;an000; dms; + +AAJ_Error_Exit: + + pop es ;restore regs ;an000; dms; + pop ds ; ;an000; dms; + popf ; ;an000; dms; + pop si ; ;an000; dms; + pop di ; ;an000; dms; + pop cx ; ;an000; dms; + pop bx ; ;an000; dms; + + + ret ;return to caller ;an000; dms; + +Alter_And_Jump endp ;end proc ;an000; dms; + + + + page +;========================================================================= +;=============== Function 56h Logic - Alter Page Map & Call ============= +;========================================================================= + + + +;========================================================================= +; Alter_And_Call - This routine alters the page map and calls +; the specified address. The mapping context +; is saved on entry to the routine and restored +; on exit from the routine. +; +; Inputs : AH - 56h (Alter page map & call) +; AL - Physical page number/segment selector +; 0 = Physical page numbers specified +; 1 = Segment addresses specified in lieu of +; physical page numbers +; 2 = Give minimum required stack size +; DX - handle number +; DS:SI - Pointer to map and jump structure +; (see Map_And_Call_Struc above) +; +; Outputs : Revised map +; AH - Non-zero if error +; BX - Function 2 = size in bytes needed for stack +; +;========================================================================= + + +Alter_And_Call proc ;modify map & call ;an000; dms; + + cmp al,MAC_Stack_Status_Request ;stack report? ;an000; dms; + je MAC_Calc_Stack_Status ;yes ;an000; dms; + jb MAC_Alter_And_Call ;no - new mapping ;an000; dms; + mov ah,EMS_Code8F ;error occurred ;an000; dms; + jmp MAC_Stack_Exit ;exit routine ;an000; dms; + +MAC_Calc_Stack_Status: + + mov bx,8h ;room for call address ;an000; dms; + ; and return address + xor ax,ax ;signal no error ;an000; dms; + jmp MAC_Stack_Exit ;exit routine ;an000; dms; + +MAC_Alter_And_Call: + + cli ;ints off ;an000; dms; + mov cs:[bp].EMS_Reg_BX,bx ; ;an000; dms; + mov bx,ax ;save ax across flags ;an000; dms; + lahf ;move flags to ah ;an000; dms; + mov cs:[bp].EMS_Reg_FL,ax ;save flags ;an000; dms; + mov ax,bx ;restore ax ;an000; dms; + mov cs:[bp].EMS_Reg_CX,cx ; ;an000; dms; + mov cs:[bp].EMS_Reg_DX,dx ; ;an000; dms; + mov cs:[bp].EMS_Reg_DI,di ; ;an000; dms; + mov cs:[bp].EMS_Reg_SI,si ; ;an000; dms; + mov cs:[bp].EMS_Reg_DS,ds ; ;an000; dms; + mov cs:[bp].EMS_Reg_ES,es ; ;an000; dms; + + mov cs:[bp].MAC_Option,al ;save option ;an000; dms; + sti ;ints on ;an000; dms; + cmp dx,Num_Handles-1 ;dx > handle count ;an000; dms; + jbe MAC_Check_Reusable ;continue test ;an000; dms; + mov ah,EMS_Code83 ;EMS handle bad ;an000; dms; + jmp MAC_Error_Exit ;exit routine ;an000; dms; + +MAC_Check_Reusable: + + mov ax,dx ;get handle ;an000; dms; + mov cs:[bp].MAC_Mult,Type H_LookUp_Struc ;handle lookup table ;an000; dms; + mul cs:[bp].MAC_Mult ;obtain index position ;an000; dms; + mov cs:[bp].MAC_LookUp_Index,ax ;index to handle ;an000; dms; + mov di,ax ;place index in di ;an000; dms; + + cli ;ints off ;an000; dms; + mov ax,Handle_LookUp_Table.H_Pages[di] ;get logical page count ;an000; dms; + mov cs:[bp].MAC_Xref_Pages,ax ;save logical page count;an000; dms; + cmp Handle_LookUp_Table.H_Pages[di],Reusable_Handle ;handle allocated ;an000; dms; + sti ;ints on ;an000; dms; + jne MAC_Verify_New_Count ;handle good ;an000; dms; + mov ah,EMS_Code83 ;EMS handle bad ;an000; dms; + jmp MAC_Error_Exit ;exit routine ;an000; dms; + +MAC_Verify_New_Count: + + cli ;ints off ;an000; dms; + mov ax,Map_Count ;get phys. page count ;an000; dms; + sti ;ints on ;an000; dms; + cmp [si].MAC_New_Page_Map_Len,al ;> physical pages ;an000; dms; + jbe MAC_Verify_Old_Count ;no - continue ;an000; dms; + mov ah,EMS_Code8B ;out of range ;an000; dms; + jmp MAC_Error_Exit ;exit routine ;an000; dms; + +MAC_Verify_Old_Count: + + cli ;ints off ;an000; dms; + mov ax,Map_Count ;get phys. page count ;an000; dms; + sti ;ints on ;an000; dms; + cmp [si].MAC_Old_Page_Map_Len,al ;> physical pages ;an000; dms; + jbe MAC_Do_Alter_and_Call ;no - continue ;an000; dms; + mov ah,EMS_Code8B ;yes - error ;an000; dms; + jmp MAC_Error_Exit ;exit routine ;an000; dms; + +MAC_Do_Alter_And_Call: + + jmp MAC_Build_Stack_And_Map ;build stack and map ;an000; dms; + ; new pages +MAC_Return_Routine: + + jmp MAC_Strip_Stack_And_Map ;restore data strucs ;an000; dms; + ; and map old pages + +MAC_Exit: +MAC_Error_Exit: + + cli ;ints off ;an000; dms; + mov bx,ax ;save ax ;an000; dms; + mov ax,cs:[bp].EMS_Reg_FL ;obtain entry flag stat ;an000; dms; + sahf ;put in flags reg ;an000; dms; + mov ax,bx ;restore ax ;an000; dms; + mov bx,cs:[bp].EMS_Reg_BX ; ;an000; dms; + mov cx,cs:[bp].EMS_Reg_CX ; ;an000; dms; + mov dx,cs:[bp].EMS_Reg_DX ; ;an000; dms; + mov di,cs:[bp].EMS_Reg_DI ; ;an000; dms; + mov si,cs:[bp].EMS_Reg_SI ; ;an000; dms; + mov ds,cs:[bp].EMS_Reg_DS ; ;an000; dms; + mov es,cs:[bp].EMS_Reg_ES ; ;an000; dms; + sti ;ints on ;an000; dms; + +MAC_Stack_Exit: + + ret ;return to caller ;an000; dms; + + +;========================================================================= +; MAC_Build_Stack_And_Map : This routine will build the required +; stack structure for a re-entrant +; routine and map the new pages. +; +; Inputs : DS:SI - Pointer to data in Map_And_Call_Struc format +; +; Outputs : BP - Instance table to reflect data copyied to it +; New mapped pages +; AH - 0 = no error +; >0 = error (determined by Map_Pages) +; +; Instance Table carries this data: Old Map Data +; New Map Data +; Map & Call Data +; Context +;========================================================================= + +MAC_Build_Stack_And_Map: + + mov cs:[bp].EMS_Reg_DS,ds ;save DS ;an000; dms; + mov cs:[bp].EMS_Reg_SI,si ;save SI ;an000; dms; + + mov ax,word ptr [si].MAC_Old_Page_Map_Ptr[+2];get the segment ;an000; dms; + mov es,ax ; of the old map ;an000; dms; + mov di,word ptr [si].MAC_Old_Page_Map_Ptr[+0];get its offset ;an000; dms; + + mov al,[si].MAC_Old_Page_Map_Len ;get length of data ;an000; dms; + cbw ;convert to word ;an000; dms; + xor dx,dx ;clear high word ;an000; dms; + mov bx,Type Log_Phys_Map_Struc ;struc size + mul bx ;get total byte count ;an000; dms; + cli ;ints off ;an000; dms; + mov bx,offset MAC_M_C_Log ;offset in struc ;an000; dms; + sti ;ints on ;an000; dms; + add bx,bp ;actual offset ;an000; dms; + call MAC_Expand_Stack_And_Copy ;set up stack for ;an000; dms; + ; copy of data and + ; copy the data + mov ds,cs:[bp].EMS_Reg_DS ;restore ds ;an000; dms; + mov si,cs:[bp].EMS_Reg_SI ;restore si ;an000; dms; + + mov ax,word ptr [si].MAC_New_Page_Map_Ptr[+2];get the segment ;an000; dms; + mov es,ax ; of the old map ;an000; dms; + mov di,word ptr [si].MAC_New_Page_Map_Ptr[+0];get its offset ;an000; dms; + + mov al,[si].MAC_New_Page_Map_Len ;get length of data ;an000; dms; + cbw ;conver to word ;an000; dms; + xor dx,dx ;clear high word ;an000; dms; + mov bx,Type Log_Phys_Map_Struc ;struc size + mul bx ;get total byte count ;an000; dms; + cli ;ints off ;an000; dms; + mov bx,offset MAC_M_C_Log ;Ptr in struc ;an000; dms; + add bx,size MAC_M_C_Log/2 ;next entry ;an000; dms; + sti ;ints on ;an000; dms; + add bx,bp ;offset BP relative ;an000; dms; + call MAC_Expand_Stack_And_Copy ;set up stack for ;an000; dms; + ; copy of data and + ; copy the data + mov ds,cs:[bp].EMS_Reg_DS ;restore ds ;an000; dms; + mov si,cs:[bp].EMS_Reg_SI ;restore si ;an000; dms; + + mov ax,ds ;move seg of data to ;an000; dms; + mov es,ax ; es ;an000; dms; + mov di,si ;move off of data ;an000; dms; + mov ax,Type Map_And_Call_Struc ;get size of structure ;an000; dms; + cli ;ints off ;an000; dms; + mov bx,offset MAC_M_C_Data + sti ;ints on ;an000; dms; + add bx,bp ;offset BP relative ;an000; dms; + call MAC_Expand_Stack_And_Copy ;set up stack for ;an000; dms; + ; copy of data and + ; copy the data + mov ds,cs:[bp].EMS_Reg_DS ;restore ds ;an000; dms; + mov si,cs:[bp].EMS_Reg_SI ;restore si ;an000; dms; + + mov ax,cs ;get seg of context ;an000; dms; + mov es,ax ; in es ;an000; dms; + cli ;ints off ;an000; dms; + mov di,offset cs:Map_Table ;get offset of context ;an000; dms; + mov ax,Map_Count ;get context entry count;an000; dms; + sti ;ints on ;an000; dms; + xor dx,dx ;clear dx ;an000; dms; + mov bx,Type Mappable_Phys_Page_Struct ;get struc size ;an000; dms; + mul bx ;get size in bytes ;an000; dms; + cli ;ints off ;an000; dms; + mov bx,offset cs:MAC_Map_Table + sti ;ints on ;an000; dms; + add bx,bp ;offset BP relative ;an000; dms; + call MAC_Expand_Stack_And_Copy ;set up stack for ;an000; dms; + ; copy of data and + ; copy the data + mov ds,cs:[bp].EMS_Reg_DS ;restore ds ;an000; dms; + mov si,cs:[bp].EMS_Reg_SI ;restore si ;an000; dms; + + push cs ;save return segment ;an000; dms; + mov ax,offset MAC_Return_Routine ;save return offset ;an000; dms; + push ax ; ;an000; dms; + + mov ax,word ptr [si].MAC_Target_Address[+2] ;get seg of call far ;an000; dms; + mov bx,word ptr [si].MAC_Target_Address[+0] ;get offset of call far ;an000; dms; + push ax ;put on stack ;an000; dms; + push bx ; ;an000; dms; + + les di,[si].MAC_New_Page_Map_Ptr ;set up for call ;an000; dms; + xor cx,cx ;clear cx ;an000; dms; + mov cl,[si].MAC_New_Page_Map_Len ;get array size ;an000; dms; + mov dx,cs:[bp].EMS_Reg_DX ;get handle for call ;an000; dms; + mov bx,cs:[bp].MAC_Xref_Pages ;get handle page count ;an000; dms; + xor ah,ah ;clear high word ;an000; dms; + mov al,cs:[bp].MAC_Option ;get option ;an000; dms; + + call Map_Pages ;map the new pages ;an000; dms; + or ah,ah ;error? ;an000; dms; + jnz MAC_Error_Strip_Stack ;take data off stack ;an000; dms; + + cli ;ints off ;an000; dms; + mov ax,cs:[bp].EMS_Reg_FL ;obtain entry flag stat ;an000; dms; + sahf ;put in flags reg ;an000; dms; + mov bx,cs:[bp].EMS_Reg_BX ; ;an000; dms; + mov cx,cs:[bp].EMS_Reg_CX ; ;an000; dms; + mov dx,cs:[bp].EMS_Reg_DX ; ;an000; dms; + mov di,cs:[bp].EMS_Reg_DI ; ;an000; dms; + mov si,cs:[bp].EMS_Reg_SI ; ;an000; dms; + mov ds,cs:[bp].EMS_Reg_DS ; ;an000; dms; + mov es,cs:[bp].EMS_Reg_ES ; ;an000; dms; + sti ;ints on ;an000; dms; + +Retf_Fake_Out Proc Far ;this proc is to ;an000; dms; + ; simulate a RETF + ; instruction + ret ;performs a far return ;an000; dms; + +Retf_Fake_Out Endp ;end of retf fake out ;an000; dms; + + +MAC_Error_Strip_Stack: + + add sp,8h ;adjust for return add. ;an000; dms; + ; and target add. on + ; error + jmp MAC_Error_Exit ;exit routine ;an000; dms; + + +;========================================================================= +; MAC_Strip_Stack_And_Map : This routine will strip the stack of all +; the data placed on by MAC_Build_Stack_And_Map. +; +; Inputs : CS:BP - Pointer to data on the instance table +; +; Outputs : All data area restored +; Pages remapped to original +; AH - 0 = no error +; >0 = error (determined by Map_Pages) +; +; Instance Table carries this data: Old Map Data +; New Map Data +; Map & Call Data +; Context +;========================================================================= + +MAC_Strip_Stack_And_Map: ;an000; dms; + + mov ax,cs ;seg of context ;an000; dms; + mov es,ax ;place in es ;an000; dms; + cli ;ints off ;an000; dms; + mov di,offset cs:Map_Table ;get off of context ;an000; dms; + mov ax,Map_Count ;get entries in context ;an000; dms; + sti ;ints on ;an000; dms; + xor dx,dx ;clear dx ;an000; dms; + mov bx,Type Mappable_Phys_Page_Struct ;struc size ;an000; dms; + mul bx ;get byte count ;an000; dms; + cli ;ints off ;an000; dms; + mov bx,offset MAC_Map_Table + sti ;ints on ;an000; dms; + add bx,bp ;offset BP relative ;an000; dms; + call MAC_Shrink_Stack_And_Copy ;restore context ;an000; dms; + + mov si,cs:[bp].EMS_Reg_SI ;restore pointer ;an000; dms; + mov ds,cs:[bp].EMS_Reg_DS ; to data struc ;an000; dms; + + mov ax,ds ;transfer seg of struc ;an000; dms; + mov es,ax ; to dest. segment ;an000; dms; + mov di,si ;di=dest. offset ;an000; dms; + mov ax,Type Map_And_Call_Struc ;get size to move ;an000; dms; + cli ;ints off ;an000; dms; + mov bx,offset MAC_M_C_Data + sti ;ints on ;an000; dms; + add bx,bp ;offset BP relative ;an000; dms; + call MAC_Shrink_Stack_And_Copy ;restore Map & Call buf ;an000; dms; + + mov ds,cs:[bp].EMS_Reg_DS ;restore ds ;an000; dms; + mov si,cs:[bp].EMS_Reg_SI ;restore si ;an000; dms; + + mov ax,word ptr [si].MAC_New_Page_Map_Ptr[+2];get the segment ;an000; dms; + mov es,ax ; of the old map ;an000; dms; + mov di,word ptr [si].MAC_New_Page_Map_Ptr[+0];get its offset ;an000; dms; + + mov al,[si].MAC_New_Page_Map_Len ;get length of data ;an000; dms; + cbw ;convert to word ;an000; dms; + xor dx,dx ;clear high word ;an000; dms; + mov bx,Type Log_Phys_Map_Struc ;struc size ;an000; dms; + mul bx ;get total byte count ;an000; dms; + cli ;ints off ;an000; dms; + mov bx,offset MAC_M_C_Log + sti ;ints on ;an000; dms; + add bx,size MAC_M_C_Log/2 + add bx,bp ;offset BP relative ;an000; dms; + call MAC_Shrink_Stack_And_Copy ;restore new page data ;an000; dms; + + mov ds,cs:[bp].EMS_Reg_DS ;restore ds ;an000; dms; + mov si,cs:[bp].EMS_Reg_SI ;restore si ;an000; dms; + + mov ax,word ptr [si].MAC_Old_Page_Map_Ptr[+2];get the segment ;an000; dms; + mov es,ax ; of the old map ;an000; dms; + mov di,word ptr [si].MAC_Old_Page_Map_Ptr[+0];get its offset ;an000; dms; + + mov al,[si].MAC_Old_Page_Map_Len ;get length of data ;an000; dms; + cbw ;convert to word ;an000; dms; + xor dx,dx ;clear high word ;an000; dms; + mov bx,Type Log_Phys_Map_Struc ;struc size ;an000; dms; + mul bx ;get total byte count ;an000; dms; + cli ;ints off ;an000; dms; + mov bx,offset MAC_M_C_Log + sti ;ints on ;an000; dms; + add bx,bp ;offset BP relative ;an000; dms; + call MAC_Shrink_Stack_And_Copy ;set up stack for ;an000; dms; + + mov ds,cs:[bp].EMS_Reg_DS ;restore ds ;an000; dms; + mov si,cs:[bp].EMS_Reg_SI ;restore si ;an000; dms; + + mov dx,cs:[bp].EMS_Reg_DX ;get DX reg + + les di,[si].MAC_Old_Page_Map_Ptr ;set up for call ;an000; dms; + xor cx,cx ;clear cx ;an000; dms; + mov cl,[si].MAC_Old_Page_Map_Len ;get array size ;an000; dms; + mov bx,cs:[bp].MAC_Xref_Pages ;get handle page count ;an000; dms; + xor ah,ah ;clear high byte ;an000; dms; + mov al,cs:[bp].MAC_Option ;get option ;an000; dms; + + call Map_Pages ;map the new pages ;an000; dms; + + jmp MAC_Exit ;exit the program ;an000; dms; + + +Alter_And_Call endp ;end proc ;an000; dms; + + + page +;========================================================================= +;=============== Function 57h Logic - Move/Exchange Memory Region ======= +;========================================================================= + +;========================================================================= +; Exchng_Region - This routine moves/exchanges memory regions +; specified by the user. The following types of +; moves/exchanges are possible: +; +; Source Destination +; ------------------- ---------------------- +; Conventional Memory Expanded Memory +; Expanded Memory Conventional Memory +; Expanded Memory Expanded Memory +; +; Inputs : AH - 57h (Move/Exchange Memory Region) +; AL - Type of transfer +; 0 = Move memory +; 1 = Exchange memory +; DS:SI - Pointer to Move_Source_Dest Structure +; +; Outputs : Revised map +; AH - Non-zero if error +;========================================================================= + + +Exchng_Region proc + + push bx ;save regs ;an000; dms; + push cx ; ;an000; dms; + push dx ; ;an000; dms; + push di ; ;an000; dms; + push si ; ;an000; dms; + push ds ; ;an000; dms; + push es ; ;an000; dms; + + mov cs:[bp].ER_Sub_Function,al ;save subfunction ;an000; dms; + cmp al,ER_Max_Function ;valid function? ;an000; dms; + jbe ER_Valid_Sub_Function ;yes - continue ;an000; dms; + mov ah,EMS_Code8F ;no - error ;an000; dms; + jmp ER_Error_Exit ;exit routine ;an000; dms; + +ER_Valid_Sub_Function: + + call ER_Type_Check ;Proper types & ;an000; dms; + or ah,ah ; type combinations? ;an000; dms; + jnz ER_Error_Exit ;no - exit routine ;an000; dms; + + call ER_Handle_Check ;valid handles? ;an000; dms; + or ah,ah ; ;an000; dms; + jnz ER_Error_Exit ;no - exit routine ;an000; dms; + + call ER_Length_Check ;Region fits in page ;an000; dms; + or ah,ah ; and <= 1Mb? ;an000; dms; + jnz ER_Error_Exit ;no - exit routine ;an000; dms; + + call ER_Wrap_Check ;> 1Mb wrap on move? ;an000; dms; + or ah,ah ; ;an000; dms; + jnz ER_Error_Exit ;yes - exit routine ;an000; dms; + + call ER_Overlap_Check ;conv. memory overlaps ;an000; dms; + or ah,ah ; EMS page frame? ;an000; dms; + jnz ER_Error_Exit ;yes - exit routine ;an000; dms; + + call ER_Log_Page_Test ;offset valid for log. ;an000; dms; + or ah,ah ; page? ;an000; dms; + jnz ER_Error_Exit ;no - exit routine ;an000; dms; + + cmp cs:[bp].ER_Sub_Function,ER_Move ;move? ;an000; dms; + je ER_Move_Call ;yes - perform move ;an000; dms; + call ER_EMS_Overlap_Check ;EMS pages overlap? ;an000; dms; + or ah,ah ; + jz ER_Exchange_No_Overlap ;no - exit with error ;an000; dms; + mov ah,EMS_Code97 ;signal error ;an000; dms; + jmp ER_Error_Exit ;exit with error code ;an000; dms; + +ER_Exchange_No_Overlap: + + call ER_Exchange_Data ;no - perform exchange ;an000; dms; + jmp ER_Exit ;exit the routine ;an000; dms; + +ER_Move_Call: + + call ER_EMS_Overlap_Check ;see if we had a move ;an000; dms; + ; overlap + push ax ;save result across call;an000; dms; + call ER_Move_Data ;perform the move ;an000; dms; + pop ax ;restore result ;an000; dms; + + ER_Exit: + ER_Error_Exit: + + pop es ;restore regs ;an000; dms; + pop ds ; ;an000; dms; + pop si ; ;an000; dms; + pop di ; ;an000; dms; + pop dx ; ;an000; dms; + pop cx ; ;an000; dms; + pop bx ; ;an000; dms; + + ret ;return to caller ;an000; dms; + +Exchng_Region endp + + +;========================================================================= +; ER_Handle_Check : This routine checks to see if the EMS handles +; specified are valid. +; +; Inputs : DS:SI - Pointer to Move_Source_Dest_Struc data +; +; Outputs : AH - Non-zero on error +; Possible error codes: 83h +;========================================================================= + +ER_Handle_Check proc ;check requested handles;an000; dms; + + push dx ;save regs ;an000; dms; + push di ; ;an000; dms; + + cmp [si].Source_Memory_Type,ER_Conv_Memory ;Conv memory for source?;an000; dms; + je ER_Handle_Check_Dest ;yes - ck dest. handle ;an000; dms; + + push dx ;save dx ;an000; dms; + xor dx,dx ;clear it ;an000; dms; + mov ax,[si].Source_Handle ;get handle requested ;an000; dms; + mov dx,Type H_LookUp_Struc ;handle lookup table ;an000; dms; + mul dx ;obtain index position ;an000; dms; + mov di,ax ;place index in di ;an000; dms; + pop dx ;restore dx ;an000; dms; + + cmp Handle_LookUp_Table.H_Pages[di],Reusable_Handle ;handle allocated ;an000; dms; + je ER_Handle_Check_Error_Exit ;handle not allocated ;an000; dms; + +ER_Handle_Check_Dest: + + cmp [si].Dest_Memory_Type,ER_Conv_Memory ;Conv memory for dest? ;an000; dms; + je ER_Handle_Check_Good_Exit ;yes - exit routine ;an000; dms; + + push dx ;save dx ;an000; dms; + xor dx,dx ;clear it ;an000; dms; + mov ax,[si].Dest_Handle ;get handle requested ;an000; dms; + mov dx,Type H_LookUp_Struc ;handle lookup table ;an000; dms; + mul dx ;obtain index position ;an000; dms; + mov di,ax ;place index in di ;an000; dms; + pop dx ;restore dx ;an000; dms; + + cmp Handle_LookUp_Table.H_Pages[di],Reusable_Handle ;handle allocated ;an000; dms; + je ER_Handle_Check_Error_Exit ;handle not allocated ;an000; dms; + +ER_Handle_Check_Good_Exit: + + xor ah,ah ;signal no error ;an000; dms; + jmp ER_Handle_Check_Exit ;exit program ;an000; dms; + +ER_Handle_Check_Error_Exit: + + mov ah,EMS_Code83 ;signal error ;an000; dms; + +ER_Handle_Check_Exit: + + pop di ;restore regs ;an000; dms; + pop dx ; ;an000; dms; + + ret ;return to caller ;an000; dms; + +ER_Handle_Check endp ;end proc ;an000; dms; + + + +;========================================================================= +; ER_Length_Check : This routine checks to see if the region length +; specified exceeds the page count of either the +; source or destination EMS handle pages allocated. +; It also checks to determine if the region length +; exceeds 1 Mb. +; +; Inputs : DS:SI - Pointer to Move_Source_Dest_Struc data +; +; Outputs : AH - Non-zero on error +; Possible error codes: 93h +; 96h +; 8Ah +;========================================================================= + +ER_Length_Check proc ;check region length ;an000; dms; + + push bx ;save regs ;an000; dms; + push cx ; ;an000; dms; + push dx ; ;an000; dms; + push di ; ;an000; dms; + + mov cx,[si].Region_Length_High_Word ;get size of the region ;an000; dms; + mov bx,[si].Region_Length_Low_Word ; in CX:BX ;an000; dms; + cmp cx,ER_10H ;> 1Mb ;an000; dms; + ja ER_Length_Check_Error96 ;exit with error ;an000; dms; + cmp cx,ER_10H ;high word = 10h? ;an000; dms; + jne ER_Length_Check_Cont ;no - continue ;an000; dms; + cmp bx,0 ;low word other than 0? ;an000; dms; + je ER_Length_Check_Cont ;no - good value ;an000; dms; + +ER_Length_Check_Error96: + + mov ah,EMS_Code96 ;signal error ;an000; dms; + jmp ER_Length_Check_Exit ;exit routine + +ER_Length_Check_Cont: + + cmp [si].Source_Memory_Type,ER_Conv_Memory ;Conv memory for source?;an000; dms; + je ER_Length_Check_Dest ;yes - ck dest. length ;an000; dms; + + push dx ;save dx ;an000; dms; + xor dx,dx ;clear it ;an000; dms; + mov ax,[si].Source_Handle ;get handle requested ;an000; dms; + mov dx,Type H_LookUp_Struc ;handle lookup table ;an000; dms; + mul dx ;obtain index position ;an000; dms; + mov di,ax ;place index in di ;an000; dms; + pop dx ;restore dx ;an000; dms; + + mov ax,Handle_LookUp_Table.H_Pages[di] ;get logical page count ;an000; dms; + ; for source handle + sub ax,[si].Source_Initial_Seg_Page ;pages in EMS to fill ;an000; dms; + push ax ;save ax ;an000; dms; + dec ax ;make it 0 based ;an000; dms; + pop ax ;restore ax ;an000; dms; + js ER_Length_Check_Error8A_Exit ;page out of range ;an000; dms; + + xor dx,dx ;clear it ;an000; dms; + mov dx,EMS_Page_Size_In_Bytes+1 ;page size in bytes ;an000; dms; + mul dx ;get total bytes to trf ;an000; dms; + sub ax,[si].Source_Initial_Offset ;get byte count in 1st ;an000; dms; + sbb dx,0 + + mov bx,ax ;prepare for DWORD comp ;an000; dms; + mov ax,dx ; ;an000; dms; + + mov cx,[si].Region_Length_High_Word ;get size of the region ;an000; dms; + mov dx,[si].Region_Length_Low_Word ; in CX:BX ;an000; dms; + + call ER_Dword_Compare ;region > target? ;an000; dms; + jc ER_Length_Check_Error93_Exit ;CY = region > target ;an000; dms; + + +ER_Length_Check_Dest: + + cmp [si].Dest_Memory_Type,ER_Conv_Memory ;Conv memory for dest? ;an000; dms; + je ER_Length_Check_Good_Exit ;yes - exit routine ;an000; dms; + + push dx ;save dx ;an000; dms; + xor dx,dx ;clear it ;an000; dms; + mov ax,[si].Dest_Handle ;get handle requested ;an000; dms; + mov dx,Type H_LookUp_Struc ;handle lookup table ;an000; dms; + mul dx ;obtain index position ;an000; dms; + mov di,ax ;place index in di ;an000; dms; + pop dx ;restore dx ;an000; dms; + + mov ax,Handle_LookUp_Table.H_Pages[di] ;get logical page count ;an000; dms; + + sub ax,[si].Dest_Initial_Seg_Page ;pages in EMS to fill ;an000; dms; + push ax ;save ax ;an000; dms; + dec ax ;make it 0 based ;an000; dms; + pop ax ;restore ax ;an000; dms; + js ER_Length_Check_Error8A_Exit ;page out of range ;an000; dms; + + xor dx,dx ;clear high word ;an000; dms; + mov dx,EMS_Page_Size_In_Bytes+1 ;page size in bytes ;an000; dms; + mul dx ;get total bytes to trf ;an000; dms; + sub ax,[si].Dest_Initial_Offset ;get byte count in 1st ;an000; dms; + sbb dx,0 + + mov bx,ax ;prepare for DWORD comp ;an000; dms; + mov ax,dx ; ;an000; dms; + + mov cx,[si].Region_Length_High_Word ;get size of the region ;an000; dms; + mov dx,[si].Region_Length_Low_Word ; in CX:BX ;an000; dms; + + call ER_Dword_Compare ;region > target? ;an000; dms; + jc ER_Length_Check_Error93_Exit ;CY = region > target ;an000; dms; + + +ER_Length_Check_Good_Exit: + + xor ah,ah ;signal no error ;an000; dms; + jmp ER_Length_Check_Exit ;exit routine ;an000; dms; + +ER_Length_Check_Error93_Exit: + + mov ah,EMS_Code93 ;signal error ;an000; dms; + jmp ER_Length_Check_Exit ;exit routine ;an000; dms; + +ER_Length_Check_Error8A_Exit: + + mov ah,EMS_Code8A ;signal error ;an000; dms; + +ER_Length_Check_Exit: ;main exit ;an000; dms; + + pop di ;restore regs ;an000; dms; + pop dx ; ;an000; dms; + pop cx ; ;an000; dms; + pop bx ; ;an000; dms; + + ret ;return to caller ;an000; dms; + +ER_Length_Check endp ;end proc ;an000; dms; + + +;========================================================================= +; ER_Type_Check : This routine checks the source/destination type +; specified to determine if they are within the +; proper range. +; +; Inputs : DS:SI - Pointer to Move_Source_Dest_Struc data +; +; Outputs : AH - Non-zero on error +; Possible error codes: 98h +;========================================================================= + +ER_Type_Check proc ;check type ;an000; dms; + + cmp [si].Source_Memory_Type,ER_Max_Type ;type within range? ;an000; dms; + ja ER_Type_Check_Error_Exit ;no - error exit ;an000; dms; + + cmp [si].Dest_Memory_Type,ER_Max_Type ;type within range? ;an000; dms; + ja ER_Type_Check_Error_Exit ;no - error exit ;an000; dms; + + +ER_Type_Check_Good_Exit: + + xor ah,ah ;signal no error ;an000; dms; + jmp ER_Type_Check_Exit ;exit routine ;an000; dms; + +ER_Type_Check_Error_Exit: + + mov ah,EMS_Code98 ;signal error ;an000; dms; + +ER_Type_Check_Exit: + + ret ;return to caller ;an000; dms; + +ER_Type_Check endp ;end proc ;an000; dms; + + +;========================================================================= +; ER_Wrap_Check : This routine checks to determine if there will be +; a wrap of conventional memory beyond 1Mb. +; +; Inputs : DS:SI - Pointer to Move_Source_Dest_Struc data +; +; Outputs : AH - Non-zero on error +; Possible error codes: A2h +;========================================================================= + +ER_Wrap_Check proc ;cks. conv. mem. wrap ;an000; dms; + + push dx ;save regs ;an000; dms; + push bx ; ;an000; dms; + + cmp [si].Source_Memory_Type,ER_Conv_Memory ;conv. memory? ;an000; dms; + jne ER_Wrap_Check_Dest ;no -check dest. ;an000; dms; + + mov ax,[si].Source_Initial_Seg_Page ;get segment ;an000; dms; + xor dx,dx ;clear high word ;an000; dms; + mov bx,ER_10H ;adjust segment to ;an000; dms; + ; absolute address + mul bx ; ;an000; dms; + add ax,[si].Source_Initial_Offset ;add in offset ;an000; dms; + adc dx,0 ;pick up carry if any ;an000; dms; + + add ax,[si].Region_Length_Low_Word ;add in low word of ;an000; dms; + ; trf size + adc dx,[si].Region_Length_High_Word ;add in high word of ;an000; dms; + ; trf size + cmp dx,ER_10H ;> 1Mb? ;an000; dms; + jae ER_Wrap_Check_Error_Exit ;yes - signal error ;an000; dms; + jmp ER_Wrap_Check_Good_Exit ;no - signal no error ;an000; dms; + +ER_Wrap_Check_Dest: + + cmp [si].Dest_Memory_Type,ER_Conv_Memory ;conv. memory? ;an000; dms; + jne ER_Wrap_Check_Good_Exit ;no - exit routine ;an000; dms; + + mov ax,[si].Dest_Initial_Seg_Page ;get segment ;an000; dms; + xor dx,dx ;clear high word ;an000; dms; + mov bx,ER_10H ;adjust segment to ;an000; dms; + ; absolute address + mul bx ; ;an000; dms; + add ax,[si].Dest_Initial_Offset ;add in offset ;an000; dms; + adc dx,0 ;pick up carry if any ;an000; dms; + + add ax,[si].Region_Length_Low_Word ;add in low word of ;an000; dms; + ; trf size + adc dx,[si].Region_Length_High_Word ;add in high word of ;an000; dms; + ; trf size + cmp dx,ER_10H ;> 1Mb? ;an000; dms; + jae ER_Wrap_Check_Error_Exit ;yes - signal error ;an000; dms; + +ER_Wrap_Check_Good_Exit: + + xor ah,ah ;signal no error ;an000; dms; + jmp ER_Wrap_Check_Exit ;exit routine ;an000; dms; + +ER_Wrap_Check_Error_Exit: + + mov ah,EMS_CodeA2 ;signal error ;an000; dms; + +ER_Wrap_Check_Exit: + + pop bx ;restore regs ;an000; dms; + pop dx ; ;an000; dms; + + ret ;return to caller ;an000; dms; + +ER_Wrap_Check endp ;end proc ;an000; dms; + + +;========================================================================= +; ER_Overlap_Check : This routine checks to determine if the conventional +; memory region and expanded memory region overlap. +; Specifically, does the conventional memory region +; overlap the physical page addresses used for +; expanded memory? +; +; Inputs : DS:SI - Pointer to Move_Source_Dest_Struc data +; +; Outputs : AH - Non-zero on error +; Possible error codes: 94h +; +; Algorithm : +; +; If Beg.Src.Add. < Beg.Dst.Add +; If (End.Src.Add - Beg.Dst.Add) > 0 +; signal OVERLAP +; Else +; signal NO-OVERLAP +; EndIf +; Else +; If (End.Dst.Add - Beg.Src.Add) > 0 +; signal OVERLAP +; Else +; signal NO-OVERLAP +; EndIf +; EndIf +;========================================================================= + +ER_Overlap_Check proc ;check for overlap ;an000; dms; + + push dx ;save regs ;an000; dms; + call ER_Save_Context ;save context ;an000; dms; + + cmp [si].Source_Memory_Type,ER_Conv_Memory ;conventional memory? ;an000; dms; + je ER_Overlap_Check_Source ;yes - check overlap ;an000; dms; + ;no - see if dest is + ; conv. memory + + cmp [si].Dest_Memory_Type,ER_Conv_Memory ;conventional memory? ;an000; dms; + jne ER_Overlap_Jump_Good ;no - exit routine ;an000; dms; + +ER_Overlap_Check_Dest: + + mov di,offset cs:ER_Save_Context_Buffer ;get addressibility to ;an000; dms; + ; the page frame save + ;buffer + add di,bp ;offset BP relative ;an000; dms; + cli ;ints off ;an000; dms; + cmp Map_Count,2 ;>= 2 page frames ;an000; dms; + sti ;ints on ;an000; dms; + jb ER_Overlap_Check_Dest_1_Frame ;no - use 1st. frame ;an000; dms; + add di,Type Mappable_Phys_Page_Struct ;yes - adjust ptr to ;an000; dms; + ; next frame for dest. +ER_Overlap_Check_Dest_1_Frame: + + ;**** calc abs address of the bottom of EMS transfer area + + mov ax,cs:[di].Phys_Page_Segment ;get seg value ;an000; dms; + xor dx,dx ;clear high word ;an000; dms; + mov bx,ER_10H ;para size ;an000; dms; + mul bx ;make abs address ;an000; dms; + mov cs:[bp].ER_Src_Abs_Beg_Low,ax ;save abs. address of ;an000; dms; + mov cs:[bp].ER_Src_Abs_Beg_High,dx ; phys page beg. ;an000; dms; + + ;**** calc abs address of the top of EMS transfer area + + add ax,EMS_Page_Size_In_Bytes ;make abs address ;an000; dms; + adc dx,0 ; ;an000; dms; + mov cs:[bp].ER_Src_Abs_End_Low,ax ;save abs. address ;an000; dms; + mov cs:[bp].ER_Src_Abs_End_High,dx ; of phys page end ;an000; dms; + + ;**** calc abs address of the bottom of CONV transfer area + + mov ax,[si].Dest_Initial_Seg_Page ;get segment ;an000; dms; + xor dx,dx ;clear high word ;an000; dms; + mov bx,ER_10H ;para size ;an000; dms; + mul bx ;make abs address ;an000; dms; + add ax,[si].Dest_Initial_Offset ;get offset ;an000; dms; + adc dx,0 ;pick up carry ;an000; dms; + mov cs:[bp].ER_Dst_Abs_Beg_Low,ax ;save initial seg start ;an000; dms; + mov cs:[bp].ER_Dst_Abs_Beg_High,dx ;save initial off start ;an000; dms; + + ;**** calc abs address of the top of CONV transfer area + + add ax,[si].Region_Length_Low_Word ;add in low word of ;an000; dms; + ; trf size + adc dx,[si].Region_Length_High_Word ;add in high word of ;an000; dms; + mov cs:[bp].ER_Dst_Abs_End_Low,ax ;save initial seg start ;an000; dms; + mov cs:[bp].ER_Dst_Abs_End_High,dx ;save initial off start ;an000; dms; + + call ER_General_Overlap_Test ;test for overlap ;an000; dms; + + jc ER_Overlap_Error_Exit ;exit with error ;an000; dms; + +ER_Overlap_Jump_Good: + + jmp ER_Overlap_Good_Exit ;exit good ;an000; dms; + +ER_Overlap_Check_Source: + + mov di,offset cs:ER_Save_Context_Buffer ;get addressibility to ;an000; dms; + ; the page frame save + ;buffer + add di,bp ;offset BP relative ;an000; dms; + + ;**** calc abs address of the bottom of EMS transfer area + + mov ax,cs:[di].Phys_Page_Segment ;get seg value ;an000; dms; + xor dx,dx ;clear high word ;an000; dms; + mov bx,ER_10H ;para size ;an000; dms; + mul bx ;make abs address ;an000; dms; + mov cs:[bp].ER_Src_Abs_Beg_Low,ax ;save abs. address of ;an000; dms; + mov cs:[bp].ER_Src_Abs_Beg_High,dx ; phys page beg. ;an000; dms; + + ;**** calc abs address of the top of EMS transfer area + + mov ax,cs:[di].Phys_Page_Segment ;get seg value ;an000; dms; + mov dx,EMS_Page_Size_In_Bytes ;get end of phys page ;an000; dms; + mov bx,ER_10H ;para size ;an000; dms; + mul bx ;make abs address ;an000; dms; + mov cs:[bp].ER_Src_Abs_End_Low,ax ;save abs. address ;an000; dms; + mov cs:[bp].ER_Src_Abs_End_High,dx ; of phys page end ;an000; dms; + + ;**** calc abs address of the bottom of CONV transfer area + + mov ax,[si].Source_Initial_Seg_Page ;get segment ;an000; dms; + xor dx,dx ;clear high word ;an000; dms; + mov bx,ER_10H ;para size ;an000; dms; + mul bx ;make abs address ;an000; dms; + add ax,[si].Source_Initial_Offset ;get offset ;an000; dms; + adc dx,0 ;pick up carry ;an000; dms; + mov cs:[bp].ER_Dst_Abs_Beg_Low,ax ;save initial seg start ;an000; dms; + mov cs:[bp].ER_Dst_Abs_Beg_High,dx ;save initial off start ;an000; dms; + + ;**** calc abs address of the top of CONV transfer area + + add ax,[si].Region_Length_Low_Word ;add in low word of ;an000; dms; + ; trf size + adc dx,[si].Region_Length_High_Word ;add in high word of ;an000; dms; + mov cs:[bp].ER_Dst_Abs_End_Low,ax ;save initial seg start ;an000; dms; + mov cs:[bp].ER_Dst_Abs_End_High,dx ;save initial off start ;an000; dms; + + call ER_General_Overlap_Test ;test for overlap ;an000; dms; + + jnc ER_Overlap_Good_Exit ;exit good ;an000; dms; + jmp ER_Overlap_Error_Exit ;exit bad + +ER_Overlap_Good_Exit: + + xor ah,ah ;signal no error ;an000; dms; + jmp ER_Overlap_Exit ;exit ;an000; dms; + +ER_Overlap_Error_Exit: + + mov ah,EMS_Code94 ;signal error ;an000; dms; + +ER_Overlap_Exit: + + call ER_Restore_Context ;restore context ;an000; dms; + + pop dx ;restore regs ;an000; dms; + + ret ;return to caller ;an000; dms; + +ER_Overlap_Check endp ;end proc ;an000; dms; + + +;========================================================================= +; ER_EMS_Overlap_Check : This routine determines if the source and target +; EMS regions overlap when both the source and target +; reside in EMS. +; +; Inputs : DS:SI - Pointer to Move_Source_Dest_Struc data +; +; Outputs : AH - Non-zero on error +; Possible error codes: 92h +; +; Algorithm : +; +; If Beg.Src.Add. < Beg.Dst.Add +; If (End.Src.Add - Beg.Dst.Add) > 0 +; signal OVERLAP +; Else +; signal NO-OVERLAP +; EndIf +; Else +; If (End.Dst.Add - Beg.Src.Add) > 0 +; signal OVERLAP +; Else +; signal NO-OVERLAP +; EndIf +; EndIf +;========================================================================= + +ER_EMS_Overlap_Check proc ;check for overlap ;an000; dms; + + push bx ;save regs ;an000; dms; + push dx ; ;an000; dms; + + cmp [si].Source_Memory_Type,ER_EMS_Memory ;Source EMS? ;an000; dms; + jne ER_EMS_Overlap_Exit ;no - exit routine ;an000; dms; + + cmp [si].Dest_Memory_Type,ER_EMS_Memory ;Dest. EMS? ;an000; dms; + jne ER_EMS_Overlap_Exit ;no - exit routine ;an000; dms; + + mov bx,[si].Source_Handle ;get source handle ;an000; dms; + cmp bx,[si].Dest_Handle ;source = dest? ;an000; dms; + jne ER_EMS_Overlap_Good_Exit ;no - exit routine ;an000; dms; + +ER_EMS_Overlap_Calc_N_Ck: + + ;**** calc absolute beginning address of source page + + mov ax,[si].Source_Initial_Seg_Page ;get start page ;an000; dms; + xor dx,dx ;clear high word ;an000; dms; + mov bx,EMS_Page_Size_In_Bytes ;get page size ;an000; dms; + mul bx ;convert page to abs ;an000; dms; + ; address + add ax,[si].Source_Initial_Offset ;add in offset value ;an000; dms; + adc dx,0 ;pick up carry ;an000; dms; + + mov cs:[bp].ER_Src_Abs_Beg_Low,ax ;save low word of add + mov cs:[bp].ER_Src_Abs_Beg_High,dx ;save high word of add ;an000; dms; + + ;**** calc absolute ending address of source page + + add ax,[si].Region_Length_Low_Word ;add in low word of ;an000; dms; + ; length + adc dx,[si].Region_Length_High_Word ;add in high word of ;an000; dms; + ; length + mov cs:[bp].ER_Src_Abs_End_Low,ax ;save low word of end ;an000; dms; + mov cs:[bp].ER_Src_Abs_End_High,dx ;save high word of end ;an000; dms; + + ;**** calc absolute beginning address of dest. page + + mov ax,[si].Dest_Initial_Seg_Page ;get start page ;an000; dms; + xor dx,dx ;clear high word ;an000; dms; + mov bx,EMS_Page_Size_In_Bytes ;get page size ;an000; dms; + mul bx ;convert page to abs ;an000; dms; + ; address + add ax,[si].Dest_Initial_Offset ;add in offset value ;an000; dms; + adc dx,0 ;pick up carry ;an000; dms; + + mov cs:[bp].ER_Dst_Abs_Beg_Low,ax ;save low word of add + mov cs:[bp].ER_Dst_Abs_Beg_High,dx ;save high word of add ;an000; dms; + + ;**** calc absolute ending address of dest. page + + add ax,[si].Region_Length_Low_Word ;add in low word of ;an000; dms; + ; length + adc dx,[si].Region_Length_High_Word ;add in high word of ;an000; dms; + ; length + mov cs:[bp].ER_Dst_Abs_End_Low,ax ;save low word of end ;an000; dms; + mov cs:[bp].ER_Dst_Abs_End_High,dx ;save high word of end ;an000; dms; + + ;**** Actual test for overlap - corresponds to algorithm above + + call ER_General_Overlap_Test ;test for overlap ;an000; dms; + jnc ER_EMS_Overlap_Good_Exit ;no error ;an000; dms; + +ER_EMS_Overlap_Error_Exit: + + mov ah,EMS_Code92 ;signal error ;an000; dms; + jmp ER_EMS_Overlap_Exit ;exit ;an000; dms; + +ER_EMS_Overlap_Good_Exit: + + xor ah,ah ;no error ;an000; dms; + +ER_EMS_Overlap_Exit: + + pop dx ;restore regs ;an000; dms; + pop bx ; ;an000; dms; + + ret ;return to caller ;an000; dms; + +ER_EMS_Overlap_Check endp ;end proc ;an000; dms; + + +;========================================================================= +; ER_General_Overlap_Test:This routine determines if the source and target +; EMS regions overlap when both the source and target +; reside in EMS. +; +; Inputs : ER_Src_Abs_Beg_Low - Low word of beginning trf area of source +; ER_Src_Abs_Beg_High - High word of beginning trf area of source +; +; ER_Src_Abs_End_Low - Low word of ending trf area of source +; ER_Src_Abs_End_High - High word of ending trf area of source +; +; : ER_Dst_Abs_Beg_Low - Low word of beginning trf area of dest. +; ER_Dst_Abs_Beg_High - High word of beginning trf area of dest. +; +; ER_Dst_Abs_End_Low - Low word of ending trf area of dest. +; ER_Dst_Abs_End_High - High word of ending trf area of dest. +; +; Outputs : NC - no overlap +; CY - overlap +; +; Algorithm : +; +; If Beg.Src.Add. < Beg.Dst.Add +; If (End.Src.Add - Beg.Dst.Add) > 0 +; signal OVERLAP +; Else +; signal NO-OVERLAP +; EndIf +; Else +; If (End.Dst.Add - Beg.Src.Add) > 0 +; signal OVERLAP +; Else +; signal NO-OVERLAP +; EndIf +; EndIf +;========================================================================= + +ER_General_Overlap_Test proc ; ;an000; dms; + + push ax ;save regs ;an000; dms; + push bx ; ;an000; dms; + push cx ; ;an000; dms; + push dx ; ;an000; dms; + + mov ax,cs:[bp].ER_Src_Abs_Beg_High ;get source beg. add. ;an000; dms; + mov bx,cs:[bp].ER_Src_Abs_Beg_Low ; ;an000; dms; + mov cx,cs:[bp].ER_Dst_Abs_Beg_High ;get dest. beg. add. ;an000; dms; + mov dx,cs:[bp].ER_Dst_Abs_Beg_Low ; ;an000; dms; + call ER_Dword_Compare ; +; $if c ;< dest. beg. add.? ;an000; dms; + JNC ER_IF1 + mov ax,cs:[bp].ER_Src_Abs_End_Low ;get end address ;an000; dms; + mov dx,cs:[bp].ER_Src_Abs_End_High ; ;an000; dms; + sub ax,cs:[bp].ER_Dst_Abs_Beg_Low ;End.Src.Add-Beg.Dst.Add;an000; dms; + sbb dx,cs:[bp].ER_Dst_Abs_Beg_High ; ;an000; dms; +; $if ns ;yes - overlap ;an000; dms; + JS ER_IF2 + stc ;signal error ;an000; dms; + mov cs:[bp].ER_Direction_Flag,ER_Down ;signal reverse move ;an000; dms; +; $else ;no - not sure yet ;an000; dms; + JMP SHORT ER_EN2 +ER_IF2: + clc ;signal no overlap ;an000; dms; + mov cs:[bp].ER_Direction_Flag,ER_Up ;forward move ;an000; dms; +; $endif ; ;an000; dms; +ER_EN2: +; $else ;not sure if src < dst ;an000; dms; + JMP SHORT ER_EN1 +ER_IF1: + mov ax,cs:[bp].ER_Dst_Abs_End_Low ;get end address ;an000; dms; + mov dx,cs:[bp].ER_Dst_Abs_End_High ; ;an000; dms; + sub ax,cs:[bp].ER_Src_Abs_Beg_Low ;End.Dst.Add-Beg.Src.Add;an000; dms; + sbb dx,cs:[bp].ER_Src_Abs_Beg_High ; ;an000; dms; +; $if ns ;yes - overlap ;an000; dms; + JS ER_IF6 + stc ;signal error ;an000; dms; + mov cs:[bp].ER_Direction_Flag,ER_Up ;forward move ;an000; dms; +; $else ;no - not sure yet ;an000; dms; + JMP SHORT ER_EN6 +ER_IF6: + clc ;signal no overlap ;an000; dms; + mov cs:[bp].ER_Direction_Flag,ER_Up ;forward move ;an000; dms; +; $endif ; ;an000; dms; +ER_EN6: +; $endif ; ;an000; dms; +ER_EN1: + + pop dx ;restore regs ;an000; dms; + pop cx ; ;an000; dms; + pop bx ; ;an000; dms; + pop ax ; ;an000; dms; + + ret ;return to caller ;an000; dms; + +ER_General_Overlap_Test endp ;end proc ;an000; dms; + + +;========================================================================= +; ER_Dword_Compare : This routine determines whether or not a dword +; value is greater than another dword value. +; +; Inputs : AX - Source high word +; BX - Source low word +; CX - Destination high word +; DX - Destination low word +; +; Outputs : NC - source >= destination +; CY - source < destination +;========================================================================= + +ER_Dword_Compare proc ; ;an000; dms; + + cmp ax,cx ;src high < dest high? ;an000; dms; +; $if b ;yes ;an000; dms; + JNB ER_IF10 + stc ;signal less than ;an000; dms; +; $else ;no ;an000; dms; + JMP SHORT ER_EN10 +ER_IF10: + cmp ax,cx ;src high > dest high? ;an000; dms; +; $if a ;yes ;an000; dms; + JNA ER_IF12 + clc ;signal greater than ;an000; dms; +; $else ;no ;an000; dms; + JMP SHORT ER_EN12 +ER_IF12: + cmp bx,dx ;src low < dest low? ;an000; dms; +; $if b ;yes ;an000; dms; + JNB ER_IF14 + stc ;signal less than ;an000; dms; +; $else ;no ;an000; dms; + JMP SHORT ER_EN14 +ER_IF14: + cmp bx,dx ;src low > dest low? ;an000; dms; +; $if a ;yes ;an000; dms; + JNA ER_IF16 + clc ;signal greater than ;an000; dms; +; $else ;no ;an000; dms; + JMP SHORT ER_EN16 +ER_IF16: + clc ; ;an000; dms; +; $endif ; ;an000; dms; +ER_EN16: +; $endif ; ;an000; dms; +ER_EN14: +; $endif ; ;an000; dms; +ER_EN12: +; $endif ; ;an000; dms; +ER_EN10: + + ret ; ;an000; dms; + +ER_Dword_Compare endp ; ;an000; dms; + + + +;========================================================================= +; ER_Segment_Adjust : This routine adjusts the segment:offset to a value +; with an offset less than 16. +; +; Inputs : AX:DX - Segment:Offset to be adjusted +; +; Outputs : AX:DX - New Segment:Offset value +;========================================================================= + +ER_Segment_Adjust proc ;adjust segment value ;an000; dms; + + push bx ;save bx ;an000; dms; + push cx ; ;an000; dms; + + mov bx,ax ;save segment value ;an000; dms; + mov ax,dx ;get offset ;an000; dms; + xor dx,dx ;clear high word ;an000; dms; + mov cx,ER_10h ;divide by 10h ;an000; dms; + div cx ;get seg adjustment ;an000; dms; + ; factor + add ax,bx ;adjust segment up ;an000; dms; + ; dx contains new off. ;an000; dms; + pop cx ;restore regs ;an000; dms; + pop bx ;restore bx ;an000; dms; + + ret ;return to caller ;an000; dms; + +ER_Segment_Adjust endp ;end proc ;an000; dms; + + +;========================================================================= +; ER_Log_Page_Test : This routine checks the offset specified for +; the logical page to determine if the offset is +; within the valid ranges for the page size. +; +; Inputs : DS:SI - Pointer to Move_Source_Dest_Struc data +; +; Outputs : AH - Non-zero on error +; Possible error codes: 95h +;========================================================================= + +ER_Log_Page_Test proc ; ;an000; dms; + + mov ax,EMS_Page_Size_In_Bytes ;get page size ;an000; dms; + + cmp [si].Source_Memory_Type,ER_EMS_Memory ;EMS memory specified? ;an000; dms; + jne ER_Log_Dest_Test ;no - check dest. ;an000; dms; + + cmp ax,[si].Source_Initial_Offset ;> EMS page size ;an000; dms; + jae ER_Log_Good_Exit ;good exit ;an000; dms; + jmp ER_Log_Error_Exit ;error - bad exit ;an000; dms; + +ER_Log_Dest_Test: + + cmp [si].Dest_Memory_Type,ER_EMS_Memory ;EMS memory specified? ;an000; dms; + jne ER_Log_Good_Exit ;good exit ;an000; dms; + + cmp ax,[si].Dest_Initial_Offset ;> EMS page size ;an000; dms; + jae ER_Log_Good_Exit ;good exit ;an000; dms; + +ER_Log_Error_Exit: + + mov ah,EMS_Code95 ;signal error ;an000; dms; + jmp ER_Log_Exit ;exit routine ;an000; dms; + +ER_Log_Good_Exit: + + xor ah,ah ;signal no error ;an000; dms; + +ER_Log_Exit: + + ret ;return to caller ;an000; dms; + +ER_Log_Page_Test endp ;end proc ;an000; dms; + +;========================================================================= +; ER_Save_Context : This routine saves the context for page frames +; needed for the move/exchange. +; +; Inputs : none +; +; Outputs : ER_Save_Context_Buffer - save context for the needed page frames +;========================================================================= + +ER_Save_Context proc ;save contexts ;an000; dms; + + push ax ;save regs ;an000; dms; + push cx ; ;an000; dms; + push di ; ;an000; dms; + push si ; ;an000; dms; + push ds ; ;an000; dms; + push es ; ;an000; dms; + + mov ax,cs ;make ds/es = cs ;an000; dms; + mov ds,ax ; ;an000; dms; + mov es,ax ; ;an000; dms; + + mov si,offset cs:Map_Table ;ptr to page frame table;an000; dms; + mov di,offset cs:ER_Save_Context_Buffer ;get dest. offset + add di,bp ;offset BP relative ;an000; dms; + + mov cx,2 ;default frame save ;an000; dms; + cli ;ints off ;an000; dms; + cmp Map_Count,2 ;2 page frames? ;an000; dms; + jae ER_Save_Context_Loop ;< = 2 - continue ;an000; dms; + mov cx,Map_Count ;max frame count to save;an000; dms; + +ER_Save_Context_Loop: + + sti ;ints on ;an000; dms; + push cx ;save cx ;an000; dms; + mov cx,Type Mappable_Phys_Page_Struct ;get byte count to trf ;an000; dms; + cli ;ints off ;an000; dms; + rep movsb ;perform save ;an000; dms; + sti ;ints on ;an000; dms; + pop cx ;restore cx ;an000; dms; + loop ER_Save_Context_Loop ;continue ;an000; dms; + +ER_Save_Exit: + + pop es ;restore regs ;an000; dms; + pop ds ; ;an000; dms; + pop si ; ;an000; dms; + pop di ; ;an000; dms; + pop cx ; ;an000; dms; + pop ax ; ;an000; dms; + + ret ;return to caller ;an000; dms; + +ER_Save_Context endp ;end proc ;an000; dms; + + +;========================================================================= +; ER_Restore_Context : This routine restores the context for page frames +; saved. These pages were used for the +; move/exchange requested. +; +; Inputs : ER_Save_Context_Buffer - contains saved context +; +; Outputs : restored context for the saved page frames +;========================================================================= + +ER_Restore_Context proc ;restore contexts ;an000; dms; + + push ax ;save regs ;an000; dms; + push cx ; ;an000; dms; + push di ; ;an000; dms; + push si ; ;an000; dms; + push ds ; ;an000; dms; + push es ; ;an000; dms; + + mov ax,cs ;make ds/es = cs ;an000; dms; + mov ds,ax ; ;an000; dms; + mov es,ax ; ;an000; dms; + + mov di,offset cs:Map_Table ;ptr to page frame table;an000; dms; + mov si,offset cs:ER_Save_Context_Buffer ;get dest. offset + add si,bp ;offset BP relative ;an000; dms; + + mov cx,2 ;default frame restore ;an000; dms; + cli ;ints off ;an000; dms; + cmp Map_Count,2 ;2 page frames? ;an000; dms; + jae ER_Restore_Context_Loop ;< = 2 - continue ;an000; dms; + mov cx,Map_Count ;max frame count to rest;an000; dms; + +ER_Restore_Context_Loop: + + sti ;ints on ;an000; dms; + mov al,byte ptr ds:[si].Phys_Page_Number ;get physical page num. ;an000; dms; + mov bx,word ptr ds:[si].PPM_Log_Page ;get logical page num. ;an000; dms; + mov dx,word ptr ds:[si].PPM_Handle ;get handle number ;an000; dms; + call Map_L_To_P ;map in orig. page ;an000; dms; + + push cx ;save cx ;an000; dms; + mov cx,Type Mappable_Phys_Page_Struct ;get byte count to trf ;an000; dms; + cli ;ints off ;an000; dms; + rep movsb ;perform save ;an000; dms; + sti ;ints on ;an000; dms; + pop cx ;restore cx ;an000; dms; + loop ER_Restore_Context_Loop ;continue ;an000; dms; + +ER_Restore_Exit: + + pop es ;restore regs ;an000; dms; + pop ds ; ;an000; dms; + pop si ; ;an000; dms; + pop di ; ;an000; dms; + pop cx ; ;an000; dms; + pop ax ; ;an000; dms; + + ret ;return to caller ;an000; dms; + +ER_Restore_Context endp ;end proc ;an000; dms; + + + +;========================================================================= +; ER_Det_Src_Dest_Seg : This routine determines the applicable segment, +; offset, and page to be used for the move/exchange. +; This routine sets the pages/addresses to the end +; of the area to be moved/exchanged, if the move +; is to be a reverse move. If the move is to be +; a forward move, the pages/addresses are set to +; the beginning of the area to be moved/exchanged. +; In this way an overlapping move can be +; performed without overlaying data it is to move. +; +; Inputs : DS:SI - Pointer to Move_Source_Dest_Struc data +; +; Outputs : ER_Source_Seg - Segment value of source +; ER_Dest_Seg - Segment value of destination +; +; ER_Source_Off - Offset value of source +; ER_Dest_Off - Offset value of destination +; +; ER_Source_Page - Source EMS page +; ER_Dest_Page - Destination EMS page +; +; ER_Source_Handle - Source handle +; ER_Dest_Handle - Destination handle +; +; ER_Source_Phys_Page - Physical page number +; ER_Dest_Phys_Page - Physical page number +;========================================================================= + +ER_Det_Src_Dest_Seg proc ; ;an000; dms; + + push ax ;save regs ;an000; dms; + push bx ; ;an000; dms; + push cx ; ;an000; dms; + push dx ; ;an000; dms; + push di ; ;an000; dms; + push ds ; ;an000; dms; + push es ; ;an000; dms; + + + cmp [si].Source_Memory_Type,ER_EMS_Memory ;EMS? ;an000; dms; + jne ER_Det_Source_Conv ;no - conventional mem. ;an000; dms; + + mov di,offset cs:ER_Save_Context_Buffer ;get addressibility to ;an000; dms; + ; the page frame save + ;buffer + add di,bp ;offset BP relative + mov ax,cs:[di].Phys_Page_Segment ;get seg value ;an000; dms; + mov cs:[bp].ER_Source_Seg,ax ;save it in variable ;an000; dms; + + mov ax,[si].Source_Handle ;get source handle ;an000; dms; + mov cs:[bp].ER_Source_Handle,ax ;save handle ;an000; dms; + + cmp cs:[bp].ER_Direction_Flag,ER_Down ;reverse move? ;an000; dms; +; $if e ;yes ;an000; dms; + JNE ER_IF22 + mov ax,[si].Region_Length_Low_Word ;get low word of move ;an000; dms; + mov dx,[si].Region_Length_High_Word ;get high word ;an000; dms; + add ax,[si].Source_Initial_Offset ;pick up offset value ;an000; dms; + adc dx,0 ;pick up carry ;an000; dms; + mov bx,4000h ;get page size ;an000; dms; + div bx ;get end logical page ;an000; dms; + add ax,[si].Source_Initial_Seg_Page ;adjust it for 1st. ;an000; dms; + mov cs:[bp].ER_Source_Page,ax ;save log. page ;an000; dms; + dec dx ;adjust to end point ;an000; dms; + mov cs:[bp].ER_Source_Off,dx ;save offset in last pg ;an000; dms; + +; $else ;forward move ;an000; dms; + JMP SHORT ER_EN22 +ER_IF22: + mov ax,[si].Source_Initial_Seg_Page ;get page ;an000; dms; + mov dx,[si].Source_Initial_Offset ;get offset ;an000; dms; + mov cs:[bp].ER_Source_Page,ax ;save page ;an000; dms; + mov cs:[bp].ER_Source_Off,dx ;save offset ;an000; dms; +; $endif ; ;an000; dms; +ER_EN22: + mov ax,cs:[di].Phys_Page_Number ;get phys. page ;an000; dms; + mov cs:[bp].ER_Source_Phys_Page,ax ;save it ;an000; dms; + jmp ER_Det_Dest_Check ;jump to dest check ;an000; dms; + +ER_Det_Source_Conv: + + cmp cs:[bp].ER_Direction_Flag,ER_Down ;reverse move? ;an000; dms; +; $if e ;yes ;an000; dms; + JNE ER_IF25 + mov ax,[si].Region_Length_Low_Word ;get low word of move ;an000; dms; + mov dx,[si].Region_Length_High_Word ;get high word ;an000; dms; + mov bx,ER_10h ;get bytes/para ;an000; dms; + div bx ;get para count ;an000; dms; + ; AX = para's + ; DX = offset + mov bx,ax ;save across adjust call;an000; dms; + mov cx,dx ; ;an000; dms; + mov ax,[si].Source_Initial_Seg_Page ;get seg value ;an000; dms; + mov dx,[si].Source_Initial_Offset ;get off value ;an000; dms; + dec dx ;adjust to end byte + call ER_Segment_Adjust ;adjust it downward ;an000; dms; + add ax,bx ;new segment value ;an000; dms; + add dx,cx ;new offset value ;an000; dms; + + mov cs:[bp].ER_Source_Seg,ax ;save it in variable ;an000; dms; + mov cs:[bp].ER_Source_Off,dx ;save offset in var ;an000; dms; +; $else ;forward move ;an000; dms; + JMP SHORT ER_EN25 +ER_IF25: + mov ax,[si].Source_Initial_Seg_Page ;get seg value ;an000; dms; + mov dx,[si].Source_Initial_Offset ;get off value ;an000; dms; + mov cs:[bp].ER_Source_Seg,ax ;save it in variable ;an000; dms; + mov cs:[bp].ER_Source_Off,dx ;save offset in var ;an000; dms; +; $endif ; ;an000; dms; +ER_EN25: + + +ER_Det_Dest_Check: + + cmp [si].Dest_Memory_Type,ER_EMS_Memory ;Dest. EMS? ;an000; dms; + jne ER_Det_Dest_Conv ;no - conventional mem. ;an000; dms; + + mov di,offset cs:ER_Save_Context_Buffer ;save frame buffer ;an000; dms; + add di,bp ;offset BP relative ;an000; dms; + cli ;ints off ;an000; dms; + cmp Map_Count,1 ;> 1 page frame? ;an000; dms; + sti ;ints on ;an000; dms; + jb ER_Det_Dest_Check1 ;don't adjust pointer ;an000; dms; + add di,Type Mappable_Phys_Page_Struct ;next entry in save buf ;an000; dms; + +ER_Det_Dest_Check1: + + mov ax,cs:[di].Phys_Page_Segment ;get seg value ;an000; dms; + mov cs:[bp].ER_Dest_Seg,ax ;save it in variable ;an000; dms; + + mov ax,[si].Dest_Handle ;get dest. handle ;an000; dms; + mov cs:[bp].ER_Dest_Handle,ax ;save handle ;an000; dms; + + cmp cs:[bp].ER_Direction_Flag,ER_Down ;reverse move? ;an000; dms; +; $if e ;yes ;an000; dms; + JNE ER_IF28 + mov ax,[si].Region_Length_Low_Word ;get low word of move ;an000; dms; + mov dx,[si].Region_Length_High_Word ;get high word ;an000; dms; + add ax,[si].Dest_Initial_Offset ;pick up offset value ;an000; dms; + adc dx,0 ;pick up carry ;an000; dms; + + mov bx,4000h ;get page size ;an000; dms; + div bx ;get end logical page ;an000; dms; + add ax,[si].Dest_Initial_Seg_Page ;adjust it for 1st. ;an000; dms; + mov cs:[bp].ER_Dest_Page,ax ;save log. page ;an000; dms; + dec dx ;adjust to end point ;an000; dms; + mov cs:[bp].ER_Dest_Off,dx ;save off. in last page ;an000; dms; + +; $else ;forward move ;an000; dms; + JMP SHORT ER_EN28 +ER_IF28: + mov ax,[si].Dest_Initial_Seg_Page ;get page ;an000; dms; + mov dx,[si].Dest_Initial_Offset ;get offset ;an000; dms; + mov cs:[bp].ER_Dest_Page,ax ;save log. page ;an000; dms; + mov cs:[bp].ER_Dest_Off,dx ;save off. in last page ;an000; dms; +; $endif ; ;an000; dms; +ER_EN28: + mov ax,cs:[di].Phys_Page_Number ;get phys page number ;an000; dms; + mov cs:[bp].ER_Dest_Phys_Page,ax ;save it ;an000; dms; + jmp ER_Det_Exit ;exit routine ;an000; dms; + +ER_Det_Dest_Conv: + + cmp cs:[bp].ER_Direction_Flag,ER_Down ;reverse move? ;an000; dms; +; $if e ;yes ;an000; dms; + JNE ER_IF31 + mov ax,[si].Region_Length_Low_Word ;get low word of move ;an000; dms; + mov dx,[si].Region_Length_High_Word ;get high word ;an000; dms; + mov bx,ER_10H ;get bytes/para ;an000; dms; + div bx ;get para count ;an000; dms; + ; AX = para's + ; DX = offset + mov bx,ax ;save across adjust call;an000; dms; + mov cx,dx ; ;an000; dms; + mov ax,[si].Dest_Initial_Seg_Page ;get seg value ;an000; dms; + mov dx,[si].Dest_Initial_Offset ;get off value ;an000; dms; + dec dx ;adjust to end byte ;an000; dms; + call ER_Segment_Adjust ;adjust it downward ;an000; dms; + add ax,bx ;new segment value ;an000; dms; + add dx,cx ;new offset value ;an000; dms; + + mov cs:[bp].ER_Dest_Seg,ax ;save it in variable ;an000; dms; + mov cs:[bp].ER_Dest_Off,dx ;save offset in var ;an000; dms; +; $else ;forward move ;an000; dms; + JMP SHORT ER_EN31 +ER_IF31: + mov ax,[si].Dest_Initial_Seg_Page ;get seg value ;an000; dms; + mov dx,[si].Dest_Initial_Offset ;get off value ;an000; dms; + mov cs:[bp].ER_Dest_Seg,ax ;save it in variable ;an000; dms; + mov cs:[bp].ER_Dest_Off,dx ;save offset in var ;an000; dms; +; $endif ; ;an000; dms; +ER_EN31: + + +ER_Det_Exit: + + pop es ;restore regs ;an000; dms; + pop ds ; ;an000; dms; + pop di ; ;an000; dms; + pop dx ; ;an000; dms; + pop cx ; ;an000; dms; + pop bx ; ;an000; dms; + pop ax ; ;an000; dms; + + ret ;return to caller ;an000; dms; + +ER_Det_Src_Dest_Seg endp ;end proc ;an000; dms; + + +;========================================================================= +; ER_Det_Move_Count : This initializes the count variables for the +; loop iteration counter of the move/exchange. +; +; Inputs : DS:SI - Pointer to Move_Source_Dest_Struc data +; +; Outputs : ER_Move_Count_Low - low word value of move count +; ER_Move_Count_High - high word value of move count +;========================================================================= + + +ER_Det_Move_Count proc ; ;an000; dms; + + push ax ;save regs ;an000; dms; + push dx ; ;an000; dms; + + mov ax,[si].Region_Length_Low_Word ;get low word count ;an000; dms; + mov dx,[si].Region_Length_High_Word ;get high word count ;an000; dms; + mov cs:[bp].ER_Move_Count_Low,ax ;save low word ;an000; dms; + mov cs:[bp].ER_Move_Count_High,dx ;save high word ;an000; dms; + + pop dx ;restore regs ;an000; dms; + pop ax ; ;an000; dms; + + ret ;return to caller ;an000; dms; + +ER_Det_Move_Count endp ;end proc ;an000; dms; + +;========================================================================= +; ER_Move_Source_To_Buffer : This routine moves the source data to +; the buffer before it is transferred to +; its final destination. +; +; Inputs : BP - carries type of memory for source/dest +; Bit 0 - Destination (EMS if set) +; Bit 1 - Source (EMS if set) +; +; Outputs : ER_Move_Xchg_Buffer1 - Source data +;========================================================================= + +ER_Move_Source_To_Buffer proc ; ;an000; dms; + + push ax ;save regs ;an000; dms; + push bx ; ;an000; dms; + push dx ; ;an000; dms; + push di ; ;an000; dms; + push es ; ;an000; dms; + + test cs:[bp].ER_Mem_Type,ER_Source_EMS_Memory;Source EMS? ;an000; dms; + jz ER_Move_Source_Conv_Mem ;no - adjust seg:off ;an000; dms; + jmp ER_Move_Source_EMS_Mem ;yes- continue move ;an000; dms; + +ER_Move_Source_Conv_Mem: + + cmp cs:[bp].ER_Direction_Flag,ER_Down ;reverse move? ;an000; dms; +; $if e ;yes ;an000; dms; + JNE ER_IF34 + mov ax,ds ;adjust segment:off ;an000; dms; + dec ax ;segment - 1 para ;an000; dms; + mov ds,ax ; ;an000; dms; + add si,ER_10H ;adjust offset for 1 ;an000; dms; +; $else ;forward move ;an000; dms; + JMP SHORT ER_EN34 +ER_IF34: + mov ax,ds ;get segment value ;an000; dms; + mov dx,si ;get offset value ;an000; dms; + call ER_Segment_Adjust ;adjust the seg:off ;an000; dms; + mov ds,ax ;restore ds ;an000; dms; + mov si,dx ;restore offset ;an000; dms; +; $endif ; ;an000; dms; +ER_EN34: + jmp ER_Move_Source_Count ;determine count ;an000; dms; + +ER_Move_Source_EMS_Mem: + + + cmp cs:[bp].ER_Direction_Flag,ER_Down ;reverse move? ;an000; dms; +; $if e ;yes ;an000; dms; + JNE ER_IF37 + cmp si,0ffffh ;beginning of log page ;an000; dms; +; $if e ;yes ;an000; dms; + JNE ER_IF38 + dec cs:[bp].ER_Source_Page ;adjust page ptr ;an000; dms; + mov si,EMS_Page_Size_In_Bytes;get page size ;an000; dms; +; $endif ; ;an000; dms; +ER_IF38: +; $else ;forward move ;an000; dms; + JMP SHORT ER_EN37 +ER_IF37: + cmp si,4000h ;wrap beyond page ;an000; dms; +; $if e ;yes ;an000; dms; + JNE ER_IF41 + inc cs:[bp].ER_Source_Page ;adjust page ptr ;an000; dms; + xor si,si ;clear si ;an000; dms; +; $endif ; ;an000; dms; +ER_IF41: +; $endif ; ;an000; dms; +ER_EN37: + mov bx,cs:[bp].ER_Source_Page ;pass page to map ;an000; dms; + call ER_Map_Next_Src_Page ;no - map in current pg;an000; dms; + +ER_Move_Source_Count: + + mov cx,ER_10H ;default count ;an000; dms; + cmp cs:[bp].ER_Move_Count_High,0 ;high word set ;an000; dms; + jne ER_Move_Source_High_Set ;yes - use default ;an000; dms; + cmp cs:[bp].ER_Move_Count_Low,cx ;>= 10h bytes ;an000; dms; + jae ER_Move_Source_High_Set ;yes - use default ;an000; dms; + mov cx,cs:[bp].ER_Move_Count_Low ;no - use last few bytes;an000; dms; + +ER_Move_Source_High_Set: + + cmp cs:[bp].ER_Direction_Flag,ER_Down ;reverse move? ;an000; dms; +; $if e ;yes ;an000; dms; + JNE ER_IF44 + cmp si,di ;source >= dest? ;an000; dms; +; $if b ;no ;an000; dms; + JNB ER_IF45 + cmp si,ER_10H ;source >= 10h? ;an000; dms; +; $if b ;no ;an000; dms; + JNB ER_IF46 + mov cx,si ;get move count ;an000; dms; + inc cx ;always 1 byte off ;an000; dms; +; $endif ; ;an000; dms; +ER_IF46: +; $else ;source >= dest ;an000; dms; + JMP SHORT ER_EN45 +ER_IF45: + cmp di,ER_10H ;dest >= 10h? ;an000; dms; +; $if b ;no ;an000; dms; + JNB ER_IF49 + mov cx,di ;get move count ;an000; dms; + inc cx ;always 1 byte off ;an000; dms; +; $endif ; ;an000; dms; +ER_IF49: +; $endif ; ;an000; dms; +ER_EN45: +; $else ;forward move ;an000; dms; + JMP SHORT ER_EN44 +ER_IF44: + cmp si,di ;source >= dest? ;an000; dms; +; $if a ;yes ;an000; dms; + JNA ER_IF53 + mov ax,4000h ;get end of page ;an000; dms; + sub ax,si ;get bytes remaining ;an000; dms; + cmp ax,ER_10H ;source >= 10h ;an000; dms; +; $if b ;no ;an000; dms; + JNB ER_IF54 + mov cx,ax ;get remaining count ;an000; dms; +; $endif ; ;an000; dms; +ER_IF54: +; $else ;source >= dest ;an000; dms; + JMP SHORT ER_EN53 +ER_IF53: + mov ax,4000h ;get end of page ;an000; dms; + sub ax,di ;get bytes remaining ;an000; dms; + cmp ax,ER_10H ;dest >= 10h ;an000; dms; +; $if b ;no ;an000; dms; + JNB ER_IF57 + mov cx,ax ;get remaining count ;an000; dms; +; $endif ; ;an000; dms; +ER_IF57: +; $endif ; ;an000; dms; +ER_EN53: +; $endif ; ;an000; dms; +ER_EN44: + + jmp ER_Move_Source_Default_Count ;continue routine ;an000; dms; + +ER_Move_Source_Default_Count: + + mov cs:[bp].ER_Current_Move_Count,cx ;save current move cnt ;an000; dms; + + sub cs:[bp].ER_Move_Count_Low,cx ;get new count ;an000; dms; + sbb cs:[bp].ER_Move_Count_High,0 ;pick up borrow ;an000; dms; + + mov ax,cs ;get seg for buffer ;an000; dms; + mov es,ax ;put into es ;an000; dms; + mov di,offset cs:ER_Move_Xchg_Buffer1 ;offset of buffer ;an000; dms; + add di,bp ;offset BP relative ;an000; dms; + + cmp cs:[bp].ER_Direction_Flag,ER_Down ;reverse move? ;an000; dms; +; $if e ;yes ;an000; dms; + JNE ER_IF61 + add di,ER_10H ;end of buffer + 1 ;an000; dms; + dec di ;end of buffer ;an000; dms; +; $endif ; ;an000; dms; +ER_IF61: + + + cmp cs:[bp].ER_Direction_Flag,ER_Down ;reverse move? ;an000; dms; +; $if e ;yes ;an000; dms; + JNE ER_IF63 + std ;reverse move ;an000; dms; +; $else ;forward move ;an000; dms; + JMP SHORT ER_EN63 +ER_IF63: + cld ; ;an000; dms; +; $endif ; ;an000; dms; +ER_EN63: + cli ;ints off ;an000; dms; + rep movsb ;move the data ;an000; dms; + sti ;ints on ;an000; dms; + +ER_Move_Source_Exit: + + pop es ;restore regs ;an000; dms; + pop di ; ;an000; dms; + pop dx ; ;an000; dms; + pop bx ; ;an000; dms; + pop ax ; ;an000; dms; + + ret ;return to caller ;an000; dms; + +ER_Move_Source_To_Buffer endp ;end proc ;an000; dms; + + +;========================================================================= +; ER_Move_Buffer_To_Dest : This routine moves the data in the buffer +; to the destination specified by the user. +; +; Inputs : BP - carries type of memory for source/dest +; Bit 0 - Destination (EMS if set) +; Bit 1 - Source (EMS if set) +; ER_Move_Xchg_Buffer1 - Source data +; +; Outputs : Adjusted segment:offset or page/offset +;========================================================================= + +ER_Move_Buffer_To_Dest proc ; ;an000; dms; + + push ax ;save regs ;an000; dms; + push bx ; ;an000; dms; + push dx ; ;an000; dms; + push si ; ;an000; dms; + push ds ; ;an000; dms; + + test cs:[bp].ER_Mem_Type,ER_Dest_EMS_Memory ;Source EMS? ;an000; dms; + jz ER_Move_Buffer_Conv_Mem ;no - adjust seg:off ;an000; dms; + jmp ER_Move_Buffer_EMS_Mem ;yes- continue move ;an000; dms; + +ER_Move_Buffer_Conv_Mem: + + cmp cs:[bp].ER_Direction_Flag,ER_Down ;reverse move? ;an000; dms; +; $if e ;yes ;an000; dms; + JNE ER_IF66 + mov ax,es ;adjust segment:off ;an000; dms; + dec ax ;segment - 1 para ;an000; dms; + mov es,ax ; ;an000; dms; + add di,ER_10H ;adjust offset for 1 ;an000; dms; +; $else ;forward move? ;an000; dms; + JMP SHORT ER_EN66 +ER_IF66: + mov ax,es ;adjust seg:off ;an000; dms; + mov dx,di ; ;an000; dms; + call ER_Segment_Adjust ; ;an000; dms; + mov es,ax ;new seg:off ;an000; dms; + mov di,dx ; ;an000; dms; +; $endif ; ;an000; dms; +ER_EN66: + ; para + jmp ER_Move_Buffer_Count ;determine count ;an000; dms; + +ER_Move_Buffer_EMS_Mem: + + cmp cs:[bp].ER_Direction_Flag,ER_Down ;reverse move? ;an000; dms; +; $if e ;yes ;an000; dms; + JNE ER_IF69 + cmp di,0ffffh ;beginning of log page ;an000; dms; +; $if e ;yes ;an000; dms; + JNE ER_IF70 + dec cs:[bp].ER_Dest_Page ;next page ;an000; dms; + mov di,EMS_Page_Size_In_Bytes;end of page ;an000; dms; +; $endif ; ;an000; dms; +ER_IF70: +; $else ;forward move ;an000; dms; + JMP SHORT ER_EN69 +ER_IF69: + cmp di,4000h ;end of page? ;an000; dms; +; $if e ;yes ;an000; dms; + JNE ER_IF73 + inc cs:[bp].ER_Dest_Page ;next page ;an000; dms; + xor di,di ;clear di ;an000; dms; +; $endif ; ;an000; dms; +ER_IF73: +; $endif ; ;an000; dms; +ER_EN69: + mov bx,cs:[bp].ER_Dest_Page ;pass page to map ;an000; dms; + call ER_Map_Next_Dest_Page ;map in the page ;an000; dms; + +ER_Move_Buffer_Count: + + mov cx,cs:[bp].ER_Current_Move_Count ;get move from source ;an000; dms; + + mov ax,cs ;get seg for buffer ;an000; dms; + mov ds,ax ;put into es ;an000; dms; + mov si,offset cs:ER_Move_Xchg_Buffer1 ;offset of buffer ;an000; dms; + add si,bp ;offset BP relative ;an000; dms; + cmp cs:[bp].ER_Direction_Flag,ER_Down ;reverse move? ;an000; dms; +; $if e ;yes ;an000; dms; + JNE ER_IF76 + add si,ER_10H ;end of buffer + 1 ;an000; dms; + dec si ;end of buffer ;an000; dms; +; $endif ; ;an000; dms; +ER_IF76: + + cmp cs:[bp].ER_Direction_Flag,ER_Down ;reverse move? ;an000; dms; +; $if e ;yes ;an000; dms; + JNE ER_IF78 + std ;reverse move ;an000; dms; +; $else ;forward move ;an000; dms; + JMP SHORT ER_EN78 +ER_IF78: + cld ; ;an000; dms; +; $endif ; ;an000; dms; +ER_EN78: + cli ;ints off ;an000; dms; + rep movsb ;move the data ;an000; dms; + sti ;ints on ;an000; dms; + +ER_Move_Dest_Exit: + + pop ds ;restore regs ;an000; dms; + pop si ; ;an000; dms; + pop dx ; ;an000; dms; + pop bx ; ;an000; dms; + pop ax ; ;an000; dms; + + ret ;return to caller ;an000; dms; + +ER_Move_Buffer_To_Dest endp ;end proc ;an000; dms; + + +;========================================================================= +; ER_Xchg_Source_To_Buffer : This routine moves the source data to +; the buffer before it is exchanged with +; the destination data. +; +; Inputs : BP - carries type of memory for source/dest +; Bit 0 - Destination (EMS if set) +; Bit 1 - Source (EMS if set) +; +; Outputs : ER_Move_Xchg_Buffer1 - Source data +;========================================================================= + +ER_Xchg_Source_To_Buffer proc ; ;an000; dms; + + push ax ;save regs ;an000; dms; + push bx ; ;an000; dms; + push dx ; ;an000; dms; + push di ; ;an000; dms; + push si ; ;an000; dms; + push ds ; ;an000; dms; + push es ; ;an000; dms; + + test cs:[bp].ER_Mem_Type,ER_Source_EMS_Memory;Source EMS? ;an000; dms; + jz ER_Xchg_Source_Conv_Mem ;no - adjust seg:off ;an000; dms; + jmp ER_Xchg_Source_EMS_Mem ;yes- continue move ;an000; dms; + +ER_Xchg_Source_Conv_Mem: + + mov ax,ds ;adjust segment:off ;an000; dms; + mov dx,si ; ;an000; dms; + call ER_Segment_Adjust ; ;an000; dms; + mov ds,ax ;new segment:off ;an000; dms; + mov si,dx ; ;an000; dms; + jmp ER_Xchg_Source_Count ;determine count ;an000; dms; + +ER_Xchg_Source_EMS_Mem: + + cmp si,4000h ;beginning of log page ;an000; dms; + je ER_Xchg_Source_EMS_Next ;yes - get next page ;an000; dms; + mov bx,cs:[bp].ER_Source_Page ;pass log. page to call ;an000; dms; + call ER_Map_Next_Src_Page ;no - map in current pg;an000; dms; + jmp ER_Xchg_Source_Count ;get count for move ;an000; dms; + +ER_Xchg_Source_EMS_Next: + + mov bx,cs:[bp].ER_Source_Page ;pass log. page to call ;an000; dms; + inc bx ; adjusted upward ;an000; dms; + call ER_Map_Next_Src_Page ;map in the page ;an000; dms; + xor si,si ;reinit pointer ;an000; dms; + +ER_Xchg_Source_Count: + + mov cx,ER_10H ;default count ;an000; dms; + cmp cs:[bp].ER_Move_Count_High,0 ;high word set ;an000; dms; + jne ER_Xchg_Source_High_Set ;yes - use default ;an000; dms; + cmp cs:[bp].ER_Move_Count_Low,cx ;>= 10h bytes ;an000; dms; + jae ER_Xchg_Source_High_Set ;yes - use default ;an000; dms; + mov cx,cs:[bp].ER_Move_Count_Low ;no - use last few bytes;an000; dms; + +ER_Xchg_Source_High_Set: + + cmp si,di ;source >= dest? ;an000; dms; +; $if b ;no ;an000; dms; + JNB ER_IF81 + mov ax,4000h ;get end of page ;an000; dms; + sub ax,si ;get bytes remaining ;an000; dms; + cmp ax,ER_10H ;source >= 10h ;an000; dms; +; $if b ;no ;an000; dms; + JNB ER_IF82 + mov cx,ax ;get remaining count ;an000; dms; +; $endif ; ;an000; dms; +ER_IF82: +; $else ;source >= dest ;an000; dms; + JMP SHORT ER_EN81 +ER_IF81: + mov ax,4000h ;get end of page ;an000; dms; + sub ax,di ;get bytes remaining ;an000; dms; + cmp ax,ER_10H ;dest >= 10h ;an000; dms; +; $if b ;no ;an000; dms; + JNB ER_IF85 + mov cx,ax ;get remaining count ;an000; dms; +; $endif ; ;an000; dms; +ER_IF85: +; $endif ; ;an000; dms; +ER_EN81: + +ER_Xchg_Source_Default_Count: + + mov cs:[bp].ER_Current_Move_Count,cx ;save current move cnt ;an000; dms; + + sub cs:[bp].ER_Move_Count_Low,cx ;get new count ;an000; dms; + sbb cs:[bp].ER_Move_Count_High,0 ;pick up borrow ;an000; dms; + + mov ax,cs ;get seg for buffer ;an000; dms; + mov es,ax ;put into es ;an000; dms; + mov di,offset cs:ER_Move_Xchg_Buffer1 ;offset of buffer ;an000; dms; + add di,bp ;offset BP relative ;an000; dms; + + cld ;forward move ;an000; dms; + cli ;ints off ;an000; dms; + rep movsb ;move the data ;an000; dms; + sti ;ints on ;an000; dms; + +ER_Xchg_Source_Exit: + + pop es ;restore regs ;an000; dms; + pop ds ; ;an000; dms; + pop si ; ;an000; dms; + pop di ; ;an000; dms; + pop dx ; ;an000; dms; + pop bx ; ;an000; dms; + pop ax ; ;an000; dms; + + ret ;return to caller ;an000; dms; + +ER_Xchg_Source_To_Buffer endp ;end proc ;an000; dms; + + +;========================================================================= +; ER_Xchg_Dest_To_Buffer : This routine moves the destination data to +; the buffer before it is exchanged with +; the source data. +; +; Inputs : BP - carries type of memory for source/dest +; Bit 0 - Destination (EMS if set) +; Bit 1 - Source (EMS if set) +; +; Outputs : ER_Move_Xchg_Buffer2 - Destination data +;========================================================================= + +ER_Xchg_Dest_To_Buffer proc ; ;an000; dms; + + push ax ;save regs ;an000; dms; + push bx ; ;an000; dms; + push dx ; ;an000; dms; + push di ; ;an000; dms; + push si ; ;an000; dms; + push ds ; ;an000; dms; + push es ; ;an000; dms; + + test cs:[bp].ER_Mem_Type,ER_Dest_EMS_Memory ;Dest EMS? ;an000; dms; + jz ER_Xchg_Dest_Conv_Mem ;no - adjust seg:off ;an000; dms; + jmp ER_Xchg_Dest_EMS_Mem ;yes- continue move ;an000; dms; + +ER_Xchg_Dest_Conv_Mem: + + mov ax,es ;adjust segment:off ;an000; dms; + mov dx,di ; ;an000; dms; + call ER_Segment_Adjust ; ;an000; dms; + mov es,ax ;new segment:off ;an000; dms; + mov di,dx ; ;an000; dms; + jmp ER_Xchg_Dest_Count ;determine count ;an000; dms; + +ER_Xchg_Dest_EMS_Mem: + + cmp di,4000h ;beginning of log page ;an000; dms; + je ER_Xchg_Dest_EMS_Next ;yes - get next page ;an000; dms; + mov bx,cs:[bp].ER_Dest_Page ;pass log. page to call ;an000; dms; + call ER_Map_Next_Dest_Page ;no - map in current pg;an000; dms; + jmp ER_Xchg_Dest_Count ;get count for move ;an000; dms; + +ER_Xchg_Dest_EMS_Next: + + mov bx,cs:[bp].ER_Dest_Page ;pass log. page to call ;an000; dms; + inc bx ; adjusted upward ;an000; dms; + call ER_Map_Next_Dest_Page ;map in the page ;an000; dms; + xor di,di ;reinit pointer ;an000; dms; + +ER_Xchg_Dest_Count: + + mov cx,cs:[bp].ER_Current_Move_Count ;get move count ;an000; dms; + mov ax,es ;get destination seg ;an000; dms; + mov ds,ax ;put into ds for buffer ;an000; dms; + ; transfer + mov si,di ;get destination off ;an000; dms; + mov ax,cs ;get seg for buffer ;an000; dms; + mov es,ax ;put into es ;an000; dms; + mov di,offset cs:ER_Move_Xchg_Buffer2 ;offset of buffer ;an000; dms; + add di,bp ;offset BP relative ;an000; dms; + + cld ;forward move ;an000; dms; + cli ;ints off ;an000; dms; + rep movsb ;move the data ;an000; dms; + sti ;ints on ;an000; dms; + +ER_Xchg_Dest_Exit: + + pop es ;restore regs ;an000; dms; + pop ds ; ;an000; dms; + pop si ; ;an000; dms; + pop di ; ;an000; dms; + pop dx ; ;an000; dms; + pop bx ; ;an000; dms; + pop ax ; ;an000; dms; + + ret ;return to caller ;an000; dms; + +ER_Xchg_Dest_To_Buffer endp ;end proc ;an000; dms; + + + + +;========================================================================= +; ER_Xchg_Buffer_To_Source ; This routine performs the actual exchange +; from the destination buffer to the source +; buffer. +; +; Inputs : BP - carries type of memory for source/dest +; Bit 0 - Destination (EMS if set) +; Bit 1 - Source (EMS if set) +; ER_Move_Xchg_Buffer2 - Destination data +; +; Outputs : Adjusted segment:offset or page/offset +;========================================================================= + +ER_Xchg_Buffer_To_Source proc ; ;an000; dms; + + push ax ;save regs ;an000; dms; + push bx ; ;an000; dms; + push dx ; ;an000; dms; + push di ; ;an000; dms; + push es ; ;an000; dms; + + test cs:[bp].ER_Mem_Type,ER_Source_EMS_Memory;Source EMS? ;an000; dms; + jz ER_Xchg_Buf2_Conv_Mem ;no - adjust seg:off ;an000; dms; + jmp ER_Xchg_Buf2_EMS_Mem ;yes- continue move ;an000; dms; + +ER_Xchg_Buf2_Conv_Mem: + + mov ax,ds ;adjust segment:off ;an000; dms; + mov dx,si ; ;an000; dms; + call ER_Segment_Adjust ; ;an000; dms; + mov ds,ax ;new segment:off ;an000; dms; + mov si,dx ; ;an000; dms; + jmp ER_Xchg_Buf2_Count ;determine count ;an000; dms; + +ER_Xchg_Buf2_EMS_Mem: + + cmp si,4000h ;beginning of log page ;an000; dms; + je ER_Xchg_Buf2_EMS_Next ;yes - get next page ;an000; dms; + mov bx,cs:[bp].ER_Source_Page ;pass log. page to call ;an000; dms; + call ER_Map_Next_Src_Page ;no - map in current pg;an000; dms; + jmp ER_Xchg_Buf2_Count ;get count for move ;an000; dms; + +ER_Xchg_Buf2_EMS_Next: + + inc cs:[bp].ER_Source_Page ;adjust log page ;an000; dms; + mov bx,cs:[bp].ER_Source_Page ;pass log. page to call ;an000; dms; + call ER_Map_Next_Src_Page ;map in the page ;an000; dms; + xor si,si ;reinit pointer ;an000; dms; + +ER_Xchg_Buf2_Count: + + mov cx,cs:[bp].ER_Current_Move_Count ;get move count ;an000; dms; + + mov ax,ds ;get destination seg ;an000; dms; + mov es,ax ;put into ds for buffer ;an000; dms; + ; transfer + mov di,si ;get destination off ;an000; dms; + add si,cx ;adjust source ptr ;an000; dms; + push si ;save across xchg ;an000; dms; + push ds ; ;an000; dms; + + mov ax,cs ;get seg for buffer ;an000; dms; + mov ds,ax ;put into es ;an000; dms; + mov si,offset cs:ER_Move_Xchg_Buffer2 ;offset of buffer ;an000; dms; + add si,bp ;offset BP relative ;an000; dms; + + cld ;forward move ;an000; dms; + cli ;ints off ;an000; dms; + rep movsb ;move the data ;an000; dms; + sti ;ints on ;an000; dms; + + pop ds ;restore ptr ;an000; dms; + pop si ; ;an000; dms; + +ER_Xchg_Buf2_Exit: + + pop es ;restore regs ;an000; dms; + pop di ; ;an000; dms; + pop dx ; ;an000; dms; + pop bx ; ;an000; dms; + pop ax ; ;an000; dms; + + ret ;return to caller ;an000; dms; + +ER_Xchg_Buffer_To_Source endp ;end proc ;an000; dms; + + + +;========================================================================= +; ER_Xchg_Buffer_To_Dest ; This routine performs the actual exchange +; from the source buffer to the destination. +; +; Inputs : BP - carries type of memory for source/dest +; Bit 0 - Destination (EMS if set) +; Bit 1 - Source (EMS if set) +; ER_Move_Xchg_Buffer1 - Source data +; +; Outputs : Adjusted segment:offset or page/offset +;========================================================================= + +ER_Xchg_Buffer_To_Dest proc ; ;an000; dms; + + push ax ;save regs ;an000; dms; + push bx ; ;an000; dms; + push dx ; ;an000; dms; + push si ; ;an000; dms; + push ds ; ;an000; dms; + + test cs:[bp].ER_Mem_Type,ER_Dest_EMS_Memory ;Dest EMS? ;an000; dms; + jz ER_Xchg_Buf1_Conv_Mem ;no - adjust seg:off ;an000; dms; + jmp ER_Xchg_Buf1_EMS_Mem ;yes- continue move ;an000; dms; + +ER_Xchg_Buf1_Conv_Mem: + + mov ax,es ;adjust segment:off ;an000; dms; + mov dx,di ; ;an000; dms; + call ER_Segment_Adjust ; ;an000; dms; + mov es,ax ;new segment:off ;an000; dms; + mov di,dx ; ;an000; dms; + jmp ER_Xchg_Buf1_Count ;determine count ;an000; dms; + +ER_Xchg_Buf1_EMS_Mem: + + cmp di,4000h ;beginning of log page ;an000; dms; + je ER_Xchg_Buf1_EMS_Next ;yes - get next page ;an000; dms; + mov bx,cs:[bp].ER_Dest_Page ;pass log. page to call ;an000; dms; + call ER_Map_Next_Dest_Page ;no - map in current pg;an000; dms; + jmp ER_Xchg_Buf1_Count ;get count for move ;an000; dms; + +ER_Xchg_Buf1_EMS_Next: + + inc cs:[bp].ER_Dest_Page ;adjust log page ;an000; dms; + mov bx,cs:[bp].ER_Dest_Page ;pass log. page to call ;an000; dms; + call ER_Map_Next_Dest_Page ;map in the page ;an000; dms; + mov di,EMS_Page_Size_In_Bytes ;reinit pointer ;an000; dms; + +ER_Xchg_Buf1_Count: + + mov cx,cs:[bp].ER_Current_Move_Count ;get move count ;an000; dms; + mov ax,cs ;get seg for buffer ;an000; dms; + mov ds,ax ;put into es ;an000; dms; + mov si,offset cs:ER_Move_Xchg_Buffer1 ;offset of buffer ;an000; dms; + add si,bp ;offset BP relative ;an000; dms; + + cld ;forward move ;an000; dms; + cli ;ints off ;an000; dms; + rep movsb ;move the data ;an000; dms; + sti ;ints on ;an000; dms; + +ER_Xchg_Buf1_Exit: + + pop ds ;restore regs ;an000; dms; + pop si ; ;an000; dms; + pop dx ; ;an000; dms; + pop bx ; ;an000; dms; + pop ax ; ;an000; dms; + + ret ;return to caller ;an000; dms; + +ER_Xchg_Buffer_To_Dest endp ;end proc ;an000; dms; + + + +;========================================================================= +; ER_Map_Next_Src_Page : This routine maps in the page needed by +; the source of the move/exchange. +; +; Inputs : ER_Source_Phys_Page - Physical page of source +; ER_Source_Handle - Handle of source +; BX - logical page +; +; Outputs : newly mapped page +;========================================================================= + +ER_Map_Next_Src_Page proc ;map next src. page ;an000; dms; + + mov ax,cs:[bp].ER_Source_Phys_Page ;map the source page ;an000; dms; + mov dx,cs:[bp].ER_Source_Handle ;handle to use ;an000; dms; + call Map_L_To_P ;map the page ;an000; dms; + + ret ;return to caller ;an000; dms; + +ER_Map_Next_Src_Page endp ;end proc ;an000; dms; + +;========================================================================= +; ER_Map_Next_Dest_Page : This routine maps in the page needed by +; the destination of the move/exchange. +; +; Inputs : ER_Dest_Phys_Page - Physical page of source +; ER_Dest_Handle - Handle of source +; BX - logical page to map +; +; Outputs : newly mapped page +;========================================================================= + +ER_Map_Next_Dest_Page proc ;map next dest. page ;an000; dms; + + mov ax,cs:[bp].ER_Dest_Phys_Page ;map the dest. page ;an000; dms; + mov dx,cs:[bp].ER_Dest_Handle ;handle to use ;an000; dms; + call Map_L_To_P ;map the page ;an000; dms; + + ret ;return to caller ;an000; dms; + +ER_Map_Next_Dest_Page endp ;end proc ;an000; dms; + +;========================================================================= +; ER_Move_Data : This routine will perform the actual move of the +; data for the function 5700h. +; +; Inputs : DS:SI - Pointer to Move_Source_Dest_Struc data +; +; Outputs : AH - Non-zero on error +;========================================================================= + +ER_Move_Data proc ;move the data ;an000; dms; + + push bx ;save regs ;an000; dms; + push cx ; ;an000; dms; + push dx ; ;an000; dms; + push di ; ;an000; dms; + push si ; ;an000; dms; + push ds ; ;an000; dms; + push es ; ;an000; dms; + + call ER_Save_Context ;save off max of 2 pages;an000; dms; + call ER_Det_Src_Dest_Seg ;determine segs ;an000; dms; + call ER_Det_Move_Count ;ER_10h_Move_Count = ;an000; dms; + ; # of 10h moves + ;ER_10h_Move_Remainder = + ; # of bytes remaining + +ER_Move_Data_Now: + + ;set the flags to signal + ;the memory type in use + ;for Source/Destination. + + xor al,al ;al signals type of mem ;an000; dms; + or al,[si].Source_Memory_Type ;get source memory type ;an000; dms; + shl al,1 ;put into bit 1 ;an000; dms; + or al,[si].Dest_Memory_Type ;get dest. memory type ;an000; dms; + cbw ;make it a word value ;an000; dms; + mov cs:[bp].ER_Mem_Type,ax ;put flags in var ;an000; dms; + ;bp = bit 0 - dest mem + ; bit 1 - src mem + + mov di,cs:[bp].ER_Dest_Off ;get dest. offset ;an000; dms; + mov es,cs:[bp].ER_Dest_Seg ;get dest. seg ;an000; dms; + + mov si,cs:[bp].ER_Source_Off ;get src. offset ;an000; dms; + mov ds,cs:[bp].ER_Source_Seg ;get src. seg ;an000; dms; + +ER_Move_Data_Loop: + + call ER_Move_Source_To_Buffer ;move data to buffer ;an000; dms; + call ER_Move_Buffer_To_Dest ;move buffer to dest. ;an000; dms; + + cmp cs:[bp].ER_Move_Count_High,0 ;end of move? ;an000; dms; + jne ER_Move_Data_Loop ;no - continue loop ;an000; dms; + cmp cs:[bp].ER_Move_Count_Low,0 ;end of move? ;an000; dms; + jne ER_Move_Data_Loop ;no - continue loop ;an000; dms; + ;yes - end of loop ;an000; dms; + +ER_Move_Data_Error_Exit: + + call ER_Restore_Context ;restore the context ;an000; dms; + + pop es ;restore regs ;an000; dms; + pop ds ; ;an000; dms; + pop si ; ;an000; dms; + pop di ; ;an000; dms; + pop dx ; ;an000; dms; + pop cx ; ;an000; dms; + pop bx ; ;an000; dms; + + ret ;return to caller ;an000; dms; + +ER_Move_Data endp ;end proc ;an000; dms; + + + +;========================================================================= +; ER_Exchange_Data : This routine will perform the actual exchange of +; data for the function 5701h. +; +; Inputs : DS:SI - Pointer to Move_Source_Dest_Struc data +; +; Outputs : AH - Non-zero on error +;========================================================================= + +ER_Exchange_Data proc ;xchg the data ;an000; dms; + + push bx ;save regs ;an000; dms; + push cx ; ;an000; dms; + push dx ; ;an000; dms; + push di ; ;an000; dms; + push si ; ;an000; dms; + push ds ; ;an000; dms; + push es ; ;an000; dms; + + call ER_Save_Context ;save off max of 2 pages;an000; dms; + call ER_Det_Src_Dest_Seg ;determine segs ;an000; dms; + call ER_Det_Move_Count ;ER_10h_Move_Count = ;an000; dms; + ; # of 10h moves + ;ER_10h_Move_Remainder = + ; # of bytes remaining + +ER_Xchg_Data_Now: + + ;set the flags to signal + ;the memory type in use + ;for Source/Destination. + + xor al,al ;al signals type of mem ;an000; dms; + or al,[si].Source_Memory_Type ;get source memory type ;an000; dms; + shl al,1 ;put into bit 1 ;an000; dms; + or al,[si].Dest_Memory_Type ;get dest. memory type ;an000; dms; + cbw ;make it a word value ;an000; dms; + mov cs:[bp].ER_Mem_Type,ax ;put flags in var ;an000; dms; + ;bp = bit 0 - dest mem + ; bit 1 - src mem + + mov di,cs:[bp].ER_Dest_Off ;get dest. offset ;an000; dms; + mov es,cs:[bp].ER_Dest_Seg ;get dest. seg ;an000; dms; + + mov si,cs:[bp].ER_Source_Off ;get src. offset ;an000; dms; + mov ds,cs:[bp].ER_Source_Seg ;get src. seg ;an000; dms; + +ER_Xchg_Data_Loop: + + call ER_Xchg_Source_To_Buffer ;move source to buf 1 ;an000; dms; + call ER_Xchg_Dest_To_Buffer ;move dest. to buf 2 ;an000; dms; + call ER_Xchg_Buffer_To_Source ;move buf2 to source ;an000; dms; + call ER_Xchg_Buffer_To_Dest ;move buf1 to dest. ;an000; dms; + + cmp cs:[bp].ER_Move_Count_High,0 ;end of move? ;an000; dms; + jne ER_Xchg_Data_Loop ;no - continue loop ;an000; dms; + cmp cs:[bp].ER_Move_Count_Low,0 ;end of move? ;an000; dms; + jne ER_Xchg_Data_Loop ;no - continue loop ;an000; dms; + ;yes - end of loop ;an000; dms; + +ER_Xchg_Data_Error_Exit: + + call ER_Restore_Context ;restore the context ;an000; dms; + + pop es ;restore regs ;an000; dms; + pop ds ; ;an000; dms; + pop si ; ;an000; dms; + pop di ; ;an000; dms; + pop dx ; ;an000; dms; + pop cx ; ;an000; dms; + pop bx ; ;an000; dms; + + ret ;return to caller ;an000; dms; + +ER_Exchange_Data endp ;end proc ;an000; dms; + + + + page + +;========================================================================= +;=============== Function 5Ah Logic - Allocate Raw Pages ============= +;========================================================================= + + +;========================================================================= +; Alloc_Raw - This routine allocates raw EMS pages, pages +; less than the standard 16k page. These pages +; are a sub-multiple of 16k. In the IBM version +; of this implementation the raw page is defined +; as 16k, thus we do not need to do anything +; special here. We map this call to the proc +; GET_HANDLE (function 43h) to allocate a handle. +; +; Inputs : AH - 5Ah (Allocate Raw Pages) +; BX - Number of raw pages to allocate +; +; Outputs : AH - Non-zero if error (Determined by Get_Handle proc) +; DX - Handle if no error +;========================================================================= + +Alloc_Raw proc ;Allocate raw pages ;an000; dms; + + PUSH BX + PUSH CX + PUSH DI + PUSH SI + PUSH DS ;save these registers + + PUSH CS ;get cs + POP DS ;into ds + + ;Remove test for BX = 0. This is @RH4 + ; valid under LIM 4.0 + + cmp al,AR_Sub_Max ;sub function out of range? ;an000; dms; + jna AR_OKSub ;no ;an000; dms; + mov ah,EMS_Code8F ;yes-signal error ;an000; dms; + jmp AR_Exit ;exit routine ;an000; dms; + +AR_OKSub: + + CMP BX,TOTAL_EMS_PAGES ;Enough total EMS pages? + JNA AR_OKTOTAL + MOV AH,EMS_CODE87 + JMP AR_EXIT + +AR_OKTOTAL: + cli ;ints off ;an000; dms; + CMP BX,FREE_PAGES ;Enough unallocated pages? + sti ;ints on ;an000; dms; + JNA AR_OKFREE + MOV AH,EMS_CODE88 + JMP AR_EXIT + ;----------------------------------------------------- + ; Search for a free handle @RH1 + ;----------------------------------------------------- +AR_OKFREE: + MOV CX,NUM_HANDLES ;loop counter is #handles + DEC CX ;handle 0 reserved for op. sys. @RH1 + MOV DX,1 ;handle assignment set to 1 @RH1 + MOV DI,TYPE H_LOOKUP_STRUC ;init table index to 1st entry @RH1 +;-------------------------------- + CLI ;interrupts OFF during allocation +;-------------------------------- +AR_FREEHSRCH: + CMP HANDLE_LOOKUP_TABLE.H_PAGES[DI],REUSABLE_HANDLE + ;Is this handle available? @RH1 + JE AR_HFREE ;yes end search dx=handle id @RH1 + INC DX ;next handle assignment + ADD DI,TYPE H_LOOKUP_STRUC ;next entry in handle lookup @RH1 + ;repeat for all table entries + LOOP AR_FREEHSRCH + MOV AH,EMS_CODE85 ;no available handles + JMP AR_EXIT ;go to exit ;GGA + + ;----------------------------------------------------- + ; If here then there's enough pages for request. @RH1 + ; DX = handle #, DI = ptr to hndl lookup entry @RH1 +AR_HFREE: + + MOV CX,NUM_HANDLES ;loop counter + DEC CX ;handle 0 reserved for op. sys. @RH1 + ;si = index to hndl lookup tbl @RH1 + MOV SI,TYPE H_LOOKUP_STRUC ; for adding pages (skip 0 entry) @RH1 + XOR AX,AX ;clear page counter + CLC ;clear carry for addition +AR_PAGESUM: + CMP HANDLE_LOOKUP_TABLE.H_PAGES[SI],REUSABLE_HANDLE + JE AR_PGSUM_BOT ;If handle is free don't add @RH4 + ADD AX,HANDLE_LOOKUP_TABLE.H_PAGES[SI] + ;add lengths (pages) of PALs @RH1 + ADD SI,TYPE H_LOOKUP_STRUC ; next entry in handle lookup @RH1 +AR_PGSUM_BOT: + LOOP AR_PAGESUM + CMP AX,TOTAL_EMS_PAGES ;pages in handle lookup > total? @RH1 + JNA AR_CALCHLUP ;no OK @RH1 + MOV AH,EMS_CODE80 ;software error..we screwed up @RH1 + JMP AR_EXIT ;go to exit @RH1 ;GGA + +AR_CALCHLUP: ;calculate entry in hndl lkup tbl @RH1 + cmp bx,0 ;page request? ;an000; dms; + jne AR_Alloc_Cont ;yes continue ;an000; dms; + cli ;ints off ;an001; dms; + mov Handle_LookUp_Table.H_Pages[di],bx ;new page count ;an001; dms; + sti ;ints on ;an001; dms; + xor ah,ah ;clear flag ;an000; dms; + jmp AR_Exit ;exit routine ;an000; dms; + +AR_Alloc_Cont: + + cli ;ints off ;an001; dms; + mov cx,bx ;alloc count ;an000; dms; + call EMS_Page_Contig_Chk ;do we have contig pgs. ;an001; dms; + jnc AR_Alloc ;yes continue process ;an001; dms; + mov ah,EMS_Code88 ;no signal error ;an001; dms; + sti ;ints on ;an001; dms; + jmp AR_Exit ;exit routine ;an001; dms; + +AR_Alloc: + + call EMS_Link_Set ;set up links ;an001; dms; + + + sub Free_Pages,bx ;free = free - requested pages + mov Handle_LookUp_Table.H_Pages[di],bx ;page count ;an000; dms; + mov Handle_LookUp_Table.H_Pal_Ptr[di],si ;initialize to ptr for ;ac001; dms; + ; pages + sti ;ints on ;an001; dms; + xor ah,ah ;clear flag ;an000; dms; + + +AR_EXIT: ;GGA + + POP DS + POP SI + POP DI + POP CX + POP BX + + ret ;return to caller ;an000; dms; + +Alloc_Raw endp ;end proc ;an000; dms; + + page +;========================================================================= +;=============== Function 5Ch Logic - Prepare for Warm Boot ============= +;========================================================================= + + +;========================================================================= +; Prepare_Boot - This routine prepares the hardware for a +; warm boot. Since we have no special hardware +; requirements at this time, this routine sets +; a good error level and returns to the caller. +; +; Inputs : AH - 5Ch (Prepare for Warm Boot) +; +; Outputs : AH - Non-zero if error (Determined by Get_Handle proc) +;========================================================================= + +Prepare_Boot proc ;prepare for warm boot ;an000; dms; + + xor ah,ah ;signal no error ;an000; dms; + + ret ;return to caller ;an000; dms; + +Prepare_Boot endp ;end proc ;an000; dms; + + + diff --git a/v4.0/src/DEV/XMA2EMS/MAKEFILE b/v4.0/src/DEV/XMA2EMS/MAKEFILE new file mode 100644 index 0000000..c739b08 --- /dev/null +++ b/v4.0/src/DEV/XMA2EMS/MAKEFILE @@ -0,0 +1,24 @@ +#************************ makefile for dev\xma2ems************************ + +msg =..\..\messages +dos =..\..\dos +inc =..\..\inc +hinc =..\..\h + +# +####################### dependencies begin here. ######################### +# + +all: xma2ems.sys + +xma2ems.ctl: xma2ems.skl $(MSG)\$(country).MSG makefile + +xma2ems.obj: xma2ems.asm xma1diag.inc xma2ems.cl1 $(inc)\COPYRIGH.INC \ + parmpars.inc lim40.inc ps2_5060.inc makefile \ + emsinit.inc genioctl.inc xma2emsp.inc lim40b.inc romscan.inc \ + $(inc)\psdata.inc + +xma2ems.sys: xma2ems.obj makefile + link xma2ems; + exe2bin xma2ems.exe xma2ems.sys + del xma2ems.exe diff --git a/v4.0/src/DEV/XMA2EMS/PARMPARS.INC b/v4.0/src/DEV/XMA2EMS/PARMPARS.INC new file mode 100644 index 0000000..42ea6e8 --- /dev/null +++ b/v4.0/src/DEV/XMA2EMS/PARMPARS.INC @@ -0,0 +1,530 @@ + PAGE +;-----------------------------------------------------------------------; +; GET_PARMS extracts parameters from the command line buffer ; +; ; +; On entry: all letters after 'Device=' have been changed ; +; to upper case ; +; ; +; On exit: (zf)=0 if syntax error ; +; if (zf)=1 then... ; +; ; +; EMM_START_BLOCK has been updated ; +; ; +; AX,BX,CX,DX,DI,SI,DS are destroyed ; +;-----------------------------------------------------------------------; + +include xma2emsp.inc ; include parser things +include parse.asm + +GET_PARMS PROC + LDS BX,CS:RH_PTRA ;make ds:bx point to request header + + LDS SI,RH.RH0_BPBA ;make ds:si point to bios paramter buffer + CLD + mov cs:EMS_Pgs_Parm,E_Parm_Def ;default to all of memory ;an000; dms; + +;------------------------------------------------------------------- +; parser support added by GGA +;------------------------------------------------------------------- + push cs ; make ES:DI point to parm block + pop es + lea di,p_block + + xor cx,cx ; cx = 0, ordinal + xor dx,dx ; dx = 0, reserved + + push ds ; save ds + +get_args: + pop ds ; restore ds + call SysParse ; call the parser + cmp ax,0 ; end of line? + je check_frame ; no, find out what we got this time + cmp ax,-1 ; end of parse? + je end_of_input_line1 ; yes + cmp ax,-1 ; flag an error + ret ; return to caller + +end_of_input_line1: + + jmp end_of_input_line ; + +; find out which arg was processed this time + +check_frame: + +; make ds point to data area for these comparisons, must restore before +; calling parser again + + push ds ; save ds + push es ; make ds point to save areas + pop ds + + cmp frame_result.$P_Type,2 ; was there a FRAME= in this pass? + jne check_p0 ; no, look for a P0 + + mov parse_flag,1 ; set parse flag + + mov byte ptr frame_ctl+9,0 ; turn this off so we don't allow another + mov frame_result.$P_Type,0 ; clear this so we don't get fooled later + + mov byte ptr p0_ctl+9,0 ; turn these off so we don't allow any + mov byte ptr p1_ctl+9,0 ; others that would conflict + mov byte ptr p2_ctl+9,0 + mov byte ptr p3_ctl+9,0 + + push si ;save regs + + mov si,word ptr frame_result.$P_Picked_Val[+0] + + mov word ptr ds:[si+0],0 ;clear the + mov word ptr ds:[si+4],0 ; pages + mov word ptr ds:[si+8],0 + mov word ptr ds:[si+12],0 + + pop si ;restore regs + + +; set flags for later code to fill in map_table + + or page_flags,frame_flag ; set frame flag + + jmp get_args ; go get another argument + +check_p0: + cmp p0_result.$P_Type,2 ; was there a P0= in this pass? + jne check_p1 ; no, look for a P0 + + mov parse_flag,1 ; set parse flag + + mov byte ptr p0_ctl+9,0 ; turn this off so we don't allow another + mov p0_result.$P_Type,0 ; clear this so we don't get fooled later + + mov byte ptr frame_ctl+9,0 ; turn this off so we don't allow another + + push si ;save regs + + mov si,word ptr p0_result.$P_Picked_Val[+0] + + mov word ptr ds:[si+0],0 + + pop si ;restore regs +; set flags for later code to fill in map_table + + or page_flags,p0_flag ; set p0 flag + + jmp get_args ; go get another argument + +check_p1: + cmp p1_result.$P_Type,2 ; was there a p1= in this pass? + jne check_p2 ; no, look for a P2 + + mov parse_flag,1 ; set parse flag + + mov byte ptr p1_ctl+9,0 ; turn this off so we don't allow another + mov p1_result.$P_Type,0 ; clear this so we don't get fooled later + + mov byte ptr frame_ctl+9,0 ; turn this off so we don't allow another + + push si ;save regs + + mov si,word ptr p1_result.$P_Picked_Val[+0] + + mov word ptr ds:[si+0],0 + + pop si ;restore regs +; set flags for later code to fill in map_table + + or page_flags,p1_flag ; set p1 flag + + jmp get_args ; go get another argument + +check_p2: + cmp p2_result.$P_Type,2 ; was there a p2= in this pass? + jne check_p3 ; no, look for a p3 + + mov parse_flag,1 ; set parse flag + + mov byte ptr p2_ctl+9,0 ; turn this off so we don't allow another + mov p2_result.$P_Type,0 ; clear this so we don't get fooled later + + mov byte ptr frame_ctl+9,0 ; turn this off so we don't allow another + + push si ;save regs + + mov si,word ptr p2_result.$P_Picked_Val[+0] + + mov word ptr ds:[si+0],0 + + pop si ;restore regs +; set flags for later code to fill in map_table + + or page_flags,p2_flag ; set p2 flag + + jmp get_args ; go get another argument + +check_p3: + cmp p3_result.$P_Type,2 ; was there a p3= in this pass? + jne check_p254 ; no, look for a P254 + + mov parse_flag,1 ; set parse flag + + mov byte ptr p3_ctl+9,0 ; turn this off so we don't allow another + mov p3_result.$P_Type,0 ; clear this so we don't get fooled later + + mov byte ptr frame_ctl+9,0 ; turn this off so we don't allow another + + push si ;save regs + + mov si,word ptr p3_result.$P_Picked_Val[+0] + + mov word ptr ds:[si+0],0 + + pop si ;restore regs +; set flags for later code to fill in map_table + + or page_flags,p3_flag ; set p3 flag + + jmp get_args ; go get another argument + +check_p254: + cmp p254_result.$P_Type,2 ; was there a p254= in this pass? + jne check_p255 ; no, look for a P255 + + mov parse_flag,1 ; set parse flag + + mov byte ptr p254_ctl+9,0 ; turn this off so we don't allow another + mov p254_result.$P_Type,0 ; clear this so we don't get fooled later + + push si ;save regs + + mov si,word ptr p254_result.$P_Picked_Val[+0] + + mov word ptr ds:[si+0],0 + + pop si ;restore regs +; set flags for later code to fill in map_table + + or page_flags,p254_flag ; set p254 flag + + jmp get_args ; go get another argument + +check_p255: + cmp p255_result.$P_Type,2 ; was there a P255= in this pass? + je do_p255 ; yes, process it + jmp Check_X ; no, find out if /X was included + +do_p255: + mov parse_flag,1 ; set parse flag + + mov byte ptr p255_ctl+9,0 ; turn this off so we don't allow another + mov p255_result.$P_Type,0 ; clear this so we don't get fooled later + + push si ;save regs + + mov si,word ptr p255_result.$P_Picked_Val[+0] + + mov word ptr ds:[si+0],0 + + pop si ;restore regs +; set flags for later code to fill in map_table + + or page_flags,p255_flag ; set p255 flag + + jmp get_args ; go get another argument + +Check_X: + cmp es:X_Result.$P_SYNONYM_Ptr,offset es:X_Switch.$P_KeyorSW ; switch Ptr ;an000; dms; + je Do_X ; yes, process it + jmp get_args ; no, must have been the positional, ignore it and go on + +Do_X: + + push ax ; save regs + mov ax,es:word ptr X_Result.$P_Picked_Val ;get low word of result ;an000; dms; + mov cs:EMS_Pgs_Parm,ax ; pass to program ;an000; dms; + pop ax ; restore regs + + jmp get_args ; go get another argument + + + + +; getting here means invalid argument, figure out what to do later + +end_of_input_line: + + cmp parse_flag,null ; were there command line args? + jne cmd_line_args ; yes, process them + jmp null_cmd_line ; no, skip processing + +cmd_line_args: + +; put the stuff into map_table, this is done by looking at flags set +; by the above code and putting the addresses into map_table + + push ax ; save some regs + push bx + push cx + push dx + push di + + xor di,di ; clear index pointer + + mov map_count,null ; clear map count default + + test page_flags,frame_flag ; was FRAME= included? + jz chk_p0 ; no, try p0 + +; yes, fix up page count and fill in map_table + + mov map_count,4 ; FRAME= takes up 4 map entries + +; convert the item tag into a segment address + + xor ah,ah ; make 0 + mov al,frame_result.$P_Item_Tag ; get item tag + mov cx,8 ; need to shift left eight bits + shl ax,cl ; to convert to a segment address + +; do some math with di + + xor di,di ; clear index pointer + +; save the segment addresses in map_table + + mov map_table.phys_page_segment[di],ax ; store p0 segment + mov map_table.phys_page_number[di],0 ; p0 page number + mov cs:Page_Frame_Sta,ax ;save our page for XMA1 ;an000; dms; + ; diags. + + add ax,400h ; increase segment ID by 16K + add di,type mappable_phys_page_struct + + mov map_table.phys_page_segment[di],ax ; store p1 segment + mov map_table.phys_page_number[di],1 ; p1 page number + + add ax,400h ; increase segment ID by 16K + add di,type mappable_phys_page_struct + + mov map_table.phys_page_segment[di],ax ; store p2 segment + mov map_table.phys_page_number[di],2 ; p2 page number + + add ax,400h ; increase segment ID by 16K + add di,type mappable_phys_page_struct + + mov map_table.phys_page_segment[di],ax ; store p3 segment + mov map_table.phys_page_number[di],3 ; p3 page number + +; do some math with di, this will be used as a pointer into map_table + + add di,type mappable_phys_page_struct + + jmp chk_p254 ; FRAME= implies that p0 - p3 were not present, + ; skip ahead and look for p254 and p255 + +; check for p0 + +chk_p0: + + test page_flags,p0_flag ; was p0= included? + jz chk_p1 ; no, try p1 + +; yes, fix up page count and fill in map_table + + add map_count,1 ; one extra map entry + +; convert the item tag into a segment address + + xor ah,ah ; make 0 + mov al,p0_result.$P_Item_Tag; get item tag + mov cx,8 ; need to shift left eight bits + shl ax,cl ; to convert to a segment address + + +; save the segment addresses in map_table + + mov map_table.phys_page_segment[di],ax ; store p0 segment + mov map_table.phys_page_number[di],0 ; p0 page number + mov cs:Page_Frame_Sta,ax ;save our page for XMA1 ;an000; dms; + ; diags. + +; do some math with di, this will be used as a pointer into map_table + + add di,type mappable_phys_page_struct + +;------------------------ +; check for p1 +;------------------------ + +chk_p1: + + test page_flags,p1_flag ; was p1= included? + jz chk_p2 ; no, try p2 + +; yes, fix up page count and fill in map_table + + add map_count,1 ; one extra map entry + +; convert the item tag into a segment address + + xor ah,ah ; make 0 + mov al,p1_result.$P_Item_Tag; get item tag + mov cx,8 ; need to shift left eight bits + shl ax,cl ; to convert to a segment address + + +; save the segment addresses in map_table + + mov map_table.phys_page_segment[di],ax ; store p1 segment + mov map_table.phys_page_number[di],1 ; p0 page number + mov cs:Page_Frame_Sta,ax ;save our page for XMA1 ;an000; dms; + ; diags. + +; do some math with di, this will be used as a pointer into map_table + + add di,type mappable_phys_page_struct + +;------------------------ +; check for p2 +;------------------------ + +chk_p2: + + test page_flags,p2_flag ; was p2= included? + jz chk_p3 ; no, try p3 + +; yes, fix up page count and fill in map_table + + add map_count,1 ; one extra map entry + +; convert the item tag into a segment address + + xor ah,ah ; make 0 + mov al,p2_result.$P_Item_Tag; get item tag + mov cx,8 ; need to shift left eight bits + shl ax,cl ; to convert to a segment address + + +; save the segment addresses in map_table + + mov map_table.phys_page_segment[di],ax ; store p2 segment + mov map_table.phys_page_number[di],2 ; p2 page number + mov cs:Page_Frame_Sta,ax ;save our page for XMA1 ;an000; dms; + ; diags. + +; do some math with di, this will be used as a pointer into map_table + + add di,type mappable_phys_page_struct + +;------------------------ +; check for p3 +;------------------------ + +chk_p3: + + test page_flags,p3_flag ; was p3= included? + jz chk_p254 ; no, try p254 + +; yes, fix up page count and fill in map_table + + add map_count,1 ; one extra map entry + +; convert the item tag into a segment address + + xor ah,ah ; make 0 + mov al,p3_result.$P_Item_Tag; get item tag + mov cx,8 ; need to shift left eight bits + shl ax,cl ; to convert to a segment address + + +; save the segment addresses in map_table + + mov map_table.phys_page_segment[di],ax ; store p3 segment + mov map_table.phys_page_number[di],3 ; p3 page number + mov cs:Page_Frame_Sta,ax ;save our page for XMA1 ;an000; dms; + ; diags. + +; do some math with di, this will be used as a pointer into map_table + + add di,type mappable_phys_page_struct + +;------------------------ +; check for p254 +;------------------------ + +chk_p254: + + test page_flags,p254_flag ; was p254= included? + jz chk_p255 ; no, try p255 + +; yes, fix up page count and fill in map_table + + add map_count,1 ; one extra map entry + +; convert the item tag into a segment address + + xor ah,ah ; make 0 + mov al,p254_result.$P_Item_Tag; get item tag + mov cx,8 ; need to shift left eight bits + shl ax,cl ; to convert to a segment address + + +; save the segment addresses in map_table + + mov map_table.phys_page_segment[di],ax ; store p254 segment + mov map_table.phys_page_number[di],0feh ; p254 page number + mov cs:Page_Frame_Sta,ax ;save our page for XMA1 ;an000; dms; + ; diags. + +; do some math with di, this will be used as a pointer into map_table + + add di,type mappable_phys_page_struct + +;------------------------ +; check for p255 +;------------------------ + +chk_p255: + + test page_flags,p255_flag ; was p255= included? + jz Chk_X ; no, /X switch + +; yes, fix up page count and fill in map_table + + add map_count,1 ; one extra map entry + +; convert the item tag into a segment address + + xor ah,ah ; make 0 + mov al,p255_result.$P_Item_Tag; get item tag + mov cx,8 ; need to shift left eight bits + shl ax,cl ; to convert to a segment address + + +; save the segment addresses in map_table + + mov map_table.phys_page_segment[di],ax ; store p255 segment + mov map_table.phys_page_number[di],0ffh ; p255 page number + mov cs:Page_Frame_Sta,ax ;save our page for XMA1 ;an000; dms; + ; diags. + +; do some math with di, this will be used as a pointer into map_table + + add di,type mappable_phys_page_struct + +Chk_X: + + pop di ; restore some regs + pop dx + pop cx + pop bx + pop ax + + +null_cmd_line: + CMP AL,AL ; else set zf to indicate no error + ret ; return to calling routine + + +GET_PARMS ENDP diff --git a/v4.0/src/DEV/XMA2EMS/PS2_5060.INC b/v4.0/src/DEV/XMA2EMS/PS2_5060.INC new file mode 100644 index 0000000..96425f5 --- /dev/null +++ b/v4.0/src/DEV/XMA2EMS/PS2_5060.INC @@ -0,0 +1,735 @@ +;Ŀ +; Include File: PS2_5060.INC +; +; Purpose: Initialization code for the Personal Systems/2 +; models 50 and 60. +; +; Returns: INIT_ERR +; Flag indicating if an error was detected. +; DX = ptr to error message string if error. +; +; This procedure is called to initialize the XMO and/or XMA/A +; card(s) on a PS/2 mod 50 or 60. Any mix of multiple XMA and +; XMO cards are supported. The XMA cards will be used in +; 'real' mode, meaning the virtual mode ports providing bank +; swapping are not used (since this only works on 1 XMA card). +; This procedure is not called if WSP's XMA/A device driver +; (INDXMAA.SYS) is installed. In this case only the single XMA +; card is used for EMS, and it is spoken to in 'virtual' mode. +; The procedure searches each adapter slot for the presence of +; an XMA or a XMO card by checking the card ID. It checks +; the configuration registers on the cards to determine the amount +; of memory they contain. +; The procedure will then calculate for the /E parameter. This +; states how much of the extended memory the user wants for EMS. +; Extended memory will come from the top of the address range, +; and EMS will come off the bottom (i.e. starting at 1M+384K). +; Memory kept as extended has to be marked unusable in the Page +; Allocation List. Translate table entries in extended memory +; are disabled for memory used for EMS. +; Note that the /E parameter is only valid within this +; procedure, i.e. for PS/2 mod 50 and 60's. On family 1 machines, +; only the XMA 1 card is supported, and it doesn't come up as +; extended memory. On mod 50 or 60 with the XMA/A driver, the +; driver takes all of the (uppermost) XMA card and resets CMOS. +; On the mod 80 with the XMA emulator, this XMA/extended split +; must be specified on the Emulator's parm line. +; +; + +include SYSVAR.INC ;system variables structure ;an007; dms; + + + ;Ŀ + ; XMA/A declares + ; +HI6BIT_MASK EQU 00000011b ;Mask for 2 bit bank descriptor +LO2BIT_FLIP EQU 00000011b ;Reverses bottom 2 bits in bank des + ; gives # of 1/2M in that bank +NUM_CONFR_BANKS EQU 3 ;Number of memory banks described + ; by the XMA/A config register + ; Bank 4 is on the control reg. +X_CONF_REG_VAL DB ? ;temporary holder for XMAA's + ; config (memory size) register +X_CTRL_REG_VAL DB ? ;temporary holder for XMAA's + ; control (mem size bank 4) reg. +X_BLKS_PER_HALFM DB 128 ;4K blocks per half meg of memory +XMAA_NUM_BLOCKS DW ? ;temp for # of 4K blocks on xmaa @RH2 + ;Ŀ + ; Expanded Memory Option (XMO) declares + ; +NUM_CINFO_BANKS EQU 3 ;# of complete memory banks (4-2) + ; described by the XMO card info reg + ; Bank 1 - hi 1/2 bit - info, lo CC/P +H_CARD_INFO_VAL DB ? ;temporary holder for XMO card's + ; info (memory size) register +H_BLKS_PER_HALFM DB 32 ;16K XMO card blocks per 1/2M of mem +HLST_NUM_BLOCKS DW ? ;temp for # of 16K blocks on hlstr @RH3 + ;Ŀ + ; /E option declares + ; (used to set extended memory) + ; +ems_pgs_parm dw 0 ;temp value for /E parameter +e_parm_def equ 0FFFFh ;default...take all for ems +MIN_EXTMEM_H EQU (1024+384)/16 ;Translate table pointer for the lowest +MIN_EXTMEM_X EQU (1024+384)/4 ; addr extended memory can start at on +BASE_MEM EQU 1024 ;Base planer memory ;an007; dms; + ; a PS/2 (16K XMO and 4K XMA) +PREV_EXT_PGS DW 0 ;Extended memory claimed by previous + ; drivers +NEEDED_EMS_PGS DW ? ;Pages that will go for EMS use +CARDS_PGS DW ? ;Number of pages on card being checked +CARD_EXT_S16K DW ? ; and where its extended memory starts + ; expressed in 16K blocks + +INIT_MOD_50_60 PROC + + PUSH AX + PUSH BX + PUSH CX + PUSH SI + PUSH DI + + MOV INIT_ERR,NO_ERROR ;Initialize error flag @RH4 + MOV TOTAL_SYS_PAGES,0 ;Init total number of pages in the @RH2 + MOV NUM_MEM_CARDS,0 ; system & # of memory cards found @RH2 + XOR DI,DI ;Clear offset into mem card table @RH2 + + ;Ŀ + ; Search for XMO cards + ; + XOR CX,CX ;Check all system slots starting @RH2 + ; at slot 0 RH2 +H_SLOT_SCAN: + MOV AL,CL ;Enable the specific slot by ORing @RH2 + OR AL,SLOT_SETUP ; the slot (bits 0-2) with the @RH2 + OUT 96h,AL ; setup flag (bit 3). @RH2 + + MOV DX,CARD_ID_LO ;Read the signature ID of the card @RH2 + IN AL,DX ; @RH2 + XCHG AL,AH ; @RH2 + MOV DX,CARD_ID_HI ; @RH2 + IN AL,DX ; @RH2 +HLST_CHECK: + CMP AX,HLST_CARD_ID ;If it's a XMO card then @RH3 + JNE H_NEXT_SLOT ; calculate the amount of memory @RH3 + CALL HLST_MEM_ADD ; on the card @RH3 + MOV WTT_CARD_SLOT,CL ;Set default slot # and card type @RH5 + MOV MEMCARD_MODE,HOLS_REAL ; for single card support @RH5 + + MOV BX,HLST_NUM_BLOCKS ;1 XMO card block = an EMS page + + ;Ŀ + ; Save info in the memory card table + ; + MOV MEM_CARD_TABLE.CARD_ID[DI],AX ;Save the card ID and @RH5 + MOV MEM_CARD_TABLE.CARD_SLOT[DI],CL ; slot # of this card @RH5 + MOV AX,TOTAL_SYS_PAGES ;Set # of the 1st EMS @RH5 + MOV MEM_CARD_TABLE.START_PG_NUM[DI],AX ; page this card maps @RH5 + ADD AX,BX ;Last page mapped = @RH5 + DEC AX ; 1st pg + pages on @RH5 + MOV MEM_CARD_TABLE.END_PG_NUM[DI],AX ; this card - 1. @RH5 + + ADD TOTAL_SYS_PAGES,BX ;Add card's pgs to tot. @RH5 + INC NUM_MEM_CARDS ;Inc # of cards found @RH5 + ADD DI,TYPE MEM_CARD_STRUC ;Next entry in card @RH5 + ; descriptor table RH5 + +H_NEXT_SLOT: + INC CL ;Check next adapter slot @RH2 + CMP CL,NUM_OF_SLOTS ;Is it <= system slots? @RH2 + JB H_SLOT_SCAN ;Yes..check next slot ;ac000; dms; + ;No fall through loop RH2 + + ;Ŀ + ; Search for XMA/A cards + ; + XOR CX,CX ;Check all slots starting at 0 @RH2 +X_SLOT_SCAN: + MOV AL,CL ;Enable the specific slot by ORing @RH2 + OR AL,SLOT_SETUP ; the slot (bits 0-2) with the @RH2 + OUT 96h,AL ; setup flag (bit 3). @RH2 + + MOV DX,CARD_ID_LO ;Read the signature ID of the card @RH2 + IN AL,DX ; @RH2 + XCHG AL,AH ; @RH2 + MOV DX,CARD_ID_HI ; @RH2 + IN AL,DX ; @RH2 +XMAA_CHECK: + CMP AX,XMAA_CARD_ID ;If it's an XMA/A card then @RH2 + JNE X_NEXT_SLOT ; calculate the amount of memory @RH2 + CALL XMAA_MEM_ADD ; on the card @RH2 + MOV WTT_CARD_SLOT,CL ;Set default slot # and card type @RH5 + MOV MEMCARD_MODE,XMAA_REAL ; for single card support @RH5 + + MOV BX,XMAA_NUM_BLOCKS ;Divide the # of 4K XMA/A blocks @RH2 + SHR BX,1 ; by 4 to get number or 16K EMS @RH2 + SHR BX,1 ; pages on this card @RH2 + + ;Ŀ + ; Save info in the memory card table + ; + MOV MEM_CARD_TABLE.CARD_ID[DI],AX ;Save the card ID and @RH5 + MOV MEM_CARD_TABLE.CARD_SLOT[DI],CL ; slot # of this card @RH5 + MOV AX,TOTAL_SYS_PAGES ;Set # of the 1st EMS @RH5 + MOV MEM_CARD_TABLE.START_PG_NUM[DI],AX ; page this card maps @RH5 + ADD AX,BX ;Last page mapped = @RH5 + DEC AX ; 1st pg + pages on @RH5 + MOV MEM_CARD_TABLE.END_PG_NUM[DI],AX ; this card - 1. @RH5 + + ADD TOTAL_SYS_PAGES,BX ;Add card's pgs to tot. @RH5 + INC NUM_MEM_CARDS ;Inc # of cards found @RH5 + ADD DI,TYPE MEM_CARD_STRUC ;Next entry in card @RH5 + ; descriptor table RH5 + +X_NEXT_SLOT: + INC CL ;Check next adapter slot @RH2 + CMP CL,NUM_OF_SLOTS ;Is it <= system slots? @RH2 + JB X_SLOT_SCAN ;Yes..check next slot ;ac000; dms; + ;No fall through loop RH2 + + CMP TOTAL_SYS_PAGES,0 ;If one or more cards are found @RH4 + JA CALC_EXTENDED ; then everythang's cool so far @RH4 + MOV INIT_ERR,ERROR ;Else no card...set @RH4 + MOV DX,OFFSET NOT_FOUND_MSG ; 1st part of error msg @RH4 + JMP INIT_50_60_RET ; for no card found @RH4 + + ;Ŀ + ; Calculate /E parameter - amount of memory for EMS + ; + ;Ŀ + ; Find ext mem addr of bottom card + ; in case card memory ever starts at + ; something other than 1M + 384K + ; (i.e. if more planar memory is + ; added or a new unsupported card + ; comes in below XMO card) + ; +CALC_EXTENDED: + push es ;this call kills these regs ;an007; dms; + push bx ; ;an007; dms; + + mov ah,52h ;get the sysvars ptr ;an007; dms; + int 21h ; to get total ext. memory at boot ;an007; dms; + mov ax,word ptr es:[bx].SYSI_Ext_Mem ; ;an007; dms; + + pop bx ;restore regs ;an007; dms; + pop es ; ;an007; dms; + + add ax,Base_Mem ; + base memory ;an007; dms; + MOV CL,4 ; convert to 16Kb pages ;an007; dms; + SHR AX,CL ; ;an007; dms; + sub ax,cs:Total_Sys_Pages ;get page where card begins ;an007; dms; + + xor di,di ;init. index value ;an008; dms + CMP MEM_CARD_TABLE.CARD_ID[DI],HLST_CARD_ID ;If 1st card holst @RH4 + JE FIND_H_1ST_TT ; then get hlst TT @RH4 +FIND_X_1ST_TT: ;XMAA is 1st card (lowest ext mem) @RH4 +;;;;; MOV AX,MIN_EXTMEM_X ;Set XMAA TT ptr at 1.384M and @RH4 + shl ax,1 ; ;an000; dms; + shl ax,1 ; ;an000; dms; +FIND_X_1ST_LOOP: ; search for start of ext mem @RH4 + CALL X_READ_TT ;Read trans tbl data at this addr @RH4 + CMP BX,XMA_TT_INHIBIT ;If not inhibitted then mem here. @RH4 + JE FIND_X_1ST_NEXT ;Divide the 4K translate table ptr @RH4 + MOV CL,2 ; by 4 to convert it to 16K format @RH4 + SHR AX,CL ; AX = start of ext mem (in 16K) @RH4 + JMP FIRST_EXT_FOUND ; @RH4 +FIND_X_1ST_NEXT: ; @RH4 + INC AX ;Else no mem...inc TT ptr and see @RH4 + JMP FIND_X_1ST_LOOP ; if ext mem starts at next 4K @RH4 + +FIND_H_1ST_TT: ;XMO is 1st card (lowest ext mem) @RH4 +;;;;; MOV AX,MIN_EXTMEM_H ;Set hlst TT ptr at 1.384M and @RH4 +FIND_H_1ST_LOOP: ; search for start of ext mem @RH4 + CALL H_READ_TT ;Read trans tbl data at this addr @RH4 + CMP BL,H_TT_INHIBIT ;If not inhibitted then mem here. @RH4 + JNE FIRST_EXT_FOUND ; found start of card ext mem @RH4 + INC AX ;Else no mem...inc TT ptr and see @RH4 + JMP FIND_H_1ST_LOOP ; if ext mem starts at next 16K @RH4 +FIRST_EXT_FOUND: + MOV CARD_EXT_S16K,AX ;Save the start of ext mem ptr @RH4 + ;Ŀ + ; Calc pages for extended memory + ; + MOV AH,88H ;Go to BIOS and find amount of @RH4 + INT 15H ; extended memory (assume previous @RH4 + MOV CL,4 ; drivers have hooked INT 15h) @RH4 + SHR AX,CL ;Get # of 16k pages @RH4 + + MOV BX,CARD_EXT_S16K ;Pages of extended memory used @RH4 + ADD BX,TOTAL_SYS_PAGES ; by previous drivers = @RH4 + SUB BX,1024/16 ; what we know is the # of ext @RH4 + SUB BX,AX ; pages minus what BIOS tells us @RH4 + MOV PREV_EXT_PGS,BX ; @RH4 + + CMP EMS_PGS_PARM,E_PARM_DEF ;If no /E parm specified then @RH4 + JNE CHECK_E_PARM ; use the remaining pages for EMS @RH4 + MOV AX,TOTAL_SYS_PAGES ; (total on cards minus previously @RH4 + cmp Prev_Ext_Pgs,ax ;Previous ext pages >= avail on cards? ;an000; dms; + jae Default_Mem_Err_Exit ;yes - we have used the whole card ;an000; dms; + SUB AX,PREV_EXT_PGS ; used for extended memory) @RH4 + MOV NEEDED_EMS_PGS,AX ;Set counter for marking PAL and TT@RH4 + JMP SHORT MARK_EXT_IN_PAL + +Default_Mem_Err_Exit: + + mov Init_Err,Error ;flag an error occurred ;an000; dms; + lea dx,No_EMS_Memory ;no memory on cards left ;an000; dms; + jmp Init_50_60_Ret ;exit routine ;an000; dms; + +CHECK_E_PARM: ;Else test user specified # EMS pgs@RH4 + MOV BX,EMS_PGS_PARM ;Set counter for marking Page @RH4 + MOV NEEDED_EMS_PGS,BX ; Allocation List and TT entries @RH4 + MOV AX,TOTAL_SYS_PAGES ;If the requested EMS pages are @RH4 + SUB AX,PREV_EXT_PGS ; more than what's left @RH4 + CMP AX,EMS_PGS_PARM ; (total pages minus pages @RH4 + JGE MARK_EXT_IN_PAL ; used by other drivers) then set @RH4 + MOV INIT_ERR,ERROR ; an error condition flag @RH4 + LEA DX,REQ_EMS_ERR_MSG ; Set first part of error message @RH4 + JMP INIT_50_60_RET ; @RH4 + + ;Ŀ + ; Mark PAL for extended memory pages + ; +MARK_EXT_IN_PAL: + xor di,di ;start at bottom of PAL to init EXT ;an002; dms; +MARK_NEW_IN_PAL: + MOV CX,TOTAL_SYS_PAGES ;Loop for the 'new' extended pages @RH4 + SUB CX,NEEDED_EMS_PGS ; (left over from /E parm and not @RH4 + SUB CX,PREV_EXT_PGS ; reserved by a previous driver) @RH4 + MOV RESR_EXT_PGS,CX ; @RH4 + CMP CX,0 ; This assumes that others anyone @RH4 + JE MARK_PREV_IN_PAL ; using extended memory after us @RH4 +MARK_NEW_LP: ; will take it from the top @RH4 + MOV PAGE_ALLOC_LIST[DI],RESR_EXT ;Place a 'RE' in the PAL @RH4 + ADD DI,TYPE PAGE_ALLOC_LIST ; (Reserved Extended) for @RH4 + LOOP MARK_NEW_LP ; these entries @RH4 + +MARK_PREV_IN_PAL: + MOV AX,NEEDED_EMS_PGS ;Set offset into Page Alloc List @RH4 + add ax,Resr_Ext_Pgs ;get end of area for EMS pages ;an002; dms; + MOV DX,TYPE PAGE_ALLOC_LIST ; for the page where extended mem @RH4 + MUL DX ; starts. This is done by skipping@RH4 + MOV DI,AX ; over the EMS pages on bottom @RH4 + MOV CX,PREV_EXT_PGS ;Loop for the previous extended @RH4 + CMP CX,0 ; memory pages (if any). This is @RH4 + JE DIS_EMS_TT ; ext mem claimed before we load @RH4 +MARK_PREV_LP: ; @RH4 + MOV PAGE_ALLOC_LIST[DI],PREV_EXT ;Place a 'PE' in the PAL @RH4 + ADD DI,TYPE PAGE_ALLOC_LIST ; (Previous Extended) for @RH4 + LOOP MARK_PREV_LP ; these entries @RH4 + ;Ŀ + ; Disable translate table entries + ; in extended memory for memory + ; used as EMS + ; + +DIS_EMS_TT: + + mov cx,Resr_Ext_Pgs ;get extended page count ;ac008; dms; + ;1 based page count + + xor di,di ;set mem card table ptr ;an002; dms; + +Card_Find_Chk: + + cmp cx,Mem_Card_Table.End_Pg_Num[di];page > ending page on card? ;ac008; dms; + ja Card_Find_Loop ;yes - next card please ;an002; dms; + add Card_Ext_S16K,cx ;get 1st. avail page ;an008; dms; + mov cx,Mem_Card_Table.End_Pg_Num[di];Calc # pages remaining on card ;an002; dms; + sub cx,Resr_Ext_Pgs ; ;ac008; dms; + inc cx ; ;an002; dms; + jmp Calc_Cards_EMS ; ;an002; dms; + +Card_Find_Loop: + + add di,Type Mem_Card_Struc ;next pointer ;an002; dms; + jmp Card_Find_Chk ;continue loop ;an002; dms; + + +CALC_CARDS_EMS: + + MOV CARDS_PGS,CX ; @RH4 + + ;Calc # of pages to inhibit for. @RH4 + CMP CX,NEEDED_EMS_PGS ;If the card has less pgs than @RH4 + JBE ADJUST_NEEDED_EMS ; # needed for EMS then just loop @RH4 + MOV CX,NEEDED_EMS_PGS ; for card. Else loop for needed. @RH4 + +ADJUST_NEEDED_EMS: + SUB NEEDED_EMS_PGS,CX ;Remaining EMS pages to inhibit @RH4 + ; after this card is taken care of @RH4 + + MOV AL,MEM_CARD_TABLE.CARD_SLOT[DI] ;Activate the slot of @RH4 + OR AL,SLOT_SETUP ; the card and set ptr @RH4 + OUT 96h,AL ; to where it's ext mem @RH4 + MOV AX,CARD_EXT_S16K ; starts @RH4 + + CMP MEM_CARD_TABLE.CARD_ID[DI],HLST_CARD_ID ;Test card type @RH4 + JE H_INHIBIT_EMS ; @RH4 +X_INHIBIT_EMS: ;Inhibit TT on XMA/A for EMS @RH4 + PUSH CX ;Save ctr for # EMS on this card @RH4 + MOV CL,2 ;Convert 16K start of EMS ptr to @RH4 + SHL AX,CL ; 4K XMA/A translate table format @RH4 + POP CX ;Restore # EMS pages counter @RH4 +X_INH_EMS_PGS: ;----Loop for all XMA EMS pages----@RH4 + PUSH CX ;Save # EMS pages ctr @RH4 + MOV CX,BLOCKS_PER_PAGE ;Loop for all XMA blocks in a pg @RH4 +X_INH_ONE_PAGE: ;----Loop for one XMA EMS page-----@RH4 + CALL X_INH_FOR_EMS ;Inhibit TT entry (AX = 4K ptr) @RH4 + INC AX ;Next XMA block @RH4 + LOOP X_INH_ONE_PAGE ; @RH4 + POP CX ;Restore ctr for # EMS pgs on card @RH4 + LOOP X_INH_EMS_PGS ;Loop for # EMS pgs on card @RH4 + JMP short next_card_ems ;Now go fix that page alloc table @RH4 + +H_INHIBIT_EMS: ;Inhibit TT on XMO for EMS @RH4 + CALL H_INH_FOR_EMS ;Inhibit one TT entry per EMS page @RH4 + INC AX ;Next 16K pointer @RH4 + LOOP H_INHIBIT_EMS ; and do it again yahoooooo @RH4 + +NEXT_CARD_EMS: + CMP NEEDED_EMS_PGS,0 ;If this card had the rest of the @RH4 + JE INIT_50_60_RET ; EMS pages then done disabling TT @RH4 + ;Else EMS on next card. Set ptr @RH4 + MOV AX,CARDS_PGS ; to where next card's ext mem @RH4 + ADD CARD_EXT_S16K,AX ; starts (in units of 16K) and save@RH4 + + ADD DI,TYPE MEM_CARD_STRUC ;Next entry in the memory card @RH4 + + mov cx,Mem_Card_Table.End_Pg_Num[di] ;calc pages on ;an002; dms; + sub cx,Mem_Card_Table.Start_Pg_Num[di] ;card ;an002; dms; + inc cx ; ;an002; dms; + + JMP CALC_CARDS_EMS ; table. @RH4 + +INIT_50_60_RET: + + MOV AX,TOTAL_SYS_PAGES ;Total EMS pages in the system = @RH4 + SUB AX,PREV_EXT_PGS ; pages on cards - amount used @RH4 + SUB AX,RESR_EXT_PGS ; as extended memory @RH4 + MOV TOTAL_SYS_PAGES,AX ;Initialize values for: @RH4 + MOV TOTAL_EMS_PAGES,AX ; EMS pages - pages to back planar @RH4 + MOV FREE_PAGES,AX ; EMS pages free for applications @RH4 + + MOV AL,0 ;Reset the slot ID @RH5 + OUT 96h,AL ; @RH5 + + POP DI + POP SI + POP CX + POP BX + POP AX + RET +INIT_MOD_50_60 ENDP + +;Ŀ +; HLST_MEM_ADD subprocedure +; Calculates the amount of memory on the XMO card +; on entry: (CL) = card slot # +; card is in setup mode +; +; The following describes how to read memory size, where the 2 bit +; pattern indicates SIP size. There are 2 SIPs per bank. +; +; Reg: Card Info Channel Check, Presence +; Port: 102h 105h +; SIPS: bank 4 bank 3 bank 2 bank 1 bank 1 +; Bit: 7 6 5 4 3 2 1 0 +; ----------------------------------------------------------------- +; 1 1 1 1 1 1 1 1 No memory,error +; 1 0 1 0 1 0 1 0 256K +; 0 1 0 1 0 1 0 1 512K +; 0 0 0 0 0 0 0 0 1M +; +; Note that for bank 0, 102's bit 1 forms the upper bit and +; 105's bit 0 forms the lower of the 2 bit presence pattern. +; Therefore, if the pattern is '10'B, then the bank has 256K. +; +; +HLST_MEM_ADD PROC + PUSH DX ; @RH3 + PUSH CX ; @RH3 + PUSH AX ; @RH3 + + MOV HLST_NUM_BLOCKS,0 ;Init # of 16K blocks on card @RH3 + + MOV DX,H_CARD_INFO ;Read & store card info reg (102h) @RH3 + IN AL,DX ; bits 7-2 describe banks 4-2 @RH3 + AND AL,11111110B ; bit 1 upper half of bank 1 descr @RH3 + MOV H_CARD_INFO_VAL,AL ; (don't care about sleep bit 0) @RH3 + MOV DX,H_CC_PRES ;Read chan. check & presence (105) @RH3 + IN AL,DX ; for bit 0 - lower half of bank 1 @RH3 + AND AL,00000001B ; Turn off all other bits @RH3 + OR AL,H_CARD_INFO_VAL ;Join 2 bits - bank 1 descriptor @RH3 + + XOR AL,LO2BIT_FLIP ;Flip these 2 to get # of 1/2 Megs @RH3 + ; in bank 1 of XMO card @RH3 + AND AL,HI6BIT_MASK ;Clear other bits @RH3 + CMP AL,LO2BIT_FLIP ;Are both bits on (i.e. 1M sips)? @RH3 + JNE H_B1_HMEG_OK ;No # of 1/2 M for bank OK (0,1,2)@RH3 + INC AL ;Yes # of 1/2 M should be 4 not 3 @RH3 +H_B1_HMEG_OK: + MUL H_BLKS_PER_HALFM ;Multiply by # of 16k Blocks per @RH3 + ; half meg to get bank's blocks @RH3 + ADD HLST_NUM_BLOCKS,AX ;Add bank 1 to the total @RH3 + + SHR H_CARD_INFO_VAL,1 ;Shift bank 4-2 descriptors to @RH3 + SHR H_CARD_INFO_VAL,1 ; bits 0-5 @RH3 + + MOV CX,NUM_CINFO_BANKS ; Loop for banks accounted for by @RH3 + ; the XMO card info register @RH3 +HLST_MEM_LOOP: + MOV AL,H_CARD_INFO_VAL ;Get 2 bit bank descriptor & flip @RH3 + XOR AL,LO2BIT_FLIP ; the 2 bits. Bits now indicate @RH3 + ; the # of 1/2 meg in the bank @RH3 + AND AL,HI6BIT_MASK ;Ignore other banks @RH3 + CMP AL,LO2BIT_FLIP ;Are both bits on (i.e. 1M sips)? @RH3 + JNE H_B42_HMEG_OK ;No # of 1/2 M for bank OK (0,1,2)@RH3 + INC AL ;Yes # of 1/2 M should be 4 not 3 @RH3 +H_B42_HMEG_OK: + MUL H_BLKS_PER_HALFM ;Multiply by # of 4k blocks per @RH3 + ; half meg to get bank's blocks @RH3 + ADD HLST_NUM_BLOCKS,AX ;Add XMO banks 4-2 to total @RH3 + SHR H_CARD_INFO_VAL,1 ;Get next bank @RH3 + SHR H_CARD_INFO_VAL,1 ; @RH3 + LOOP HLST_MEM_LOOP ; @RH3 + + POP AX ; @RH3 + POP CX ; @RH3 + POP DX ; @RH3 + + RET +HLST_MEM_ADD ENDP + +;Ŀ +; XMAA_MEM_ADD subprocedure +; Calculates the amount of memory on the XMAA card +; on entry: (CL) = card slot # +; card is in setup mode +; +; The following describes how to read memory size, where the 2 bit +; pattern indicates SIP size. There are 2 SIPs per bank. +; +; Reg: Control Reg Config, Channel Check reg +; Port: 102h 105h +; SIPS: bank 4 bank 3 bank 2 bank 1 +; Bit: 7 6 5 4 3 2 1 0 +; ------------------------------------------------- +; 1 1 1 1 1 1 1 1 No memory or error +; 1 0 1 0 1 0 1 0 256K +; 0 1 0 1 0 1 0 1 512K +; 0 0 0 0 0 0 0 0 1M +; +; +XMAA_MEM_ADD PROC + PUSH DX ; @RH2 + PUSH CX ; @RH2 + PUSH AX ; @RH2 + + ;Insure XMA/A init ROM is disabled @RH2 + ;When the high byte of the TT data @RH2 + MOV DX,X_CTRL_REG + IN AL,DX ; is read or written using port @RH2 + MOV X_CTRL_REG_VAL,AL ; SAVE FOR MEM COUNT + AND AL,CR_ROMSLEEP_DIS ; 104h (real mode), the upper @RH2 + OUT DX,AL ; nibble has info for setting the @RH2 + ; initialization ROM addresses. To @RH2 + ; insure this causes no problems, @RH2 + ; disable XMA/A ROM by clearing @RH2 + ; ROM sleep bit in the control reg @RH2 + + MOV XMAA_NUM_BLOCKS,0 ; @RH2 + + MOV AL,X_CTRL_REG_VAL ;Get bits 6&7 of control register @RH2 + MOV CL,6 ; to get memory configuration of @RH2 + SHR AL,CL ; bank 4 @RH2 + XOR AL,LO2BIT_FLIP ;Flip these 2 to get # of 1/2M @RH2 + ; in bank 4 of XMA/A card @RH2 + AND AL,HI6BIT_MASK ;Clear other bits @RH2 + CMP AL,LO2BIT_FLIP ;Are both bits on (i.e. 1M sips)? @RH2 + JNE CTRL_HMEG_OK ;No # of 1/2 M for bank OK (0,1,2)@RH2 + INC AL ;Yes # of 1/2 M should be 4 not 3 @RH2 +CTRL_HMEG_OK: + MUL X_BLKS_PER_HALFM ;Multiply by # of 4k blocks per @RH2 + ; half meg to get bank's blocks @RH2 + ADD XMAA_NUM_BLOCKS,AX + + + MOV DX,X_CONF_REG ;Read the config, channel check @RH2 + IN AL,DX ; register to get mem size of @RH2 + MOV X_CONF_REG_VAL,AL ; banks 1-3 @RH2 + + MOV CX,NUM_CONFR_BANKS ; Loop for banks accounted for by @RH2 + ; the config register @RH2 +XMAA_MEM_LOOP: + MOV AL,X_CONF_REG_VAL ;Get 2 bit bank descriptor & flip @RH2 + XOR AL,LO2BIT_FLIP ; the 2 bits. Bits now indicate @RH2 + ; the # of 1/2 meg in the bank @RH2 + AND AL,HI6BIT_MASK ;Ignore other banks @RH2 + CMP AL,LO2BIT_FLIP ;Are both bits on (i.e. 1M sips)? @RH2 + JNE CONF_HMEG_OK ;No # of 1/2 M for bank OK (0,1,2)@RH2 + INC AL ;Yes # of 1/2 M should be 4 not 3 @RH2 +CONF_HMEG_OK: + MUL X_BLKS_PER_HALFM ;Multiply by # of 4k blocks per @RH2 + ; half meg to get bank's blocks @RH2 + ADD XMAA_NUM_BLOCKS,AX ; @RH2 + SHR X_CONF_REG_VAL,1 ;Get next bank @RH2 + SHR X_CONF_REG_VAL,1 ; @RH2 + LOOP XMAA_MEM_LOOP ; @RH2 + + POP AX ; @RH2 + POP CX ; @RH2 + POP DX ; @RH2 + + RET +XMAA_MEM_ADD ENDP + +;Ŀ +; H_READ_TT subprocedure +; Reads the contents of a translate table entry on a XMO card +; on entry: (AX) = Translate table pointer +; on exit: (BL) = Data (byte) at that entry +; +; +H_READ_TT PROC + PUSH AX ;Save the TT pointer @RH4 + MOV DX,H_TTPTR_LO ;Set the low and high bytes of @RH4 + OUT DX,AL ; the XMO translate table @RH4 + XCHG AL,AH ; pointer, then read the value @RH4 + MOV DX,H_TTPTR_HI ; of the data for that entry @RH4 + OUT DX,AL ; @RH4 + MOV DX,H_TTDATA ; @RH4 + IN AL,DX ;Read the data into AL @RH4 + MOV BL,AL ; and store it in BL @RH4 + POP AX ;Restore TT pointer @RH4 + RET ; @RH4 +H_READ_TT ENDP + +;Ŀ +; X_READ_TT subprocedure +; Reads the contents of a translate table entry on an XMA/A card +; on entry: (AX) = Translate table pointer +; on exit: (BX) = Data (12 bits) at that entry +; +; +X_READ_TT PROC + PUSH AX ;Save the TT pointer @RH4 + MOV DX,RM_TTPTR_LO ;Set the low and high bytes of @RH4 + OUT DX,AL ; the XMA/A translate table @RH4 + XCHG AL,AH ; pointer, then read the value @RH4 + MOV DX,RM_TTPTR_HI ; of the data for that entry @RH4 + OUT DX,AL ; @RH4 + + MOV DX,RM_TTDATA_HI ;Read 12 bit TT data high byte @RH4 + IN AL,DX ; first, then read low byte. @RH4 + XCHG AL,AH ; @RH4 + MOV DX,RM_TTDATA_LO ; @RH4 + IN AL,DX ; @RH4 + MOV BX,AX ;Store result in BX @RH4 + AND BX,XMA_TT_MASK ;Turn off useless upper 4 bits @RH4 + POP AX ;Restore TT pointer @RH4 + RET ; @RH4 +X_READ_TT ENDP + +;Ŀ +; H_INH_FOR_EMS subprocedure +; Inhibits a single translate table entry of extended memory +; on a XMO card. This entry (16K) is for use by EMS. +; on entry: (AX) = XMO Translate table pointer (# of K / 16) +; +; +H_INH_FOR_EMS PROC + PUSH AX ;Save the TT pointer @RH4 + MOV DX,H_TTPTR_LO ;Set the low and high bytes of @RH4 + OUT DX,AL ; the XMO translate table @RH4 + XCHG AL,AH ; pointer, @RH4 + MOV DX,H_TTPTR_HI ; @RH4 + OUT DX,AL ; @RH4 + + MOV AL,H_TT_INHIBIT ;AL = XMO TT inhibit data @RH4 + MOV DX,H_TTDATA ;Inhibit this TT entry so that @RH4 + OUT DX,AL ; it is no longer extended memory @RH4 + POP AX ;Restore TT pointer @RH4 + RET ; @RH4 +H_INH_FOR_EMS ENDP + +;Ŀ +; X_INH_FOR_EMS subprocedure +; Inhibits a single translate table entry of extended memory +; on a XMA/A card. This entry (4K) is for use by EMS. +; on entry: (AX) = XMA/A Translate table pointer (# of K / 4) +; +; +X_INH_FOR_EMS PROC + PUSH AX ;Save the TT pointer @RH4 + MOV DX,RM_TTPTR_LO ;Set the low and high bytes of @RH4 + OUT DX,AL ; the XMA/A translate table @RH4 + XCHG AL,AH ; pointer, then read the value @RH4 + MOV DX,RM_TTPTR_HI ; of the data for that entry @RH4 + OUT DX,AL ; @RH4 + + MOV AX,XMA_TT_INHIBIT ;AX = XMA 12 bit TT inhibit data @RH4 + MOV DX,RM_TTDATA_LO ;Write 12 bit TT data low byte @RH4 + OUT DX,AL ; first, then write high byte. @RH4 + XCHG AL,AH ; @RH4 + MOV DX,RM_TTDATA_HI ; @RH4 + OUT DX,AL ; @RH4 + POP AX ;Restore TT pointer @RH4 + RET ; @RH4 +X_INH_FOR_EMS ENDP + +;Ŀ +; ADJUST_CMOS subprocedure +; Reset the CMOS value for amount of extended memory. The +; memory off the 'top' (upper addresses) is used by EMS. +; on entry: +; CARD_EXT_S16K = First 16K translate table pointer past the +; top of the last card. Example - One 2M card +; that started at 1M+384K, AX = 58h + 80H = D8h +; +; +; +ADJUST_CMOS PROC +CMOS_LO EQU 70h ;Port addrs of CMOS controller +CMOS_HI EQU 71h + + MOV BX,CARD_EXT_S16K ;Convert to 1st 16K TT ptr past @RH4 + SUB BX,ems_pgs_parm ; entries reserved for ext mem @RH4 + SUB BX,1024/16 ;Convert to # of 16K above 1M + MOV CL,4 ;Multiply by 16 to get # of K + SHL BX,CL ; above 1 Megabyte + + MOV AX,8800h ;Get BIOS' current value for # + INT 15h ; of K extended (above 1M) + + CMP AX,BX ;If already set below what we think + JBE CMOS_RET ; think then don't adjust it + + PUSHF ;Else adjust CMOS...save state of + CLI ; interrupts and disable + MOV AL,0B5h ;Select NMI off byte 35 + OUT CMOS_LO,AL ;Write to CMOS controller + JMP $+2 ; delay + MOV AL,BL ;Write low data byte to CMOS + OUT CMOS_HI,AL ; + JMP $+2 ; + + MOV AL,0B6h ;Select NMI off byte 36 + OUT CMOS_LO,AL ;Write to CMOS controller + JMP $+2 ; delay + MOV AL,BH ;Write high data byte to CMOS + OUT CMOS_HI,AL ; + JMP $+2 ; + + MOV AL,0Fh ;Select NMI on byte 0f + OUT CMOS_LO,AL ;Write to CMOS controller + JMP $+2 ; delay + IN AL,CMOS_HI ;Reset CMOS like BIOS does + POPF ;Restore interrupt state +CMOS_RET: + RET ; @RH4 +ADJUST_CMOS ENDP + + \ No newline at end of file diff --git a/v4.0/src/DEV/XMA2EMS/ROMSCAN.INC b/v4.0/src/DEV/XMA2EMS/ROMSCAN.INC new file mode 100644 index 0000000..8eeb1b8 --- /dev/null +++ b/v4.0/src/DEV/XMA2EMS/ROMSCAN.INC @@ -0,0 +1,420 @@ + + page +;------------------------------------------------------------------- +; +; This file contains the code to do a pseudo-rom scan looking +; for possible EMS holes +; +;------------------------------------------------------------------- + + + +romscan proc near + + push ax + push dx + push cx + push di + + push cs ; make es and ds point to segment where messages are + pop es + + push cs + pop ds + +; must do rom scan with interrupts disabled + + cli + +;------------------------ + + cmp map_count,0 ; no segments specified, do rom scan + je no_pages_spec + + mov cx,map_count ; number of segments to check + xor di,di ; use di as pointer into table + +check_segs: + mov ax,map_table.phys_page_segment[di] + + call CHK_FREE_SEGMENT ; check a 16K block + jnc segment_ok + +; display the error + + mov segment_error,1 ; set segment error flag + + +; display conflict message + + push ax ; save some regs + push dx + push di + + MOV DI,OFFSET confl_address ; ascii string page frame + CALL CNVHEXAT + + MOV DX,OFFSET conflict_msg ; start of message + MOV AH,9 ; dos prt string + INT 21H ; + + pop di ; restore some regs + pop dx + pop ax + +segment_ok: + add di,type mappable_phys_page_struct + loop check_segs + +;------------------------ +; if there were no conflicts, then exit with no error + + cmp segment_error,0 + je rom_scan_no_error ; exit with no error (carry = 0) + +;------------------------ + + MOV DX,OFFSET CRLF ; skip a blank line + MOV AH,9 ; dos prt string + INT 21H ; + + jmp rom_scan_code + +; display no pages message + +no_pages_spec: + MOV DX,OFFSET NO_PAGES_MSG ; skip a blank line + MOV AH,9 ; dos prt string + INT 21H + + MOV DX,OFFSET CRLF ; skip a blank line + MOV AH,9 ; dos prt string + INT 21H ; + +;------------------------------------------------------------------- +; +; This routine scans the address range from c000 - FFFF looking +; for 16 K gaps. +; +;------------------------------------------------------------------- + +rom_scan_code: + + mov ax,0c000h ; start at c000 + xor bx,bx ; bx holds count of contiguous pages + mov cx,15 ; loop counter + mov dx,ax ; dx holds start of frame + +fam2_loop: + call CHK_FREE_SEGMENT ; check a 16K block + jc bad_seg + +; good 16 segment + + call FoundBlock + + add bx,1 ; add another page to frame counter + cmp bx,4 ; 4 means frame is found + jne no_frame_yet + +; a frame has been found + + mov bx,100 ; make sure we don't look for more frames + +no_frame_yet: + add ax,0400h ; point to next segment + jmp continue_loop + +; bad 16 segment + +bad_seg: + add ax,0400h ; point to next segment + cmp bx,100 + jae continue_loop ; don't reset frame info if one has been found + + xor bx,bx ; clear contiguous page counter + mov dx,ax ; make frame pointer point to next page + +continue_loop: + + loop fam2_loop + jmp rom_scan_exit + + +rom_scan_no_error: + clc + jmp clean_exit + + +;------------------------------------------------------------------- + +rom_scan_exit: + +; display frame if found + + cmp bx,100 ; >= 100 means frame was found + jb no_frame_exit + + mov ax,dx ; get frame address in ax + call FoundFrame ; display frame address + + +no_frame_exit: + STC ; carry = 1 means error + +clean_exit: + sti + + + pop di + pop dx + pop cx + pop ax + + ret + +romscan endp + + + +;------------------------------------------------------------------- +; +; FoundBlock assumes AX = segment address of good 16 K block +; +;------------------------------------------------------------------- + +FoundBlock proc near + + push ax + push dx + push es + push di + + push cs + pop es + + push cs + pop ds + + MOV DI,OFFSET hole_address ; ascii string page frame + CALL CNVHEXAT + + MOV DX,OFFSET hole_msg ; start of message + MOV AH,9 ; dos prt string + INT 21H ; + + + pop di + pop es + pop dx + pop ax + + ret + +FoundBlock endp + +;------------------------------------------------------------------- +; +; FoundFrame assumes AX = segment address of good 64 K block +; +;------------------------------------------------------------------- + +FoundFrame proc near + + push ax + push dx + push es + push di + + push cs + pop es + + push cs + pop ds + + MOV DI,OFFSET frame_address ; ascii string page frame + CALL CNVHEXAT + + MOV DX,OFFSET frame_msg ; start of message + MOV AH,9 ; dos prt string + INT 21H ; + + + pop di + pop es + pop dx + pop ax + + ret + +FoundFrame endp + + + + + + +;------------------------------------------------------------------- +;------------------------------------------------------------------- +;------------------------------------------------------------------- +;------------------------------------------------------------------- +;------------------------------------------------------------------- +;------------------------------------------------------------------- +;------------------------------------------------------------------- +;------------------------------------------------------------------- +;------------------------------------------------------------------- +;------------------------------------------------------------------- +;------------------------------------------------------------------- +;------------------------------------------------------------------- +;------------------------------------------------------------------------ +; 03/04/88 jwg: +; PROCEDURE NAME: CHK_FREE_SEGMENT : +; : +; THIS PROCEDURE CHECKS EACH OF THE 2K BOUNDARIES IN THE 16K SEGMENT : +; TO DETERMINE IF A ROM SEGMENT IS EMPTY. IT VERIFIES THAT NO ROM : +; FROM A PRECEEDING ADDRESS EXTENDS INTO THIS 16K SEGMENT. ALSO THE : +; 16K BLOCK IS CHECKED FOR THE PRESENCE OF ANY RESPONDING CARD. : +; : +; ENTRY: AX - CONTAINS 16K SEGMENT ADDRESS : +; EXIT: CARRY FLAG = 0 - SEGMENT FREE : +; CARRY FLAG = 1 - SEGMENT IN USE : +; : +;------------------------------------------------------------------------ + +ROM_SCAN EQU 0AA55H +CARD_SEL_PORT EQU 091h ; CARD SELECTED LATCH PORT + + +CHK_FREE_SEGMENT PROC NEAR + + PUSH AX ; Save work registers + PUSH BX + PUSH CX + PUSH DX + PUSH DI + PUSH ES ; Save data segment register + MOV BX,AX ; Save segment start address + MOV CX,AX ; Save in work register + ADD CX,0400h ; Determine End segment address of FIFE +; MOV DX,0C000h-00100h ; Get address of start of ROM area + mov dx,ax ; gga + sub dx,0100h ; gga +CHK_FREE_NEXT: + ADD DX,00100h ; Add offset to get next 2K segment + CMP DX,CX ; Check for past end of 16K ROM area + JAE CHK_FREE_OK ; IF (NC) then Exit, segment was free + + ; CHECK FOR ROM BLOCK SIGNATURE + MOV ES,DX ; Change to new ROM segment + CMP ES:WORD PTR [0],ROM_SCAN; Check if a ROM module is present + JE CHK_FREE_SIZE ; Go check length if ROM SCAN signature + + CMP BX,DX ; Check if into the target segment yet + JA CHK_FREE_NEXT ; Loop and check next 2K block in not + + ; CHECK FOR CARD RESPONDING IN 2K + NOP ; Following sequence can not be traced.. +;;;;; CALL CARD_SEL_NOW ; Reset CARD SELECTED FEED BACK latch . + XOR DI,DI ; Clear source pointer . + MOV AX,0FFFFh ; Get expected floating bus pattern . + PUSH CX ; Save CX . + MOV CX,00400h ; Get count of 1 K words (2K bytes) . + REPE SCASW ; Check for all bits on in block ES:DI . + POP CX ; Recover end segment address . + JNE CHK_FREE_ERROR ; Exit if anything there . + +;;;;;; cmp rom_scan_type,family1 ; gga only do the card select check on PS2's +;;;;;; je skip_ps2_check + +;;;;;; CALL CARD_SEL_NOW ; Check for a CARD SELECTED by scan . +;;;;;; JC CHK_FREE_ERROR ; Exit (CY) if a card responded ........ + +;;;;;;skip_ps2_check: + JMP CHK_FREE_NEXT ; ELSE check next 2K address + +CHK_FREE_SIZE: ; CHECK LENGTH INTO 16K SEGMENT + push cx ; gga + MOV AL,ES:BYTE PTR [2] ; Get ROM module length in 512 bytes + MOV AH,0 ; Clear high byte + mov cl,5 ; gga + SHL AX,cl ; gga convert to segment length (16 byte) + pop cx ; gga + ADD AX,DX ; Determine ending segment size + CMP BX,AX ; Does ROM extend into this 16K segment + JNB CHK_FREE_NEXT ; IF not then continue search + +CHK_FREE_ERROR: + STC ; ELSE (CY), Exit with segment not free +CHK_FREE_OK: + POP ES ; restore segment register + POP DI + POP DX + POP CX ; restore all registers + POP BX + POP AX + RET ; EXIT (NC) if segment free to test + +CHK_FREE_SEGMENT ENDP + + +;------------------------------------------------------------------------ +; 03/04/88 jwg: +; PROCEDURE NAME: CARD_SEL_FBK : +; : +; THIS PROCEDURE CHECKS THE CARD SELECTED FEEDBACK LINE AND LATCH : +; TO VERIFY THAT THIS LINE WAS ACTIVATED. METHOD IS TO CLEAR THE : +; LATCH AND READ A LOCATION USING THE PASSED SEGMENT ADDRESS. IF : +; ANY CARD RESPONDS THE LATCH WILL BE SET ON. : +; : +; NOTE: These routines can not be traced with a debug-er : +; as VIDEO updates also set the card selected latch. : +; : +; ENTRY: AX - ADDRESS OF SELECTED SEGMENT : +; : +; EXIT: CARRY FLAG = 0 - CARD SELECTED LATCH WAS NOT SET (OFF) : +; CARRY FLAG = 1 - CARD SELECTED LATCH WAS SET BY TEST : +; : +;------------------------------------------------------------------------ + +;;;;;CARD_SEL_FBK PROC NEAR ; TEST CARD SELECTED FEED BACK + +;;;;; CLI ; Block interrupts during operation +;;;;; CALL CARD_SEL_NOW ; Read current port value to clear +;;;;; PUSH DS ; Save segment register +;;;;; MOV DS,AX ; Set segment +;;;;; CMP DS:BYTE PTR [0],AL ; Read first byte with dummy compare +;;;;; POP DS ; Restore segment selector +;;;;; CALL CARD_SEL_NOW ; Read current port value and clear +;;;;; STI ; Enable interrupts +;;;;; RET ; RETurn (CY)= 1 if latch set by read + +;;;;;CARD_SEL_FBK ENDP + +;------------------------------------------------------------------------ +; 03/04/88 jwg: +; PROCEDURE NAME: CARD_SEL_NOW (CURRENT VALUE) : +; : +; THIS PROCEDURE READS AND RESETS THE CURRENT CARD SELECTED FEEDBACK : +; LATCH AND RETURNS THE STATUS. : +; : +; NOTE: This routine can not be traced with a debug-er : +; as VIDEO updates also set the card selected latch. : +; : +; ENTRY: NONE : +; : +; EXIT: CARRY FLAG = 0 - CARD SELECTED LATCH WAS NOT SET (OFF) : +; CARRY FLAG = 1 - CARD SELECTED LATCH WAS SET ON WHEN READ : +; : +;------------------------------------------------------------------------ + +;;;;;CARD_SEL_NOW PROC NEAR ; READ CARD SELECTED FEED BACK + +;;;;; PUSH AX ; Save segment address +;;;;; IN AL,CARD_SEL_PORT ; Read current port value and clear +;;;;; RCR AL,1 ; Move bit 0 into CY flag +;;;;; POP AX ; Recover segment address +;;;;; RET ; RETurn (CY)= 0 if latch set + +;;;;;CARD_SEL_NOW ENDP + + \ No newline at end of file diff --git a/v4.0/src/DEV/XMA2EMS/XMA1DIAG.INC b/v4.0/src/DEV/XMA2EMS/XMA1DIAG.INC new file mode 100644 index 0000000..bbf3875 --- /dev/null +++ b/v4.0/src/DEV/XMA2EMS/XMA1DIAG.INC @@ -0,0 +1,1870 @@ +;-----------------------------------------------------------------------; +; This section contains the prescence test and diagnostic ; +; routines for the XMA 1 card. ; +; ; +;-----------------------------------------------------------------------; + +;-----------------------------------------------------------------------; +; DATA THAT IS UNIQUE TO THE DIAGNOSTICS PORTION OF ; +; THE DEVICE DRIVER. THIS AREA WILL NOT REMAIN PRESENT ; +; AFTER INITIALIZATION. ; +;-----------------------------------------------------------------------; + +MEM_INST DB '1' +TEST_ID DB ? ;SAVE AREA FOR CURRENT TEST ID +CTRLPARM DW ? ;SAVE AREA FOR CONTROL PARM +PAGE_UNDER_TEST DW 0 ;SAVE AREA FOR PAGE UNDER TEST +CUR_SAVE DW ? ;SAVE AREA FOR NEXT AVAILABLE LINE + ;FOR MESSAGES +ACTIVE_PAGE DB ? ;ACTIVE DISPLAY PAGE +TESTABLE_SEGMENTS DW ? + + +PAGE +;-----------------------------------------------------------------------; +; EQUATES THAT ARE UNIQUE TO THE DIAGNOSTICS PORTION OF ; +; THE DEVICE DRIVER. ; +;-----------------------------------------------------------------------; +BLK_ON EQU 11110111B ;MASK FOR ENABLING A BLOCK +BLK_OFF EQU 00001000B ;MASK FOR INHIBITING A BLOCK +VIRT_MODE EQU 00000010B ;MASK FOR VIRTUAL MODE +REAL_MODE EQU 11111101B ;MASK FOR REAL MODE +MAX_TASK_ID EQU 15 ;MAXIMIM TASK ID +ENABLE EQU 01H ;INDICATES THAT BLOCK SHOULD BE ENABLED +TABLEN EQU 1000H ;NUMBER OF ENTRIES IN XLAT TABLE +DMAREQ1 EQU 0009H ;I/O ADDRESS OF DMA CTRL 1 REQ REG +DMAREQ2 EQU 00D2H ;I/O ADDRESS OF DMA CTRL 2 REQ REG +DMAMODE1 EQU 000BH ;I/O ADDRESS OF DMA CTRL 1 MODE REG +DMAMODE2 EQU 00D6H ;I/O ADDRESS OF DMA CTRL 2 MODE REG +AT_NMI_REG EQU 70H ;AT NMI REG +AT_NMI_OFF EQU 80H ;AT NMI OFF MASK +AT_NMI_ON EQU 00H ;AT NMI ON MASK +AT_CHCHK_EN_REG EQU 61H ;AT CH CHK ENABLE REG +AT_CHCHK_REG EQU 61H ;AT CH CHK REG +AT_CHCHK_EN EQU 0F7H ;AT CH CHK ENABLE MASK +AT_CHCHK_DIS EQU 08H ;AT CH CHK DISABLE MASK +AT_CHCHK EQU 40H ;AT CH CHK MASK +XT_NMI_REG EQU 0A0H ;XT NMI REG +XT_NMI_OFF EQU 00H ;XT NMI OFF MASK +XT_NMI_ON EQU 80H ;XT NMI ON MASK +XT_CHCHK_EN_REG EQU 61H ;XT CH CHK ENABLE REG +XT_CHCHK_REG EQU 62H ;XT CH CHK REG +XT_CHCHK_EN EQU 0DFH ;XT CH CHK ENABLE MASK +XT_CHCHK_DIS EQU 20H ;XT CH CHK DISABLE MASK +XT_CHCHK EQU 40H ;XT CH CHK MASK +CR EQU 0DH ;CARRIAGE RETURN +LF EQU 0AH ;LINE FEED +PRES_TEST EQU 01 ;PRESENCE TEST ID +REG_TEST EQU 02 ;REG TEST ID +AUTO_INC EQU 03 ;AUTO INC TEST ID +XLAT_TABLE_TEST EQU 04 ;TT TEST ID +LOMEM_TEST EQU 05 ;ABOVE 640K TEST ID +DMA_CAPTURE EQU 06 ;DMA CAPTURE TEST ID +PAGE_TEST EQU 07 ;PAGE TEST ID +MEM_TEST EQU 10 ;MEMORY TEST ID + +;------------------------------------------------------------------------- +; +; PRESENCE TEST +; +; DESCRIPTION : This routine will determine if the XMA is in the system. +; It will also determine the amount of memory installed +; on the card in 1Meg increments (up to 4Meg). +; +; FUNCTION/ : See description +; PURPOSE +; +; ENTRY POINT : PRESTST +; +; ENTRY : The assumption is that at least 1MB of memory is installed. +; CONDITIONS If the 2nd, 3rd or 4th MB of memory is installed then the +; TOTAL_SYS_PAGES, TOTAL_EMS_PAGES, FREE_PAGES and +; MEM_INST words are Revised accordingly. +; +; +; +; EXIT : (zero flag) = 0 indicates that the XMA is not installed. +; if (zero flag) <> 0 then +; TOTAL_SYS_PAGES, TOTAL_EMS_PAGES, FREE_PAGES and +; MEM_INST words are Revised accordingly. +; +; AX,BX,CX,DX ARE DESTROYED +;------------------------------------------------------------------------- +; +PRESTST PROC +; + MOV AL,PRES_TEST + MOV CS:TEST_ID,AL + +;SAVE CONTENTS OF MODE REG + MOV DX,MODE_REG + IN AL,DX + PUSH AX + +; TRANSLATE TABLE ADDRESS AND DATA REGISTERS +; + MOV AX,0AA55H ;DATA PATTERN (IN REAL MODE) + ;BE CERTAIN MODE REG GETS + ;REAL MODE + MOV DX,MODE_REG ;I/O TO MODE REG + OUT DX,AL ;WRITE PATTERN + MOV DX,TTPOINTER + 1 ;I/O TO TT POINTER (ODD ADDR) + XCHG AL,AH ;CHRG BUS WITH INVERSE PATTERN + OUT DX,AL ;WRITE IT + MOV DX,MODE_REG + IN AL,DX ;READ BACK MODE REG + XOR AL,AH + AND AL,0FH ;MASK OFF UNUSED BITS + ;ZERO FLAG = 0 IF ERROR +END_PRES: + POP AX + PUSHF ;SAVE FLAGS + MOV DX,MODE_REG + OUT DX,AL ;RESTORE MODE REG TO INITIAL STATE + POPF ;RESTORE FLAGS + RET ;BACK TO CALLER +; +PRESTST ENDP + +PAGE + +;------------------------------------------------------------------------; +; Diagnostics...on exit if ZF=0 then error ; +;------------------------------------------------------------------------; +XMA1DIAGS PROC + + MOV CS:TEST_ID,00H ;CLEAR TEST ID BYTE + MOV CS:CTRLPARM,0100H ;SAVE CONTROL PARM + CALL CUR_POS ;GET CURSOR READY FOR MESSAGES + CALL REGTST ;TEST XMA REGISTERS + JNE FOUND_ERROR ;JUMP IF ERROR + CALL INCTST + JNE FOUND_ERROR + CALL XLATST + JNE FOUND_ERROR + CALL LOMEMTST ;TEST FOR BELOW 640K + JNE FOUND_ERROR ;JUMP IF ERROR + CALL MEMARRAY ;TEST MEMORY ABOVE 640K + JNE FOUND_ERROR ;JUMP IF ERROR + CALL PAGETST + JNE FOUND_ERROR + CALL CAPTST ;TEST DMA CAPTURE + JNE FOUND_ERROR ;JUMP IF ERROR +FOUND_ERROR: + RET +XMA1DIAGS ENDP + + + +PAGE +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; SAVES CURSOR POSITION +; +; DESCRIPTION : This routine simply saves the cursor location +; in CS:CUR_SAVE. This cursor position +; should be used by the KB_OK routine to insure proper +; format of the screen. +; +; FUNCTION/ : See description +; PURPOSE +; +; +; ENTRY POINT : CUR_POS +; +; ENTRY : +; CONDITIONS +; +; +; EXIT : new cursor position is saved in CS:CUR_SAVE +; +; All registers are preserved +; +;------------------------------------------------------------------------- +; +CUR_POS PROC +; + PUSH AX + PUSH BX + PUSH CX + PUSH DX + PUSH SI + PUSH DI + PUSH DS ;SAVE REGISTERS +; + PUSH CS + POP DS ;GET DS TO THIS CODE SEGMENT + ;MOVE CURSOR TO NEXT AVAILABLE LINE +;IF DOS +; MOV AH,9 ;DOS PRINT STRING +; MOV DX,OFFSET NEXT_LINE + 1 ;OFFSET OF NEXT LINE MSG +; INT 21H ;DISPLAY MESSAGE +;ELSE +; MOV BX,OFFSET NEXT_LINE ;GET OFFSET OF NEXT LINE MSG +; MOV AH,0 ;TELL DCP TO DISPLAY +; INT 82H ;DISPLAY MESSAGE +;ENDIF + ; rsh001 fix scroll problem + ; and remove IF DOS crap + ;READ CURRENT VIDEO PAGE ; rsh001 + MOV AH,15 ;READ CURRENT Video Page + INT 10H ;VIDEO CALL + MOV ACTIVE_PAGE,BH ;SAVE ACTIVE PAGE + + ;READ CURRENT CURSOR POSITION + MOV AH,3 ;READ CURRENT CURSOR POS + INT 10H ;VIDEO CALL + MOV CUR_SAVE,DX ;SAVE CURSOR POSITION + + ;RESTORE ALL REGISTERS + POP DS + POP DI + POP SI + POP DX + POP CX + POP BX + POP AX ;RESTORE ALL REGISTERS + + RET ;RETURN TO CALLER + +CUR_POS ENDP + + + + + +PAGE +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; TEST FOR PRESENCE OF MORE THAN 1 MEGABYTE OF MEMORY +; +; DESCRIPTION : This routine will determine if the 2nd, 3rd or 4th MB is +; installed. Since there are no switches or other indicators +; to be tested, this test will make a "best guess" as to +; the presence of this memory. This test will roll a 0 +; and a 1 through the 1st word of the next Meg and if +; at least 1 bit is consistently good then it is assumed +; that the optional memory is installed. If successful +; then try next Meg. +; +; FUNCTION/ : See description +; PURPOSE +; +; ENTRY POINT : TRY4MEG +; +; ENTRY : none +; CONDITIONS +; +; EXIT : +; +; AX,BX,CX,DX ARE DESTROYED +;------------------------------------------------------------------------- +; +TRY4MEG PROC + +;MEMORY TEST MUST RUN IN PAGE MODE +;BEFORE CARD IS PUT INTO PAGE MODE...MUST SET UP XLAT TABLE TO PASSOVER +;RESERVED MEMORY SPACES (IE.,BIOS, DISPLAY, DISTRIBUTED ROS, ETC) +; + CALL VIRT2REAL + + MOV DX,IDREG ;I/O TO ID REGISTER + MOV AL,0 ;ID = 0 + OUT DX,AL ;SWITCH TO ID = 0 +; + ;DISABLE NMI AND ENABLE I/O CHANNEL CHECK + MOV AL,CS:MODEL_BYTE ;GET SAVED MODEL BYTE + CMP AL,PC1 ;IS IT A PC1? + JE TR2M1 ;IF NO THEN TRY FOR PC_XT + CMP AL,PC_XT ;IS IT AN XT? + JE TR2M1 ;IF NO THEN TRY FOR AQUARIUS + CMP AL,XT_AQUARIUS ;IS IT AN AQUARIUS? + JE TR2M1 ;IF NO THEN USE AT NMI REGS + ;USE PC-AT NMI REGISTER + MOV DX,AT_NMI_REG ;AT's NMI REGISTER + MOV AL,AT_NMI_OFF ;MASK OFF NMI + OUT DX,AL ;OUTPUT IT + MOV DX,AT_CHCHK_EN_REG ;AT's I/O CH CHK REG + IN AL,DX ;READ IT + OR AL,AT_CHCHK_DIS ;MASK OFF I/O CH CHK ENABLE + OUT DX,AL ;WRITE IT + AND AL,AT_CHCHK_EN ;MASK ON I/O CH CHK ENABLE + OUT DX,AL ;TOGGLE CH CHK LTCH AND LEAVE + ;ENABLED + ;USE PC1, XT, AQUARIUS REGISTERS +TR2M1: + MOV DX,XT_NMI_REG ;XT's NMI REGISTER + MOV AL,XT_NMI_OFF ;MASK OFF NMI + OUT DX,AL ;OUTPUT IT + MOV DX,XT_CHCHK_EN_REG ;XT's I/O CH CHK REG + IN AL,DX ;READ IT + OR AL,XT_CHCHK_DIS ;MASK OFF I/O CH CHK ENABLE + OUT DX,AL ;WRITE IT + AND AL,XT_CHCHK_EN ;MASK ON I/O CH CHK ENABLE + OUT DX,AL ;TOGGLE CH CHK LTCH AND LEAVE + ;ENABLED +; + ;MAP FIRST 64K OF 2ND MEG INTO PC SPACE BEGINNING AT 512K +;***jnw MOV CX,3 ;LOOK FOR PRESENCE OF NEXT 3 MB IN 1MB STEPS + MOV CX,99*1024/16 ;***jnw ;LOOK FOR PRESENCE OF NEXT n MB IN 1MB STEPS + MOV AX,CS:PAGE_FRAME_STA ;SEGMENT AT PAGE FRAME +;***jnw MOV DX,256 ;BEGINNING AT 2ND MEG OF XMA + MOV DX,256+3 ;***jnw ;AT end of 16k + MOV BH,0 ;ASSIGNED TO TASK ID 0 + MOV BL,01H ;ENABLE THIS MEMORY +TR2M1A: + PUSH AX + PUSH BX + PUSH CX + PUSH DX +;***jnw MOV CX,16 ;16 * 4K = 64K BLOCK + MOV CX,1 ;***jnw ;1 * 4K = 4K BLOCK + CALL SETXLAT ;SET TRANSLATE TABLE +; + MOV AX,CS:PAGE_FRAME_STA + MOV DS,AX ;SET SEGMENT AND + MOV SI,0 ;OFFSET TO TEST + MOV BX,0000000000000001B ;ROLL 1 THROUGH WORD + MOV DX,1111111111111110B ;ROLL 0 THROUGH WORD + MOV CX,16 ;16 BITS TO TEST +TR2M2: + MOV [SI],BX ;WRITE ROLLING 1 PATTERN + LOCK MOV [SI+2],DX ;CHARGE BUS INVERSE PATTERN + LOCK MOV AX,[SI] ;READ BACK INITIAL PATTERN + AND AX,BX ;ISOLATE BIT UNDER TEST +;***jnw JZ TR2M3 ;IF ZERO TRY ANOTHER BIT + JZ quit ;IF ZERO quit ***jnw + MOV [SI],DX ;WRITE ROLLING 0 PATTERN + LOCK MOV [SI+2],BX ;CHARGE BUS INVERSE PATTERN + LOCK MOV AX,[SI] ;READ BACK INITIAL PATTERN + AND AX,BX ;ISOLATE BIT UNDER TEST + AND AX,BX ;ISOLATE BIT UNDER TEST +;***jnw JZ TR2M4 ;IF ZERO THEN FOUND GOOD BIT + Jnz quit ;IF nonzero then quit ***jnw +TR2M3: + ROL BX,1 ;ROLL 1 TO NEXT POSITION + ROL DX,1 ;ROLL 0 TO NEXT POSITION + LOOP TR2M2 ;REPEAT FOR 16 BITS + jmp tr2m4 ;all 16 bits passed test ***jnw +quit: ;***jnw +;AT THIS POINT THERE ARE NO GOOD BITS SO END SEARCH FOR NEXT MB + POP DX ;RECOVER THESES REGISTERS + POP CX + POP BX + POP AX + JMP TR2M5 ;EXIT +;AT THIS POINT WE KNOW THERE IS MEMORY IN THIS MEG THAT WAS JUST TESTED +TR2M4: +;***jnw ADD CS:MEM_INST,1 ;ADD 1 MB TO THIS FLAG +;***jnw ADD CS:TOTAL_XMA_PAGES,1024/16 ;ADD 1 MB TO THIS FLAG +;***jnw ADD CS:TOTAL_PAGES,1024/16 ;ADD 1 MB TO THIS FLAG +;***jnw ADD CS:FREE_PAGES,1024/16 ;ADD 1 MB TO THIS FLAG + ADD CS:TOTAL_SYS_PAGES,1 ;Add 16k ***jnw + ADD CS:TOTAL_EMS_PAGES,1 ;Add 16k ***jnw + ADD CS:FREE_PAGES,1 ;Add 16k ***jnw + POP DX ;RECOVER THESE REGISTERS + POP CX + POP BX + POP AX +;***jnw ADD DX,256 ;TRY NEXT MB + ADD DX,4 ;TRY NEXT 16k ***jnw + LOOP TR2M1A ;REPEAT LOOP +TR2M5: +;BEFORE NMI IS ENABLED, CLEAR PARITY CHECK LATCH ON XMA + MOV SI,0 + MOV AX,[SI] ;READ 1ST WORD OF THIS SEG + MOV [SI],AX ;WRITE BACK SAME WORD + ;THE WRITE WILL CLEAR PCHK LTCH +;PUT THE XMA CARD BACK INTO REAL MODE + MOV DX,MODE_REG ;READY FOR I/O TO MODE REG + IN AL,DX ;READ IT + AND AL,REAL_MODE ;TURN OFF VIRTUAL BIT + OUT DX,AL ;WRITE IT TO MODE REG +;CLEAR I/O CHANNEL CHECK LATCHES AND ENABLE NMI + MOV AL,CS:MODEL_BYTE ;GET SAVED MODEL BYTE + CMP AL,PC1 ;IS IT A PC1? + JE TR2M6 ;USE XT REGISTERS + CMP AL,PC_XT ;IS IT AN XT? + JE TR2M6 ;USE XT REGISTERS + CMP AL,XT_AQUARIUS ;IS IT AN AQUARIUS? + JE TR2M6 ;USE XT REGISTERS +;IF NONE OF THE ABOVE THEN... +;USE AT NMI REGISTER + MOV DX,AT_CHCHK_EN_REG ;AT's I/O CH CHK REG + IN AL,DX ;READ IT + OR AL,AT_CHCHK_DIS ;MASK OFF I/O CH CHK ENABLE + OUT DX,AL ;WRITE IT + AND AL,AT_CHCHK_EN ;MASK ON I/O CH CHK ENABLE + OUT DX,AL ;TOGGLE CH CHK LTCH AND LEAVE + ;ENABLED + MOV DX,AT_NMI_REG ;AT's NMI REGISTER + MOV AL,AT_NMI_ON ;MASK ON NMI + OUT DX,AL ;OUTPUT IT +;USE XT/AQUARIUS NMI REGISTER +TR2M6: + MOV DX,XT_CHCHK_EN_REG ;XT's I/O CH CHK REG + IN AL,DX ;READ IT + OR AL,XT_CHCHK_DIS ;MASK OFF I/O CH CHK ENABLE + OUT DX,AL ;WRITE IT + AND AL,XT_CHCHK_EN ;MASK ON I/O CH CHK ENABLE + OUT DX,AL ;TOGGLE CH CHK LTCH AND LEAVE + ;ENABLED + MOV DX,XT_NMI_REG ;XT's NMI REGISTER + MOV AL,XT_NMI_ON ;MASK ON NMI + OUT DX,AL ;OUTPUT IT +; + RET ;RETURN TO CALLER + +TRY4MEG ENDP + + +PAGE +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; REGISTER TESTS +; +; DESCRIPTION : This routine will test the following subset +; of XMA registers: +; 31A0...8 bits +; 31A1...4 bits +; 31A6...4 bits +; 31A7...4 bits (BIT 1 IS HELD LOW TO DISABLE +; THE VIRTUAL MODE) +; +; The test is performed by writing and reading +; AA, 55, FF, 00 from each of the above locations. +; +; NOTE: Regs 31A6 and 31A7 should always return 0 in +; the high nibble. +; +; The remainding registers will be tested in +; subsequent routines. +; +; +; FUNCTION/ : To ensure integrity of XMA registers that will be used +; PURPOSE in subsequent routines. +; +; ENTRY POINT : REGTST +; +; ENTRY : none +; CONDITIONS +; +; EXIT : XMA registers are set to zero +; +; (zero flag) = 0 indicates an error +; (DX) failing register +; (AL) expected data XOR'ed with actual data +; +;------------------------------------------------------------------------- +; +REGTST PROC +; + MOV AL,REG_TEST + MOV CS:TEST_ID,AL + +;SAVE CONTENTS OF MODE REG + MOV DX,MODE_REG + IN AL,DX + PUSH AX + +; TRANSLATE TABLE ADDRESS AND DATA REGISTERS +; + MOV BX,0AA55H ;SET UP INITIAL DATA PATTERN + MOV AX,BX + MOV CX,BX + +R1: + MOV DX,TTPOINTER ;FIRST REGISTER PAIR TO WRITE + + OUT DX,AX ;WRITE PATTERN TO REGS + ADD DX,6 ;POINT TO NEXT REG PAIR + XCHG AL,AH ;SETUP INVERSE PATTERN + AND AH,11111101B ;MASK OFF BIT 1 + OUT DX,AX ;BECAUSE AH -> 21B7 +R2: + SUB DX,6 ;POINT TO FIRST REGISTER PAIR + IN AX,DX ;READ REGISTER (21B1 -> AH) + XOR AX,BX ;DATA READ AS EXPECTED ? + AND AX,0FFFH ;MASK OFF UPPER NIBBLE OF 21B1 + JNE R_ERROR ;MISMATCH - GO TO ERROR ROUTINE + XCHG BH,BL ;NEXT PATTERN TO TEST + AND BX,0F0FH ;REGS RETURN 0 IN HI NIBBLE + ADD DX,6 ;POINT TO NEXT REGISTER PAIR + IN AX,DX ;READ IT (21B7 -> AH) + XOR AX,BX ;DATA READ AS EXPECTED ? + AND AX,0DFFH ;MASK OFF BIT 1 IN REG 21B7 + JNE R_ERROR ;MISMATCH - GO TO ERROR ROUTINE +; + CMP CH,CL ;LAST PASS ? + JE R_EXIT ;YES - THEN EXIT REG TEST +; + CMP CX,055AAH ;END OF AA55,55AA PATTERNS? + JNE R3 ; + MOV CX,000FFH ;SET UP NEXT VALUE TO WRITE + JMP R4 +R3: + CMP CX,00FFH ;END OF FF00,00FF PATTERNS? + JNE R4 ; + MOV CX,0 ;YES, THEN SET UP FOR LAST PASS +R4: + XCHG CL,CH ;SET UP INVERSE PATTERN + MOV AX,CX ;SAVE IT + MOV BX,CX ;SAVE IT +R5: + JMP R1 ;CONTINUE TILL ZERO PATTERN + +R_ERROR: +R_EXIT: + POP AX + MOV DX,MODE_REG + OUT DX,AL ;restore mode reg + RET +; +REGTST ENDP + + + + +PAGE +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; MEMORY ARRAY TEST +; +; DESCRIPTION : This routine test all 1Meg (or 2Meg) of XMA memory +; through a 64K window in PC space beginning at PF:0 +; (where PF is the Page Frame Segment) +; This module looks at TOTAL_SYS_PAGES +; to determine the memory size to be tested. +; +; (i) write the Translate Table for the 1st 64K block +; of XMA memory to be mapped into PF:0 in PC space +; (ii) test PF:0 to PF:FFFF +; (iii) if good...write Translate Table to map next 64K block +; into PF:0 +; (iv) repeat 'till all XMA memory is tested +; +; FUNCTION/ : See description +; PURPOSE +; +; +; ENTRY POINT : MEMARRAY +; +; ENTRY : +; CONDITIONS +; +; EXIT : All SMAS memory is set to zero. +; +; (zero flag) = 0 if storage error +; (AX) expected data XOR'ed with actual data +; if AX = 0 and ZF = 0 then parity error +; DS:SI point to failing location +; CS:PAGE_UNDER_TEST point failing 64k block +; +; AX,BX,CX,DX,DS,ES,SI,DI ARE DESTROYED +; +;------------------------------------------------------------------------- + +MEMARRAY PROC + + MOV AL,MEM_TEST + MOV CS:TEST_ID,AL + +;MEMORY TEST MUST RUN IN PAGE MODE + + CALL VIRT2REAL + +;INDICATE 0 KB OK + MOV DX,(640-16)/4 ;CODE FOR 640 KB OK + CALL KB_OK +;SETUP FOR TEST OF SMAS MEMORY ARRAY + MOV AX,CS:PAGE_FRAME_STA ;PAGE MEMORY FROM THIS SEGMENT + MOV ES,AX ;SET UP DEST SEG + MOV DS,AX ;SET UP SOURCE SEG + MOV BL,01H ;ENABLE THIS BLOCK OF MEMORY + MOV BH,0 ;USING ID 0 + MOV DX,(640)/4 ;STARTING BLK IN SMAS ARRAY + ;DETERMINE HOW MUCH MEMORY TO TEST + MOV CX,CS:TOTAL_SYS_PAGES ;GET NUMBER OF 16K PAGES + SUB CX,640/16 ;SUBTRACT OFF 1ST 640K MEMORY ;an000; dms; +;BEGIN TEST +MA1: + MOV CS:PAGE_UNDER_TEST,DX ;INDICATE WHICH 64K BLOCK + PUSH AX ;IS UNDER TEST + PUSH BX + PUSH CX + PUSH DX ;SAVE ALL REGISTERS +; + MOV CX,4 ;test 16k at one time ;an000; dms; + ;4 x 4K = 16K + CALL SETXLAT ;SET UP XLAT TABLE + CALL STGTST ;TEST 64K OF STORAGE + JNZ MA2 ;WAS THERE AN ERROR + POP DX + POP CX + POP BX + POP AX ;RESTORE REGISTERS +; + PUSHF ;SAVE FLAGS FOR ADDITION + + CALL KB_OK ;INDICATE HOW MUCH + ;MEMORY HAS BEEN TESTED + + + ADD DX,4 ;POINT TO NEXT 64K BLOCK + POPF ;RESTORE FLAGS + LOOP MA1 ;LOOP FOR NEXT 64K + JMP MA3 ;EXIT WHEN COMPLETE +MA2: + POP DX + POP CX + POP BX ;BX IS POPPED TWICE + POP BX ;TO RESTORE STACK WHILE + ;MAINTAINING AX +MA3: + PUSH AX + PUSH DX + PUSHF ;SAVE THESE REGS...THEY CONTAIN + ;USEFULL ERROR INFO +;PUT THE SMAS CARD INTO REAL MODE + MOV DX,MODE_REG ;READY FOR I/O TO MODE REG + IN AL,DX ;READ IT + AND AL,REAL_MODE ;TURN OFF VIRTUAL BIT + OUT DX,AL ;WRITE IT TO MODE REG + POPF + POP DX + POP AX ;RESTORE THESE REGS + RET +; +MEMARRAY ENDP + + + + +PAGE +;--------------------------------------------------------------------- +;--------------------------------------------------------------------- +; LO MEMORY TEST +; +; DESCRIPTION : This routine tests the first 256K or 512K +; of XMA memory depending on the starting +; position of the starting address jumper on +; the card. The memory that is used to +; fill conventional memory space is not tested +; it is tested during POST and may now contain +; parts of COMMAND.COM. +; +; FUNCTION/ : See description +; PURPOSE +; +; ENTRY POINT : LOMEMTST +; +; ENTRY : +; CONDITIONS +; +; EXIT : All tested memory is set to zero +; +; (zero flag) = 0 if storage error +; (AX) = expected data XOR'ed with actual data +; if (AX)=0 and ZF=0 then parity error +; DS:SI point to failing location +; CS:PAGE_UNDER_TEST point to failing 64K block +; +; AX,BX,CX,DX,DI,SI,ES,DS ARE DESTROYED +; +;----------------------------------------------------------------------- +LOMEMTST PROC + + MOV AL,LOMEM_TEST + MOV CS:TEST_ID,AL + +;MEMORY TEST MUST RUN IN PAGE MODE + CALL VIRT2REAL + +;INDICATE 0 KB OK AT START OF TEST + MOV DX,03ffcH ;code for initial 0 kb ;an000; dms; + CALL KB_OK + +;DETERMINE HOW MUCH MEMORY TO TEST + MOV AX,CS:START_BACMEM_SEG ;get starting fill segment + XCHG AH,AL + MOV CL,2 ; ;an000; dms; + SHR AX,CL ;convert to 16k block number + MOV CS:TESTABLE_SEGMENTS,AX ;save...this is number of 64k blocks + ;that can be tested without + ;destroying DOS +;SET UP FOR TEST OF XMA MEMORY + MOV AX,CS:PAGE_FRAME_STA ;test through page frame + MOV DS,AX ;set up ds + MOV ES,AX ;and es + MOV BL,01H ;enable this block of memory + MOV BH,0 ;using id=0 + XOR DX,DX ;start at block 0 in xma + MOV CX,640/16 ;loop counter is # 16k blocks in + ;conventional memory +LM1: + MOV CS:PAGE_UNDER_TEST,DX ;save page under test + PUSH AX + PUSH BX + PUSH CX + PUSH DX ;save these registers + + MOV CX,4 ;test 16k at one time ;an000; dms; + ;4 * 4k = 16k + CALL SETXLAT ;set translate table + CMP CS:TESTABLE_SEGMENTS,0 ;if this segment under test is used for + ;fill then read only + JG LM2 ;else do storage test + CALL READ_ONLY + JMP LM3 +LM2: + CALL STGTST +LM3: + JNZ LM4 ;jump if there was an error + POP DX + POP CX + POP BX + POP AX ;recover registers + + PUSHF ;save flags for addition + CALL KB_OK + ;indicate kb ok + ADD DX,4 ;next 16k block ;an000; dms; + DEC CS:TESTABLE_SEGMENTS ;dec testable pages + POPF ;recover flags + LOOP LM1 ;repeat for next 64k block + JMP LM5 ;exit when complete +LM4: + POP DX ;recover these registers + POP CX + POP BX ;bx is popped twice to restore + POP BX ;satck while maintaining ax +LM5: + PUSH AX ;save these ... they contain + PUSH DX ;useful error information + PUSHF +;PUT CARD BACK TO REAL MODE + MOV DX,MODE_REG ;read mode reg + IN AL,DX + AND AL,REAL_MODE ;turn off virtual bit + OUT DX,AL ;write it to mode reg + POPF + POP DX + POP AX ;restore these registers + RET + + +READ_ONLY PROC ;INTERNAL PROC TO READ MEMORY WITHOUT DESTROYING CONTENTS + XOR SI,SI ;start of segment + XOR CX,CX ;test 64k + + LODSW ;just read each byte + XOR AX,AX ;and set zf=1 for return + RET ;back to caller +READ_ONLY ENDP + +LOMEMTST ENDP + + + +PAGE +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; PAGE TEST +; +; DESCRIPTION : This routine tests that the TASK ID register is +; actually paging in unique segments of memory. +; The test is performed through the page frame segment. +; The test assumes that the memory test has already +; completed successfully. The page test procedes as +; follows: +; (i) 6-64K blocks of XMA memory are mapped into a +; 64K segment of PC space (the page frame) +; These XMA blocks are from 640k to 1024k of XMA memory. +; (ii) Each of these blocks is assigned to a unique +; task ID ranging from 0 to 5. +; (iii) For each task ID, the page frame is filled with +; a pattern that is the same as the task ID. +; (iv) The page frame is then read for each task ID +; and compared with the expected data. +; +; FUNCTION/ : +; PURPOSE +; +; ENTRY POINT : PAGETST +; +; ENTRY : NONE +; CONDITIONS +; +; EXIT : (zero flag) = 0 indicates an error +; (AL) expected data XOR'ed with actual data +; +; AX,BX,CX,DX,ES,DS,SI,DI ARE DESTROYED +;------------------------------------------------------------------------- +; +PAGETST PROC +; + MOV AL,PAGE_TEST + MOV CS:TEST_ID,AL +;MEMORY TEST MUST RUN IN PAGE MODE + CALL VIRT2REAL +;INITIALIZE TRANSLATE TABLE FOR THIS TEST + MOV AX,CS:PAGE_FRAME_STA ;SEMENT OF PAGE FRAME + MOV BL,01H ;ENABLE CODE + MOV BH,0 ;START WITH TASK ID = 0 + MOV DX,640/4 ;START WITH XMA BLOCK 160 + MOV CX,6 ;LOOP COUNT...6 TASK ID's + ;EACH TASK ID IS ASSIGNED 16K + ;FROM 640K TO 1024K +PT1: + PUSH AX + PUSH BX + PUSH CX + PUSH DX ;SAVE ALL REGISTERS +; + MOV CX,4 ;4 -4K BLOCKS IN 16K ;an000; dms; + CALL SETXLAT ;SET TRANSLATE TABLE + POP DX + POP CX + POP BX + POP AX ;RECOVER ALL + INC BH ;POINT TO NEXT TASK ID + ADD DX,4 ;NEXT 64K IN XMA MEMORY ;an000; dms; + LOOP PT1 ;REPEAT FOR ALL TASK ID's +;FILL MEMORY WITH A UNIQUE PATTERN FOR EACH TASK ID + MOV CX,6 ;6 TASK ID's + MOV DX,IDREG ;READY FOR I/O TO TASK ID REG + MOV AL,0 ;START WITH ID = 0 +PT2: + PUSH AX ;SAVE ID NUMBER + PUSH CX ;SAVE ID COUNT + OUT DX,AL ;SWITCH TASK ID + MOV BX,CS:PAGE_FRAME_STA + MOV ES,BX ;SEGMENT TO 1ST 64K 0F ID + SUB DI,DI ;POINT TO 1ST LOCATION + mov cx,4000h ;WRITE ALL 16K LOCATIONS ;an000; dms; +PT2X: + STOSB + LOOP PT2X + POP CX ;RECOVER ID COUNT + POP AX ;RECOVER CURRENT ID + INC AL + LOOP PT2 ;REPEAT FOR ALL TASK ID's +;NOW CHECK THAT THERE ARE 16 UNIQUE PATTERNS IN MEMORY + MOV CX,6 ;USE 6 TASK ID's + MOV AH,0 ;START WITH ID = 0 +PT3: + MOV AL,AH ;GET TASK ID IN AL + PUSH AX + PUSH CX ;SAVE ID COUNT + OUT DX,AL ;SWITCH TASK ID + MOV BX,CS:PAGE_FRAME_STA + MOV DS,BX + MOV ES,BX ;SEGMENT AT 1ST 64K + SUB DI,DI ;POINT TO 1ST LOCATION + SUB SI,SI ;POINT TO 1ST LOCATION + mov cx,4000h ;READ ALL 16K LOCATIONS +PT3X: + LODSB + XOR AL,AH ;DATA AS EXPECTED ? + JNE PT4X ;NO - THEN EXIT + STOSB ;AL SHOULD CONTAIN 0...WRITE IT + LOOP PT3X + + POP CX ;RECOVER ID COUNT + POP AX + INC AH ;NEXT TASK ID + LOOP PT3 ;REPEAT FOR ALL TASK ID's + XOR AL,AL ;IF WE GOT THIS FAR THEN + ;NO ERRORS...SET ZF TO + ;INDICATE SUCCESS +PT4: + PUSH AX + PUSH DX + PUSHF ;SAVE THESE REGS...THEY CONTAIN + ;USEFULL ERROR INFO +;PUT THE SMAS CARD INTO REAL MODE + MOV DX,MODE_REG ;READY FOR I/O TO MODE REG + IN AL,DX ;READ IT + AND AL,REAL_MODE ;TURN OFF VIRTUAL BIT + OUT DX,AL ;WRITE IT TO MODE REG +;MAKE SURE WE EXIT WHILE IN TASK ID=0 + MOV DX,IDREG + XOR AL,AL + OUT DX,AL + + POPF + POP DX + POP AX ;RESTORE THESE REGS + RET ;RETURN TO CALLER +PT4X: + POP CX ;ALTERNATE RETURN PATH + POP AX + JMP PT4 ;TO ADJUST STACK +; +PAGETST ENDP + + +PAGE +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; DMA CAPTURE TEST +; +; DESCRIPTION : This routine is a test of the DMA capture logic. +; The test is as follows: +; (i) A bit is rolled through the second entry in the +; DMA cature register file. (The first entry is used +; for refresh on a PC-XT). +; (ii) A bit and address test is performed on the +; remainder of the register file(s). +; (iii) A test is made for the capture of both REQUEST and +; MODE registers of the DMA controller. +; (iv) DMA channel 0 is tested only on the PC-AT +; +; +; FUNCTION/ : To verify the functionality of the DMA capture logic. +; PURPOSE +; +; ENTRY POINT : CAPTST +; +; ENTRY : NONE +; CONDITIONS +; +; EXIT : Each entry in the DMA capture register file is set to 0. +; +; (zero flag) = 0 indicates an error +; '31A8'X points to failing DMA capture reg +; (AL) expected data XOR'ed with actual data +; +; AX,BX,CX,DX,SI,DI ARE DESTROYED +;------------------------------------------------------------------------- +; +; +CAPTST PROC +; + MOV AL,DMA_CAPTURE + MOV CS:TEST_ID,AL +; +;ROLL A BIT THROUGH THE SECOND ENTRY IN THE DMA CAPTURE REGISTER FILE +; + MOV BL,01H ;SET UP INITIAL PATTERN + MOV BH,01H ;SET UP DMA CHANNEL 1 + MOV DI,DMACAPT ;SAVE FOR I/O TO DMA CAPTURE REG + MOV SI,DMAREQ1 ;SAVE FOR I/O TO DMA CTRL 1 REQ REG + MOV CX,4 ;ROLL 4 BIT POSITIONS +C1: + MOV DX,IDREG ;I/O TO ID REG + MOV AL,BL ;PATTERN TO WRITE + OUT DX,AX ;SETUP ID REG WITH DATA PATTERN + MOV DX,SI ;DMA CTRL 1 + MOV AL,BH ;CHANNEL 1 + OUT DX,AL ;SETUP DMA CH 1...CAPT ID IN 2nd ENTRY + MOV DX,DI ;DMA CAPTURE REG + OUT DX,AL ;POINT TO 2nd ENTRY + IN AL,DX ;READ IT + XOR AL,BL ;DATA READ AS EXPECTED ? + JNE CAPT_ERROR ;NO - THEN ERROR + SHL BL,1 ;SHIFT BIT TO NEXT POSITION + LOOP C1 ;REPEAT +; + MOV DI,DMAREQ2 ;SETUP FOR I/O TO DMA CTRL 2 REQ REG + MOV AL,05H ;DATA PATTERN TO CAPTURE + CALL CAPT_FILL ;FILL CAPTURE REGS WITH VALUE +; + MOV AH,05H ;SETUP INITIAL PATTERN + MOV BX,0F0AH ;OTHER PATTERNS TO USE +C2: + CALL CAPT_RMW + JNZ CAPT_ERROR ;ERROR - THEN EXIT + CMP AH,BL ;ZERO PATTERN ? + JE CAPT_EXIT ;EXIT IF YES + MOV AH,BL ;SET UP + MOV BL,BH ; NEXT + MOV BH,0 ; PATTERN + JMP C2 ;REPEAT + +;NOW REPEAT TEST FOR CATPURE OF DMA MODE REGISTERS + MOV SI,DMAMODE1 ;SETUP FOR I/O TO DMA CTRL 1 MODE REG + MOV DI,DMAMODE2 ;SETUP FOR I/O TO DMA CTRL 2 MODE REG + MOV AL,05H ;DATA PATTERN TO CAPTURE + CALL CAPT_FILL ;FILL CAPTURE REGS WITH VALUE +; + MOV AH,05H ;SETUP INITIAL PATTERN + MOV BX,0F0AH ;OTHER PATTERNS TO USE +C3: + CALL CAPT_RMW + JNZ CAPT_ERROR ;ERROR - THEN EXIT + CMP AH,BL ;ZERO PATTERN ? + JE CAPT_EXIT ;EXIT IF YES + MOV AH,BL ;SET UP + MOV BL,BH ; NEXT + MOV BH,0 ; PATTERN + JMP C3 ;REPEAT +CAPT_ERROR: +CAPT_EXIT: + RET + +CAPTST ENDP + + + +PAGE + +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; FILL DMA CAPTURE REG +; +; DESCRIPTION : This routine will fill the entire DMA capture register +; file with the pattern that is passed in AL +; +; FUNCTION/ : See Description. +; PURPOSE +; +; ENTRY POINT : CAPT_FILL +; +; ENTRY : AL contains the value to be captured into +; CONDITIONS the register file. +; SI contains the address of DMA controller 1 +; DI contains the address of DMA controller 2 +; +; EXIT : Each entry in the DMA capture register file is set to +; the value specified in AL. +;------------------------------------------------------------------------- +; +CAPT_FILL PROC NEAR +; + MOV DX,IDREG + OUT DX,AL ;LOAD ID REG WITH PAT TO BE CAPTURED + MOV DX,DI ;GET ADDRESS OF CTRL 2 + MOV CX,3 ;REP FOR CHANNELS 7,6,5 +CF1: + MOV AL,CL ;CL CONTAINS WHICH DMA CHANNEL + OUT DX,AL ;SETUP & CAPTURE DMA CHANNEL + LOOP CF1 ;REPEAT +; + MOV DX,SI ;GET ADDRESS OF CTRL 1 + MOV CX,3 ;REP FOR CHANNELS 3,2,1 +CF2: + MOV AL,CL ;CL CONTAINS WHICH DMA CHANNEL + OUT DX,AL ;SETUP & CAPTURE DMA CHANNEL + LOOP CF2 ;REPEAT + ;DO CHANNEL 0 IF NOT PC1, XT, AQUARIUS + CMP CS:MODEL_BYTE,PC1 ;IS THIS A PC1 ? + JE CF3 ;YES - THEN EXIT ELSE TRY PC_XT + CMP CS:MODEL_BYTE,PC_XT ;IS THIS AN XT ? + JE CF3 ;YES - THEN EXIT ELSE TRY AQUARIUS + CMP CS:MODEL_BYTE,XT_AQUARIUS ;IS THIS AN AQUARIUS? + JE CF3 ;YES - THEN EXIT ELSE FILL CH 0 CAPT + MOV AL,0 ;INDICATE CHANNEL 0 + OUT DX,AL ;SETUP & CAPTURE DMA CHANNEL +CF3: + RET ;RETURN TO CALLER +; +CAPT_FILL ENDP + + + + +PAGE +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; READ-MODIFY-WRITE DMA CAPTURE REG +; +; DESCRIPTION : This routine will read the a DMA capture register +; and if the correct value is found will cause a capture +; of a new value. The next DMA capture reg is read and +; the process repeated. +; +; FUNCTION/ : See Description. +; PURPOSE +; +; ENTRY POINT : CAPT_RMW +; +; ENTRY : AH contains the value to be compared +; CONDITIONS BL contains the new value to be written +; SI contains the address of DMA controller 1 +; DI contains the address of DMA controller 2 +; +; EXIT : Each entry in the DMA capture register file is set to +; the value specified in BL. +; +; AL,CX,DX,ARE DESTROYED +;------------------------------------------------------------------------- +; +CAPT_RMW PROC NEAR +; + MOV CX,3 ;REP FOR CHANNELS 7,6,5 +RMW1: + MOV DX,DMACAPT ;I/O ADDRESS OF DMA CAPTURE REG + MOV AL,CL ;GET LOW BYTE OF COUNT + ADD AL,4 ;ADD 4 TO POINT TO DMA CAPTURE + CALL RMW + JNZ RMW4 ;EXIT IF ERROR + LOOP RMW1 ;REPEAT FOR CHANNEL 6,5 +; + MOV CX,3 ;REP FOR CHANNELS 3,2,1 + PUSH DI ;SAVE DMA CTRL 2 + MOV DI,SI ;GET DMA CTRL 1 INTO DI FOR PROC RMW +RMW2: + MOV DX,DMACAPT ;I/O ADDRESS OF DMA CAPTURE REG + MOV AL,CL ;GET LOW BYTE OF COUNT + CALL RMW + JNZ RMW3 ;EXIT IF ERROR + LOOP RMW2 ;REPEAT FOR DMA CHANNELS 2,1 + ;DO CHANNEL 0 IF NOT PC1, XT, AQUARIUS + CMP CS:MODEL_BYTE,PC1 ;IS THIS A PC1 ? + JE RMW3 ;YES - THEN EXIT ELSE TEST FOR PC_XT + CMP CS:MODEL_BYTE,PC_XT ;IS THIS AN XT ? + JE RMW3 ;YES - THEN EXIT ELSE TEST FOR AQUARIUS + CMP CS:MODEL_BYTE,XT_AQUARIUS ;IS THIS AN AQUARIUS? + JE RMW3 ;YES - THEN EXIT ELSE TEST CH 0 + MOV DX,DMACAPT ;I/O ADDRESS OF DMA CAPTURE REG + MOV CL,0 ;INDICATE CHANNEL 0 + MOV AL,CL ;ALSO INTO AL + CALL RMW +RMW3: + POP DI ;RESTORE DI (ADDR OF DMA CTRL 2) +RMW4: + RET ;RETURN TO CALLER +; +CAPT_RMW ENDP +; +RMW PROC +; + OUT DX,AL ;SETUP TO READ FROM DMA CAPTURE REG + IN AL,DX ;READ IT + XOR AL,AH ;DATA AS EXPECTED ? + JNE RMW5 ;NO THEN EXIT + ;DATA WAS GOOD---NOW GET NEXT PATTERN INTO THIS CAPTURE REG + MOV DX,IDREG ;ADDRESS OF ID REG + MOV AL,BL ;NEW PATTERN TO WRITE + OUT DX,AL ;WRITE IT TO ID REG + MOV DX,DI ;ADDRESS OF DMA CTRL 2 + MOV AL,CL ;DMA CHANNEL TO SET UP + OUT DX,AL ;SET UP DMA---THIS CAUSES CAPTURE OF ID +RMW5: + RET ;RETURN TO CALLER +; +RMW ENDP + + + + +PAGE +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; INHIBIT A BLOCK OF MEMORY +; +; DESCRIPTION : This routine will set a block of SMAS memory with +; the code to enable or inhibit it. The user simply +; specifies the starting segment and length of the block in +; PC 'real' address space that is to be enabled/inhibited. +; The appropriate entries in the Translate Table are +; written so that this specified block in 'real' address +; is enabled or protected in all 16 possible TASK ID's. +; +; +; FUNCTION/ : To enable or inhibit SMAS memory in specified areas of +; PURPOSE PC 'real'address space (ie.,diplay buffer, BIOS, +; distributed ROS...) +; +; ENTRY POINT : INHIBLK +; +; ENTRY : (AX) starting segment in PC address space to be +; CONDITIONS protected/enabled. Must be on 4K boundary else +; this routine will round UP to next 4K block. +; +; (CX) number of 4K blocks to be protected +; +; (BL) 01 = ENABLE +; 00 = INHIBIT +; +; EXIT : specified entries in Translate Table are enabled or +; inhibited for all posible task ID's. +; +; AX,BH,CX,DX ARE DESTROYED +;------------------------------------------------------------------------- +; +INHIBLK PROC +; + ;ADJUST SI FOR TRANSLATE TABLE ENTRY + XCHG AL,AH ;ROTATE RIGHT BY 8 + XOR AH,AH ;CLEAR AH + ;AX IS NOW ADJUSTED FOR ENTRY INTO + ;XLAT TABLE FOR TASK ID=0 + PUSH AX ;SAVE IT + PUSH CX ;SAVE COUNT OF 4K BLOCKS +; + MOV SI,TTDATA ;ADDRESS OF TT DATA REG + MOV DI,AIDATA ;ADDRESS OF TT DATA WITH AUTO INC + XOR BH,BH ;BH IS TASK ID +INH1: + MOV DX,TTPOINTER ;ADDRESS OF TT POINTER + POP CX ;RESTORE COUNT + POP AX ;RESTORE TT ENTRY + PUSH AX ;SAVE BOTH + PUSH CX ; OF THEM + MOV AH,BH ;APPEND TASK ID TO TT POINTER + OUT DX,AX ;SET TT POINTER TO STARTING ENTRY +INH2: + MOV DX,SI ;TT DATA REG + IN AX,DX ;READ CURRENT ENTRY + MOV DX,DI ;ADDRESS OF TT DATA WITH AUTO INC + ;DETERMINE IF ENABLE OR INHIBIT BLOCK + CMP BL,ENABLE ;WANT TO ENABLE THIS BLOCK ? + JNE INH3 ;NO - THEN DISABLE IT + AND AH,BLK_ON ;MASK OFF INHIBIT BIT + JMP INH4 +INH3: + OR AH,BLK_OFF ;MASK ON INHIBIT BIT +INH4: + OUT DX,AX ;WRITE IT THEN INC TO NEXT TT ENTRY + LOOP INH2 ;REPEAT FOR EACH BLOCK OF 4K + INC BH ;NEXT TASK ID + CMP BH,MAX_TASK_ID ;COMPLETED FOR ALL TASK ID's ? + JBE INH1 ;NO - THEN LOOP TILL DONE +INHIBLK_EXIT: + POP CX + POP AX + RET +; +INHIBLK ENDP + + + + +PAGE +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; STORAGE TEST +; +; DESCRIPTION : This routine performs a bit and address test on a +; 64K block of storage. +; +; (i) 55AA is written to each location. +; (ii) 55AA is read back +; (iii) if good, write AA55 and point to next location +; (iv) repeat step (iii) for all 64K locations +; (v) repeat steps (ii) to (iv) for AA55, FF00, 0101, 0000 +; (vi) check parity bits +; +; +; FUNCTION/ : See description +; PURPOSE +; +; ENTRY POINT : STGTST +; +; ENTRY : (ES) storage segment to be tested +; CONDITIONS (DS) storage segment to be tested +; +; EXIT : (zero flag) = 0 if storage error +; (AX) expected data XOR'ed with actual data +; if ax = 0 and zf = 0 then parity error +; DS:SI point to failing location +; +; AX,BX,CX,DX,DI,SI ARE DESTROYED +; +;------------------------------------------------------------------------- +; +STGTST PROC +; + CMP CS:WARM_START,'Y' ;is this a warm start? + JNE STG1A ;if no then do mem test + CALL CLEAR_MEM ;if yes then just clear memory + XOR AX,AX ;set zero flag + JMP STG6 ;exit + + + ;DISABLE NMI AND ENABLE I/O CHANNEL CHECK +STG1A: + MOV AL,CS:MODEL_BYTE ;GET SAVED MODEL BYTE + CMP AL,PC1 ;IS IT A PC1? + JE STG1 ;IF NO THEN TRY FOR PC_XT + CMP AL,PC_XT ;IS IT AN XT? + JE STG1 ;IF NO THEN TRY FOR AQUARIUS + CMP AL,XT_AQUARIUS ;IS IT AN AQUARIUS? + JE STG1 ;IF NO THEN USE AT NMI REGS + ;USE PC-AT NMI REGISTER + MOV DX,AT_NMI_REG ;AT's NMI REGISTER + MOV AL,AT_NMI_OFF ;MASK OFF NMI + OUT DX,AL ;OUTPUT IT + MOV DX,AT_CHCHK_EN_REG ;AT's I/O CH CHK REG + IN AL,DX ;READ IT + OR AL,AT_CHCHK_DIS ;MASK OFF I/O CH CHK ENABLE + OUT DX,AL ;WRITE IT + AND AL,AT_CHCHK_EN ;MASK ON I/O CH CHK ENABLE + OUT DX,AL ;TOGGLE CH CHK LTCH AND LEAVE + ;ENABLED + ;USE PC1, XT, AQUARIUS REGISTERS +STG1: + MOV DX,XT_NMI_REG ;XT's NMI REGISTER + MOV AL,XT_NMI_OFF ;MASK OFF NMI + OUT DX,AL ;OUTPUT IT + MOV DX,XT_CHCHK_EN_REG ;XT's I/O CH CHK REG + IN AL,DX ;READ IT + OR AL,XT_CHCHK_DIS ;MASK OFF I/O CH CHK ENABLE + OUT DX,AL ;WRITE IT + AND AL,XT_CHCHK_EN ;MASK ON I/O CH CHK ENABLE + OUT DX,AL ;TOGGLE CH CHK LTCH AND LEAVE + ;ENABLED + + + + ;ROLL A BIT THROUGH THE FIRST WORD + SUB DI,DI ;FIRST LOCATION + MOV CX,16 ;ROLL 16 BITS + MOV AX,0001H ;FIRST PATTERN TO WRITE + MOV BX,AX ;SAVE IT +STG2: + MOV [DI],AX ;WRITE PATTERN + MOV [DI+2],0FFFFH ;CHARGE BUS + MOV AX,[DI] ;READ PATTERN + XOR AX,BX ;IS IT CORRECT ? + JNE STG_EXIT ;IF NO - THEN EXIT + SHL BX,1 ;SHIFT BIT + MOV AX,BX ;GET IT INTO AX + LOOP STG2 ;REPEAT +; + CLD ;FILL FORWARD + SUB DI,DI ;POINT TO FIRST LOCATION + MOV CX,2000H ;8K WORDS ;an000; dms; + MOV AX,55AAH ;INITIAL PATTERN TO WRITE + REP STOSW ;FILL ENTIRE SEGMENT +; + MOV BX,55AAH ;PATTERN TO LOOK FOR + MOV DX,0AA55H ;NEXT PATTERN TO WRITE + CALL STG_CNT + JNZ STG_EXIT ;EXIT IF ERROR +; + MOV BX,0AA55H ;PATTERN TO LOOK FOR + MOV DX,0101H ;NEXT PATTERN TO WRITE + CALL STG_CNT + JNZ STG_EXIT ;EXIT IF ERROR +; + MOV BX,0101H ;PATTERN TO LOOK FOR + MOV DX,0000H ;NEXT PATTERN TO WRITE + CALL STG_CNT + JNZ STG_EXIT ;EXIT IF ERROR +; +; MOV BX,0000H ;PATTERN TO LOOK FOR +; MOV DX,0000H ;NEXT PATTERN TO WRITE +; CALL STG_CNT +; JNZ STG_EXIT ;EXIT IF ERROR +; + ;IF TEST REACHES THIS POINT THEN MEMORY IS GOOD + ;NEED TO CHECK PARITY BITS...IF PARITY ERROR EXISTS THEN + ;CAN ASSUME BAD PARITY BIT OR BAD PARITY GENERATOR +; + MOV AL,CS:MODEL_BYTE ;GET SAVED MODEL BYTE + CMP AL,PC1 ;IS IT A PC1? + JE STG3 ;USE XT REGISTERS + CMP AL,PC_XT ;IS IT AN XT? + JE STG3 ;USE XT REGISTERS + CMP AL,XT_AQUARIUS ;IS IT AN AQUARIUS? + JE STG3 ;USE XT REGISTERS + ;IF NONE OF THE ABOVE THEN... + ;USE AT NMI REGISTER + MOV DX,AT_CHCHK_REG ;AT's I/O CH CHK REG + IN AL,DX ;READ IT + AND AL,AT_CHCHK ;IS CH CHK BIT ON ? + JZ STG4 ;IF NO - THEN EXIT + MOV AX,0 ;ELSE - CLEAR AX TO INDICATE + ;PARITY ERROR + JMP STG4 ;EXIT + ;USE XT/AQUARIUS NMI REGISTER +STG3: + MOV DX,XT_CHCHK_REG ;XT's I/O CH CHK REG + IN AL,DX ;READ IT + AND AL,XT_CHCHK ;IS CH CHK BIT ON ? + JZ STG4 ;IF NO - THEN EXIT + MOV AX,0 ;ELSE - CLEAR AX TO INDICATE + ;PARITY ERROR +STG4: +STG_EXIT: + PUSH AX ;SAVE THESE REGS + PUSH DX ;THEY CONTAIN + PUSH SI + PUSHF ;USEFUL ERROR INFORMATION + ;BEFORE NMI IS ENABLED, CLEAR PARITY CHECK LATCH ON XMA + MOV SI,0 + MOV AX,[SI] ;READ 1ST WORD OF THIS SEG + MOV [SI],AX ;WRITE BACK SAME WORD + ;THE WRITE WILL CLEAR PCHK LTCH + ;CLEAR I/O CHANNEL CHECK LATCHES AND ENABLE NMI + MOV AL,CS:MODEL_BYTE ;GET SAVED MODEL BYTE + CMP AL,PC1 ;IS IT A PC1? + JE STG5 ;USE XT REGISTERS + CMP AL,PC_XT ;IS IT AN XT? + JE STG5 ;USE XT REGISTERS + CMP AL,XT_AQUARIUS ;IS IT AN AQUARIUS? + JE STG5 ;USE XT REGISTERS + ;IF NONE OF THE ABOVE THEN... + ;USE AT NMI REGISTER + MOV DX,AT_CHCHK_EN_REG ;AT's I/O CH CHK REG + IN AL,DX ;READ IT + OR AL,AT_CHCHK_DIS ;MASK OFF I/O CH CHK ENABLE + OUT DX,AL ;WRITE IT + AND AL,AT_CHCHK_EN ;MASK ON I/O CH CHK ENABLE + OUT DX,AL ;TOGGLE CH CHK LTCH AND LEAVE + ;ENABLED + MOV DX,AT_NMI_REG ;AT's NMI REGISTER + MOV AL,AT_NMI_ON ;MASK ON NMI + OUT DX,AL ;OUTPUT IT + ;USE XT/AQUARIUS NMI REGISTER +STG5: + MOV DX,XT_CHCHK_EN_REG ;XT's I/O CH CHK REG + IN AL,DX ;READ IT + OR AL,XT_CHCHK_DIS ;MASK OFF I/O CH CHK ENABLE + OUT DX,AL ;WRITE IT + AND AL,XT_CHCHK_EN ;MASK ON I/O CH CHK ENABLE + OUT DX,AL ;TOGGLE CH CHK LTCH AND LEAVE + ;ENABLED + MOV DX,XT_NMI_REG ;XT's NMI REGISTER + MOV AL,XT_NMI_ON ;MASK ON NMI + OUT DX,AL ;OUTPUT IT +; + POPF + POP SI + POP DX + POP AX ;RESTORE REGS +STG6: + RET ;RETURN TO CALLER + + + +CLEAR_MEM PROC ;INTERNAL PROC TO CLEAR MEMORY + XOR DI,DI ;start of segment + XOR CX,CX ;clear entire segment + XOR AX,AX ;write zeroes + + STOSB ;just write + RET ;back to caller +CLEAR_MEM ENDP + + +STGTST ENDP + + +PAGE +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; STORAGE TEST SUBROUTINE +; +; DESCRIPTION : This routine performs a bit and address test on a +; 64K block of storage. +; +; (i) a word is read and compared against the value in (BX) +; (ii) if good the value in (DX) is written into that location +; (iii) point to next location and repeat steps (i) to (ii) +; +; +; FUNCTION/ : See description +; PURPOSE +; +; ENTRY POINT : STG_CNT +; +; ENTRY : (ES) storage segment to be tested +; CONDITIONS (DS) storage segment to be tested +; (BX) value to be compared +; (DX) new value to be written +; +; EXIT : (zero flag) = 0 if storage error +; (AX) expected data XOR'ed with actual data +; if ax = 0 and zf = 0 then parity error +; DS:SI point to failing location +;------------------------------------------------------------------------- +; +STG_CNT PROC +; + MOV CX,2000H ;8K WORDS ;an000; dms; + SUB DI,DI ;FIRST LOCATION + MOV SI,DI ;FIRST LOCATION +SC1: + LODSW ;READ OLD WORD FROM STORAGE + XOR AX,BX ;DATA AS EXPECTED ? + JNE SC2 ;IF NO - THEN EXIT + MOV AX,DX ;GET NEW PATTERN + STOSW ;WRITE IT + LOOP SC1 ;REPEAT +SC2: + RET + +STG_CNT ENDP + + + + +PAGE +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; PRINT MEMORY GOOD +; +; DESCRIPTION : This routine will print to the screen how much memory +; has been tested. +; +; The format will be: xxxx KB TESTED +; +; FUNCTION/ : See description +; PURPOSE +; +; +; ENTRY POINT : KB_OK +; +; ENTRY : (DX) = 1/4 OF GOOD MEMORY + 64K IN KB +; CONDITIONS ex: if (DX) = 16 then +; (16 * 4) + 64 = 128KB is OK +; +; NOTE: if (DX) = FFF0 then 0 KB is OK +; +; +; EXIT : Message is displayed +; +; All registers are preserved +; +;------------------------------------------------------------------------- +; +KB_OK PROC +; + PUSH AX + PUSH BX + PUSH CX + PUSH DX + PUSH SI + PUSH DI + PUSH DS ;SAVE REGISTERS +; + PUSH CS + POP DS ;GET DS TO THIS CODE SEGMENT + ;CONVERT DX TO KILO BYTES + SHL DX,1 + SHL DX,1 ;MULTIPLY BY 4 + ADD DX,16 ;ADJUST BY 16 ;an000; dms; +; + MOV AX,DX ;GET NUMBER INTO AX + MOV BX,10 ;READY FOR DECIMAL CONVERT + MOV CX,4 ;OF 4 DIGITS +K1: + XOR DX,DX ;CLEAR HI WORD OF DIVIDEND + ;AX IS LOW WORD OF DIVIDEND + DIV BX ;DIVIDE BY 10 + OR DL,30H ;MAKE MODULO INTO ASCII + PUSH DX ;SAVE IT + LOOP K1 ;REPEAT FOR ALL DIGITS +; + XOR SI,SI ;CLEAR SI + MOV CX,4 +K2: + POP AX ;ASCII DIGIT GOES INTO AL + MOV BX,OFFSET MEM_OK + MOV CS:[BX+SI],AL ;BUILD ASCII MESSAGE + INC SI + LOOP K2 + ;MOVE THE CURSOR AND PRINT MESSAGE + MOV DX,CUR_SAVE + MOV BH,ACTIVE_PAGE + MOV AH,2 ;SET CURSOR + + INT 10H ;BIOS VIDEO CALL SET CURSOR + MOV AH,9 ;DOS PRINT STRING + MOV DX,OFFSET SIZE_MSG1 + 1 ;OFFSET OF MEM_OK MSG + INT 21H ;DISPLAY MESSAGE + + POP DS + POP DI + POP SI + POP DX + POP CX + POP BX + POP AX ;RESTORE ALL REGISTERS + + RET ;RETURN TO CALLER + +KB_OK ENDP + + +PAGE +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; SET TRANSLATE TABLE +; +; DESCRIPTION : This routine will write the Translate Table so that +; a specified block of PC 'real' address will be mapped +; to a specified block of SMAS physycal memory. Note that +; this routine will map only into CONTIGUOUS blocks of +; SMAS memory. PC memory is referenced by segments +; (must be on 4K boundaries) while SMAS memory is referenced +; by block number (each block is 4K). +; +; EXAMPLE: segment 4000 can be mapped to block 5 +; segment 4100 can be mapped to block 6 +; +; FUNCTION/ : To map PC 'real' addresses into SMAS physical memory. +; PURPOSE +; +; +; ENTRY POINT : SETXLAT +; +; ENTRY : (AX) starting segment in PC address space to be +; CONDITIONS mapped. Must be on 4K boundary else +; this routine will round UP to next 4K block. +; +; (CX) number of 4K blocks translated. +; +; (BH) task ID for this memory allocation +; +; (BL) 01 = ENABLE +; 00 = INHIBIT +; +; (DX) starting block number in SMAS memory +; +; +; EXIT : specified entries in Translate Table are enabled or +; inhibited for all posible task ID's. +; +; +; AX,CX,DX ARE DESTROYED +; +;------------------------------------------------------------------------- +; +SETXLAT PROC +; + ;ADJUST AX FOR TRANSLATE TABLE ENTRY + XCHG AL,AH ;ROTATE RIGHT BY 8 + MOV AH,BH ;TASK ID INTO BH + ;AX IS NOW ADJUSTED FOR ENTRY INTO + ;XLAT TABLE FOR TASK ID=(BH) + PUSH DX ;SAVE STARTING SMAS BLOCK NUMBER +; + MOV DX,TTPOINTER ;ADDRESS OF TT POINTER + OUT DX,AX ;SET TT POINTER TO STARTING ENTRY + POP AX ;GET STARTING BLOCK NUMBER INTO AX +; + MOV DX,AIDATA ;TT DATA REG WITH AUTO INC + ;DETERMINE IF ENABLE OR INHIBIT BLOCK + CMP BL,ENABLE ;WANT TO ENABLE THIS BLOCK ? + JE SETX1 ;YES - THEN SKIP THE DISABLE STEP + OR AH,BLK_OFF ;MASK ON INHIBIT BIT +SETX1: + OUT DX,AX ;WRITE IT THEN INC TO NEXT TT ENTRY + INC AX ;NEXT BLOCK OF SMAS MEMORY + LOOP SETX1 ;REPEAT FOR EACH BLOCK OF 4K +SETXLAT_EXIT: + RET +; +SETXLAT ENDP + + PAGE +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; AUTO-INCREMENT TEST +; +; DESCRIPTION : This routine will test the auto-increment of +; the Translate Table pointer. The test will procede +; in the following manner: +; (i) A basic check of the TT pointer reg is performed +; (ii) The TT pointer is initialized to '00'H +; (iii) The auto increment data reg is written +; (iv) The TT pointer is read and checked for increment +; (v) Repeat until TT pointer wraps from 'FFF'H to '000'H +; (vi) Repeat test for auto-increment for read of data reg +; +; FUNCTION/ : To ensure that the Translate Table pointer can auto +; PURPOSE increment when 31A5 is written or read. +; +; ENTRY POINT : INCTST +; +; ENTRY : NONE +; CONDITIONS +; +; EXIT : +; (zero flag) = 0 indicates an error +; (DX) failing register (ie.,TT pointer reg) +; (AX) expected data XOR'ed with actual data +;------------------------------------------------------------------------- +; +; +INCTST PROC +; + MOV AL,AUTO_INC + MOV CS:TEST_ID,AL +; +;PERFORM SIMPLE TEST OF TTPOINTER REG +; + MOV BX,0AA55H ;SET UP PATTERN TO WRITE + MOV AX,BX + MOV DX,TTPOINTER ;I/O TO TTPOINTER REG + MOV SI,TTDATA ;SAVE FOR I/O TO TTDATA + OUT DX,AX ;WRITE THE REGISTER + XCHG DX,SI ;I/O TO TTDATA REG + XCHG AH,AL ;INVERSE PATTERN + OUT DX,AX ;CHARGE BUS WITH OPPOSITE PATTERN + XCHG DX,SI ;I/O TO TTPOINTER REG + IN AX,DX ;READ TTPOINTER REG + XOR AX,BX ;READ AS EXPECTED + AND AX,0FFFH ;MASK OFF HI NIBBLE (INVALID) + JNE INC_ERROR ;NO - THEN EXIT +; +;CONTINUE WITH AUTO-INC TEST +; + MOV DI,2 ;2 PASSES...1 WRITE , 1 READ +AI1: + MOV SI,AIDATA ;SAVE FOR I/O TO TTDATA WITH AUTO-INC +AI2: + MOV CX,1000H ;TTPOINTER RANGE 0 -> FFF + MOV BX,0001H ;INITIAL COMPARE VALUE + MOV AX,0 ;SET TTPONTER TO ZERO + OUT DX,AX ;TTPOINTER IS INITIALIZED TO ZERO +AI2X: + XCHG DX,SI ;I/O TO TTDATA WITH AUTO-INC +; +;DETERMINE IF WRITE OR READ TEST +; + CMP DI,2 ;DOING A AUTO-INC WRITE TEST ? + JNE AI3 ;NO - THEN MUST BE AUTO-INC READ TEST + OUT DX,AX ;WRITE TO AUTO-INC DATA REG + JMP AI4 ;CONTINUE WITH TEST +AI3: + IN AX,DX ;READ FROM AUTO-INC DATA REG +AI4: + XCHG DX,SI ;I/O TO TTPOINTER REG + IN AX,DX ;READ TTPOINTER (31A1 -> AH) + XOR AX,BX ;DATA AS EXPECTED ? + AND AX,0FFFH ;MASK OFF UPPER NIBBLE (INVALID) + JNE INC_ERROR ;NO - GO TO ERROR + INC BX ;NEXT VALUE TO LOOK FOR + LOOP AI2X ;CONTINUE TIL ALL VALUES ARE TESTED +; + DEC DI + CMP DI,0 ;COMPLETE WITH WRITE AND READ TEST ? + JE INC_EXIT ;YES - THEN EXIT + JMP AI1 ;NO - THEN CONTINUE WITH READ TEST +; +INC_ERROR: +INC_EXIT: RET +; +INCTST ENDP + +PAGE +;------------------------------------------------------------------------- +;------------------------------------------------------------------------- +; +; TRANSLATE TABLE TEST +; +; DESCRIPTION : This routine performs a write/read storage test +; on the Translate Table. The test is as follows: +; (i) A bit is rolled through the first word of the TT +; (ii) A bit and address test is performed on the +; remainder of the TT. +; +; FUNCTION/ : To verify the integrity of the Translate Table. +; PURPOSE +; +; ENTRY POINT : XLATST +; +; ENTRY : NONE +; CONDITIONS +; +; EXIT : Entire Translate Table is left with FFF (passover code) +; +; (zero flag) = 0 indicates an error +; (DX) failing register (TT data register) +; (AX) expected data XOR'ed with actual data +; (31A0) address in TT of failure +;------------------------------------------------------------------------- +; +XLATST PROC +; + MOV AL,XLAT_TABLE_TEST + MOV CS:TEST_ID,AL +; +;ROLL A BIT THROUGH THE FIRST BYTE +; + MOV BX,0001H ;SET UP INITIAL PATTERN + MOV SI,TTDATA ;SAVE FOR I/O TO DATA REG + MOV DX,TTPOINTER ;I/O TO TTPOINTER REG + MOV CX,12 ;ROLL 12 BIT POSITIONS + XOR AX,AX ;CLEAR AX (WRITE TO 1st TT LOCATION) + OUT DX,AX ;SET TT POINTER + XCHG DX,SI ;READY FOR I/O TO TTDATA REG +X1: + MOV AX,BX ;GET BIT PATTERN + OUT DX,AX ;WRITE BIT PATTERN TO TT + XCHG DX,SI ;READY FOR I/O TO TTPOINTER REG + XOR AX,AX ;CLEAR AX + OUT DX,AX ;CHARGE BUS WITH 0000 PATTERN + XCHG DX,SI ;READY FOR I/O TO TTDATA REG + IN AX,DX ;READ TT (31A1 -> AH) + XOR AX,BX ;DATA READ AS EXPECTED ? + AND AX,0FFFH ;MASK OFF UPPER NIBBLE (INVALID) + JNE XLA_ERROR ;NO - THEN EXIT + SHL BX,1 ;SHIFT BIT TO NEXT POSITION + LOOP X1 +; +;CONTINUE REMAINDER OF TRANSLATE TABLE +; + MOV DX,AIDATA +; + XCHG DX,SI ;READY FOR I/O TO TTPOINTER + XOR AX,AX ;CLEAR AX + OUT DX,AX ;TTPOINTER AT 1st LOCATION +; + XCHG DX,SI ;READY FOR I/O TO TT DATA W/AUTO-INC + MOV AX,0AA55H ;INITIAL DATA PATTERN + MOV CX,TABLEN ;NUMBER OF TT ENTRIES +X2: + OUT DX,AX ;SETUP INVERSE PATTERN + LOOP X2 ;FILL ENTIRE XLATE TABLE +; + MOV SI,TTDATA ;ADDRESS OF TTDATA WITHOUT INC. + MOV BX,AX ;SAVE VALUE FOR COMPARE + MOV DI,055AAH ;NEXT PATTERN TO WRITE +X3: + MOV CX,TABLEN ;NUMBER OF TT ENTRIES +X4: + XCHG DX,SI ;GET IT INTO DX...SI GETS AUTO-INC + IN AX,DX ;READ TABLE ENTRY (HI BYTE -> AH) + XOR AX,BX ;DATA READ AS EXPECTED ? + AND AX,0FFFH ;MASK OFF HI NIBBLE (INVALID) + JNE XLA_ERROR ;NO - THE EXIT + XCHG DX,SI ;GET TTDATA WITH AUTO-INC + MOV AX,DI ;RECOVER NEXT PATTERN TO WRITE + OUT DX,AX ;WRITE IT THEN INCREMENT + LOOP X4 ;REPEAT TILL TABLE FILLED + + +; + CMP DI,0FFFFH ;LAST PASS ? + JE XLA_EXIT ;YES - THEN EXIT REG TEST +; + XCHG BX,DI ;BX GETS NEXT PATTERN TO TEST +; + CMP BX,055AAH ;LAST PASS FOR AA55,55AA PATTERN? + JNE X5 ;NO + MOV DI,0FF00H ;YES- PREPARE TO WRITE NEW PATTERN + JMP X3 ;DO IT +X5: + CMP BX,0FF00H ;READY TO READ 0FF00 PATTERN + JNE X6 ;NO + MOV DI,00FFH ;YES- PREPARE TO WRITE NEW PATTERN + JMP X3 ;DO IT +X6: + MOV DI,0FFFFH ;PREPARE TO SET ALL OF TT INACTIVE + JMP X3 ;DO IT +; +XLA_ERROR: +XLA_EXIT: RET +; +XLATST ENDP diff --git a/v4.0/src/DEV/XMA2EMS/XMA2EMS.ASM b/v4.0/src/DEV/XMA2EMS/XMA2EMS.ASM new file mode 100644 index 0000000..43f038f --- /dev/null +++ b/v4.0/src/DEV/XMA2EMS/XMA2EMS.ASM @@ -0,0 +1,2591 @@ + +PAGE 85,132 ;Set for 5182 Pageprinter + ;85 lines per page, 132 col per line + ;(formerly 60,132) + +;ͻ +; +; This is the new version of the XMA2EMS driver for DOS 3.3. +; It contains the following revisions and code flags: +; +; @RH0 - Correct scrolling problem +; @RH1 - Expand table to 32M +; @RH2 - Real Mode support (XMA/A card) +; @RH3 - Memory Expansion Option (MXO a.k.a. XMO) support +; @RH4 - LIM 4.0 support +; @RH5 - Multicard support +; @RH6 - WSP interfaces +; @RH7 - 386 XMA Emulator support +; @RH8 - Make driver reentrant +; +; AN007 P5134 - Provide variable planar size support. +; Modify linked list to forward link vs. the +; reverse linked list. +; +; AN008 P5150 - Fix incorrect access of slot 0 when no +; Catskill/Holster card is in slot 0. +; +;Ķ +; It should be noted that certain EMS calls will alter the contents +; of the translate table pointer for any supported memory cards or +; emulators (i.e. MXO, XMA, XMA/A cards, 80386 XMA emulator). +; Therefore, software that writes to the translate table(s) has the +; responsiblity of keeping the integrity of the TT pointer. For +; example, programs should disable interrupts between setting the +; TT pointer and writing the TT data. This will prevent: An interrupt +; occurring between the two, control going to another application +; that makes an EMS call and thus screws up the TT ptr. The EMS calls +; that do this are: +; Function # EMS Call +; 5 Map logical to physical page +; 8, 15/0 Save (Get) mapping array +; 9, 15/1 Restore (Set) mapping array +; 15/2 Get and Set mapping array +; +;ͼ + +;XMA2EMS provides a Lotus/Intel/Microsoft Expanded Memory (EMS) interface +;for the IBM Expanded Memory Adapter (XMA). + +;Program Property of Microsoft + +;Add the following statement to CONFIG.SYS +; DEVICE=[d:][path]XMA2EMS.SYS + + +;-----------------------------------------------------------------------; +; Equates go here ; +;-----------------------------------------------------------------------; +EMS_INT EQU 67H ;EMS INTERRUPT +EM_INT EQU 15H ;EM INTERRUPT ;an000; dms; +DK_Int equ 13h ;disk interrupt ;an004; dms; +EM_Size_Get EQU 88h ;get EM size ;an000; dms; +EMM_VERSION EQU 40H ;VERSION 4.0 +PF_HI_LIMIT EQU 0E000H ;highest allowable page frame segment +PF_LOW_LIMIT EQU 0A000H ;lowest allowable page frame segment +OK EQU 'OK' ;card is good +HW_ERROR EQU 'HW' ;card is not functional...HardWare error +SW_ERROR EQU 'SW' ;SoftWare error has been detected +PAGE_INHIBITTED EQU 0FFFFh ;Entry in the save area indicating + ; a page is currently inhibitted +REUSABLE_HANDLE EQU 'HR' ;Reusable (free) entry in the @RH1 + ; handle lookup table. Placed in @RH1 + ; the 'pages' field @RH1 +REUSABLE_SAVEA EQU 'SR' ;Reusable (free) entry in the @RH1 + ; handle save area. 0 is a valid @RH1 + ; page #, and 'FFFF' is for saving @RH1 + ; an inhibitted field, so S(ave) @RH1 + ; R(eusable) is stored. Page 5352 @RH1 + ; not a valid page (5352 = 333Meg) @RH1 + ;Page Allocation List entries + ; Allocated pages have the handle # +UNALLOCATED EQU 'U' ; Unused entry +ALLOCATED EQU 'X' ; Temporary...used by reallocate @RH4 +PAL_NULL EQU '--' ; End of list marker @RH8 +EXTENDED EQU 'ME' ; Extended memory (not for EMS use)@RH8 +BACMEM_ALLOC EQU 'MB' ; Allocated to back conventional @RH8 + ; memory (back disabled planar) +WSP_ALLOC EQU 'SW' ; Allocated to Workstation Program @RH8 + ; Pages kept as extended memory by: +RESR_EXT EQU 'ER' ; /E parameter +PREV_EXT EQU 'EP' ; Previously loaded drivers + ; These values are OK as long as the + ; # of handles supported (40h) is + ; not above the ascii 'B' (42h) +WARM_MASK EQU 1 ;ISOLATE WARM START BIT +OFFSET_IN_XREF EQU BYTE PTR[BX+SI] +LENGTH_IN_XREF EQU BYTE PTR[BX+SI+1] +PAGE_LIST_ENTRY EQU WORD PTR[SI + OFFSET PAGE_ALLOC_LIST] ; @RH8 +page_table_entry EQU byte PTR[SI + OFFSET PAGE_ALLOC_table] ;temp for assembl +XREF_TABLE_ENTRY EQU word PTR[DI + OFFSET HANDLE_XREF_TABLE] ; @RH1 +NUM_PHYSICAL_PAGES EQU 4 +STACK_SIZE EQU 100H +Instance_Size EQU 150 ;instance size ;an000; dms; +Instance_Count EQU 3 ;number of instances ;an000; dms; + + ;Ŀ + ; Common memory adapter declares + ; +SLOT_SETUP EQU 08h ;Mask to put the desired adapter @RH2 + ; slot into setup mode, activating @RH2 + ; the 10X registers @RH2 +CARD_ID_LO EQU 100H ;PS/2 Adapter card id low and @RH2 +CARD_ID_HI EQU 101H ; high bytes - read only @RH2 + ;Card IDs read from port 100,101 @RH2 +XMAA_CARD_ID EQU 0FEF7h ; XMA/A Card ID @RH2 +HLST_CARD_ID EQU 0FEFEh ; MXO @RH3 +NO_CARD EQU 0FFFFh ; No card present @RH5 + ;Values for the flag MEMCARD_MODE @RH5 + ; indicating what type of memory @RH5 + ; card is being used. @RH5 +XMA1_VIRT EQU 00000001B ; XMA 1...always in virtual +XMAA_VIRT EQU 00000010B ; XMA/A card (PS/2) in virtual +EMUL_VIRT EQU 00000100B ; XMA emulator on 80386 @RH7 +XMAA_REAL EQU 00001000B ; XMA/A in real mode...no banking @RH3 +HOLS_REAL EQU 00010000B ; MXO card @RH3 + ;Combinations +XMA1A_VIRT EQU 00000011B ; XMA1 or XMA/A in virtual mode +WSP_VIRT EQU 00000111B ; Any virtual mode...banking used + + ;Ŀ + ; XMA, XMA\A, and XMA emulator declares + ; + ; The XMA translate table is a 4K x 12 bit + ; array. A 12 bit address points to entries + ; in the TT. The data in the entry is: + ; + ; Bit Contents + ; 12 Inhibit bit (1 = inhibit xlate) + ; 10-0 On XMA 1, pointer to 4K block + ; for up to 4 meg capability + ; 11-0 On XMA/A, pointer to 4K block + ; for up to 8 meg capability + ; + ; + ;All are byte ports unless indicated + +X_CTRL_REG EQU 102H ;Control register - en/disable functions +X_CONF_REG EQU 105H ;Config (mem size), channel check reg. +RM_TTPTR_LO EQU 106H ;Translate table pointer low and +RM_TTPTR_HI EQU 107H ; high bytes +RM_TTDATA_LO EQU 103H ;TT data - high and low bytes +RM_TTDATA_HI EQU 104H ; Low byte (103) auto incs the TT ptr + + ;Virtual mode port addresses for: +TTPOINTER EQU 31A0H ; Translate Table Pointer (word) +TTDATA EQU 31A2H ; Translate Table Data (word) +AIDATA EQU 31A4H ; TT Data with auto increment (word) +IDREG EQU 31A6H ; Bank ID register +MODE_REG EQU 31A7H ; Mode register +DMACAPT EQU 31A8H ; DMA capture register + +CR_ROMSLEEP_DIS EQU 11011111B ;XMA/A control register mask to + ; disable the ROM on XMA/A card +XMA_TT_INHIBIT EQU 0000100000000000B ;XMA mask for an inhibitted TT entry +XMA_TT_MASK EQU 0000111111111111B ;XMA mask for anding off unused bits +EMUL_TTDATA_ON EQU 1000000000000000B ;XMA translate table data - mask for + ; the emulator. On XMA cards, data + ; is only 12 bits. On the emulator, + ; bit 15 turned on indicates data is + ; 15 bits. This allows the emulator + ; to use more than 8 Meg. Note that + ; both 0FFFh and FFFFh are inhibit. + + ;Ŀ + ; MXO declares + ; + ; The MXO translate table is a 1K x 8 bit + ; array. A 10 bit address points to entries + ; in the TT. The data in the entry is: + ; + ; Bit Contents + ; 8 Inhibit bit (0 = inhibit xlate) + ; 7-0 Pointer to 16K block for up to + ; 2 meg capability + ; + ; + ;All are byte ports +H_CARD_INFO EQU 102H ;Info Bits 7-1 mem size Bit 0 sleep +H_CC_PRES EQU 105H ;Channel check, presence (Bit 0) +H_TTPTR_LO EQU 106H ;Translate table pointer low and +H_TTPTR_HI EQU 107H ; high bytes +H_TTDATA EQU 103H ;TT data - one byte. No auto inc. + +H_TT_INHIBIT EQU 00000000B ;MXO value for setting inhibitted + ; translate table entry +H_TT_ENBMASK EQU 10000000B ;Pattern to test if TT entry read is + ; enabled. 'and' with entry,jz inhib + + ;EMS ERROR CODES +EMS_CODE80 EQU 80H ; Sotware malfunction +EMS_CODE81 EQU 81H ; Hardware malfunction +EMS_CODE82 EQU 82H ; This return code not used +EMS_CODE83 EQU 83H ; Handle not found +EMS_CODE84 EQU 84H ; Invalid function code +EMS_CODE85 EQU 85H ; All handles used +EMS_CODE86 EQU 86H ; Save or restore mapping error +EMS_CODE87 EQU 87H ; Not enough pages to satisfy request +EMS_CODE88 EQU 88H ; Not enough unallocated pages +EMS_CODE89 EQU 89H ; Can't allocate zero pages +EMS_CODE8A EQU 8AH ; Logical page out of range +EMS_CODE8B EQU 8BH ; Physical page out of range +EMS_CODE8C EQU 8CH ; Hardware save area is full +EMS_CODE8D EQU 8DH ; Save area already saved for handle +EMS_CODE8E EQU 8EH ; Save area not saved for this handle +EMS_CODE8F EQU 8FH ; Subfunction parameter not defined +;------------------------------------------------------------------- +EMS_CODE91 EQU 091H +EMS_CODE92 EQU 092H ; added for DMS ;an000; +EMS_CODE93 EQU 093H ;an000; +EMS_CODE94 EQU 094H ;an000; +EMS_CODE95 EQU 095H ;an000; +EMS_CODE96 EQU 096H ;an000; +EMS_CODE97 EQU 097H ;an000; +EMS_CODE98 EQU 098H ;an000; +EMS_CODE9E EQU 09EH ;an000; +EMS_CODE9C EQU 09CH ;an000; +;------------------------------------------------------------------- ;an000; +EMS_CODEA0 EQU 0A0h ; No matching handle +EMS_CODEA1 EQU 0A1h ; Duplicate handle name +EMS_CODEA2 EQU 0A2h ; Memory wrap error +EMS_CODEA3 EQU 0A3h ; Data in control structure corrupted +EMS_CODEA4 EQU 0A4h ; Access to this function denied + +;Ŀ +; Request Header (Common portion) +; +; This structure defines the portion that is common to +; all Request Headers. +; +; +RH EQU DS:[BX] ;addressability to Request Header structure + +RHC STRUC ;fields common to all request types + DB ? ;length of Request Header (including data) + DB ? ;unit code (subunit) +RHC_CMD DB ? ;command code +RHC_STA DW ? ;status + DQ ? ;reserved for DOS +RHC ENDS ;end of common portion + +CMD_INPUT EQU 4 ;RHC_CMD is INPUT request + +;status values for RHC_STA + +STAT_GOOD EQU 0000H ;invalid command code error +STAT_DONE EQU 0100H ;function complete status (OR on bit) +STAT_CMDERR EQU 8003H ;invalid command code error +STAT_CRC EQU 8004H ;CRC error +STAT_SNF EQU 8008H ;sector not found error +STAT_GENFAIL EQU 800CH ;general failure +NOT_BUSY EQU 11111101B ;busy bit (9) NOT BUSY mask (high order byte) +BUSY_MASK EQU 00000010B ;busy bit (9) BUSY mask (high order byte) + +;Ŀ +; Request Header for INIT command +; +; This structure defines the Request Header for the +; INIT command +; +; +RH0 STRUC + DB (TYPE RHC) DUP (?) ;common portion + +RH0_NUN DB ? ;number of units + ;set to 1 if installation succeeds, + ;set to 0 to cause installation failure +RH0_ENDO DW ? ;offset of ending address +RH0_ENDS DW ? ;segment of ending address +RH0_BPBO DW ? ;offset of BPB array address +RH0_BPBS DW ? ;segment of BPB array address +RH0_DRIV DB ? ;drive code (DOS 3 only) +RH0_ERR DW 0 ; error flag used by DOS - gga +RH0 ENDS + +RH0_BPBA EQU DWORD PTR RH0_BPBO ;OFFSET/SEGMENT OF BPB +;note RH0_BPBA at entry to init points to all after DEVICE= on CONFIG.SYS stmt + +;Ŀ +; Request Header for OUTPUT STATUS command +; +; This structure defines the Request Header for the +; Output Status command. +; +RH10 STRUC + DB (TYPE RHC) DUP (?) ;common portion +RH10 ENDS + + +;Ŀ +; Request Header for Generic IOCTL Request +; + +RH19 STRUC + DB (TYPE RHC) DUP (?) ; Reserve space for the header @RH6 + +RH19_MAJF DB ? ; Major function @RH6 +RH19_MINF DB ? ; Minor function @RH6 +RH19_SI DW ? ; Contents of SI @RH6 +RH19_DI DW ? ; Contents of DI @RH6 +RH19_RQPK DD ? ; Pointer to Generic IOCTL request packet @RH6 +RH19 ENDS + + +;Ŀ +; Map EMS INT 67H vector in low storage +; +; The vector for the interrupt handler for INT 67H +; is defined here. +; +INT_VEC SEGMENT AT 00H + ORG 4*EMS_INT +EMS_VEC LABEL DWORD +EMS_VECO DW ? ;offset +EMS_VECS DW ? ;segment +INT_VEC ENDS + +;Ŀ +; Map EM INT 15H vector in low storage +; +; The vector for the extended memory interrupt handler INT 15h +; is defined here. +; +INT_VEC15 SEGMENT AT 00H ;an000; dms; + ORG 4*EM_INT ;an000; dms; +EM_VEC LABEL DWORD ;an000; dms; +EM_VECO DW ? ;offset ;an000; dms; +EM_VECS DW ? ;segment ;an000; dms; +INT_VEC15 ENDS ;an000; dms; + + +;Ŀ +; Map INT 13h vector in low storage +; +; The vector for the disk access interrupt handler INT 13h +; is defined here. +; +INT_VEC13 SEGMENT AT 00H ;an004; dms; + ORG 4*DK_INT ;an004; dms; +DK_VEC LABEL DWORD ;an004; dms; +DK_VECO DW ? ;offset ;an004; dms; +DK_VECS DW ? ;segment ;an004; dms; +INT_VEC13 ENDS ;an004; dms; + +;ͻ +; This marks the start of the device driver code segment +;ͼ + +CSEG SEGMENT PARA PUBLIC 'CODE' + ASSUME CS:CSEG + +START EQU $ ;begin resident XMA2EMS data & code + +;DEVICE HEADER - must be at offset zero within device driver + DD -1 ;becomes pointer to next device header + DW 0C040H ;attribute (character device) + DW OFFSET STRATEGY ;pointer to device "strategy" routine + DW OFFSET IRPT ;pointer to device "interrupt handler" + DB 'EMMXXXX0' ;device name + + +;-----------------------------------------------------------------------; +; The next word is used to inform the 3270 Workstation Program ; +; which 4K block in XMA marks the start of EMS Expanded Memory. ; +;-----------------------------------------------------------------------; +EMS_START_IN_XMA DW 0 ;initially, memory manager uses all + +;-----------------------------------------------------------------------; +; The following is the Code Label: +;-----------------------------------------------------------------------; +COPYRIGHT DB '74X9921 (C)COPYRIGHT 1988 Microsoft ' + DB 'LEVEL 1.00 LICENSED MATERIAL - PROGRAM ' + DB 'PROPERTY OF Microsoft ' + +;-----------------------------------------------------------------------; +; Request Header (RH) address, saved here by "strategy" routine ; +;-----------------------------------------------------------------------; +RH_PTRA LABEL DWORD +RH_PTRO DW ? ;offset +RH_PTRS DW ? ;segment + db 7 dup(0) ;align following tables on seg. + +;Ŀ +; HANDLE LOOKUP TABLE +; +; This table keeps track of EMS handles and pages assigned +; to each handle. An entry exists for each of the 64 handles +; supported. If the handle is active, the first field will +; contain the number of pages it owns. Otherwise, the field +; will indicate the handle is free. The second field is a head +; pointer to the handle's pages in the linked Page Allocation List. +; +; +H_LOOKUP_STRUC STRUC ;Structure for Handle lookup table @RH1 +H_PAGES DW REUSABLE_HANDLE ;If handle is active, # of owned @RH8 + ; pages. Init to reusable handle RH8 +H_PAL_PTR DW PAL_NULL ;Head ptr for owned pages in PAL @RH8 +H_NAME DB 8 DUP(0) ;Name - new for LIM 4.0 @GGA +H_BANK DB 0 ;If virtual, this handle's bank @RH6 +xref_pages dw 0 ;temp to compile +xref_index dw 0 ;temp to compile +H_LOOKUP_STRUC ENDS + +NUM_HANDLES EQU 64 ;One structure @RH1 +HANDLE_LOOKUP_TABLE H_LOOKUP_STRUC <0,,,,,> ; initialize handle 0 + H_LOOKUP_STRUC NUM_HANDLES-1 DUP (<>) ; for OS use - gga + +;-----------------------------------------------------------------------; +; HANDLE CROSS REFERENCE (XREF) TABLE ; +; Each entry in the Handle_Xref_Table points to a corresponding ; +; page in the page allocation table. Entries in the XREF table ; +; are contiguous for a handle, while PAT entries may not be. ; +;-----------------------------------------------------------------------; +XREF_TABLE_LEN EQU 2048 ; @RH1 + +HANDLE_XREF_TABLE DW XREF_TABLE_LEN DUP(0) ; Changed from byte to @RH1 + ; word table @RH1 +XREF_TABLE_END EQU ($) ;Used for table shift on deallocate @RH1 +;Ŀ +; PAGE ALLOCATION LIST +; +; This is the structure pointed to by the handle lookup table. +; The Page Allocation list is a linked list governing EMS pages. +; Each 16KB EMS page has an entry in the PAGE_ALLOC_LIST. +; The entries correspond to the physical blocks on the extended +; memory cards (ex. the first 2 Meg card in a system will use the +; first 128 entries in the PAL). +; At initialization time, a 'free' pointer will point to the last +; (top) page in the PAL, and all entries will be linked from top +; down. Whenever pages are allocated they are retreived from the +; free chain, and deallocated pages are placed back on the free +; chain. +; +; +EMS_PAGES_SUPPORTED EQU 1024 ;Support up to 16 Megabytes of EMS @RH8 + +PAGE_ALLOC_LIST DW EMS_PAGES_SUPPORTED DUP(0) + ;Page Allocation List (PAL) @RH8 +page_alloc_table db 1024 dup(unallocated) ;temp for assemble +;-----------------------------------------------------------------------; +; HANDLE SAVE AREA ; +; Each handle has 4 entries where the page frame map can ; +; be stored. Each entry contains a word for the handle and ; +; a word for the logical page active there. If no save has ; +; occurred for a handle, then the logical page field in the ; +; save area will contain a value indicating it's reusable. ; +;-----------------------------------------------------------------------; +H_SAVEA_ENTRY STRUC ;This is an overlay for one page's @RH5 +HSA_HNDL DW ? ; entry in the handle save area. @RH5 +HSA_LP DW ? ; It is used to clear the save @RH5 +H_SAVEA_ENTRY ENDS ; area after a restore. While not @RH5 + ; directly used by the structure @RH5 + ; below, its size should match @RH5 + ; that for one page entry @RH5 + +H_SAVE_STRUC STRUC ;Structure for Handle Save Area @RH1 +PG0_HNDL DW 0 +PG0_LP DW REUSABLE_SAVEA +PG1_HNDL DW 0 +PG1_LP DW REUSABLE_SAVEA +PG2_HNDL DW 0 +PG2_LP DW REUSABLE_SAVEA +PG3_HNDL DW 0 +PG3_LP DW REUSABLE_SAVEA +PGFE_HNDL DW 0 ;AN006; +PGFE_LP DW REUSABLE_SAVEA ;AN006; +PGFF_HNDL DW 0 ;AN006; +PGFF_LP DW REUSABLE_SAVEA ;AN006; +H_SAVE_STRUC ENDS + +HANDLE_SAVE_AREA H_SAVE_STRUC NUM_HANDLES DUP (<>) + ;One structure for each handle @RH1 + +H_SAVE_ENTRY EQU WORD PTR[DI + OFFSET HANDLE_SAVE_AREA] ; @RH1 + + +;------------------------------------------------------------------- +; +; mappable_phys_page table +; +; This table is used by function 5800h +; +;------------------------------------------------------------------- + +mappable_phys_page_struct STRUC ; define the structure + phys_page_segment dw ? ; segment + phys_page_number dw ? ; page ID + ppm_handle dw ? ; handle, -1 means unused + ppm_log_page dw ? ; logical page, -1 means unused +mappable_phys_page_struct ENDS + +; allocate the storage + +map_table mappable_phys_page_struct <-1, -1, -1, -1> ;p0 no default + mappable_phys_page_struct <-1, -1, -1, -1> ;p1 no default + mappable_phys_page_struct <-1, -1, -1, -1> ;p2 no default + mappable_phys_page_struct <-1, -1, -1, -1> ;p3 no default + mappable_phys_page_struct <-1, -1, -1, -1> ;p254 no default + mappable_phys_page_struct <-1, -1, -1, -1> ;p255 no default + +map_count_def equ 6 ; default 6 +map_count dw 0 ; +map_size dw type mappable_phys_page_struct * map_count_def ; size of default table +ppm_size equ 6 ;size of partial page map entry + +; flags and a word used in setting up map_table stuff, see parmpars.inc + +p0_flag equ 0001h ; flags used to indicate which p's were +p1_flag equ 0002h ; set on command line +p2_flag equ 0004h +p3_flag equ 0008h +p254_flag equ 0010h +p255_flag equ 0020h +frame_flag equ 8000h ; special flag used when FRAME= was found + +page_flags dw 0 ; word of above flags used in setting map_table +parse_flag dw 0 ; flag used to indicate command line args were encountered + +;------------------------------------------------------------------- +; rom scan stuff +;------------------------------------------------------------------- +family1 equ 1 +micro_channel equ 2 + + +rom_scan_type dw micro_channel ; +segment_error dw 0 ; segment error flag = 0 means all OK + +;----------------------------------------------------------------------- +; Tables added for multicard support +; +; These tables manage the mapping of multiple memory cards +; on a PS/2 Model 50 and 60. These systems may have a combination +; of MXO and XMA/A cards. The model 80 is excluded, since +; it uses the XMA emulator. +; +;----------------------------------------------------------------------- + ;----------------------------------------------- + ; Memory Card Descriptor Table + ;----------------------------------------------- + +MEM_CARD_STRUC STRUC ;Structure for the memory cards @RH5 +CARD_ID DW NO_CARD ;Card ID from ports 100 and 101 @RH5 +CARD_SLOT DB ? ;Physical slot of card (0 based) @RH5 +START_PG_NUM DW ? ;Starting and ending #s of the @RH5 +END_PG_NUM DW ? ; pages this card has within the @RH5 +MEM_CARD_STRUC ENDS ; total EMS page pool (0 based) @RH5 + + ;Memory Card Table - entries are @RH5 + ; filled in ascending order (from @RH5 + ; slot 0) for each card found. @RH5 + ; MXOs scanned 1st, then XMA/A @RH5 +MAX_SLOTS EQU 8 ;Max of 8, but most @RH5 +MEM_CARD_TABLE MEM_CARD_STRUC MAX_SLOTS DUP (<>) ; likely 1 or 2 cards @RH5 + + ;----------------------------------------------- + ; Multicard Page Frame Descriptor Table + ;----------------------------------------------- +MULTIC_PM_STRUC STRUC ;Structure for storing the card ID @RH5 +PG_CARD DW NO_CARD ; and slot of the card currently @RH5 +PG_SLOT DB 0 ; mapped to this page of the page @RH5 +MULTIC_PM_STRUC ENDS ; frame @RH5 + + ;Multicard Page Mapping Table. + ; Entry for each page of the page + ; frame (including pages FE & FF) +MC_PM_TABLE MULTIC_PM_STRUC MAP_COUNT_DEF DUP (<>) + + ;----------------------------------------------- + ; Assorted Multicard declares + ;----------------------------------------------- +NUM_MEM_CARDS DW 0 +NUM_OF_SLOTS DB ? ;Number of adapter slots RR 8 TB 4 @RH2 +WTT_CARD_SLOT DB ? ;Slot # of the memory card being @RH2 + ; used to map a page @RH2 + + +Instance_Entry_Struc struc ;required data in first 2 entries ;an000; dms; + IE_Alloc_Byte db ? ;instance allocated byte ;an000; dms; + IE_Saved_DI_Reg dw ? ;saved di register ;an000; dms; +Instance_Entry_Struc ends ;end struc ;an000; dms; + +;-----------------------------------------------------------------------; +; Table of DOS command processing routine entry points ; +; ; +; An '*' in the comment area indicates the command is handled ; +; by meaningful code. All other commands simply set a good ; +; return code and exit back to DOS. ; +;-----------------------------------------------------------------------; +CMD_TABLE LABEL WORD + DW OFFSET INIT ; 0 - *Initialization + DW OFFSET MEDIA_CHECK ; 1 - Media check + DW OFFSET BLD_BPB ; 2 - Build BPB + DW OFFSET INPUT_IOCTL ; 3 - IOCTL input + DW OFFSET INPUT ; 4 - Input + DW OFFSET INPUT_NOWAIT ; 5 - Non destructive input no wait + DW OFFSET INPUT_STATUS ; 6 - Input status + DW OFFSET INPUT_FLUSH ; 7 - Input flush + DW OFFSET OUTPUT ; 8 - Output + DW OFFSET OUTPUT_VERIFY ; 9 - Output with verify + DW OFFSET OUTPUT_STATUS ;10 - *Output status + DW OFFSET OUTPUT_FLUSH ;11 - Output flush + DW OFFSET OUTPUT_IOCTL ;12 - IOCTL output + DW OFFSET DEVICE_OPEN ;13 - Device OPEN + DW OFFSET DEVICE_CLOSE ;14 - Device CLOSE + DW OFFSET REMOVABLE_MEDIA ;15 - Removable media + DW OFFSET INVALID_FCN ;16 - Invalid IOCTL function gga ;AN003; + DW OFFSET INVALID_FCN ;17 - Invalid IOCTL function gga ;AN003; + DW OFFSET INVALID_FCN ;18 - Invalid IOCTL function gga ;AN003; + DW OFFSET GENERIC_IOCTL ;19 - *Generic IOCTL function gga ;AN003; + DW OFFSET INVALID_FCN ;20 - Invalid IOCTL function gga ;AN003; + DW OFFSET INVALID_FCN ;21 - Invalid IOCTL function gga ;AN003; + DW OFFSET INVALID_FCN ;22 - Invalid IOCTL function gga ;AN003; + DW OFFSET GET_LOG_DEVICE ;23 - Invalid IOCTL function gga ;AN003; +MAX_CMD EQU ($-CMD_TABLE)/2 ;highest valid command follows + DW OFFSET SET_LOG_DEVICE ;24 - Invalid IOCTL function gga ;AN003; + +;-----------------------------------------------------------------------; +; Table of Expanded Memory Manager routine entry points ; +;-----------------------------------------------------------------------; +FCN_TABLE LABEL WORD + DW OFFSET EMM_STATUS ;40 - Get status of memory manager + DW OFFSET Q_PAGE_FRAME ;41 - Get segment of page frame + DW OFFSET Q_PAGES ;42 - Get number of alloc & unalloc pgs + DW OFFSET GET_HANDLE ;43 - Request ID and allocate n pages + DW OFFSET MAP_L_TO_P ;44 - Map logical to physical page + DW OFFSET DE_ALLOCATE ;45 - Deallocate all pages of ID n + DW OFFSET Q_VERSION ;46 - Get version number + DW OFFSET SAVE_MAP ;47 - Save mapping array + DW OFFSET RESTORE_MAP ;48 - Restore mapping array + DW OFFSET GET_PORT_ARRAY ;49 - Get I/O port array + DW OFFSET GET_L_TO_P ;4A - Get logical to physical array + DW OFFSET Q_OPEN ;4B - Get number of open ID's + DW OFFSET Q_ALLOCATE ;4C - Get pages allocated to ID n + DW OFFSET Q_OPEN_ALL ;4D - Get all ID's and pages allocated + DW OFFSET GET_SET_MAP ;4E - Group of subfunctions that Get + ;and/or Set the page map + +;------------------------------------------------------------------- ;GGA +; these functions were added for LIM 4.0 support ;GGA +;------------------------------------------------------------------- ;GGA + ;GGA + dw offset partial_map ; 4F - get/set partial page map ;GGA + dw offset map_mult ; 50 - map/unmap multiple handle pages ;GGA + dw offset reallocate ; 51 - reallocate pages ;GGA + dw offset handle_attrib ; 52 - get/set handle attributes ;GGA + dw offset handle_name ; 53 - get/set handle name ;GGA + dw offset handle_dir ; 54 - get handle directory ;GGA + dw offset alter_and_jump ; 55 - alter page map and jump ;GGA + dw offset alter_and_call ; 56 - alter page map and call ;GGA + dw offset exchng_region ; 57 - move/exchange memory region ;GGA + dw offset address_array ; 58 - Get mappable physical address array ;GGA + dw offset hardware_info ; 59 - Get extended momory hardware information ;GGA + dw offset alloc_raw ; 5A - allocate raw pages ;GGA + dw offset alternate_map ; 5B - alternate map register set ;GGA + dw offset prepare_boot ; 5C - Prepare for WarmBoot ;GGA +MAX_FCN EQU ($-FCN_TABLE)/2 ; highest valid command follows ;GGA + dw offset enable_os ; 5D - enable/disable OS/E functions ;GGA + +;-----------------------------------------------------------------------; +; Data variables go here ; +;-----------------------------------------------------------------------; +PAGE_FRAME_STA DW 0D000H ;STARTING SEG OF PAGE FRAME +TOTAL_SYS_PAGES DW 1024/16 ;Total number of 16k pages on the + ; memory card(s) that are initially + ; expanded memory. On PS/2 50 + 60, + ; pages used as extended are subtracted. +TOTAL_EMS_PAGES DW 1024/16 ;Pages left after conventional + ; memory is backed +FREE_PAGES DW 1024/16 ;Total unallocated pages for EMS use +EM_Ksize dw ? ;size in Kb of extended memory ;an000; dms; +CARD_STATUS DW 'OK' ;STATUS OF THE HARDWARE + ; DEFAULT='OK' FAILURE='HW' +MANAGER_STATUS DW 'OK' ;STATUS OF THE MEMORY MANAGER + ; DEFAULT='OK' FAILURE='SW' +STARTING_BLOCK DW 0 ;number of 4K blocks reserved by pinta +OVERFLOW DB 0 +WARM_START DB 'N' ;initially not a warm start +MULTIPLIER DW ? ;Used for figuring table offsets @RH1 +TEN DW 10 ; via multiplication...not the @RH1 +SIXTEEN DW 16 ; most efficient, but flexible @RH1 +MEMCARD_MODE DB XMA1_VIRT ;Flag indicating the type of memory@RH2 + ; card being used. Default to @RH2 + ; XMA 1 card. +BANKID DB ? ;Current XMA Bank ID @RH1 +BLOCKS_PER_PAGE DW 4 ;XMA blocks per EMS page (multiply)@RH1 +SEG_PER_PAGE DW 1024 ;Segments(16 bytes) per EMS page @RH1 + +INTV15 LABEL DWORD ;an000; dms; +INTV15O DW ? ;offset ;an000; dms; +INTV15S DW ? ;segment ;an000; dms; + +INTV13 LABEL DWORD ;an004; dms; +INTV13O DW ? ;offset ;an004; dms; +INTV13S DW ? ;segment ;an004; dms; + +PAL_FREE_PTR DW PAL_NULL +;------------------------------------------------------------------- +; define some flags and storage for the enable/disable functions +;------------------------------------------------------------------- + +ose_enabled equ 1 ; flags used to enable/disable OS/E fcns ;an000; +ose_disabled equ 0 ;an000; + +access_code dd 0 ; access code used by OS/E functions ;an000; +ose_functions dw ose_enabled ; OS/E functions 1 = enabled, 0 = disabled ;an000; + +;------------------------------------------------------------------- +; define some storage for the ROM scan logic +;------------------------------------------------------------------- +where_to_start dw 0a000h ; start ROM scan at A000 + + +;-----------------------------------------------------------------------; +; INT 15H Interrupt Handler routine ; +;-----------------------------------------------------------------------; + +;========================================================================= +; XMA_INT15 : This routine traps the INT 15h requests to perform its +; own unique services. This routine provides 1 INT 15h +; service; function 8800h. +; +; Service - Function 8800h: Obtains the size of EM from the word +; value EM_KSize +; Call With: AX - 8800h +; Returns : AX - Kbyte size of EM +; +;========================================================================= +XMA_INT15 PROC ;an000; dms; + + cmp ah,EM_Size_Get ;an000; dms;function 88h? + jne XMA_INT15_Jump ;an000; dms;no - jump to old INT 15h + mov ax,cs:EM_KSize ;an000; dms;return size + clc ;an000; dms;clear CY + jmp XMA_INT15_Exit ;an000; dms;exit handler + +XMA_INT15_Jump: ;an000; dms; + + jmp cs:INTV15 ;an000; dms;jump to org. vector + +XMA_INT15_Exit: ;an000; dms; + + + iret ;an000; dms; + +XMA_INT15 ENDP ;an000; dms; + +include I13HOOK.INC ;an004; dms; + + +;ͻ +; Device "strategy" entry point +; +; Retain the Request Header address for use by Interrupt routine +;ͼ +STRATEGY PROC FAR + MOV CS:RH_PTRO,BX ;offset + MOV CS:RH_PTRS,ES ;segment + RET +STRATEGY ENDP + + +;ͻ +; DOS Device "interrupt" entry point +;ͼ +IRPT PROC FAR ;device interrupt entry point + PUSH DS ;save all registers Revised + PUSH ES + PUSH AX + PUSH BX + PUSH CX + PUSH DX + PUSH DI + PUSH SI + ;BP isn't used, so it isn't saved + CLD ;all moves forward + + LDS BX,CS:RH_PTRA ;get RH address passed to "strategy" into DS:BX + + MOV AL,RH.RHC_CMD ;command code from Request Header + CBW ;zero AH (if AL > 7FH, next compare will + ;catch that error) + + CMP AL,MAX_CMD ;if command code is not too high + JNA IRPT_CMD_OK ; then handle the command + MOV RH.RHC_STA,STAT_CMDERR ;"invalid command" and error + JMP IRPT_CMD_EXIT + +IRPT_CMD_OK: + MOV RH.RHC_STA,STAT_GOOD ;initialize return to "no error" + + ADD AX,AX ;double command code for table offset + MOV DI,AX ;put into index register for JMP + +;At entry to command processing routine: +; DS:BX = Request Header address +; CS = VDISK code segment address +; AX = 0 + + CALL CS:CMD_TABLE[DI] ;call routine to handle the command + + +IRPT_CMD_EXIT: ;return from command routine + ;AX = value to OR into status word + LDS BX,CS:RH_PTRA ;restore DS:BX as Request Header pointer + OR RH.RHC_STA,STAT_DONE ;add "done" bit to status word + POP SI ;restore registers + POP DI + POP DX + POP CX + POP BX + POP AX + POP ES + POP DS + + RET ;far return back to DOS +IRPT ENDP + +include genioctl.inc ; include code for genioctl fcn gga + +;ͻ +; Set 'OUTPUT STATUS' entry point +;ͼ +OUTPUT_STATUS PROC ;Output status + LDS BX,CS:RH_PTRA ;DS:BX as pointer to request header + MOV AX,RH.RHC_STA ;get status word +OS1: + AND AH,NOT_BUSY ;turn off busy bit +OS2: + MOV RH.RHC_STA,AX ;write it back to request header + RET +OUTPUT_STATUS ENDP + + +IGNORED_CMDS PROC +IRPT_CMD_ERROR: ;CALLed for unsupported character mode commands + +MEDIA_CHECK: ;Media check +BLD_BPB: ;Build BPB +INPUT_IOCTL: ;IOCTL input +INPUT: ;Input +INPUT_NOWAIT: ;Non destructive input no wait +INPUT_STATUS: ;Input status +INPUT_FLUSH: ;Input flush +OUTPUT: ;Output +OUTPUT_VERIFY: ;Output with verify +OUTPUT_FLUSH: ;Output flush +OUTPUT_IOCTL: ;IOCTL output +DEVICE_OPEN: ;Device OPEN +DEVICE_CLOSE: ;Device CLOSE +REMOVABLE_MEDIA: ;Removable media +INVALID_FCN: ; invalid IOCTL function ;AN003; +GET_LOG_DEVICE: ; get logical device ;AN003; +SET_LOG_DEVICE: ; set logical device ;AN003; + RET +IGNORED_CMDS ENDP + + + +;ͻ +; Entry point for EMM interrupt handler +; +; +; The interrupt vector 67H points here. +; +; On Entry: +; The AH register contains the function number and the +; necessary parameters are passed in registers defined +; by the Expanded Memory Specification. +; +; On Exit: +; (AH) = 0 if no error +; (AH) = error # if error +; +; other register contain information as specified by EMS +; otherwise all registers remain unchanged +;ͼ +EMS_INT67 PROC + push bp ;save instance pointer ;an000; dms; + call Set_Instance ;set BP to proper instance entry ;an000; dms; + jc INT67_Instance_Exit ;not enough instances ;an000; dms; + + mov cs:[bp].IE_Saved_DI_Reg,di ;save reg in instance table ;an000; dms; + + + SUB AH,40H ;adjust to range of fcn table + CMP AH,0 ;too low? +; $IF GE,AND + JNGE $$IF1 + CMP AH,MAX_FCN ;too high? +; $IF LE + JNLE $$IF1 + MOV DI,OFFSET INT67_EXIT ;get common exit addr + PUSH DI ;put it on stack + PUSH AX ;save ax...al may contain parms + XCHG AH,AL ;adjust + XOR AH,AH ; for ax + ADD AX,AX ; to be offset into table + MOV DI,AX ;use di for index into table + POP AX ;recover ax ... parms in al +;At entry to function handler: +; CS = INT67 code segment +; TOP OF STACK is return address, INT67_EXIT + + JMP CS:FCN_TABLE[DI] ;call routine handler +; $ENDIF +$$IF1: + MOV AH,EMS_CODE84 ;function call out of range + + + +INT67_EXIT: + + mov di,cs:[bp].IE_Saved_DI_Reg ;save reg in instance table ;an000; dms; + call Reset_Instance ;deallocte instance entry ;an000; dms; + +INT67_Instance_Exit: + + pop bp ;restore instance pointer ;an000; dms; + + IRET ;end of interrupt 67 +EMS_INT67 ENDP + + + +;ͻ +; Entry point for EMM STATUS Function 1 +; +; on entry: (AH) = '40'x +; +; on exit: (AH) = status +; all other registers preserved +;ͼ +EMM_STATUS PROC + CMP MANAGER_STATUS,SW_ERROR ;is manager ok? +; $IF E ;if no then + JNE $$IF3 + MOV AH,EMS_CODE80 ;indicate bad status + JMP ST1 ;exit +; $ENDIF +$$IF3: + CMP CARD_STATUS,HW_ERROR ;is card ok? +; $IF E ;if no then + JNE $$IF5 + MOV AH,EMS_CODE81 ;indicate bad status + JMP ST1 ;exit +; $ENDIF +$$IF5: + XOR AH,AH ;set good return status +ST1: + RET ;return to caller +EMM_STATUS ENDP + + +;ͻ +; Entry point for GET PAGE FRAME Function 2 +; +; on entry: (AH) = '41'x +; +; on exit: (AH) = status +; (BX) = segment address of page frame +; all other registers preserved +;ͼ +Q_PAGE_FRAME PROC + push cx ;save regs ;an000; dms; + push dx ; ;an000; dms; + push si ; ;an000; dms; + + cmp cs:Map_Count,4 ;enough frames? ;an000; dms; + jb Q_Page_Frame_Error_Exit ;no - exit with error ;an000; dms; + + mov cx,4h ;loop only 4 times ;an000; dms; + xor ax,ax ;page number reference ;an000; dms; + mov si,offset cs:Map_Table ;point to map table ;an000; dms; + mov bx,cs:[si].Phys_Page_Segment ;set start segment value ;an000; dms; + mov dx,bx ;segment reference ;an000; dms; + +Q_Page_Frame_Loop: + + cmp cs:[si].Phys_Page_Number,ax ;page matches reference? ;an000; dms; + jne Q_Page_Frame_Error_Exit ;no - exit with error ;an000; dms; + + cmp cs:[si].Phys_Page_Segment,dx ;page frame match reference ;an000; dms; + jne Q_Page_Frame_Error_Exit ;no - exit with error ;an000; dms; + + add si,Type Mappable_Phys_Page_Struct;adjust pointer ;an000; dms; + add dx,400h ;next page frame ;an000; dms; + inc ax ;next page ;an000; dms; + loop Q_Page_Frame_Loop ;continue loop ;an000; dms; + + xor ah,ah ;set good return ;an000; dms; + jmp Q_Page_Exit ;exit the routine ;an000; dms; + +Q_Page_Frame_Error_Exit: + + mov ah,EMS_Code80 ;signal software error ;an000; dms; + +Q_Page_Exit: + + pop si ;restore regs ;an000; dms; + pop dx ; ;an000; dms; + pop cx ; ;an000; dms; + + RET +Q_PAGE_FRAME ENDP + + +;ͻ +; Entry point for QUERY TOTAL & UNALLOCATED PAGES Function 3 +; +; on entry: (AH) = '42'x +; +; on exit: (AH) = status +; (BX) = number of pages available in expanded memory +; (DX) = total number of pages in expanded memory +; all other registers preserved +;ͼ +Q_PAGES PROC + + XOR AH,AH ;Init good return status + MOV BX,CS:FREE_PAGES ;bx gets num unalloc pages + MOV DX,CS:TOTAL_EMS_PAGES ;dx gets num total pages + CMP BX,DX ;If unalloc <= total then OK + JNA Q_PAGES_RET ;Otherwise sumptin's rong + MOV AH,EMS_CODE81 ; set that return code +Q_PAGES_RET: + RET +Q_PAGES ENDP + + + +;ͻ +; Entry point for GET HANDLE AND ALLOCATE Function 4 +; +; on entry: (AH) = '43'x +; (BX) = number of pages to allocate +; +; on exit: (AH) = status +; (DX) = handle +; AX,DX Revised...all other registers preserved +;ͼ +GET_HANDLE PROC + PUSH BX + PUSH CX + PUSH DI + PUSH SI + PUSH DS ;save these registers + + PUSH CS ;get cs + POP DS ;into ds + + ;Remove test for BX = 0. This is @RH4 + ; valid under LIM 4.0 + + cmp bx,0 ;0 page allocate is invalid ;an000; dms; + jne GH_OKCount ;0 pages not requested ;an000; dms; + mov ah,EMS_Code89 ;flag 0 pages requested ;an000; dms; + jmp GH_Exit ;exit routine ;an000; dms; + +GH_OKCount: + + CMP BX,TOTAL_EMS_PAGES ;Enough total EMS pages? + JNA GH_OKTOTAL + MOV AH,EMS_CODE87 + JMP GH_EXIT + +GH_OKTOTAL: + cli ;ints off ;an000; dms; + CMP BX,FREE_PAGES ;Enough unallocated pages? + sti ;ints on ;an000; dms; + JNA GH_OKFREE + MOV AH,EMS_CODE88 + JMP GH_EXIT + ;----------------------------------------------------- + ; Search for a free handle @RH1 + ;----------------------------------------------------- +GH_OKFREE: + MOV CX,NUM_HANDLES ;loop counter is #handles + DEC CX ;handle 0 reserved for op. sys. @RH1 + MOV DX,1 ;handle assignment set to 1 @RH1 + MOV DI,TYPE H_LOOKUP_STRUC ;init table index to 1st entry @RH1 +;-------------------------------- + CLI ;interrupts OFF during allocation +;-------------------------------- +GH_FREEHSRCH: + CMP HANDLE_LOOKUP_TABLE.H_PAGES[DI],REUSABLE_HANDLE + ;Is this handle available? @RH1 + JE GH_HFREE ;yes end search dx=handle id @RH1 + INC DX ;next handle assignment + ADD DI,TYPE H_LOOKUP_STRUC ;next entry in handle lookup @RH1 + ;repeat for all table entries + LOOP GH_FREEHSRCH + MOV AH,EMS_CODE85 ;no available handles + JMP GH_EXIT ;go to exit ;GGA + + ;----------------------------------------------------- + ; If here then there's enough pages for request. @RH1 + ; DX = handle #, DI = ptr to hndl lookup entry @RH1 +GH_HFREE: + + MOV CX,NUM_HANDLES ;loop counter + DEC CX ;handle 0 reserved for op. sys. @RH1 + ;si = index to hndl lookup tbl @RH1 + MOV SI,TYPE H_LOOKUP_STRUC ; for adding pages (skip 0 entry) @RH1 + XOR AX,AX ;clear page counter + CLC ;clear carry for addition +GH_PAGESUM: + CMP HANDLE_LOOKUP_TABLE.H_PAGES[SI],REUSABLE_HANDLE + JE GH_PGSUM_BOT ;If handle is free don't add @RH4 + ADD AX,HANDLE_LOOKUP_TABLE.H_PAGES[SI] + ;add lengths (pages) of PALs @RH1 + ADD SI,TYPE H_LOOKUP_STRUC ; next entry in handle lookup @RH1 +GH_PGSUM_BOT: + LOOP GH_PAGESUM + CMP AX,TOTAL_EMS_PAGES ;pages in handle lookup > total? @RH1 + JNA GH_CALCHLUP ;no OK @RH1 + MOV AH,EMS_CODE80 ;software error..we screwed up @RH1 + JMP GH_EXIT ;go to exit @RH1 ;GGA + +GH_CALCHLUP: ;calculate entry in hndl lkup tbl @RH1 + + cli ;ints off ;an001; dms; + mov cx,bx ;alloc count ;an000; dms; + call EMS_Page_Contig_Chk ;do we have contig pgs. ;an001; dms; + jnc GH_Alloc ;yes continue process ;an001; dms; + mov ah,EMS_Code88 ;no signal error ;an001; dms; + sti ;ints on ;an001; dms; + jmp GH_Exit ;exit routine ;an001; dms; + +GH_Alloc: + + call EMS_Link_Set ;set up links ;an001; dms; + + + sub Free_Pages,bx ;free = free - requested pages + mov Handle_LookUp_Table.H_Pages[di],bx ;page count ;an000; dms; + mov Handle_LookUp_Table.H_Pal_Ptr[di],si ;initialize to ptr for ;ac001; dms; + ; pages + sti ;ints on ;an001; dms; + xor ah,ah ;clear flag ;an000; dms; + + +GH_EXIT: ;GGA + + POP DS + POP SI + POP DI + POP CX + POP BX + + RET +GET_HANDLE ENDP + + +;ͻ +; Entry point for MAP LOGICAL TO PHYSICAL PAGE Function 5 +; +; on entry: (AH) = '44'x +; (AL) = physical page j +; (BX) = logical page i +; (DX) = handle +; +; on exit: (AH) = status +; all other registers preserved +;ͼ + +MAP_L_TO_P PROC + PUSH BX + PUSH CX + PUSH DX + PUSH DI + PUSH SI + PUSH DS ;save these registers + PUSH CS ;get cs + POP DS ;into ds + + CMP BX,PAGE_INHIBITTED ;If the log pg = inhibit, ignore @RH4 + JNE MLP_HANDLE_CHK ; checking handle ID. Restore PF @RH4 + MOV SI,BX ; calls this proc, and a saved pg @RH4 + JMP SHORT MLP_GET_SEG ; that has never been mapped will @RH4 + ; have no handle ID @RH4 + +MLP_HANDLE_CHK: + CMP DX,NUM_HANDLES-1 ;handle within range ? + JBE MLP_DXINRANGE + MOV AH,EMS_CODE83 ;handle not found + JMP MLP_EXIT ;exit +MLP_DXINRANGE: + push ax ;save affected regs ;an000; dms; + push dx ; ;an000; dms; + MOV AX,DX ; (DX:AX used in MUL @RH1 + MOV DX,TYPE H_LOOKUP_STRUC ;SI = entry's offset into @RH8 + MUL DX ; the handle lookup table @RH8 + MOV SI,AX ; @RH1 + pop dx ;restore affected regs ;an000; dms; + pop ax ; ;an000; dms; + + MOV CX,HANDLE_LOOKUP_TABLE.H_PAGES[SI] ;CX = handle's pages @RH8 + CMP CX,REUSABLE_HANDLE ;Handle have pages? + JNE MLP_DXHASPAGES ;Yes next check + MOV AH,EMS_CODE83 ;No handle not used + JMP MLP_EXIT ; set error and exit +MLP_DXHASPAGES: + CMP BX,TOTAL_EMS_PAGES ;Logical pg requested (0 based) @RH1 + JB MLP_BX_LE_TOT ; less than or = to total pages? @RH1 + MOV AH,EMS_CODE8A ;No... logical page out of range + JMP MLP_EXIT ;exit +MLP_BX_LE_TOT: + CMP BX,CX ;Logical page requested <= number @RH1 + JB MLP_LP_OK ; of pages for this handle? + MOV AH,EMS_CODE8A ;No...error log. page out of range @RH1 + JMP MLP_EXIT ;exit + ;Ŀ + ; Convert handle's logical page to + ; relative page in the EMS pool (SI) + ; +MLP_LP_OK: ;Get this handle's @RH8 + MOV DI,HANDLE_LOOKUP_TABLE.H_PAL_PTR[SI] ; head index to PAL @RH8 + CMP BX,0 ;If 1st pg wanted @RH8 + JE MLP_GOT_PHYS_PG ; then we've got it @RH8 + MOV CX,BX ;Else scan linked PAL@RH8 + ; for log pg - 1. @RH8 +MLP_SCAN_PAL: ; (log p is 0 based) @RH8 + SHL DI,1 ;2 bytes per PAL ent + ; mult is slow here + MOV DI,PAGE_ALLOC_LIST[DI] ; This loop will get @RH8 + LOOP MLP_SCAN_PAL ; the index of the @RH8 +MLP_GOT_PHYS_PG: ; desired page @RH8 + MOV SI,DI ;SI = page on card @RH8 + + + + + ;Ŀ + ; Get seg addr of the phys page (DI) +MLP_GET_SEG: ; + XOR DI,DI ;Clear offset into mappable phys. @RH4 + MOV CX,MAP_COUNT ; page table. Loop for # entries. @RH4 +MLP_PP_CHECK: + CMP AL,BYTE PTR MAP_TABLE.PHYS_PAGE_NUMBER[DI] ;AX = table pp? @RH4 + JE MLP_PP_OK ;Yes..get seg @RH4 + ADD DI,TYPE MAPPABLE_PHYS_PAGE_STRUCT ;No..check next @RH4 + LOOP MLP_PP_CHECK ; table entry @RH4 + MOV AH,EMS_CODE8B ;If here physical page not found @RH1 + JMP MLP_EXIT ; in mappable phys pg table..Error @RH1 +MLP_PP_OK: + MOV MAP_TABLE.PPM_LOG_PAGE[DI],BX ;Place the logical pg @RH4 + MOV MAP_TABLE.PPM_HANDLE[DI],DX ; the mappable pp table @RH4 + MOV DI,MAP_TABLE.PHYS_PAGE_SEGMENT[DI] ;DI= page's PC seg addr @RH1 + + ;------------------------------------- + ; Map L to P depending on memory card + ;------------------------------------- +MLP_VIRTUAL: + TEST MEMCARD_MODE,WSP_VIRT ;Using either an XMA 1, XMA/A, or @RH2 + JZ MLP_MC_TEST ; XMA Emulator in virtual mode? @RH2 + CALL W_EMSPG_XVIRT ;Yes..Map one logical page to + JMP MLP_GOODRC ; physical page using 310X regs + ;Else not virtual...use real mode +MLP_MC_TEST: ;If system has multiple cards, @RH5 + CMP NUM_MEM_CARDS,1 ; then adjust absolute EMS page to @RH5 + JNA MLP_REAL ; its corresponding page on the @RH5 + CALL MLP_MCARD_SETUP ; card to be used @RH5 +MLP_REAL: + CMP MEMCARD_MODE,XMAA_REAL ;XMA/A card (on PS/2 mod 50 or 60) @RH3 + JNE MLP_HLST ; in real mode (WSP not loaded)? @RH3 + CALL W_EMSPG_XREAL ;Map one logical page to physical @RH2 + JMP MLP_GOODRC +MLP_HLST: ;If not XMA then MXO + CALL W_EMSPG_HLST ;Map one logical page to physical @RH3 +MLP_GOODRC: + XOR AH,AH ;Good return status..mapping + ; should always be successful +MLP_EXIT: + + POP DS ;restore these registers + POP SI + POP DI + POP DX + POP CX + POP BX + + RET +MAP_L_TO_P ENDP + + + + + +;Ŀ +; Subroutine: WRITE TRANSLATE TABLE FOR EMS PAGE +; XMA VIRTUAL MODE +; +; This routine will write the Translate Table so that the +; specified 16K page of 'real' address will be mapped to a +; specified 16K page of XMA physical memory. +; This routine is called if the XMA card is in 'virtual' +; mode - i.e. bank swapping is active. The 16 bit 31AX ports +; are used for setting up the XMA translate table. +; The XMA 1 card and XMA emulator are always in virtual +; mode. The XMA\A card is in virtual mode if bank switching +; is active (used by the 3270 Workstation Program). +; +; On entry: (DI) is starting segment in PC address space. +; Must be on 4K boundary else is rounded +; down to the nearest 4K. +; (SI) absolute EMS page number (not handle relative) RH4 +; or FFFFh if page is to be inhibitted RH4 +; +; + +W_EMSPG_XVIRT PROC + MOV DX,IDREG ;Save the current bank ID @RH1 + IN AL,DX ; (bank of the requestor). Write @RH1 + MOV BANKID,AL ; to the trans. table for this bank@RH1 + + MOV AX,DI ;Get the PC seg. addr of the page @RH1 + XCHG AL,AH ;Div by 256 (Segments per 4K block)@RH1 + MOV AH,BANKID ;Join with the bank ID to get the @RH1 + MOV DX,TTPOINTER ; ptr to the translate table entry @RH1 + OUT DX,AX ;Set TT ptr @RH1 + + MOV AX,SI ;Get absolute EMS page number @RH4 + CMP AX,PAGE_INHIBITTED ;Is TT entry to be inhibitted? @RH4 + JE VM_TTDATA_OK ;Yes..write the FFFF in AX @RH4 + MUL BLOCKS_PER_PAGE ;Else convert page to XMA 4K block @RH1 + TEST MEMCARD_MODE,EMUL_VIRT ;If running on the emulator then @RH7 + JZ VM_TTDATA_OK ; turn high order bit of data on @RH7 + OR AX,EMUL_TTDATA_ON ; allowing >8M support on emulator @RH7 +VM_TTDATA_OK: + MOV CX,BLOCKS_PER_PAGE ;Set up one page - loop on blocks @RH1 + MOV DX,AIDATA ; per page using the auto inc reg @RH1 +VM_WRITE: + OUT DX,AX ;Write TT entry, inc TT ptr @RH1 + CMP AX,PAGE_INHIBITTED ;Inhibit TT entry? + JE VM_NEXT_TT ;Yes..don't inc AX + INC AX ;Inc block ptr..contiguous blocks @RH1 +VM_NEXT_TT: + LOOP VM_WRITE ;Loop for all blocks in a page @RH1 + + RET +W_EMSPG_XVIRT ENDP + + +;Ŀ +; Subroutine: WRITE TRANSLATE TABLE FOR EMS PAGE +; XMA REAL MODE +; +; This routine performs basically the same functions as +; the above routine. It is called if the XMA/A card is in +; 'real' mode (i.e. bank switching not active, planar memory +; is not disabled). The 8 bit 10X ports are used for setting +; up the XMA translate table. +; +; +W_EMSPG_XREAL PROC + + MOV AL,WTT_CARD_SLOT ;Put the XMA/A card into setup @RH2 + OR AL,SLOT_SETUP ; mode @RH2 + OUT 96h,AL ; @RH2 + + XOR AL,AL ;Set the translate table ptr by @RH2 + MOV DX,RM_TTPTR_HI + OUT DX,AL ; dividing the PC seg. addr in DI @RH2 + MOV AX,DI + XCHG AL,AH ; by 256 (Segments per 4K block). @RH2 + MOV DX,RM_TTPTR_LO + OUT DX,AL ;High byte always 0..no banking @RH2 + + MOV AX,SI ;Get absolute EMS page number @RH4 + CMP AX,PAGE_INHIBITTED ;Is TT entry to be inhibitted? @RH4 + JE RM_TTDATA_OK ;Yes..write the FFFF in AX @RH4 + MUL BLOCKS_PER_PAGE ;Else convert page to XMA 4K block @RH1 +RM_TTDATA_OK: + MOV CX,BLOCKS_PER_PAGE ;Set up one page - loop on blocks @RH2 + ; per page using the auto inc regs @RH2 +RM_WRITE: + XCHG AH,AL ;Write TT data high byte first, @RH2 + MOV DX,RM_TTDATA_HI ; then write low byte. This is @RH2 + OUT DX,AL ; not an auto increment port. @RH2 + XCHG AH,AL ; @RH2 + MOV DX,RM_TTDATA_LO ; @RH2 + OUT DX,AL ; @RH1 + CMP AX,PAGE_INHIBITTED ;Inhibit TT entry? + JE RM_NEXT_TT ;Yes..don't inc AX + INC AX ;Inc block ptr..contiguous blocks @RH1 +RM_NEXT_TT: + LOOP RM_WRITE ;Loop for all blocks in a page @RH1 + + MOV AL,0 ;Reset the slot ID @RH5 + OUT 96h,AL ; @RH5 + RET +W_EMSPG_XREAL ENDP + +;Ŀ +; Subroutine: WRITE TRANSLATE TABLE FOR EMS PAGE +; Memory Expansion Option (MXO) +; +; This routine is used to map a logical page to a physical +; page off the MXO card. MXO has 16K blocks, as opposed +; to 4K on the XMA. The 8 bit 10X ports are used for setting +; up MXO's translate table. Note that the data in the +; translate table is only 8 bits, and the high order bit is a +; 0 to inhibit translation (where inhibit = 1 on XMA). +; +; +W_EMSPG_HLST PROC + PUSH CX ; @RH3 + + MOV AL,WTT_CARD_SLOT ;Put the MXO card into setup @RH3 + OR AL,SLOT_SETUP ; mode @RH3 + OUT 96h,AL ; @RH3 + + MOV AX,DI ;Set the MXO translate table @RH3 + MOV CL,10 ; ptr by dividing the PC segment @RH3 + SHR AX,CL ; addr in DI by 1024 @RH3 + MOV DX,H_TTPTR_LO ; (segments per 16K MXO block). @RH3 + OUT DX,AL ; @RH3 + XCHG AL,AH ; @RH3 + MOV DX,H_TTPTR_HI ; @RH3 + OUT DX,AL ; @RH3 + + MOV AX,SI ;Get absolute EMS page number @RH4 + CMP AX,PAGE_INHIBITTED ;Is TT entry to be inhibitted? @RH4 + JE HM_TTDATA_INH ;Yes write MXO inhibit pattern @RH4 + ;Else turn on enable and write pg @RH3 + OR AL,H_TT_ENBMASK ; (no need to convert.. 16K EMS @RH3 + JMP SHORT HM_WRITETT ; page = 16K MXO block) @RH3 +HM_TTDATA_INH: ; + MOV AL,H_TT_INHIBIT ;AL = MXO TT inhibit data @RH3 +HM_WRITETT: + MOV DX,H_TTDATA ; Write to the 1 MXO TT entry. @RH3 + OUT DX,AL ; @RH3 + MOV AL,0 ;Reset the slot ID @RH5 + OUT 96h,AL ; @RH5 + + POP CX ; @RH3 + RET +W_EMSPG_HLST ENDP + +;Ŀ +; Subroutine: MULTIPLE MEMORY CARD SETUP +; +; This subroutine selects the correct card in a multicard +; system for mapping a physical page. Given the absolute page +; number within the EMS pool (SI), it finds the card to use for +; this page, and converts SI to the offset of the page within +; this card. Before this new page is mapped, it may be necessary +; to disable the translate table entry of the card that's +; currently mapped. +; +; On entry: (DI) is starting segment in PC address space. +; (SI) absolute EMS page number (not handle relative) +; or FFFFh if page is to be inhibitted +; +; On exit: (DI) is unchanged. +; (SI) offset of the page within the selected card +; or FFFFh if page is to be inhibitted +; WTT_CARD_SLOT = Slot # of the new card to map +; MEMCARD_MODE = Flag indicating if XMA/A or MXO +; +; + +PG_NEW_CARD_ID DW ? ;Holders for the ID and the slot # @RH5 +PG_NEW_CARD_SLOT DB ? ; of the card that will be used @RH5 + ; in the new mapping @RH5 +MC_TABLE_OFFSET DW ? ;Holder for offset into the @RH5 + ; multicard page mapping table @RH5 + +MLP_MCARD_SETUP PROC + PUSH AX + PUSH CX + ;------------------------------------- + ; Get the ID and slot of the card to + ; make active. Convert SI to be + ; the correct page within this card. + ;------------------------------------- + PUSH DI ;Loop through the mem @RH5 + XOR DI,DI ; card table to find @RH5 + MOV CX,NUM_MEM_CARDS ; card used to map the @RH5 +MC_GET_CARD: ; absolute page (SI) @RH5 + CMP MEM_CARD_TABLE.END_PG_NUM[DI],SI ;If the last pg this @RH5 + JAE MC_FOUND_CARD ; card maps <= SI then @RH5 + ADD DI,TYPE MEM_CARD_STRUC ; use this card @RH5 + LOOP MC_GET_CARD ;Else check next card @RH5 + ; Note: if SI = FFFF @RH5 + ; the last card is @RH5 + ; selected. This is @RH5 + ; OK, since it doesn't @RH5 + ; matter which is inh @RH5 +MC_FOUND_CARD: ; @RH5 + MOV AX,MEM_CARD_TABLE.CARD_ID[DI] ;Save the card ID and @RH5 + MOV PG_NEW_CARD_ID,AX ; the slot # of the @RH5 + MOV AL,MEM_CARD_TABLE.CARD_SLOT[DI] ; card used to map @RH5 + MOV PG_NEW_CARD_SLOT,AL ; the new page. @RH5 + MOV AX,MEM_CARD_TABLE.START_PG_NUM[DI] ;If SI is not inhibit, @RH5 + CMP SI,PAGE_INHIBITTED ; convert SI from the @RH5 + JE MC_DEACTIVATE ; absolute pg number @RH5 + SUB SI,AX ; to the offset of the @RH5 + ; page within this card @RH5 + + ;------------------------------------- +MC_DEACTIVATE: ; Deactivate (inhibit) the translate + POP DI ; table entry of the current card. + ;------------------------------------- + ; Search for the seg addr in the @RH5 + ; map phys pg table to get the @RH5 + ; corresponding entry in the @RH5 + PUSH SI ; multicard page mapping table @RH5 + XOR SI,SI ;SI = offset into map phy pg table @RH5 + XOR AX,AX ;AX = offset into multic pm table @RH5 + MOV CX,MAP_COUNT ;Loop on # phys pgs (incl FE & FF) @RH5 +MC_SRCH_MPP: ; @RH5 + CMP MAP_TABLE.PHYS_PAGE_SEGMENT[SI],DI ;If no segment match @RH5 + JE MC_CHECK_CUR_PG ; then next entry in @RH5 + ADD SI,TYPE MAPPABLE_PHYS_PAGE_STRUCT ; map phys pg tbl & @RH5 + ADD AX,TYPE MULTIC_PM_STRUC ; multicard pm table @RH5 + LOOP MC_SRCH_MPP ; @RH5 + + ;Examine the current card ID and @RH5 + ; slot used for this page @RH5 +MC_CHECK_CUR_PG: + MOV MC_TABLE_OFFSET,AX ;Save mc tbl offset @RH5 + MOV SI,AX ; and put it in SI @RH5 + CMP MC_PM_TABLE.PG_CARD[SI],NO_CARD ;If the page is @RH5 + JE MC_MAP_NEW ; inhibitted or if @RH5 + MOV AL,MC_PM_TABLE.PG_SLOT[SI] ; the new page is @RH5 + CMP AL,PG_NEW_CARD_SLOT ; on the same card @RH5 + JE MC_MAP_NEW ; as the old page @RH5 + ; then dont inhibit @RH5 + + ;Inhibit TT entry for current card @RH5 + MOV WTT_CARD_SLOT,AL ;Save slot # and ID @RH5 + MOV AX,MC_PM_TABLE.PG_CARD[SI] ; of current card @RH5 + MOV SI,PAGE_INHIBITTED ;Page = inhibitted @RH5 + CMP AX,XMAA_CARD_ID ;If card = XMA/A @RH5 + JNE MC_INH_HLST ; then inh XMA/A TT @RH5 + CALL W_EMSPG_XREAL ; entry for pg via @RH5 + JMP SHORT MC_MAP_NEW ; real mode regs @RH5 +MC_INH_HLST: ;Else inhibit TT @RH5 + CALL W_EMSPG_HLST ; entry for MXO @RH5 + + ;------------------------------------- + ; Activate (enable) the translate + ; table entry of the new card. +MC_MAP_NEW: ;------------------------------------- + ;Set the multicard page frame @RH5 + ; table for the new card @RH5 + POP SI ;Restore EMS page @RH5 + PUSH DI ; and save pc seg addr. @RH5 + MOV DI,MC_TABLE_OFFSET ; @RH5 + MOV AL,PG_NEW_CARD_SLOT ;Store slot # of new card in @RH5 + MOV MC_PM_TABLE.PG_SLOT[DI],AL ; multc pm tbl and in variable @RH5 + MOV WTT_CARD_SLOT,AL ; used by map log to phys proc @RH5 + CMP SI,PAGE_INHIBITTED ;If new pg is not inhibitted @RH5 + JE MC_NEWID_INH ; then set card ID field in @RH5 + MOV AX,PG_NEW_CARD_ID ; the multicard page mapping @RH5 + MOV MC_PM_TABLE.PG_CARD[DI],AX ; table to new card ID @RH5 + JMP SHORT MC_SET_FLGS ; @RH5 +MC_NEWID_INH: ; @RH5 + MOV AX,NO_CARD ;Else set card ID as no card @RH5 + MOV MC_PM_TABLE.PG_CARD[DI],AX ; @RH5 + ;............................ + ;Set flags so main MLP proc @RH5 + ; can map the new page @RH5 +MC_SET_FLGS: ;............................. @RH5 + POP DI ;Restore PC seg addr + CMP PG_NEW_CARD_ID,XMAA_CARD_ID ;Set the flag that tells @RH5 + JNE MC_MAP_HLST ; the main Map Log to P proc @RH5 + MOV MEMCARD_MODE,XMAA_REAL ; which subroutine to call @RH5 + JMP SHORT MC_END_PROC ;At this point, @RH5 +MC_MAP_HLST: ; DI = PC segment addr of page @RH5 + MOV MEMCARD_MODE,HOLS_REAL ; SI = page's offset into card @RH5 +MC_END_PROC: ; WTT_CARD_SLOT = card slot # @RH5 + POP CX ; MEMCARD_MODE = flag showing @RH5 + POP AX ; if card is XMAA or MXO @RH5 + RET ; @RH5 +MLP_MCARD_SETUP ENDP + +;ͻ +; Entry point for DEALLOCATE PAGES Function 6 +; +; on entry: (AH) = '45'x +; (DX) = handle +; +; on exit: (AH) = status +; AX Revised...all other registers preserved +;ͼ +DE_ALLOCATE PROC + PUSH BX ;save these registers + PUSH CX + PUSH DX + PUSH DI + PUSH SI + PUSH DS + PUSH ES ; @RH1 + + PUSH CS ;get this code segment + POP DS ;into ds + PUSH CS ;Set up ES for shifting (MOVSB) @RH1 + POP ES ; the PAL table @RH1 + + cmp dx,0 ;handle zero? ;an000; dms; + jne D_Check_Handle ;no continue ;an000; dms; + mov bx,0 ;reallocate to a page count of 0 ;an000; dms; + call Reallocate ; ;an000; dms; + jmp DA_Exit ;exit routine ;an000; dms; + +D_Check_Handle: + + CMP DX,NUM_HANDLES-1 ;handle within range ? + JBE D_OKRANGE ;if not then... + MOV AH,EMS_CODE83 ;handle not found + JMP DA_EXIT ;exit +D_OKRANGE: ;check if active (valid) handle + PUSH DX ;Save handle id @RH1 + MOV AX,DX ;set up indexing into h lookup @RH1 + MOV DX,TYPE H_LOOKUP_STRUC ; @RH8 + MUL DX ;get handle lookup entry offset @RH8 + POP DX ;Restore handle id @RH1 + MOV DI,AX ;Put offset into index reg @RH1 + + CMP HANDLE_LOOKUP_TABLE.H_Pages[DI],REUSABLE_HANDLE + ;Handle has pages? @RH1 + JNE D_OKHNDL ;Yes OK handle + MOV AH,EMS_CODE83 ;No handle not in use. error. + JMP DA_EXIT ;exit + ;----------------------------------------------------- +D_OKHNDL: ; Before deallocation can continue, insure the @RH1 + ; page frame map is not saved under this handle @RH1 + ;----------------------------------------------------- + PUSH DX ;Save handle id @RH1 + MOV AX,DX ;Get the correct offset @RH1 + MOV DX,TYPE H_SAVE_STRUC ; into the handle save @RH8 + MUL DX ; area for this handle @RH8 + POP DX ;Restore handle id @RH1 + MOV SI,AX ; @RH1 +D_HSAVECHK: + CMP HANDLE_SAVE_AREA.PG0_LP[SI],REUSABLE_SAVEA + JE D_PAT_UPDATE ;If the 1st entry for this handle @RH1 + MOV AH,EMS_CODE86 ; in the save area is not free + JMP DA_EXIT ; then in use...exit with error + ;----------------------------------------------------- + ; Update Page Allocation List - unallocate +D_PAT_UPDATE: + + PUSH DX ;Save handle id @RH1 + + + + MOV CX,HANDLE_LOOKUP_TABLE.H_PAGES[DI] ;Get the # of pages @RH1 + MOV AX,HANDLE_LOOKUP_TABLE.H_PAL_PTR[DI] ;Load si with ptr @RH1 + MOV SI,AX ;pass ptr ;an000; dms; + + push cx ;save loop count ;an000; dms; + + cmp cx,0 ;handle has 0 pages? ;an001; dms; + je D_Depat_Exit1 ;yes - don't changes ptr;an001; dms; + + mov ax,cs:PAL_Free_Ptr ;no - dealloc pages ;an001; dms; + mov cs:PAL_Free_Ptr,si ;set free ptr to root of;an001; dms; + ; handle list + dec cx ;don't loop past last pg;an001; dms; + +D_DEPAT: + + ;this loop scans to + ;the end of the allocated + ;chain + + cmp cx,0 ;end of deallocate? ;an000; dms; + je D_Depat_Exit ;yes - exit ;an000; dms; + shl si,1 ;no - adjust to index ;an001; dms; + mov si,Page_Alloc_List[si] ;get new ptr val ;an001; dms; + dec cx ;dec loop ctr ;an001; dms; + jmp D_DEPAT ;continue ;an000; dms; + +D_DEPAT_EXIT: + + shl si,1 ;adjust to index value ;an001; dms; + mov Page_Alloc_List[si],ax ;pt. last page to orig. ;an001; dms; + ; free ptr. + +D_Depat_Exit1: + + pop cx ;restore loop count ;an000; dms; + pop dx ;restore handle ;an000; dms; + + push ds ;save regs ;an000; dms; + push si ; ;an000; dms; + + mov ax,cs ;swap segs ;an000; dms; + mov ds,ax ; ;an000; dms; + mov si,offset cs:Null_Handle_Name ;point to null handle ;an000; dms; + mov ax,5301h ;set handle name func ;an000; dms; + call Handle_Name ;set the handle name to ;an000; dms; + ; nulls + pop si ;restore regs ;an000; dms; + pop ds ; ;an000; dms; + + cli ;ints off ;an000; dms; + add cs:Free_Pages,cx ;free up page ;an000; dms; + mov Handle_LookUp_Table.H_Pages[di],Reusable_Handle ;deallocate ;an000; dms; + ; handle + sti ;ints on ;an000; dms; + + xor ah,ah ;clear flag ;an000; dms; + +DA_EXIT: + + POP ES ; @RH1 + POP DS + POP SI + POP DI + POP DX + POP CX + POP BX + + RET +DE_ALLOCATE ENDP + + +;==================================================================== +; Deallocate_Chain - This routine deallocates a page from a +; handle and links it to the free list +; +; Inputs : SI - PTR to entry to deallocate +; +; Outputs : SI - PTR to next entry to deallocate +; +;==================================================================== + +Deallocate_Chain proc ;deallocate page ;an000; dms; + + push ax ;save regs ;an000; dms; + push bx ; ;an000; dms; + push cx ; ;an000; dms; + + cli ;ints off ;an000; dms; + + mov bx,si ;alloc_ptr ;an000; dms; + + mov ax,si ;get page_ptr ;an000; dms; + mov dx,Type Page_Alloc_List ;get entry size ;an000; dms; + mul dx ;get pointer val ;an000; dms; + mov si,ax ;page_ptr ;an000; dms; + + mov ax,Page_List_Entry ;page_ptr value ;an000; dms; + mov cx,cs:PAL_Free_PTR ;free_ptr ;an000; dms; + + + mov cs:PAL_Free_PTR,bx ;new free_ptr ;an000; dms; + mov Page_List_Entry,cx ;new free_ptr value ;an000; dms; + mov si,ax ;next page to deallocate;an000; dms; + sti ;ints on ;an000; dms; + + pop cx ;restore regs ;an000; dms; + pop bx ; ;an000; dms; + pop ax ; ;an000; dms; + + ret ; ;an000; dms; + +Deallocate_Chain endp ; ;an000; dms; + +;ͻ +; Entry point for QUERY MEMORY MANAGER VERSION Function 7 +; +; on entry: (AH) = '46'x +; +; on exit: (AH) = status +; all other registers preserved +;ͼ +Q_VERSION PROC + MOV AL,EMM_VERSION ;al get version number + XOR AH,AH ;good return code + RET +Q_VERSION ENDP + + + +;ͻ +; Entry point for SAVE MAPPING CONTEXT Function 8 +; +; on entry: (AH) = '47'x +; (DX) = handle assigned to the interrupt service +; routine (i.e. save map under this handle). +; +; on exit: (AH) = status +; all other registers preserved +;ͼ +SAVE_MAP PROC + PUSH DX + PUSH DI + PUSH SI + PUSH DS + PUSH ES ;save these registers + + PUSH CS ;get cs + POP DS ;into ds + PUSH CS ;Get CS into ES (save area is in + POP ES ; this segment) + + CMP DX,NUM_HANDLES-1 ;handle within range ? + JBE SM_DXINRANGE ;if not then... + MOV AH,EMS_CODE83 ;handle not found + JMP SM_EXIT ;exit +SM_DXINRANGE: + PUSH DX ;Handle destroyed by MUL @RH1 + MOV AX,DX ;SI = requested handle's @RH1 + MOV DX,TYPE H_LOOKUP_STRUC ; offset into the handle @RH8 + MUL DX ; lookup table @RH8 + MOV SI,AX ; @RH1 + POP DX ;Restore handle ID @RH1 + + CMP HANDLE_LOOKUP_TABLE.H_Pages[SI],REUSABLE_HANDLE + JNE SM_HACTIVE ;If handle is in use (active), ok @RH1 + MOV AH,EMS_CODE83 ;else handle not in use; error + JMP SM_EXIT ;exit +SM_HACTIVE: + MOV AX,DX ;DI = requested handle's @RH1 + MOV DX,TYPE H_SAVE_STRUC ; offset into the handle @RH1 + MUL DX ; save area @RH1 + MOV DI,AX ;Add the table base to @RH1 + ADD DI,OFFSET HANDLE_SAVE_AREA ; make ES:DI a pointer @RH1 + + ;------------------------------------- + ; Insure save area free for this hndl +SM_AREACHECK: ;------------------------------------- + CMP [DI].PG0_LP,REUSABLE_SAVEA + JE SM_SAVE_OK ;If 1st entry free then OK to save @RH1 + MOV AH,EMS_CODE8D ;Else page map already saved for + JMP SM_EXIT ; this handle. Exit with error +SM_SAVE_OK: + CALL SAVE_PGFRM_MAP ;Save to area pointed to by ES:DI @RH1 + XOR AH,AH ;Set good return code +SM_EXIT: + POP ES ;restore these registers + POP DS + POP SI + POP DI + POP DX + RET ;return to caller +SAVE_MAP ENDP + +;-----------------------------------------------------------------------; +; Subroutine: SAVE PAGE FRAME MAP ; +; ; +; purpose: To save the map of the 4 pages within the ; +; page frame to a save area pointed to by ES:DI. ; +; The handle ID and logical page active within each ; +; of the 4 physical pages is saved. Each is a word ; +; value. ; +; called by: Save mapping array (Function 8) using a handle ID ; +; and our save area. ; +; Get page map (Function 15 subfunction 0) without ; +; a handle ID using the application's save area. ; +; ; +; on entry: ES:DI points to save area ; +; ; +; on exit: All registers preserved ; +;-----------------------------------------------------------------------; +SAVE_PGFRM_MAP PROC + PUSH AX ;save these registers + PUSH CX + PUSH DI + PUSH SI + PUSH DS + + PUSH CS ;get this segment into DS + POP DS + ;------------------------------------- + ; Read the current handle ID and log + ; pg #s in the mappable phys pg table + ;------------------------------------- + CLD ;Set direction for STOSW forward @RH5 + XOR SI,SI ;Clear offset into mappable phys. @RH5 + MOV CX,map_count ; page table. Loop for # entries @RH5 +SM_HLP_STORE: ;Store the word for the @RH5 + MOV AX,MAP_TABLE.PPM_HANDLE[SI] ; currently active handle@RH5 + STOSW ; and logical page into @RH5 + MOV AX,MAP_TABLE.PPM_LOG_PAGE[SI] ; the save area at ES:DI @RH5 + STOSW ; STOSW moves AX to ES:DI@RH5 + ADD SI,TYPE MAPPABLE_PHYS_PAGE_STRUCT ;Next entry in mpp table @RH5 + LOOP SM_HLP_STORE ; @RH5 + + POP DS ;Recover these registers + POP SI + POP DI + POP CX + POP AX + RET ;return to caller +SAVE_PGFRM_MAP ENDP + + +;ͻ +; Entry point for RESTORE MAPPING CONTEXT Function 9 +; +; on entry: (AH) = '48'x +; (DX) = handle assigned to the interrupt service +; routine (i.e. handle map was saved under). +; +; on exit: (AH) = status +; all other registers preserved +;ͼ +RESTORE_MAP PROC + PUSH BX + PUSH CX + PUSH DX + PUSH DI + PUSH SI + PUSH DS ;save these registers + + PUSH CS ;Get CS into DS (save area is in + POP DS ; this segment) + + CMP DX,NUM_HANDLES-1 ;handle within range ? + JBE RM_DXINRANGE ;if not then... + MOV AH,EMS_CODE83 ;handle not found + JMP RM_EXIT ;exit +RM_DXINRANGE: + PUSH DX ;Handle destroyed by MUL @RH1 + MOV AX,DX ;SI = requested handle's @RH1 + MOV DX,TYPE H_LOOKUP_STRUC ; offset into the handle @RH1 + MUL DX ; lookup table @RH1 + MOV SI,AX ; @RH1 + POP DX ;Restore handle ID @RH1 + + CMP HANDLE_LOOKUP_TABLE.H_Pages[SI],REUSABLE_HANDLE + JNE RM_HACTIVE ;If handle is in use (active), ok @RH1 + MOV AH,EMS_CODE83 ;else handle not in use; error + JMP RM_EXIT ;exit +RM_HACTIVE: + MOV AX,DX ;SI = requested handle's @RH1 + MOV DX,TYPE H_SAVE_STRUC ; offset into the handle @RH1 + MUL DX ; save area @RH1 + MOV SI,AX ;Add the table base to @RH1 + ADD SI,OFFSET HANDLE_SAVE_AREA ; make DS:SI a pointer @RH1 + + ;------------------------------------- + ; Insure save area used for this hndl +RM_AREACHECK: ;------------------------------------- + CMP [SI].PG0_LP,REUSABLE_SAVEA ;Unused save table entry? @RH1 + JNE RM_SAVE_OK ;No used..OK check next @RH1 + MOV AH,EMS_CODE8E ;Yes error ..no page map + JMP RM_EXIT ; saved. Exit. + + ;------------------------------------- + ; Call RESTORE_PGFRM_MAP +RM_SAVE_OK: ;------------------------------------- + CALL RESTORE_PGFRM_MAP ;Restore page frame map + CMP AH,0 ;Successful? + JNE RM_EXIT ;No exit + + ;------------------------------------- + ; Clear the save area for the handle + ;------------------------------------- + ;DS:SI still ptr to save area @RH5 + MOV CX,map_count ;Clear all saved entries @RH5 +RM_CLEAR_SA: ;Use an overlay to mark the @RH5 + MOV [SI].HSA_LP,REUSABLE_SAVEA ; save area free - put reusabl @RH5 + ADD SI,TYPE H_SAVEA_ENTRY ; indicator in the log p field @RH5 + LOOP RM_CLEAR_SA ; @RH5 + +RM_EXIT: + POP DS ;restore these registers + POP SI + POP DI + POP DX + POP CX + POP BX + RET ;return to caller +RESTORE_MAP ENDP + +;-----------------------------------------------------------------------; +; Subroutine: RESTORE PAGE FRAME MAP ; +; ; +; purpose: To restore the map of the 4 pages within the ; +; page frame from a save area pointed to by DS:SI. ; +; The save area consists of a handle ID and logical ; +; page for each of the 4 physical pages. Each is a ; +; word value. ; +; called by: Restore mapping context (Function 9) using a ; +; handle ID and our save area. ; +; Set page map (Function 15 subfunction 1) without ; +; a handle ID using the application's save area. ; +; ; +; on entry: DS:SI points to the save area ; +; ; +; on exit: (AX) = Status ; +; All other registers preserved ; +; ; +;-----------------------------------------------------------------------; +RESTORE_PGFRM_MAP PROC + PUSH BX + PUSH CX + PUSH DX + PUSH DI + PUSH SI + + XOR DI,DI ;Use for mappable phys page table @RH5 + MOV CX,map_count ;Loop for all pages in page frame @RH5 +RP_RSTR_LP: ; @RH5 + PUSH DS ;Get the phys page from @RH5 + MOV AX,MAP_TABLE.PHYS_PAGE_NUMBER[DI] ; the map phys pg tbl @RH5 + POP DS ; (only AL is used) @RH5 + MOV DX,[SI] ;DX = Handle ID..inc SI @RH5 + ADD SI,TYPE PG0_HNDL ; by len needed for hnd @RH5 + MOV BX,[SI] ;BX = Log. page..inc SI @RH5 + ADD SI,TYPE PG0_LP ; by len needed for lp @RH5 + CALL MAP_L_TO_P ;Call main Map module @RH5 + CMP AH,0 ;If an error occurred @RH5 + JE RP_NEXT ; anywhere set software @RH5 + MOV AH,EMS_CODE80 ; error and exit @RH5 + JMP SHORT RP_EXIT ;Else map next page @RH5 +RP_NEXT: ;Advance offset into @RH5 + ADD DI,TYPE MAPPABLE_PHYS_PAGE_STRUCT ; map phys page table @RH5 + LOOP RP_RSTR_LP ;Loop for 4 EMS pages @RH5 + +RP_EXIT: + POP SI + POP DI ;Restore entry regs + POP DX + POP CX + POP BX + RET ;return to caller +RESTORE_PGFRM_MAP ENDP + + +;ͻ +; Entry point for GET EMM HANDLE COUNT Function 12 +; +; on entry: (AH) = '4B'x +; +; on exit: (AH) = status +; (BX) = number of open (active) EMS handles +; all other registers preserved +;ͼ +Q_OPEN PROC + PUSH CX ;save these registers + PUSH SI + PUSH DS + + PUSH CS ;get this segment + POP DS ;into ds + + XOR BX,BX ;clear open handle counter + XOR SI,SI ;SI = offset of handle lookup table@RH1 + MOV CX,NUM_HANDLES ;loop counter = number of handles +QH_CHECKALL: + CMP HANDLE_LOOKUP_TABLE.H_Pages[SI],REUSABLE_HANDLE + ;Handle have pages? @RH1 + JE QH_NEXTH ;No..not active..next @RH1 + INC BX ;Else open handle @RH1 +QH_NEXTH: + ADD SI,TYPE H_LOOKUP_STRUC ;Point to next handle lookup entry @RH1 + LOOP QH_CHECKALL ; and check it out @RH1 + XOR AH,AH ;good return status + + POP DS ;recover these registers + POP SI + POP CX + RET ;return to caller +Q_OPEN ENDP + + +;ͻ +; Entry point for GET EMM HANDLE PAGES Function 13 +; NOTE - CAN HANDLE HANDLE WITH 0 PAGES +; on entry: (AH) = '4C'x +; (DX) = handle id +; +; on exit: (AH) = status +; (BX) = number of pages allocated to this handle +; all other registers preserved +;ͼ +Q_ALLOCATE PROC + PUSH DX ;save these registers + PUSH SI + PUSH DS + + PUSH CS ;get this segment + POP DS ;into ds + + CMP DX,NUM_HANDLES-1 ;DX <= Number of handles @RH1 + JBE QP_DXINRANGE ;Yes OK @RH1 + MOV AH,EMS_CODE83 ;No out of range..error @RH1 + JMP Q_ALLOC_EXIT ;exit @RH1 +QP_DXINRANGE: + MOV AX,DX ;SI = offset into @RH1 + MOV DX,TYPE H_LOOKUP_STRUC ; handle lookup tbl @RH1 + MUL DX ; for the given @RH1 + MOV SI,AX ; handle @RH1 + MOV BX,HANDLE_LOOKUP_TABLE.H_Pages[SI] ;Return # of pages @RH1 + + CMP BX,REUSABLE_HANDLE ; is this one free ;AN004; + JNE QP_GOOD_RC ; no, must be a real number ;AN004; + mov ah,EMS_Code83 ; this page is not allocated currently ;an004; dms; + XOR BX,BX ; yes, zero BX (number of pages) ;AN004; + jmp Q_Alloc_Exit ; exit the routine ;an004; dms; + ;AN004; +QP_GOOD_RC: ;AN004; + XOR AH,AH ;good return status +Q_ALLOC_EXIT: + POP DS ;recover these registers + POP SI + POP DX + RET ;return to caller +Q_ALLOCATE ENDP + + +;ͻ +; Entry point for GET ALL OPEN HANDLES AND PAGES Function 14 +; +; on entry: (AH) = '4D'x +; ES:DI = Points to an array. Each entry consists of +; 2 words. The first word is for an active +; EMS handle and the 2nd word for the number +; of pages allocated to that handle. This +; procedure will fill in the table, but the +; requestor must supply a large enough array. +; +; on exit: (AH) = status +; (BX) = Number of active EMS handles +; all other registers preserved +;ͼ +Q_OPEN_ALL PROC + PUSH CX ;save these registers + PUSH DX + PUSH DI + PUSH SI + PUSH DS + + PUSH CS ;get this segment + POP DS ;into ds + + MOV DI,cs:[bp].IE_Saved_DI_Reg ;restore di to its value on - gga P1501 ;an004; + ;entry + + XOR BX,BX ;Init number of active handles @RH1 + XOR DX,DX ; and handle id @RH1 + XOR SI,SI ;SI = offset into handle lup table @RH1 + MOV CX,NUM_HANDLES ;Loop for all entries in h lup tbl @RH1 +QHP_CHECKALL: + MOV AX,HANDLE_LOOKUP_TABLE.H_Pages[SI] ; @RH1 + CMP AX,REUSABLE_HANDLE ;If entry is reusable (free), @RH1 + JE QHP_NEXT ; don't count it. Check next hndl @RH1 + INC BX ;Else active handle. Inc hndl cnt @RH1 + MOV ES: WORD PTR [DI],DX ;Write handle # in the user's area @RH1 + MOV ES: WORD PTR [DI+2],AX ;Write # of pages in the 2nd word @RH1 + ADD DI,4 ;Advance ptr to user's area @RH1 +QHP_NEXT: ;Check next entry in h lup table @RH1 + ADD SI,TYPE H_LOOKUP_STRUC ;Inc offset into handle lup table @RH1 + INC DX ;Next handle ID + LOOP QHP_CHECKALL + + XOR AH,AH ;good return status + + POP DS ;restore these registers + POP SI + POP DI + POP DX + POP CX + RET ;return to caller +Q_OPEN_ALL ENDP + + +;ͻ +; Entry point for GET/SET PAGE MAP SUBFUNCTIONS Function 15 +; +; on entry: (AH) = '4E'x +; (AL) = subfunction number +; ES:DI = destination save area for Get Subfunction +; DS:SI = source save area for Set Subfunction +; +; on exit: (AH) = status +; all other registers preserved +;ͼ +SUBFCN_TABLE LABEL WORD + DW OFFSET GET_SUBFCN ;0 - Put page frame map into ES:DI array + DW OFFSET SET_SUBFCN ;1 - Set page frame map from DS:SI array + DW OFFSET GET_SET_SUBFCN ;2 - Put page frame map into ES:DI array + ;and Set page frame map from DS:SI array +MAX_SUBFCN EQU ($-SUBFCN_TABLE)/2 ;maximum allowable subfunction number + DW OFFSET SIZE_SUBFCN ;3 - Return storage requirements of the + ;Get and Set subfunctions +GET_SET_MAP PROC + MOV DI,cs:[bp].IE_Saved_DI_Reg ;restore di to its value on + PUSH BX ;save bx + CMP AL,MAX_SUBFCN ;is subfunctiion number within range? +; $IF BE ;do if yes... + JNBE $$IF86 + MOV BX,OFFSET GET_SET_EXIT ;get return address common to all subfcns + PUSH BX ;put it on stack for return + XOR AH,AH ;adjust ax to make it + ADD AX,AX ; offset into jump table + MOV BX,AX ;get it into bx for jump +;At entry to subfunction handler: +; CS = INT67 code segment +; TOP OF STACK is return address, GET_SET_EXIT + + JMP CS:SUBFCN_TABLE[BX] ;call subfunction handler +; $ENDIF +$$IF86: + ;if subfcn # is out of range then do... + MOV AH,EMS_CODE8F ;function call out of range +GET_SET_EXIT: + POP BX ;recover bx + RET ;return to caller +GET_SET_MAP ENDP + + + page +;-----------------------------------------------------------------------; +; Subfunction 0 to GET PAGE MAP Function 15/0 ; +; ; +; on entry: (AH) = '43'x ; +; (AL) = 0 ; +; ES:DI = Destination save area ; +; ; +; on exit: (AH) = status ; +; all other registers preserved ; +;-----------------------------------------------------------------------; +GET_SUBFCN PROC + PUSH DI ;save + PUSH ES ;save + + + CALL SAVE_PGFRM_MAP ;save page frame map to ES:DI + XOR AH,AH ;good return status + POP ES ;restore + POP DI ;restore + RET ;return to caller +GET_SUBFCN ENDP + + +;-----------------------------------------------------------------------; +; Subfunction 1 to SET PAGE MAP Function 15/1 ; +; ; +; on entry: (AH) = '43'x ; +; (AL) = 1 ; +; DS:SI = Source save area ; +; ; +; on exit: (AH) = status ; +; all other registers preserved ; +;-----------------------------------------------------------------------; +SET_SUBFCN PROC + PUSH SI ;save + PUSH DS ;save + CALL RESTORE_PGFRM_MAP ;restore page frame map from DS:SI + XOR AH,AH ;good return status + POP DS ;restore + POP SI ;restore + RET ;return to caller +SET_SUBFCN ENDP + + +;-----------------------------------------------------------------------; +; Subfunction 2 to GET and SET PAGE MAP Function 15/2 ; +; ; +; on entry: (AH) = '43'x ; +; (AL) = 2 ; +; ES:DI = destination save area ; +; DS:SI = source save area ; +; ; +; on exit: (AH) = status ; +; all other registers preserved ; +;-----------------------------------------------------------------------; +GET_SET_SUBFCN PROC + PUSH DI + PUSH SI + + MOV DI,cs:[bp].IE_Saved_DI_Reg ;restore di to its value on + ;entry into irpt handler + + CALL SAVE_PGFRM_MAP ;save page frame map to ES:DI + CALL RESTORE_PGFRM_MAP ;restore page frame map from DS:SI + XOR AH,AH ;good return status + + POP SI + POP DI + RET ;return to caller +GET_SET_SUBFCN ENDP + +;-----------------------------------------------------------------------; +; Subfunction 3 to RETURN SIZE OF SAVE ARRAY Function 15/3 ; +; ; +; on entry: (AH) = '43'x ; +; (AL) = 3 ; +; ; +; on exit: (AH) = status ; +; (AL) = Number of bytes needed for a GET or SET ; +; all other registers preserved ; +;-----------------------------------------------------------------------; +SIZE_SUBFCN PROC + MOV AL,TYPE H_SAVE_STRUC ;get size requirements for save area + XOR AH,AH ;good return status + RET ;return to caller +SIZE_SUBFCN ENDP + +;========================================================================= +; Set_Instance This routine accesses the instance table. +; +; Inputs : Instance_Table - Table of instances of reentrancy. +; +; Outputs : BP - pointer to instance table entry to use +; NC - instance table entry found +; CY - no instance table entry found +; AH - error code on CY +;========================================================================= + +Set_Instance proc ;set the instance table ;an000; dms; + + cli ;disable interrupts ;an000; dms; + push cx ; ;an000; dms; + + mov bp,offset cs:Instance_Table ;get pointer to instance table ;an000; dms; + mov cx,Instance_Count ;number of instances ;an000; dms; + +Set_Instance_Loop: + + cmp cs:[bp].IE_Alloc_Byte,Unallocated;unallocated entry? ;an000; dms; + je Set_Instance_Found ;open entry ;an000; dms; + add bp,Instance_Size ;next instance ;an000; dms; + loop Set_Instance_Loop ;continue ;an000; dms; + + mov ah,EMS_Code80 ;not enough instance entries ;an000; dms; + stc ;signal error ;an000; dms; + jmp Set_Instance_Exit ;exit routine ;an000; dms; + +Set_Instance_Found: + + mov cs:[bp].IE_Alloc_Byte,Allocated ;instance allocated ;an000; dms; + clc ;signal good exit ;an000; dms; + +Set_Instance_Exit: + + pop cx ;restore regs ;an000; dms; + sti ;turn on interrupts ;an000; dms; + + ret ;return ;an000; dms; + +Set_Instance endp ; ;an000; dms; + +;========================================================================= +; Reset_Instance This routine accesses the instance table. +; +; Inputs : BP - pointer to currently active instance entry +; +; Outputs : Instance_Table - Deactivated instance entry +;========================================================================= + +Reset_Instance proc + + cli ;turn off interrupts ;an000; dms; + mov cs:[bp].IE_Alloc_Byte,Unallocated;deallocate instance ;an000; dms; + sti ;set interrupts ;an000; dms; + + ret ;return ;an000; dms; + +Reset_Instance endp ; ;an000; dms; + + +;ͻ +; Entry point for UNSUPPORTED FUNCTION CALLS +;ͼ +UNSUPPORTED PROC + +GET_PORT_ARRAY: +GET_L_TO_P: + RET +UNSUPPORTED ENDP + + +;========================================================================= +; EMS_Page_Contig_Chk - This routine will take CX as input, which is +; the count of pages needed to satisfy the +; Allocate, Allocate Raw, or Reallocate functions. +; It will scan the unallocated page list to +; determine if there are CX number of contiguous +; pages. When it finds a block of contiguous +; pages it will return a pointer in SI pointing +; to the first page in the linked list that contains +; CX contiguous pages. If CX contiguous pages are +; not found a CY will be returned. +; +; Inputs : CX (Pages needed for request) +; +; Outputs : CY (There are no CX contiguous pages) +; NC (There are CX contiguous pages) +; SI (Pointer to 1st. page of CX contiguous pages) +;========================================================================= + +EMS_Page_Contig_Chk proc near ;determine contiguity ;an001; dms; + + push ax ;save regs ;an001; dms; + push bx ; ;an001; dms; + push cx ; ;an001; dms; + push dx ; ;an001; dms; + push di ; ;an001; dms; + +;;;; mov ax,cs:Free_Pages ;initialize page count ;an001; dms; + mov di,cs:PAL_Free_Ptr ;pointer to free list ;an001; dms; + mov si,di ;initialize ptr val ;an001; dms; +;;;; mov bx,di ;initialize base val ;an001; dms; +;;;; mov dx,1 ;initialize count val ;an001; dms; + +EMS_Page_Contig_Main_Loop: + +;;;; cmp dx,cx ;at end? ;an001; dms; +;;;; je EMS_Page_Found_Contig ;yes - found contig ;an001; dms; + +;;;; shl di,1 ;index value ;an001; dms; +;;;; mov si,Page_Alloc_List[di] ;point to next free ;an001; dms; +;;;; shr di,1 ;ptr value ;an001; dms; +;;;; dec di ;see if it is contig ;an001; dms; +;;;; cmp si,di ; ;an001; dms; +;;;; je EMS_Page_Contig_Loop ;contig - check next ;an001; dms; +;;;; jmp EMS_Page_Contig_Init_Loop ;not contig ;an001; dms; + +EMS_Page_Contig_Loop: + +;;;; inc dx ;inc loop counter ;an001; dms; +;;;; jmp EMS_Page_Contig_Main_Loop ;continue ;an001; dms; + +EMS_Page_Contig_Init_Loop: + +;;;; sub ax,dx ;adjust pages left cnt ;an001; dms; +;;;; cmp ax,cx ;enough left? ;an001; dms; +;;;; jb EMS_Page_Not_Contig ;no contig memory ;an001; dms; +;;;; mov bx,si ;reinit base val ;an001; dms; +;;;; mov di,si ;reinit ptr val ;an001; dms; +;;;; mov dx,1 ;reinit count val ;an001; dms; +;;;; jmp EMS_Page_Contig_Main_Loop ;continue check ;an001; dms; + +EMS_Page_Not_Contig: + +;;;; stc ;signal not contig ;an001; dms; +;;;; jmp EMS_Page_Contig_Exit ;exit routine ;an001; dms; + +EMS_Page_Found_Contig: + + clc ;signal contig ;an001; dms; +;;;; mov si,bx ;pass ptr to 1st. ;an001; dms; + +EMS_Page_Contig_Exit: + + pop di ;restore regs ;an001; dms; + pop dx ; ;an001; dms; + pop cx ; ;an001; dms; + pop bx ; ;an001; dms; + pop ax ; ;an001; dms; + + ret ;return to caller ;an001; dms; + +EMS_Page_Contig_Chk endp ;end proc ;an001; dms; + + + +;========================================================================= +; EMS_Link_Set - This routine takes the SI returned from +; EMS_Page_Cont_Chk and removes CX pages from +; the linked list for the new handle. +; +; Inputs : SI - Pointer value to the beginning of pages for handle +; CX - Count of pages to be allocated +; +; Outputs : Adjusted unallocated list +; SI - Pointer value to beginning of pages for handle +;========================================================================= + + +EMS_Link_Set proc near ;set contig links ;an001; dms; + + push ax ;save regs ;an001; dms; + push bx ; ;an001; dms; + push cx ; ;an001; dms; + push dx ; ;an001; dms; + push di ; ;an001; dms; + +;;;; cmp si,cs:PAL_Free_Ptr ;at root? ;an001; dms; +;;;; je EMS_Link_Set_Up_Root ;yes - set up links ;an001; dms; + +;;;; mov di,cs:PAL_Free_Ptr ;get first free link ;an001; dms; + +EMS_Link_Set_Up_Search_Loop: + +;;;; shl di,1 ;get index value ;an001; dms; +;;;; cmp si,Page_Alloc_List[di] ;pointers match? ;an001; dms; +;;;; je EMS_Link_Set_Up ;yes - set up links ;an001; dms; +;;;; mov di,Page_Alloc_List[di] ;get next pointer ;an001; dms; +;;;; jmp EMS_Link_Set_Up_Search_Loop ;continue ;an001; dms; + +EMS_Link_Set_Up: + +;;;; mov ax,di ;save index value ;an001; dms; +;;;; mov di,si ;point to first link ;an001; dms; +;;;; mov dx,1 ;init loop counter ;an001; dms; + +EMS_Link_Set_Up_Loop: + +;;;; cmp dx,cx ;at end? ;an001; dms; +;;;; je EMS_Link_Set_Up_Loop_Exit ;yes - exit ;an001; dms; + +;;;; shl di,1 ;index value ;an001; dms; +;;;; mov di,Page_Alloc_List[di] ;next ptr ;an001; dms; +;;;; inc dx ;inc counter ;an001; dms; +;;;; jmp EMS_Link_Set_Up_Loop ;continue ;an001; dms; + +EMS_Link_Set_Up_Loop_Exit: + +;;;; shl di,1 ;index value ;an001; dms; +;;;; mov bx,Page_Alloc_List[di] ;get next link ;an001; dms; +;;;; mov di,ax ;get orig. link ;an001; dms; +;;;; mov Page_Alloc_List[di],bx ;hook up links ;an001; dms; +;;;; jmp EMS_Link_Set_Up_Exit + + +EMS_Link_Set_Up_Root: + + mov di,si ;point to first link ;an001; dms; + xor dx,dx ;init loop counter ;an001; dms; + +EMS_Link_Set_Up_Root_Loop: + + cmp dx,cx ;at end? ;an001; dms; + je EMS_Link_Set_Up_Root_Exit ;yes - exit ;an001; dms; + + shl di,1 ;index value ;an001; dms; + mov di,Page_Alloc_List[di] ;next ptr ;an001; dms; + inc dx ;inc counter ;an001; dms; + jmp EMS_Link_Set_Up_Root_Loop ;continue ;an001; dms; + +EMS_Link_Set_Up_Root_Exit: + + mov cs:PAL_Free_Ptr,di ;new free ptr ;an001; dms; + jmp EMS_Link_Set_Up_Exit ;exit routine ;an001; dms; + +EMS_Link_Set_Up_Exit: + + pop di ;restore regs ;an001; dms; + pop dx ; ;an001; dms; + pop cx ; ;an001; dms; + pop bx ; ;an001; dms; + pop ax ; ;an001; dms; + + ret ;return to caller ;an001; dms; + +EMS_Link_Set endp ; ;an001; dms; + + + + +;Ŀ +; +; LIM 4.0 functions are kept in a seperate include file, +; LIM40.INC +; +; +include lim40.inc + +Instance_Table db Instance_Size*Instance_Count dup(Unallocated) ;instance table ;an000; dms; + +RESIDENT: ;last address that must stay resident +PAGE +PAGE + +INCLUDE EMSINIT.INC ;Main file for throwaway + ; initialization code +INCLUDE XMA1DIAG.INC ;XMA 1 diagnostics and routines +INCLUDE PS2_5060.INC ;Diagnostics for PS/2 models 50 @RH2 + ; and 60. Support for XMA/A and @RH2 + ; MXO cards @RH2 +INCLUDE XMA2EMS.CL1 + + +TEMP_STACK DB STACK_SIZE DUP(0) ;RESERVE FOR TEMP STACK +TOP_OF_STACK DB ? ;DURING INITIALIZATION + +CSEG ENDS + END START + + diff --git a/v4.0/src/DEV/XMA2EMS/XMA2EMS.LC b/v4.0/src/DEV/XMA2EMS/XMA2EMS.LC new file mode 100644 index 0000000..bee5cc6 --- /dev/null +++ b/v4.0/src/DEV/XMA2EMS/XMA2EMS.LC @@ -0,0 +1,11 @@ +XMA2EMS.ASM +XMA2EMSP.INC +DIAGS.ASM +LIM40.INC +LIM40B.INC +PS2_5060.INC +PARMPARS.INC +EMSINIT.INC +XMA1DIAG.INC +GENIOCTL.INC + \ No newline at end of file diff --git a/v4.0/src/DEV/XMA2EMS/XMA2EMS.SKL b/v4.0/src/DEV/XMA2EMS/XMA2EMS.SKL new file mode 100644 index 0000000..d2a8169 --- /dev/null +++ b/v4.0/src/DEV/XMA2EMS/XMA2EMS.SKL @@ -0,0 +1,39 @@ +:class 1 + +:use 1 xma2ems CRLF +:use 2 xma2ems Welcome_Msg +:use 3 xma2ems DGS_Start_Msg +:use 4 xma2ems DGS_End_Msg +:use 5 xma2ems Page_Frame_Msg +:use 6 xma2ems PF_Start +:use 7 xma2ems Conv_Pages +:use 8 xma2ems Reserve_Msg +:use 9 xma2ems Res_Pages +:use 10 xma2ems Avail_Msg + +:use 11 xma2ems EMS_Pages +:use 12 xma2ems XMA1_Err_Msg +:use 13 xma2ems Not_Found_Msg +:use 14 xma2ems Parm_Err_Msg +:use 15 xma2ems No_Emul_Msg +:use 16 xma2ems Wrong_Emul_Msg +:use 17 xma2ems Wrong_XMAA_Msg +:use 18 xma2ems Req_EMS_Err_Msg +:use 19 xma2ems Not_Instl_Msg +:use 20 xma2ems Conflict_Msg + +:use 21 xma2ems Confl_Address +:use 22 xma2ems Hole_Msg +:use 23 xma2ems Hole_Address +:use 24 xma2ems Frame_Msg +:use 25 xma2ems Frame_Address +:use 26 xma2ems No_Pages_Msg +:use 27 xma2ems Size_Msg1 +:use 28 xma2ems Mem_OK +:use 29 xma2ems Next_Line +:use 28 common Prompt_Msg +:use 30 xma2ems XMA2EMS_Msg_Term +:use 16 common No_EMS_Memory +:use 30 xma2ems XMA2EMS_Msg_Term1 + +:end diff --git a/v4.0/src/DEV/XMA2EMS/XMA2EMSP.INC b/v4.0/src/DEV/XMA2EMS/XMA2EMSP.INC new file mode 100644 index 0000000..fa4196f --- /dev/null +++ b/v4.0/src/DEV/XMA2EMS/XMA2EMSP.INC @@ -0,0 +1,243 @@ + +INCSW EQU 0 ;INCLUDE PSDATA.INC ;AN000; +FARSW EQU 0 ;CALL THE PARSER BY NEAR CALL +DATESW EQU 1 ; ;SUPPRESS DATE CHECKING ;AN000; +TIMESW EQU 1 ; ;SUPPRESS TIME CHECKING ;AN000; +FILESW EQU 1 ;SUPPORT CHECKING FILE SPECIFICATION ;AN000; +CAPSW EQU 1 ; ;SUPPRESS FILE TABLE CAPS ;AN000; +CMPXSW EQU 1 ; ;SUPPRESS CHECKING COMPLEX LIST +DRVSW EQU 1 ; ;SUPPRESS SUPPORT OF DRIVE ONLY FORMAT +QUSSW EQU 1 ; ;SUPPRESS SUPPORT OF QUOTED STRING FORMAT ;AN000; +NUMSW EQU 1 ; ;SUPPRESS CHECKING NUMERIC VALUE +KEYSW EQU 1 ;SUPPORT KEYWORDS ;AN000; +SWSW EQU 1 ;DO SUPPORT SWITCHES ;AN000; +VAL1SW EQU 1 ;SUPPORT VALUE DEFINITION 1 ;AN000; +VAL2SW EQU 1 ; ;SUPPRESS SUPPORT OF VALUE DEFINITION 2 ;AN000; +VAL3SW EQU 1 ;DO SUPPORT VALUE DEFINITION 3 + +include psdata.inc + +;*********************************************************************** + +;------------------------------------------------------------------- +; +; parser stuff for XMA2EMS.SYS +; +;------------------------------------------------------------------- + +p_block: + dw offset px_block ; address of extended parms block + db 0 ; number of extra stuff + +;$P_PARMS_Blk ; parm block + +;------------------------ +; extended parameter block for APPEND first load + +px_block: + db 1 ; min number positional operands + db 1 ; max number positional operands + dw offset dummy_ctl ; dummy control block + + db 1 ; /X only switch + dw offset X_Switch ; control block for /X switch + + db 7 ; max number of keywords + dw offset frame_ctl ; offset of FRAME= keyword control block + dw offset p0_ctl ; offset of p0 keyword control block + dw offset p1_ctl ; offset of p1 keyword control block + dw offset p2_ctl ; offset of p2 keyword control block + dw offset p3_ctl ; offset of p3 keyword control block + dw offset p254_ctl ; offset of p254 keyword control block + dw offset p255_ctl ; offset of p255 keyword control block + +;------------------------ + +dummy_ctl: + dw 0200h ; + dw 0 ; no caps + dw offset dum_result ; pointer to dummy result block + dw offset dum_values ; pointer to null values block + db 0 ; number of switches and synonyms + +dum_values: + dw 0 ; null value list + +X_Switch: + dw $P_Num_Val ; /X:64 + dw 0002 ; caps + dw offset X_Result ; pointer to result block + dw offset X_Values ; pointer to values block, none + db 1 ; number of switches and synonyms + db "/X",0 ; only /X is valid + +X_Values: + db 1 ; numeric values + db 1 ; 1 ranges + db 1 ; = 1 means good range + dd 4 ; valid values range from 4 (64Kb)... + dd 512 ; 512 (8MB) + +;------------------------ + +frame_ctl: + dw $P_Simple_S ; used for FRAME= and Pxxx= + dw 0 ; cap by char table + dw offset frame_result ; pointer to result block + dw offset address_values ; pointer to values block + db 1 ; number of synonyms + db "FRAME=",0 + +p0_ctl: + dw $P_Simple_S ; used for FRAME= and Pxxx= + dw 0 ; cap by char table + dw offset p0_result ; pointer to result block + dw offset address_values ; pointer to values block + db 3 ; number of synonyms + db "P0=",0 + db "P00=",0 + db "P000=",0 + +p1_ctl: + dw $P_Simple_S ; used for FRAME= and Pxxx= + dw 0 ; cap by char table + dw offset p1_result ; pointer to result block + dw offset address_values ; pointer to values block + db 3 ; number of synonyms + db "P1=",0 + db "P01=",0 + db "P001=",0 + +p2_ctl: + dw $P_Simple_S ; used for FRAME= and Pxxx= + dw 0 ; cap by char table + dw offset p2_result ; pointer to result block + dw offset address_values ; pointer to values block + db 3 ; number of synonyms + db "P2=",0 + db "P02=",0 + db "P002=",0 + +p3_ctl: + dw $P_Simple_S ; used for FRAME= and Pxxx= + dw 0 ; cap by char table + dw offset p3_result ; pointer to result block + dw offset address_values ; pointer to values block + db 3 ; number of synonyms + db "P3=",0 + db "P03=",0 + db "P003=",0 + +p254_ctl: + dw $P_Simple_S ; used for FRAME= and Pxxx= + dw 0 ; cap by char table + dw offset p254_result ; pointer to result block + dw offset address_values ; pointer to values block + db 1 ; number of synonyms + db "P254=",0 + +p255_ctl: + dw $P_Simple_S ; used for FRAME= and Pxxx= + dw 0 ; cap by char table + dw offset p255_result ; pointer to result block + dw offset address_values ; pointer to values block + db 1 ; number of synonyms + db "P255=",0 + +;------------------------ + +address_values: + db 3 ; strings + db 0 ; zeroes here for ranges + db 0 ; and values + db 24 ; 24 possible strings + db 0A0h + dw offset A0_str + db 0A4h + dw offset A4_str + db 0A8h + dw offset A8_str + db 0ACh + dw offset AC_str + db 0B0h + dw offset B0_str + db 0B4h + dw offset B4_str + db 0B8h + dw offset B8_str + db 0BCh + dw offset BC_str + db 0C0h + dw offset C0_str + db 0C4h + dw offset C4_str + db 0C8h + dw offset C8_str + db 0CCh + dw offset CC_str + db 0D0h + dw offset D0_str + db 0D4h + dw offset D4_str + db 0D8h + dw offset D8_str + db 0DCh + dw offset DC_str + db 0E0h + dw offset E0_str + db 0E4h + dw offset E4_str + db 0E8h + dw offset E8_str + db 0ECh + dw offset EC_str + db 0F0h + dw offset F0_str + db 0F4h + dw offset F4_str + db 0F8h + dw offset F8_str + db 0FCh + dw offset FC_str + + + +A0_str db "A000",0 +A4_str db "A400",0 +A8_str db "A800",0 +AC_str db "AC00",0 +B0_str db "B000",0 +B4_str db "B400",0 +B8_str db "B800",0 +BC_str db "BC00",0 +C0_str db "C000",0 +C4_str db "C400",0 +C8_str db "C800",0 +CC_str db "CC00",0 +D0_str db "D000",0 +D4_str db "D400",0 +D8_str db "D800",0 +DC_str db "DC00",0 +E0_str db "E000",0 +E4_str db "E400",0 +E8_str db "E800",0 +EC_str db "EC00",0 +F0_str db "F000",0 +F4_str db "F400",0 +F8_str db "F800",0 +FC_str db "FC00",0 + +;------------------------ + +dum_result $P_Result_Blk <> ; dummy result block +X_Result $P_Result_Blk <> ; /X result block +frame_result $P_Result_Blk <> ; FRAME= result block +p0_result $P_Result_Blk <> ; p0= result block +p1_result $P_Result_Blk <> ; p1= result block +p2_result $P_Result_Blk <> ; p2= result block +p3_result $P_Result_Blk <> ; p3= result block +p255_result $P_Result_Blk <> ; p254= result block +p254_result $P_Result_Blk <> ; p255= result block + + + \ No newline at end of file diff --git a/v4.0/src/DEV/XMAEM/INDEACC.INC b/v4.0/src/DEV/XMAEM/INDEACC.INC new file mode 100644 index 0000000..01a28b2 --- /dev/null +++ b/v4.0/src/DEV/XMAEM/INDEACC.INC @@ -0,0 +1,218 @@ +COMMENT # +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* * +* MODULE NAME : INDEACC * +* * +* * +* 5669-196 (C) COPYRIGHT 1988 Microsoft Corporation * +* * +* DESCRIPTIVE NAME: Access rights byte definitions for 80386 XMA emulator * +* * +* STATUS (LEVEL) : Version (0) Level (1.0) * +* * +* FUNCTION : This file defines the access rights bytes used in * +* descriptors that define the code and data segments. * +* * +* MODULE TYPE : INC * +* * +* REGISTER USAGE : 80386 Standard * +* * +* RESTRICTIONS : None * +* * +* DEPENDENCIES : None * +* * +* EXTERNAL * +* REFERENCES : None * +* * +* CHANGE ACTIVITY : * +* * +* $MAC(INDEACC) COMP(LOAD) PROD(3270PC) : * +* * +* $D0=D0004700 410 870530 D : NEW FOR WSP RELEASE 1.1 * +* $P1=P0000311 410 870804 D : RENAME MODULE'S LIBRARY FILE TYPE TO "INC" * +* * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +# + +PAGE +; RECORD DEFINITIONS FOR ACCESS RIGHTS BYTES +; ====== =========== === ====== ====== ===== +; +; Data Segments - Interpretation of access rights for DS/ES/SS + + +; Define the bit fields for the access rights byte + +DATA_ACC RECORD PRESENT:1,DPL:2,SEG_TYPE:1,XQTBLE:1,EXPDIR:1,WRTBLE:1,ACCESSED:1 + + ; PRESENT (1 bit) 0 = segment not present in memory + ; 1 = segment present in memory + ; + ; DPL (2 bits) Descriptor privilege level -- 0 to 3 + ; + ; SEG_TYPE (1 bit) 0 = system segment + ; 1 = application segment + ; + ; XQTBL (1 bit) 0 = segment is not executable (i.e., data) + ; 1 = segment is executable (i.e., code) + ; + ; EXPDIR (1 bit) 0 = expand up, i.e., normal data segment + ; 1 = expand down, i.e., stack segment + ; + ; WRTBLE (1 bit) 0 = data segment is read only + ; 1 = data segment is read/write + ; + ; ACCESSED (1 bit) 0 = segment has not been accessed + ; 1 = segment has been accessed + + +; Privilege level 3 read/write data segment access rights byte + +CPL3_DATA_ACCESS EQU 11110011B ; Present + ; DPL = 3 + ; Application segment + ; Not executable (i.e. data) + ; Expand up + ; Readable/Writable + ; Accessed + +; Privilege level 0 read/write data segment access rights byte + +CPL0_DATA_ACCESS EQU 10010011B ; Present + ; DPL = 0 + ; Application segment + ; Not executable (i.e. data) + ; Expand up + ; Readable/Writable + ; Accessed + + +NULL_ACCESS EQU 00000000B ; Null (Not present) + + +; Descriptor privilege levels. These can be ANDed or ORed with the access +; rights byte to get the desired DPL for the descriptor. + +DPL3 EQU 01100000B +DPL2 EQU 01000000B +DPL1 EQU 00100000B +DPL0 EQU 00000000B + +PAGE +; Code Segments - Interpretation of access rights for CS. +; Identical to data segments except for two fields. + + +CODE_ACC RECORD DATA_HI:5,CONFORM:1,READABLE:1,DATA_LO:1 + + ; DATA_HI (5 bits) Same five bits as described for data segments + ; PPRESENT (1), DPL (2), SEG_TYPE (1) and + ; XQTBL (1) + ; + ; CONFORM (1 bit) 0 = Non-conforming - cannot be called by + ; someone with a different CPL + ; 1 = Conforming - can be called by anyone + ; regardless of CPL. CPL remains the same + ; + ; READABLE (1 bit) 0 = code segment is execute only + ; 1 = data segment is executable and readable + ; + ; DATA_LO (1 bit) Same bit as described for data segments + ; ACCESSED (1) + + +; Privilege level 3 conforming readable code segment access rights byte +; BUT... +; We switched the DPL to 0. Why? Because the DPL of the current code segment +; determines the current privilege level (CPL). Whatever is running at the +; time can only access data with a DPL >= CPL. So if the DPL for the code +; segment were 3 and we tried to access data with a DPL of 0 we would get a +; fault. By setting the DPL of the code segment to 0 we can access all data +; and will never be bothered by faults. + +CPL3_CODE_ACCESS EQU 10011111B ; Present + ; DPL = 0 + ; Application segment + ; Executable (i.e. code) + ; Conforming + ; Readable + ; Accessed + +; Access rights to be able to read and write to a code segment. Code segments +; may not be written to. So this access byte will define the segment as a +; read/write data segment. It is the same as CPL3_DATA_ACCESS. + +COMP_CODE_ACCESS EQU CPL3_DATA_ACCESS + +; Privilege level 0 non-conforming readable code segment access rights byte + +CPL0_CODE_ACCESS EQU 10011011B ; Present + ; DPL = 0 + ; Application segment + ; Executable (i.e. code) + ; Non-conforming + ; Readable + ; Accessed + +PAGE +; System Segments - Interpretation of access rights for TR/LDTR as well as +; the four gate types. The access rights byte for the +; GDTR and IDTR is undefined, meaning anyone can access +; the table (although not necessarily the segments +; defined in the table). The uppermost 4 bits are +; identical to those for data segments; the type field +; occupies the lowermost 4 bits. + + +SYSTEM_ACC RECORD DATA_H:4,DESC_TYPE:4 + + ; DATA_H (4 bits) Same four bits as described for data segments + ; PPRESENT (1), DPL (2) and SEG_TYPE (1) + ; + ; DESC_TYPE(4 bits) 0000 Intel Reserved + ; 0001 Available 286 TSS + ; 0010 LDT + ; 0011 Busy 286 TSS + ; 0100 Call Gate + ; 0101 Task Gate + ; 0110 286 Interrupt Gate + ; 0111 286 Trap Gate + ; 1000 Intel Reserved + ; 1001 Available 386 TSS + ; 1010 Intel Reserved + ; 1011 Busy 386 TSS + ; 1100 386 Call Gate + ; 1101 Intel Reserved + ; 1110 386 Interrupt Gate + ; 1111 386 Trap Gate + ; + + +; These equates cover the topmost 4 bits for system segment access +; rights bytes. They define the privilege level. + +LDT_ACCESS EQU 11100000B ; Present, DPL = 3 for LDTs + +TSS_ACCESS EQU 10000000B ; Present, DPL = 0 for TSSs + +GATE_ACCESS EQU 10000000B ; Present, DPL = 0 for Gates + + +; These are for the type field. When "OR"ed with one of the above, +; you have a complete access rights byte. + +LDT_DESC EQU 00000010B OR LDT_ACCESS + +FREE_TSS EQU 00000001B OR TSS_ACCESS +FREE_TSS_386 EQU 00001001B OR TSS_ACCESS + +BUSY_TSS EQU 00000011B OR TSS_ACCESS + +CALL_GATE EQU 00000100B OR GATE_ACCESS + +TASK_GATE EQU 00000101B OR GATE_ACCESS + +INT_GATE EQU 00000110B OR GATE_ACCESS + +TRAP_GATE EQU 00000111B OR GATE_ACCESS + diff --git a/v4.0/src/DEV/XMAEM/INDEDAT.INC b/v4.0/src/DEV/XMAEM/INDEDAT.INC new file mode 100644 index 0000000..6c58eef --- /dev/null +++ b/v4.0/src/DEV/XMAEM/INDEDAT.INC @@ -0,0 +1,535 @@ +COMMENT # +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* * +* MODULE NAME : INDEDAT * +* * +* * +* 5669-196 (C) COPYRIGHT 1988 Microsoft Corporation * +* * +* DESCRIPTIVE NAME: Sytem data structures and equates for 386 XMA emulator * +* * +* STATUS (LEVEL) : Version (0) Level (1.0) * +* * +* FUNCTION : This file defines the overlays and constants for most of * +* the system data. The following structures are defined * +* here: * +* The resister save area on our stack * +* 80386 Task State Segment (TSS) * +* The Global Descriptor Table (GDT) * +* 80286 Segment Descriptor * +* 80286 Gate Descriptor * +* 80286 Task State Segment (TSS) * +* * +* MODULE TYPE : INC * +* * +* REGISTER USAGE : 80386 Standard * +* * +* RESTRICTIONS : None * +* * +* DEPENDENCIES : None * +* * +* EXTERNAL * +* REFERENCES : None * +* * +* CHANGE ACTIVITY : * +* * +* $MAC(INDEDAT) COMP(LOAD) PROD(3270PC) : * +* * +* $D0=D0004700 410 870529 D : NEW FOR WSP RELEASE 1.1 * +* $P1=P0000311 410 870804 D : RENAME MODULES'S LIBRARY FILE TYPE TO "INC" * +* $P2=P0000410 410 870918 D : RELOCATE DATA TO MAKE ROOM FOR I/O BIT MAP * +* * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +# + +; BPSTACK is an overlay for our stack when we receive control from an +; interrupt that we want to handle. The entry points for these interrupts +; push a 32 but error code and the interrupt number (16 bits) onto the stack. +; Then control goes to INDEEXC which saves the current register values on the +; stack. BP is set to point to the beginning of the register save area. This +; is the mapping of the resulting stack. + +BPSTACK STRUC + +BP_ES DW 0 ; Interrptee's ES +BP_DI DW 0 ; Interruptee's EDI (32 bit DI) + DW 0 ; +BP_SI DW 0 ; Interruptee's ESI (32 bit SI) + DW 0 ; +BP_BP DW 0 ; Interruptee's EBP (32 bit BP) + DW 0 ; +BP_PASP DW 0 ; Interruptee's ESP (32 bit SP) +BP_PSP2 DW 0 ; (ESP as it was before the PUSHA) +BP_BX DW 0 ; Interruptee's EBX (32 bit BX) + DW 0 ; +BP_DX DW 0 ; Interruptee's EDX (32 bit DX) + DW 0 ; +BP_CX DW 0 ; Interruptee's ECX (32 bit CX) + DW 0 ; +BP_AX DW 0 ; Interruptee's EAX (32 bit AX) + DW 0 ; +BP_DS DW 0 ; Interruptee's DS +BP_EX DW 0 ; Exception ID +BP_EC DW 0 ; Error Code + DW 0 + +; The following values are placed on our stack by the 80386 + +BP_IP DW 0 ; Interruptee's EIP (32 bit IP) +BP_IP2 DW 0 +BP_CS DW 0 ; Interruptee's CS (16 bit CS plus 16 bit trash) +BP_CS2 DW 0 +BP_FL DW 0 ; Interruptee's flags (32 bits) +BP_FL2 DW 0 +BP_SP DW 0 ; Interruptee's ESP - saved on an inter-level +BP_SP2 DW 0 ; interrupt +BP_SS DW 0 ; Interruptee's SSP - also saved on inter-level +BP_SS2 DW 0 ; interrupt +BP_VMES DW 0 ; Virtual mode ES +BP_VME2 DW 0 +BP_VMDS DW 0 ; Virtual mode DS + DW 0 +BP_VMFS DW 0 ; Virtual mode FS + DW 0 +BP_VMGS DW 0 ; Virtual mode GS + DW 0 +BP_STK DW 0 ; The rest of the stack + +BPSTACK ENDS + +BP_START EQU 0 ; Offset from BP of the start of the stack info + +SUBTTL 80386 TSS - Task State Segment +PAGE +;************************************************* +; * +; Start of Debugger's 386 TSS * +; * +;************************************************* + +TSS386 STRUC + DW 0 ; Intel reserved +ETSS_BACK_LINK DW 0 ; Back link to previous TSS +ETSS_SP0 DW 0 ; ESP for privilege level 0 + DW 0 +ETSS_SS0 DW 0 ; SS for privilege level 0 + DW 0 ; Intel reserved +ETSS_SP1 DD 0 ; ESP for privilege level 1 +ETSS_SS1 DW 0 ; SS for privilege level 1 + DW 0 ; Intel reserved +ETSS_SP2 DD 0 ; ESP for privilege level 2 +ETSS_SS2 DW 0 ; SS for privilege level 2 + DW 0 ; Intel reserved +ETSS_CR3 DD 0 ; CR3 - Page directory base register +ETSS_IP DW 0 ; Task's EIP + DW 0 +ETSS_FL DW 0 ; Task's Eflags +ETSS_FL2 DW 0 +ETSS_AX DD 0 ; Task's EAX +ETSS_CX DD 0 ; Task's ECX +ETSS_DX DD 0 ; Task's EDX +ETSS_BX DD 0 ; Task's EBX +ETSS_SP DW 0 ; Task's ESP + DW 0 +ETSS_BP DD 0 ; Task's EBP +ETSS_SI DD 0 ; Task's ESI +ETSS_DI DD 0 ; Task's EDI +ETSS_ES DW 0 ; Task's ES + DW 0 ; Intel reserved +ETSS_CS DW 0 ; Task's CS + DW 0 ; Intel reserved +ETSS_SS DW 0 ; Task's SS + DW 0 ; Intel reserved +ETSS_DS DW 0 ; Task's DS + DW 0 ; Intel reserved +ETSS_FS DW 0 ; Task's FS + DW 0 ; Intel reserved +ETSS_GS DW 0 ; Task's GS + DW 0 ; Intel reserved +ETSS_LDT DW 0 ; Selector for task's LDT + DW 0 ; Intel reserved +ETSS_TRAP DW 0 ; Trap bit - bit 0 (IBM bit 15) +ETSS_BM_OFFSET DW 0 ; I/O bit map base +ETSS_AVL DD 0 +TSS386 ENDS +TSS_386_LEN EQU 68H ; Length of the TSS +TSS_BM_LEN EQU 0FFFH-TSS_386_LEN ; Length of the I/O bit map + ; The bit map is in the same segment as the TSS + ; therefore the descriptor fot the TSS segment + ; must have enough room to include the bit map. + +SUBTTL GDT - Global Descriptor Table +PAGE + +SUBTTL GDT - GLOBAL DESCRIPTOR TABLE + +; THE GLOBAL DESCRIPTOR TABLE DEFINITION +; === ====== ========== ===== ========== +; + +GDT_LEN EQU 512 * 8 ; 512 entries total + +GDT_DEF STRUC + +UNUSED_ENTRY DQ 0 ; Seg reg = 0 illegal - this entry is + ; not accessible +GDT_PTR DQ 0 ; This entry points to this GDT table +MON_IDT_PTR DQ 0 ; System interrupt descriptor table +RSDA_PTR DQ 0 ; The real system data area (as opposed + ; to the virtual SDA's). XMA pages + ; start here +HUGE_PTR DQ 0 ; Used to address 0-1M as data + +LA_PTR DQ 0 ; Pointer to the LOADALL area (000800H) + +C_BWCRT_PTR DQ 0 ; Compatible blanck and white display +C_CCRT_PTR DQ 0 ; Compatible color display +E_CCRT_PTR DQ 0 ; Enhanced color display (16 bytes) +E_CCRT_PTR2 DQ 0 + +SYS_ROM_CS DQ 0 ; CS for system IDT, ROM resident +SYS_ROM_DS DQ 0 ; DS selector to access above as data +SYS_PATCH_CS DQ 0 ; CS for system IDT, RAM patch area +SYS_PATCH_DS DQ 0 ; DS selector to access above as data + +V_ROM_CS DQ 0 ; CS - virtual IDT, ROM resident +V_ROM_DS DQ 0 ; DS selector to access above as data +V_PATCH_CS DQ 0 ; CS - virtual IDT, RAM patch area +V_PATCH_DS DQ 0 ; DS selector to access above as data + +ES_TEMP DQ 0 ; Dynamic pointer for ES +CS_TEMP DQ 0 ; Dynamic pointer for CS +SS_TEMP DQ 0 ; Dynamic pointer for SS +DS_TEMP DQ 0 ; Dynamic pointer for DS + +; Monitor descriptors + +MON_LDTR DQ 0 +MON_DS DQ 0 +MON_ES DQ 0 +MON_SS DQ 0 +MON_CS DQ 0 +MON_TR_SS DQ 0 ; Task register value for single step +MON_TR_BP DQ 0 ; " " " " breakpoint +MON_TR_HWI DQ 0 ; Read/write (needs special hardware) +MON_TR_OI DQ 0 ; " " " " control-break + +KBD_OWNER_SDA DQ 0 ; Fast path to keyboard owner's SDA + +VTIMER_VECTOR DB 16 DUP (8 DUP(0)) ; 16 VM timer-related descriptors + +; Below are the 32 system exception service routine descriptors. + +SEX_TSS DB 32 DUP (8 DUP(0)) + +; Below are the 16 hardware interrupt service routine TSS descriptor +; pairs. The first is suitable for TR loading (i.e. target selector +; in the corresponding task gate) and the other is a TSS-as-data +; descriptor. + +HWI_TSS DB 16 DUP (16 DUP(0)) + +; This is the descriptor pair for the dispatcher (same format as HWI). + +DISPATCH_TASK DQ 0 + DQ 0 + +HWI_LDT DQ 0 + +BASICS_SEG DQ 0 ; BASIC's segment (F600) + +BIOSS_SEG DQ 0 ; BIOS's segment (F000) + +; +; +; Any other GDT things go here. There are around 300 slots left. +; +; + +RSVD_GDT DQ 0 + DB (GDT_LEN - (RSVD_GDT + 8) - (18 * 32)) DUP (0) + + ; The above leaves space for the + ; descriptors needed for 18 VMs + +PM_VM DB 32 DUP (0) ; Program Manager's virtual machine + ; entries. This will function as + ; the highest priority machine. +USER_CS DQ 0 ; Debugee's code segment +USER_SS DQ 0 ; Debugee's stack segment +USER_DS DQ 0 ; Debugee's data segment +USER_ES DQ 0 ; Debugee's extra segment +USER_TSS DQ 0 ; Debugee's Task State Segment +USER_TSS_DAT DQ 0 ; Debugee's TSS as a data segment +USER_LDT DQ 0 ; Debugee's LDT definition +USER_LDT_DAT DQ 0 ; Debugee's LDT as a data segment + +USER_VMS DB 14 DUP (32 DUP(0)) ; 16 user VMs + +SCRUBBER DB 32 DUP (0) ; RAM scrubber - dispatched when no other + ; machine has work to do +last_gdt_byte db 0 ; marker for last GDT byte + 1 +GDT_DEF ENDS + +SUBTTL Virtual Machine Entry +PAGE +; Virtual Machine Entry Definition - consists of 4 descriptors +; +; - Pointer to TSS, loadable into the Task Register +; - Pointer to TSS, loadable into a regular segment register +; - Pointer to the LDT, loadable into the LDT Register +; - Pointer to the LDT, loadable into a regular segment register +; +; The first of each pair is for loading into the associated special +; system registers, TR and LDTR. The second allows dynamic access +; and modification of descriptors by the system. + +VM_GDT_ENTRY STRUC + +VM_TR DQ 0 ; TR value for this machine's TSS +TSS_PTR DQ 0 ; Data pointer to this machine's TSS +VM_LDTR DQ 0 ; LDTR value for this machine's LDT +LDT_PTR DQ 0 ; Data pointer to this machine's LDT + +VM_GDT_ENTRY ENDS + +SUBTTL 80286 Segment Descriptor +PAGE +; DESCRIPTOR TABLE ENTRY STRUCTURES +; ========== ===== ===== ========== +; +; Segment Descriptor +; +; The following type of descriptor applies to data segments, code +; segments, local, global, and interrupt descriptor table segments, +; and task state segments. + +DATA_DESC STRUC + +SEG_LIMIT DW 0 ; Segment limit (1 - 65535 bytes) +BASE_LO_WORD DW 0 ; 24 bit segment physical address +BASE_HI_BYTE DB 0 ; (0 - (16M-1)) +DATA_ACC_RIGHTS DB 0 ; Access rights byte +DATA_RESERVED DW 0 ; Intel reserved + +DATA_DESC ENDS + +SHADOW_ID EQU DATA_RESERVED ; For garbage collection + +SUBTTL 80286 Gate Descriptor +PAGE +; 80286 Gate Descriptor + +; The following type of descriptor applies to task gates, call gates, +; interrupt gates, and trap gates. + +GATE_DESC STRUC + +ENTRY_POINT DW 0 ; Destination routine entry point + ; within the target segment. + ; This is unused for task gates. +CS_SELECTOR DW 0 ; Selector for destination segment. + ; For task gates, this must point + ; to a valid task state segment + ; descriptor. For call, trap, and + ; interrupt gates, this must point + ; to a valid code segment descriptor. + ; The segment defined in that + ; descriptor plus the aforementioned + ; entry-point defines the actual + ; routine address. +WORD_COUNT DB 0 ; For call gates only - number of + ; words to copy from caller's + ; stack to callee's stack +GATE_ACC_RIGHTS DB 0 ; Access rights byte +GATE_RESERVED DW 0 ; Intel reserved + +GATE_DESC ENDS + +; Record for the fields in a selector + +SELECTOR RECORD INDEX:13,TI:1,RPL:2 ; Standard 286 selector format + +SUBTTL TSS - Task State Segment +PAGE +; TASK STATE SEGMENT +; ==== ===== ======= +; +; There are currently two styles of task state segment (TSS) - one for +; VMs and one for the hardware interrupt service routines. There may +; be more later, depending on the needs and/or whims of the Authors +; of this and follow-on products. They will all have one thing in +; common - they begin with a 44 byte 286-required machine state data +; area. The first structure below is that area's definition. All +; subsequent colors of TSS will start with space for that data, defined +; like so: +; +; first_field_name DB (TYPE TASK_STATE_286) DUP (0) +; +; As a convenience, we use the highest part of the TSS for that +; particular task's stack (or in some cases, stacks - for privilege +; levels 0, 1, and 2). The intermediate area is used for task-specific +; data. + + +TASK_STATE_286 STRUC + +BACK_LINK DW 0 ; TSS selector from whence we came +VM_SP0 DW 0 ; SS:SP for CPL 0 +VM_SS0 DW 0 +VM_SP1 DW 0 ; SS:SP for CPL 1 +VM_SS1 DW 0 +VM_SP2 DW 0 ; SS:SP for CPL 2 +VM_SS2 DW 0 +VM_IP DW 0 ; IP - next instruction to execute +VM_FL DW 0 ; Flag word +VM_AX DW 0 ; +VM_CX DW 0 ; General +VM_DX DW 0 ; +VM_BX DW 0 ; +VM_SP DW 0 ; Purpose +VM_BP DW 0 ; +VM_SI DW 0 ; +VM_DI DW 0 ; Registers +VM_ES DW 0 ; +VM_CS DW 0 ; Segment +VM_SS DW 0 ; Selectors +VM_DS DW 0 ; +VM_LDT DW 0 ; Selector for this task's LDT + +TASK_STATE_286 ENDS + +; Note that the actual stacks for CPLs 2, 1, and 0 are part of the +; task state segment. CPL 3's stack is in its own address space. + +SUBTTL Length Equates +PAGE +; Length equates + +LA_LEN EQU GDT_LEN ; For new monitor + +SIDT_LEN EQU 256*8 ; Length of the IDT -- 256 interrupt + ; entries, 8 bytes each + +TSS_LEN EQU 68H + 2000H ; TSS structure length -- 68H for regs + ; 2000H for I/O bit map @P2C + +LDT_LEN EQU 00800H ; LDT structure length (2K) + +VM_ENTRY_LENGTH EQU TYPE VM_GDT_ENTRY ; Length of a VM entry + +VM_ENTRY_WIDTH EQU 5 ; Shift count for priority. Each + ; VM entry = 32 bytes, and SHL 5 + ; is the same as MUL by 32. +NEXT_DESC EQU TYPE DATA_DESC ; Length of a descriptor + +DESC_LEN EQU TYPE DATA_DESC ; Length of a descriptor + +DESC_WIDTH EQU 3 ; Shift count for desc len (8) is 3 + +PM_VM_SIZE EQU 01000H ; Virtual Manager's VM size + +MCRT_SIZE EQU 4*1024 ; Monochrome display size + +CCRT_SIZE EQU 16*1024 ; Compatible color display size + +ECCRT_SIZE EQU 0FFFFH ; Size of each portion of the enhanced + ; color display buffer + +MAX_SEG_LEN EQU 0FFFFH ; Maximum segment length = 64K + +NULL_SEG_LEN EQU 00000H ; Null segment length = 0 + +THIRTY_TWO_K EQU 08000H ; Unit of virtual machine size + + +SUBTTL Location Equates +PAGE + + +; Location equates + +; These items are all pre-allocated, and have no SBDs. After these, +; storage structures are all obtained through the memory manager. + +;----------------------------------------------------------------------------- + +; From here to the end marker, these guys must stay in order as this is +; how they are allocated. + +GDT_LOC EQU 0C100H ; GDT location relative to CS @P2C + +SIDT_LOC EQU (GDT_LOC + GDT_LEN) ; The system IDT is next + +DISPATCH_LOC EQU (SIDT_LOC + SIDT_LEN) + +; End marker + +; Monitor equate used in m_state to tell the estep routine that we're +; single stepping from within ego. +GO_MODE EQU 1 ; +; Monitor equate used in m_state to tell the hwi_int routine that we're +; breaking on a memory read address that's executed +MEMX EQU 2 ; +; Monitor equate used in m_state to tell mon_go that a breakpoint has been +; set so enable the breakpoint card +CARD_ENABL EQU 4 ; +S_MODE EQU 2000H ; Selector or segment mode flag + +BOOT_IP EQU 07C00H ; PC1 IP value for boot + +BOOT_CS EQU 00000H ; PC1 CS value for boot + +BOOT_SS EQU 00030H ; PC1 SS value for boot + +BOOT_SP EQU 07FFH ; PC1 SP value for boot + +BOOT_FL EQU 00200H ; Interrupts enabled + +CS_LO_CACHE EQU 00000H ; Code segment + +CS_HI_CACHE EQU 000H ; compatible cache + +SS_LO_CACHE EQU 00300H ; Stack segment + +SS_HI_CACHE EQU 000H ; compatible cache + +OTHER_CACHE EQU 00000H ; GP zero cache + +SUBTTL Display Equates +PAGE + +; The next equates are system definitions for display buffer addresses. + + +MCRT@_LO EQU 0000H ; + ; Monochrome display address +MCRT@_HI EQU 0BH ; (0B0000H) + +CCRT@_LO EQU 8000H ; + ; Compatible color display address +CCRT@_HI EQU 0BH ; (0B8000H) + +ECCRT@_LO_LO EQU 0000H ; + ; Enhanced color display address - +ECCRT@_LO_HI EQU 0AH ; lower 64K (0A0000H) + +ECCRT@_HI_LO EQU 0000H ; + ; Enhanced color display address - +ECCRT@_HI_HI EQU 0CH ; upper 64K (0C0000H) + + +; Code segment addresses + + +CSEG@_LO EQU 0000H ; + ; ROM code segment address +CSEG@_HI EQU 0EH ; (0E0000H) + +NSEG@_LO EQU 0000H ; + ; Null segment address +NSEG@_HI EQU 00H ; + +VIRTUAL_ENABLE EQU 0000000000000001B + +SUBTTL diff --git a/v4.0/src/DEV/XMAEM/INDEDES.MAC b/v4.0/src/DEV/XMAEM/INDEDES.MAC new file mode 100644 index 0000000..68d1776 --- /dev/null +++ b/v4.0/src/DEV/XMAEM/INDEDES.MAC @@ -0,0 +1,173 @@ +COMMENT # +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* * +* MODULE NAME : INDEDES * +* * +* * +* 5669-196 (C) COPYRIGHT 1988 Microsoft * +* * +* DESCRIPTIVE NAME: Macros for setting up 80386 descriptors * +* * +* STATUS (LEVEL) : Version (0) Level (1.0) * +* * +* FUNCTION : DESCR_DEF - Define storage for a descriptor * +* DESCR_INIT - Initialize a descriptor that has already * +* been defined * +* * +* MODULE TYPE : MAC * +* * +* REGISTER USAGE : 80286 Standard * +* * +* CHANGE ACTIVITY : * +* * +* $MAC(INDEDES) COMP(LOAD) PROD(3270PC) : * +* * +* $D0=D0004700 410 870604 D : NEW FOR RELEASE 1.1 * +* $P1=P0000311 410 870804 D : RENAME MODULE'S LIBRARY FILE TYPE TO "MAC" * +* * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +# + +; DESCR_DEF: Define a descriptor in-line using DWs and DBs. +; +; Input: For Segment descriptors, TYPE = SEG. +; For Gate descriptors, TYPE = GATE. +; Other parameters are as described by comments below. +; +; Output: DWs (define words) and DBs (define bytes) using the passed +; values. Useful for copying descriptors directly out of the code +; space, as when their values are forever static. +; +; Example: DESCR_DEF SEG, TSS0_LEN, TSS0_LOC, 0, CPL0_DATA_ACCESS +; +; This defines a segment format (limit/base/access) descriptor +; based on the parameters, which are usually equated values. Note +; that the low word of the address is TSS0_LOC and the high byte +; is 0. + + +DESCR_DEF MACRO TYPE,PARM1,PARM2,PARM3,ARB + + IFIDN <&TYPE>, +; +; Segment descriptor definition +; + DW &PARM1 ; Segment limit + DW &PARM2 ; Segment base address - low word + DB &PARM3 ; Segment base address - high byte + DB &ARB ; Access rights byte + DW 0 ; Intel reserved + + ENDIF + + IFIDN <&TYPE>, +; +; Gate descriptor definition +; + DW &PARM1 ; Destination offset + DW &PARM2 ; Destination segment selector + DB &PARM3 ; Word count for stack-to-stack copy + ; (only for call gates when PL changes) + DB &ARB ; Access rights byte + DW 0 ; Intel reserved + + ENDIF + + ENDM + +PAGE + +; DESCR_INIT: Initialize a descriptor dynamically. +; +; NOTE: ES must already point to the BASE of table +; where you want the descriptor to go. +; +; +; Input: For Segment descriptors, TYPE = SEG. +; For 4K granularity Segment descriptors, TYPE = BSEG. +; For Gate descriptors, TYPE = GATE. +; If the FIELD parameter is supplied, a MOV DI,FIELD is generated. +; Otherwise, its current value is used. Other parameters are as +; described by comments below. +; +; +; Output: DI ends up as DI + 8 (i.e. pointing at next descriptor. This +; is useful if you are initializing several consecutive +; descriptors). +; +; The passed data is stored at ES:DI using string store. This +; macro would be used when creating descriptors dynamically, as +; when allocating virtual machines. +; +; Example: DESCR_INIT GATE,INT13_PTR,INT13_IP,INT13_CS,0,TRAP_GATE_ACCESS +; +; This stores the parameters in gate format (offset/ selector/word +; count/access) through ES:DI, where DI is first loaded with +; INT13_PTR. + + +DESCR_INIT MACRO TYPE,FIELD,PARM1,PARM2,PARM3,ARB + + PUSH AX ; Save the utility register + + IFNB <&FIELD> + + MOV DI,&FIELD ; Set up index value to proper descriptor + ADD DI,GDT_LOC + + ENDIF + + + IFIDN <&TYPE>, +; +; Segment descriptor initialization +; + MOV AX,&PARM1 ; PARM1 = Segment Limit; load into AX + STOSW ; and store + MOV AX,&PARM2 ; PARM2 = BASE_LO_W; load into AX + STOSW ; and store + MOV AL,&PARM3 ; PARM3 = BASE_HI_B; load into AL, and + MOV AH,&ARB ; ARB = Access Rights Byte; load into AH + STOSW ; and store both + MOV AX,0 ; Make sure the Intel + STOSW ; reserved word is zero + + ENDIF + + + IFIDN <&TYPE>, +; +; Big (4k granularity) segment descriptor initialization +; + MOV AX,&PARM1 ; PARM1 = Segment Limit; load into AX + STOSW ; and store + MOV AX,&PARM2 ; PARM2 = BASE_LO_W; load into AX + STOSW ; and store + MOV AL,&PARM3 ; PARM3 = BASE_HI_B; load into AL, and + MOV AH,&ARB ; ARB = Access Rights Byte; load into AH + STOSW ; and store both + MOV AX,0080H ; 4k granularity bit + STOSW + + ENDIF + + + IFIDN <&TYPE>, +; +; Gate descriptor initialization +; + MOV AX,&PARM1 ; PARM1 = Destination offset; load into AX + STOSW ; and store + MOV AX,&PARM2 ; PARM2 = Destination Selector;load into AX + STOSW ; and store + MOV AL,&PARM3 ; PARM3 = Word Count; load into AL, and + MOV AH,&ARB ; ARB = Access Rights Byte; load into AH + STOSW ; and store both + MOV AX,0 ; Make sure the Intel + STOSW ; reserved word is zero + + ENDIF + + POP AX ; Restore AX + + ENDM diff --git a/v4.0/src/DEV/XMAEM/INDEDMA.ASM b/v4.0/src/DEV/XMAEM/INDEDMA.ASM new file mode 100644 index 0000000..84d73dc --- /dev/null +++ b/v4.0/src/DEV/XMAEM/INDEDMA.ASM @@ -0,0 +1,660 @@ +PAGE 60,132 +TITLE INDEDMA - 386 XMA Emulator - DMA Emulation + +COMMENT # +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* * +* MODULE NAME : INDEDMA * +* * +* * +* 5669-196 (C) COPYRIGHT 1988 Microsoft Corporation * +* * +* DESCRIPTIVE NAME: DMA handler for the 80386 XMA emulator * +* * +* STATUS (LEVEL) : Version (0) Level (1.0) * +* * +* FUNCTION : This module intercepts any I/O going to the DMA address * +* ports. We can't let the DMA requests go to the virtual * +* addresses. On the real XMA card the addresses on the * +* bus lines are translated by the card so that it accesses * +* the correct memory. But with our emulation the addresses * +* are translated before they hit the bus lines. The DMA * +* addresses go straight to the bus lines without being * +* translated. This would result in DMA reading and writing * +* data to the wrong memory location. Not good. Therefore * +* we intercept the I/O that is going to the DMA address * +* ports. We run these addresses through our paging mech- * +* anism and then write the real addresses to the DMA * +* address ports. * +* * +* MODULE TYPE : ASM * +* * +* REGISTER USAGE : 80386 Standard * +* * +* RESTRICTIONS : None * +* * +* DEPENDENCIES : None * +* * +* ENTRY POINTS : DMAIN - Entry point for "IN" instructions * +* DMAOUT - Entry point for "OUT" instructions * +* MANPORT - Entry point to issue an OUT to the manufacturing* +* port to re-IPL the system * +* * +* LINKAGE : Jumped to by INDEXMA * +* * +* INPUT PARMS : None * +* * +* RETURN PARMS : None * +* * +* OTHER EFFECTS : None * +* * +* EXIT NORMAL : Jump to POPIO to return to the V86 task * +* * +* EXIT ERROR : None * +* * +* EXTERNAL * +* REFERENCES : DISPLAY - Entry point in INDEEXC to signal an error * +* POPIO - Entry point in INDEEMU to return to the V86 * +* task * +* PGTBLOFF - Word in INDEI15 that contains the offset of * +* the page tables * +* SGTBLOFF - Word in INDEI15 that contains the offset of * +* the page directory * +* NORMPAGE - Double Word in INDEI15 that contains the * +* entry that goes into the first page directory * +* entry so that it points to the normal page * +* tables * +* BUFF_SIZE - Word in INDEI15 that contains the size of the * +* MOVEBLOCK buffer * +* MAXMEM - Word in INDEI15 that contains the total * +* number of K in the box * +* WORD_FLAG - Byte in INDEXMA that indicates whether the * +* I/O instruction was for a word or a byte * +* * +* SUB-ROUTINES : XLATE - Translate the virtual DMA address to a real DMA * +* address * +* * +* MACROS : DATAOV - Add prefix for the next instruction so that it * +* accesses data as 32 bits wide * +* ADDROV - Add prefix for the next instruction so that it * +* uses addresses that are 32 bits wide * +* LJB - Long jump if below * +* LJA - Long jump if above * +* LJAE - Long jump if above or equal * +* LJNE - Long jump if not equal * +* * +* CONTROL BLOCKS : INDEDAT.INC - System data structures * +* * +* CHANGE ACTIVITY : * +* * +* $MOD(INDEDMA) COMP(LOAD) PROD(3270PC) : * +* * +* $D0=D0004700 410 870101 D : NEW FOR RELEASE 1.1 * +* $P1=P0000312 410 870804 D : CLEAN UP WARNING MESSAGES * +* * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +# + + .286P ; Enable recognition of 286 privileged instructs. + + .XLIST ; Turn off the listing + INCLUDE INDEDAT.INC ; Include system data structures and equates + + IF1 ; Only include macros on the first pass + INCLUDE INDEOVP.MAC ; Override prefix macros + INCLUDE INDEINS.MAC ; 386 instruction macros + ENDIF + .LIST ; Turn the listing back on + +PROG SEGMENT PARA PUBLIC 'PROG' + + ASSUME CS:PROG + ASSUME DS:PROG + ASSUME ES:NOTHING + ASSUME SS:NOTHING + +INDEDMA LABEL NEAR + + EXTRN DISPLAY:NEAR ; Entry point in INDEEXC to signal an error + EXTRN POPIO:NEAR ; Entry point in INDEEMU to return to the V86 + ; task + EXTRN PGTBLOFF:WORD ; Word in INDEI15 that contains the offset of + ; the page tables + EXTRN SGTBLOFF:WORD ; Word in INDEI15 that contains the offset of + ; the page directory + EXTRN NORMPAGE:WORD ; Double Word in INDEI15 that contains the + ; entry that goes into the first page direct- + ; ory entry so that it points to the normal + ; page tables + EXTRN BUFF_SIZE:WORD ; Word in INDEI15 that contains the size of the + ; MOVEBLOCK buffer + EXTRN MAXMEM:WORD ; Word in INDEI15 that contains the total + ; number of K in the box + EXTRN WORD_FLAG:BYTE ; Byte in INDEXMA that indicates whether the + ; I/O instruction was for a word or a byte + +; Let these entry points be known to other modules + + PUBLIC INDEDMA + PUBLIC DMAIN + PUBLIC DMAOUT + PUBLIC MANPORT + +PAGE + +; Define control blocks for each of the DMA channels 0 to 7. The control +; blocks have information on where the user wanted to do DMA, where we will +; actually do the DMA, the channel number and the page port. The following +; is an overlay for the control blocks. After that the actual control +; blocks are defined. + +DMACB STRUC ; DMA control block + +DMACHN DB 0 ; Channel number +DMALSB DB 0 ; Least significant address byte +DMAMSB DB 0 ; Most significant address byte (16 bits) +DMAPAGE DB 0 ; Page - Hi-order of 24-bit address +DMALR DB 0 ; Real Least significant address byte +DMAMR DB 0 ; Real Most significant address byte (16 bits) +DMAPR DB 0 ; Real Page - Hi-order of 24-bit address +DMAPP DB 0 ; Compatability mode page port + +DMACB ENDS + +DMASTART EQU 0 +DMAENTRYLEN EQU DMAPP+1-DMASTART + +; Now, the channel control blocks + +DMATABLE DB 0 ; Channel number + DB DMAENTRYLEN-2 DUP (0) ; The other stuff + DB 87H ; Page port + + DB 1 ; Channel number + DB DMAENTRYLEN-2 DUP (0) ; The other stuff + DB 83H ; Page port + + DB 2 ; Channel number + DB DMAENTRYLEN-2 DUP (0) ; The other stuff + DB 81H ; Page port + + DB 3 ; Channel number + DB DMAENTRYLEN-2 DUP (0) ; The other stuff + DB 82H ; Page port + + DB 4 ; Channel number + DB DMAENTRYLEN-2 DUP (0) ; The other stuff + DB 8FH ; Page port + + DB 5 ; Channel number + DB DMAENTRYLEN-2 DUP (0) ; The other stuff + DB 8BH ; Page port + + DB 6 ; Channel number + DB DMAENTRYLEN-2 DUP (0) ; The other stuff + DB 89H ; Page port + + DB 7 ; Channel number + DB DMAENTRYLEN-2 DUP (0) ; The other stuff + DB 8AH ; Page port + +; And now some more variables + +DMACURRENT DB 0 ; Channel we're working on +DMABYTE DB 0 ; This flag is toggled between 0 and 1 + ; to indicated whether the least + ; significant or most significant byte + ; of the DMA address is being written +DMA_ADV_CHN DB 0 ; Advanced mode channel number + +PAGE + +; Define the jump table. There are 32 entries in the table that correspond to +; the first 32 ports, 0 to 20H. The code uses the port number as an index into +; this table which then gives control to the appropriate routine for that port. +; The table is initialized so that all entries jump to the code that will pass +; the I/O back to the real port. Then the entries for the ports we want to +; handle are set to the corresponding routines for those ports. + +OUT_TABLE: + .XLIST + REPT 32 + JMP DOOUT + ENDM + .LIST +OUT_TABLE_END: + +; Set the entries for the ports we want to handle. + + ORG OUT_TABLE+(00H*3) + JMP CHN_0 + ORG OUT_TABLE+(02H*3) + JMP CHN_1 + ORG OUT_TABLE+(04H*3) + JMP CHN_2 + ORG OUT_TABLE+(06H*3) + JMP CHN_3 + ORG OUT_TABLE+(0CH*3) + JMP RESET_BYTE_PTR + ORG OUT_TABLE+(18H*3) + JMP CHK_FUNCTION + ORG OUT_TABLE+(1AH*3) + JMP CHK_BASE_REG + + ORG OUT_TABLE_END + +PAGE + +; Control comes here from INDEXMA when it determines that the "IN" instruction +; is not for one of the XMA ports. On entry, WORD_FLAG is already set for word +; or byte operation. IP points to next instruction minus 1. DX has the port +; value in it. + +DMAIN PROC NEAR + CMP WORD_FLAG,0 ; Is this "IN" for a word? + JNE GETWORDREAL ; Yes. Then go get a word. + + IN AL,DX ; Else we'll just get a byte + MOV BYTE PTR SS:[BP+BP_AX],AL ; And put it into the user's AL reg. + JMP INEXIT ; Go return to the user + +GETWORDREAL: + IN AX,DX ; Get a word from the port + MOV WORD PTR SS:[BP+BP_AX],AX ; Put it into the user's AX register + MOV WORD_FLAG,0 ; Reset the word flag + +INEXIT: + ADD WORD PTR SS:[BP+BP_IP],1 ; Step IP past the instruction, or past + ; the port value in the case of I/O + ; with an immediate port value + JMP POPIO ; Return to the V86 task + +PAGE + +; Control comes here from INDEXMA when it determines that the "OUT" instruction +; is not for one of the XMA ports. On entry, WORD_FLAG is already set for word +; or byte operation. IP points to next instruction minus 1. DX has the port +; value in it. + +DMAOUT: + +; Check for DMA page registers in compatibility mode + + MOV AX,SYS_PATCH_DS ; Load DS with the selector for our data + MOV DS,AX ; segment + CMP WORD_FLAG,0 ; Is this a word operation? + LJNE DISPLAY ; No? Sorry. We don't support word DMA + ; yet. We'll just have to signal an + ; error. + LEA BX,DMATABLE ; Point BX to the base of our channel + ; control blocks + CMP DX,0081H ; Is this out to the channel 2 page port + LJB NOT_DMA_PAGE ; If the port number is less than 81H + ; then the "OUT" is not to a DMA page + JA CHK_CHN_0 ; If the port number is above 81H, then + ; go check if it's below 87H, the page + ; port for channel 0 + ADD BX,DMAENTRYLEN*2 ; If it's not below or above, then it + ; must be port 81H! Point BX to the + ; control block for channel 2 + JMP CHNCOM ; Continue + +CHK_CHN_0: + CMP DX,0087H ; Is it the page port for channel 0? + JA CHK680 ; Nope. It's above that. Go check for + ; the Roundup IPL port + JE CHNCOM ; It IS the page port for channel 0. + ; BX already points to the control + ; block for channel 0. + CMP DX,0083H ; Is it the page port for channel 1? + JB SET_CHN_3 ; No. It's below that. Then it must + ; be the page port for channel 3! + LJA DISPLAY ; No. It's above it. We don't know any + ; ports between 83H and 87H. Go + ; signal an error. + ADD BX,DMAENTRYLEN*1 ; Yes. It's the page port for channel 1 + ; Point BX to the control block for + ; channel 1. + JMP CHNCOM ; And continue + +; The port is greater than 87H + +CHK680: + CMP DX,680H ; Is it the manufacturing port (for IPL) + ; on the Roundup? + JE MANPORT ; Yes. Go IPL the system. + JMP DOOUT ; No. Pass the "OUT" on to the real + ; port. + +; The "OUT" is to the page port for channel 3 + +SET_CHN_3: + ADD BX,DMAENTRYLEN*3 ; Point BX to the control block for + ; channel 3 + +; Check to see if the value written to the page port is greater than 0FH. +; Why? Let me tell you. Addresses are 20 bits, right? The user puts the +; lower 16 bits into the channel port in two eight bit writes. The value +; written to the page port is the upper eight bits of the address. But to +; address 1M you only need 20 bits. Therefore, only the lower four bits are +; valid if the address is to remain within the 1M address limit. So if the +; value to be written to the page port is 10H or greater it is invalid, so +; we will signal an error. + +CHNCOM: + MOV AL,BYTE PTR SS:[BP+BP_AX] ; Get the value that is to be written + ; to the page port + CMP AL,10H ; Is it 10H or greater? + JB CHNCONT ; Nope. We're still OK. + +; Oops. It's an invalid page port value. Time to signal an error. But wait. +; If we just jump to DISPLAY as usual the code will just return to the V86 +; task. This is not good since we haven't Revised the DMA and it will end +; up going to the wrong address. What we really want to do is kill the system. +; To do this we will issue an interrupt 6, invalid instruction. The exception +; handler checks to see from whence the interrupt came. If it came from the +; emulator then it assumes something is terribly wrong and issues an NMI. +; This is what we want. So we'll issue an INT 6 instead of a JMP DISPLAY. + +INVALID_PAGE: + INT 6 ; Signal and error + JMP INVALID_PAGE ; Do it again in case control comes + ; back here + +; At this point were still OK. BX points to the control block for the channel. +; Let's translate the address we currently have to its real address and send +; it out to the DMA channel. + +CHNCONT: + MOV BYTE PTR [BX+DMAPAGE],AL ; Put the page port value into the + ; control block + CALL XLATE ; Create the real address entries in + ; the control block + MOV DL,BYTE PTR [BX+DMACHN] ; Get the channel number from the c.b. + SHL DX,1 ; Convert it to a port address + MOV AL,BYTE PTR [BX+DMALR] ; Get the LSB of the real address + OUT DX,AL ; "OUT" it to the address port + JMP $+2 ; Wait a bit + MOV AL,BYTE PTR [BX+DMAMR] ; Get the MSB of the real address + OUT DX,AL ; "OUT" it to the address port + JMP $+2 ; Wait a bit + MOV DL,BYTE PTR [BX+DMAPP] ; Get the page port + MOV AL,BYTE PTR [BX+DMAPR] ; Get the real page number + OUT DX,AL ; Do the "OUT" to the DMA page port + JMP OUTEXITDMA ; That's it + +PAGE + +; This is where we come when we want to simply send the "OUT" to the real port. + +DOOUT: + CMP WORD_FLAG,0 ; Is this an "OUT" for a word? + JNE PUTWORDREAL ; Aye. Go put out a word. + + MOV AL,BYTE PTR SS:[BP+BP_AX] ; Nay. It is for a byte. Get the + ; byte from the user's AL register + OUT DX,AL ; And send it out to the port + JMP OUTEXITDMA ; Time to leave + +PUTWORDREAL: + MOV AX,WORD PTR SS:[BP+BP_AX] ; Get the word form the user's AX + OUT DX,AX ; And thrust it out to the port + MOV WORD_FLAG,0 ; Reset the word flag + +OUTEXITDMA: + + ADD WORD PTR SS:[BP+BP_IP],1 ; Step IP past the instruction, or past + ; the port value in the case of I/O + ; with an immediate port value + JMP POPIO ; Return to the V86 task + +PAGE + +; It's not an "OUT" to one of the DMA page ports. + +NOT_DMA_PAGE: + CMP DX,(OUT_TABLE_END-OUT_TABLE)/3 ; Is the port within the range + ; covered by our jump table, i.e., + ; 0 to 20H + JAE NOTCOWBOY ; Nope. Let's go check if it's the IPL + ; port on the AT + MOV AL,DL ; Yes, it's handled by our jump table + MOV AH,3 ; Convert the port number to an index + MUL AH ; into the jump table by multiplying + ; by 3. Jump table entry are 3 bytes. + LEA CX,OUT_TABLE ; Get the offset of the jump table + ADD AX,CX ; And add it on to the index + JMP AX ; Jump to the jump table entry for this + ; port + +NOTCOWBOY: + CMP DX,80H ; Is it the manufacturing (IPL) port for + ; the AT? + JNE DOOUT ; Negative. Then let's just do a plain + ; vanilla "OUT" to the real port. +MANPORT: + MOV AL,0FEH ; It's the IPL port! Send out a FEH to + OUT 064H,AL ; reset the system. + +HALT: HLT ; In case that trick didn't work @P1C + JMP HALT ; we'll just wait here until @P1C + ; somebody hits the big red switch. + +PAGE + +; This is the entry for an "OUT" to port 0CH. An "OUT" to this port will +; reset the controller so that the next out will be to the least significant +; byte of the address register. The way you set the lower 16 bits of the +; address is by sending the two bytes to the same port, first the least +; significant byte (LSB) and then the most significant byte (MSB). The port +; knows that successive bytes to the port mean successively higher bytes of +; the address. We emulate this with our DMABYTE flag. Since the user will +; only be sending two bytes to an address port this flag will be toggled +; between 0 and 1 indicating that the "OUT" was to the LSB if 0 and to the +; MSB if 1. A write to port 0CH tells the controller that the next write +; will be for the LSB. We emulate this by setting our DMABYTE flag to 0. + +RESET_BYTE_PTR: + MOV DMABYTE,0 ; Reset the byte flag + JMP DOOUT ; Send the "OUT" to the real port + +PAGE + +; The following entries handle the "OUT"s to the address ports for channels +; 0 to 3. These are ports 00, 02, 04 and 06 respectively. As mentioned +; above the address written to these ports is done in two steps. First the +; least significant byte (LSB) is written, the the most significant byte (MSB) +; is written. This results in a 16 bit value in the address port. Combine +; this with the byte in the page port and you have a 24 bit DMA address. The +; code below emulates this by putting the byte that is "OUT"ed to the LSB if +; DMA BYTE is 0 and to the MSB if DMABYTE is 1. DMABYTE is toggled between 0 +; and 1 each time there is a write to the port. So the bytes go alternately +; to the LSB and the MSB. + +; "OUT" is to port 00, the address port for channel 0. + +CHN_0: + LEA BX,DMATABLE ; Point BX to the control block for + ; channel 0 + JMP MOVBYTE ; Go get the byte + +; "OUT" is to port 02, the address port for channel 1. + +CHN_1: + LEA BX,DMATABLE+(1*DMAENTRYLEN) ; Point BX to the control block for + ; channel 1 + JMP MOVBYTE ; Go get the byte + +; "OUT" is to port 04, the address port for channel 2. + +CHN_2: + LEA BX,DMATABLE+(2*DMAENTRYLEN) ; Point BX to the control block for + ; channel 2 + JMP MOVBYTE ; Go get the byte + +; "OUT" is to port 06, the address port for channel 3. + +CHN_3: + LEA BX,DMATABLE+(3*DMAENTRYLEN) ; Point BX to the control block for + ; channel 3 + +MOVBYTE: + MOV AL,BYTE PTR SS:[BP+BP_AX] ; Get the byte from the user's AL + XOR DMABYTE,1 ; Toggle the DMABYTE flag + JZ MOVMSB ; Was the flag set to 1? If so, go + ; put the byte to the MSB + MOV BYTE PTR [BX+DMALSB],AL ; Else it was 0 so put the byte in the + ; LSB for this channel + JMP OUTEXITDMA ; And exit + +MOVMSB: + MOV BYTE PTR [BX+DMAMSB],AL ; Put the byte in the MSB for this + ; channel + JMP OUTEXITDMA ; And exit + +PAGE + +; This is the entry point for an "OUT" to port 18H. It has something to do +; with the advanced DMA channels 4 thru 7. If the function number in the high +; nibble of AL is 2, set the base register, then we'll save the advanced channel +; number given in the low nibble of AL. If the function is not 2 then we will +; inhibit the setting of the base register. + +CHK_FUNCTION: + MOV AL,BYTE PTR SS:[BP+BP_AX] ; Get the value to be "OUT"ed to 18H + SHR AL,4 ; Shift the function number into AL + CMP AL,2 ; Is this the function to set the base + ; register? + JE SAVE_CHN ; Yup. Go save the channel number. + MOV DMABYTE,3 ; Nope. Inhibit setting the base reg. + JMP DOOUT ; Send the "OUT" to the real port + +SAVE_CHN: + MOV AL,BYTE PTR SS:[BP+BP_AX] ; Get the value in AL again + AND AL,07H ; Mask off the function number leaving + ; the channel number + MOV DMA_ADV_CHN,AL ; And save it + JMP RESET_BYTE_PTR ; Go reset the byte flag + +PAGE + +; This is the entry for an "OUT" to port 1AH. + +CHK_BASE_REG: + CMP DMABYTE,3 ; Are we inhibiting setting the base + ; register? + LJAE DOOUT ; Yes. Then just sent the "OUT" to the + ; real port + LEA BX,DMATABLE ; Point BX to the channel control blocks + MOV AL,DMA_ADV_CHN ; Get the current advanced channel + MOV AH,DMAENTRYLEN ; and multiply by the size of a + MUL AH ; control block. Now AX is the index + ; for the current control block + ADD BX,AX ; Add this on to the base and BX points + ; to the control block + SUB AX,AX ; Purge AX + MOV AL,DMABYTE ; Get the byte flag + ADD BX,AX ; And add it on to BX + MOV CL,BYTE PTR SS:[BP+BP_AX] ; Get the out value into CL + +; Now put it in the control block. Notice that BX is the base of the control +; block plus the byte flag. Now we add on the offset for the LSB entry. A +; little pondering of this code will reveal that for DMABYTE = 0 the byte in +; CL goes to the LSB entry, for DMABYTE = 1 it goes to the MSB entry and for +; DMABYTE = 2 it goes to the page entry. + + MOV BYTE PTR [BX+DMALSB],CL ; Save the byte in the control block + INC DMABYTE ; Increment our byte counter + CMP DMABYTE,3 ; Was the page entry written? + LJNE OUTEXITDMA ; Nope. Let's just exit. + + SUB BX,AX ; The page was written. Point BX back + ; to the start of the control block. + CMP CL,10H ; Does the page point to over 1M? + LJAE INVALID_PAGE ; Yes. Better signal an error. + + CALL XLATE ; The page is OK. Translate the virtual + ; address to the real address + MOV AL,BYTE PTR [BX+DMALR] ; Get the LSB of the real address + OUT 1AH,AL ; "OUT" it to the port 1AH + JMP $+2 ; Wait a bit + MOV AL,BYTE PTR [BX+DMAMR] ; Get the MSB of the real address + OUT 1AH,AL ; "OUT" it to the port 1AH + JMP $+2 ; Wait a bit + MOV AL,BYTE PTR [BX+DMAPR] ; Get the real page number + OUT 1AH,AL ; Do the "OUT" to port 1AH + JMP OUTEXITDMA ; That's all + +PAGE + +; XLATE is a procedure to translate the virtual DMA address to the real DMA +; address. It takes the virtual address that was "OUT"ed to the DMA ports +; and follows it through the page tables to get the real address. It puts +; the real address into the current channel control block. + +XLATE PROC + +; Calcuate the page fram offset of the real address, the lower 12 bits. + + MOV AX,WORD PTR [BX+DMALSB] ; Get the virtual LSB and MSB + AND AH,0FH ; Wipe out the top nibble. This leaves + ; us with only the offset into the 4K + ; page frame. This real address will + ; have the same offset into the page + ; frame + MOV WORD PTR [BX+DMALR],AX ; So save this in the real LSB + +; Pick up page table address. + + MOV SI,SGTBLOFF ; Point ST to the first page directory + ; entry + DATAOV ; Get the address of the current page + LODSW ; table + SUB AL,AL ; Clear the access rights byte. This + ; makes it a real offset. + DATAOV ; Point SI to the page table + MOV SI,AX + MOV AX,WORD PTR [BX+DMAMSB] ; Get the MSB and page + SHR AX,4 ; Shift the top four bits off the end + ; of the register these four bits are + ; not used. We are dealing with a 24 + ; bit address where only 20 bits are + ; used. + SHL AX,4-2 ; Shift back 2 bits. This puts zeroes + ; in the high bits while converting + ; the address to a page table index. + ; Page table entries are 4 bytes long, + ; hence, shift left 2 bits. + ADD SI,AX ; Add the page table index on to the + ; offset of the page table. SI now + ; points to the correct page table + ; entry. + ADD SI,1 ; Step over the access rights byte + + MOV AX,HUGE_PTR ; Load DS with a selector that accesses + MOV DS,AX ; all of memory as data + ADDROV ; Load the address of the page frame + LODSW ; into EAX + MOV CX,SYS_PATCH_DS ; Point DS back to our data segment + MOV DS,CX + +; Now AX contains the address of the page frame shifted right 8 bits. Remember +; that we incremented SI to skip the access rights? This gave us the page +; frame offset with out the lower byte. The lSB real address was already set +; above, as well as the low nibble of the real MSB. AX now contains the page +; and MSB of the real address. The low nibble of the MSB was already set so +; we just OR on the high nibble of the MSB. Then we set the real page. Then +; we're all done. + + OR BYTE PTR [BX+DMAMR],AL ; Turn on high 4 bits of the real MSB + MOV BYTE PTR [BX+DMAPR],AH ; Set the real page + + RET + +XLATE ENDP + +DMAIN ENDP + +PROG ENDS + + END diff --git a/v4.0/src/DEV/XMAEM/INDEEMU.ASM b/v4.0/src/DEV/XMAEM/INDEEMU.ASM new file mode 100644 index 0000000..9534ac2 --- /dev/null +++ b/v4.0/src/DEV/XMAEM/INDEEMU.ASM @@ -0,0 +1,653 @@ +PAGE 60,132 +TITLE INDEEMU - 386 XMA EMULATOR - Sensitive Instruction Emulator + +COMMENT # +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* * +* MODULE NAME : INDEEMU * +* * +* * +* 5669-196 (C) COPYRIGHT 1988 Microsoft Corporation * +* * +* DESCRIPTIVE NAME: 386 XMA emulator - emulate sensitive instructions * +* * +* STATUS (LEVEL) : VERSION (0) LEVEL (1.0) * +* * +* FUNCTION : When the I/O privilege level (IOPL) is less than 3 then * +* the processor flags an exception and gives control to * +* the emulator whenever the virtual 8086 (V86) task tries * +* to execute a sensitive instruction. The set of sensitive * +* instructions includes: STI, CLI, INT3, INTO, IRET, INT, * +* PUSHF, POPF, LOCK, IN and OUT. This moudle will emulate * +* these intructions for the V86 task. It will also set the * +* IOPL to 3. This will keep the processor from raising * +* further exceptions for these instructions. This in turn * +* improves performance because the emulator will not be * +* given control each time one of these instructions is * +* executed by the V86 task. * +* * +* This module also has a small piece of code to handle * +* exception 7, coprocessor not available. This exception * +* is raised when the EM (EMulation), MP (Monitor Processor),* +* and TS (Task Switch) bits in CR0 are on. When this * +* happens it turns off these bits and retries the instruc- * +* tion that faulted. * +* * +* MODULE TYPE : ASM * +* * +* REGISTER USAGE : 80386 Standard * +* * +* RESTRICTIONS : None * +* * +* DEPENDENCIES : None * +* * +* ENTRY POINT : EMULATE * +* * +* LINKAGE : Jumped to by INDEEXC * +* * +* INPUT PARMS : None * +* * +* RETURN PARMS : None * +* * +* OTHER EFFECTS : None * +* * +* EXIT NORMAL : IRET to the V86 task * +* * +* EXIT ERROR : Jump to error routine in INDEEXC * +* * +* EXTERNAL * +* REFERENCES : POPREGS - Entry point in INDEEXC to pop the registers P1C* +* off the stack and IRET to the V86 task. * +* DISPLAY - Entry point in INDEEXC for the error routine * +* that does the NMI to the error handler. * +* INT15 - Entry point to INDEI15, the INT 15 handler. * +* XMAIN - Entry point in INDEXMA to handle IN for a byte * +* at the port address in DX * +* INW - Entry point in INDEXMA to handle IN for a word * +* at the port address in DX * +* INIMMED - Entry point in INDEXMA to handle IN for a byte * +* at the immediate port address given * +* INWIMMED- Entry point in INDEXMA to handle IN for a word * +* at the immediate port address given * +* XMAOUT - Entry point in INDEXMA to handle OUT for a byte * +* at the port address in DX * +* OUTW - Entry point in INDEXMA to handle OUT for a word * +* at the port address in DX * +* XMAOUTIMMED - Entry point in INDEXMA to handle OUT for a * +* byte at the immediate port address given * +* XMAOUTWIMMED - Entry point in INDEXMA to handle OUT for a * +* word at the immediate port address given * +* MANPORT - Entry point in INDEDMA to issue an out to the * +* port that will reIPL the system * +* * +* SUB-ROUTINES : None * +* * +* MACROS : DATAOV - Create a prefix for the following instruction * +* so that it accesses data 32 bits wide * +* ADDROV - Create a prefix for the following instruction * +* so that it uses addresses that are 32 bits wide * +* CMOV - Move to or from a control register * +* * +* CONTROL BLOCKS : INDEDAT.INC * +* * +* CHANGE ACTIVITY : * +* * +* $MOD(INDEEMU) COMP(LOAD) PROD(3270PC) : * +* * +* $D0=D0004700 410 870523 D : NEW FOR RELEASE 1.1 * +* $P1=P0000312 410 870804 D : CLEAN UP WARNING MESSAGES * +* * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +# + + .286P ; Enable recognition of 286 privileged instructs. + + .XLIST ; Turn off the listing + INCLUDE INDEDAT.INC + + IF1 ; Only include macros on the first pass + INCLUDE INDEOVP.MAC + INCLUDE INDEINS.MAC + ENDIF + .LIST ; Turn on the listing + + PUBLIC INDEEMU + +PROG SEGMENT PARA PUBLIC 'PROG' + + ASSUME CS:PROG + ASSUME DS:NOTHING + ASSUME ES:NOTHING + ASSUME SS:NOTHING + +INDEEMU LABEL NEAR + + ; The following entries are in other modules + + EXTRN XMAIN:NEAR ; Byte IN from port # in DX +IN_INST EQU XMAIN ; @P1C + EXTRN INW:NEAR ; Word IN from port # in DX + EXTRN INIMMED:NEAR ; Byte IN from immediate port # + EXTRN INWIMMED:NEAR ; Word IN from immediate port # + EXTRN XMAOUT:NEAR ; Byte OUT to port # in DX +OUT_INST EQU XMAOUT ; @P1C + EXTRN OUTW:NEAR ; Word OUT to port # in DX + EXTRN XMAOUTIMMED:NEAR ; Byte OUT to immediate port # +OUTIMMED EQU XMAOUTIMMED ; + EXTRN OUTWIMMED:NEAR ; Word OUT to immediate port # + EXTRN DISPLAY:NEAR ; Signal the error handler + EXTRN MANPORT:NEAR ; ReIPL the system + EXTRN INT15:NEAR ; Handle INT 15 + EXTRN POPREGS:NEAR ; Pop the registers and IRET to V86 task @P1C + +PAGE +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; The following is a jump table for each of the instructions. There are 256 ;; +;; entries, each three bytes long, one for each possible op-code. The op- ;; +;; code is used as an index into the table. Each entry is a jump instruction ;; +;; instruction telling where to jump for each particular op-code. The table ;; +;; is initialized such that all in- structions jump to the routin for ;; +;; unexpected op-codes. Then the entries for the instructions we want to ;; +;; emulate are set to jump to the appropriate routine. ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +TABLE: + .XLIST + REPT 256 ; Initialize the table so that all instructions + JMP UNEXPECTED ; jump to UNEXPECTED + ENDM + .LIST + +; Now set up the entries for the instructions we want to emulate + +TABLE_END: + ORG TABLE+(0FBH*3) ; 0FBH is the op-code for STI. + JMP STI_INST ; @P1C + ORG TABLE+(0FAH*3) ; 0FAH is the op-code for CLI. + JMP CLI_INST ; @P1C + ORG TABLE+(0F0H*3) ; 0F0H is the op-code for LOCK. + JMP LOCK_INST ; @P1C + ORG TABLE+(0EFH*3) ; 0EFH is the op-code for OUT for a word. + JMP OUTW ; + ORG TABLE+(0EEH*3) ; 0EEH is the op-code for OUT for a byte. + JMP OUT_INST ; @P1C + ORG TABLE+(0EDH*3) ; 0EDH is the op-code for IN for a word. + JMP INW + ORG TABLE+(0ECH*3) ; 0ECH is the op-code for IN for a byte. + JMP IN_INST ; @P1C + ORG TABLE+(0E7H*3) ; 0E7H is the op-code for OUT for a word to + JMP OUTWIMMED ; an immediate port value. + ORG TABLE+(0E6H*3) ; 0E6H is the op-code for OUT for a byte to + JMP OUTIMMED ; an immediate port value. + ORG TABLE+(0E5H*3) ; 0E5H is the op-code for IN for a word to + JMP INWIMMED ; an immediate port value. + ORG TABLE+(0E4H*3) ; 0E4H is the op-code for IN for a byte to + JMP INIMMED ; an immediate port value. + ORG TABLE+(0CFH*3) ; 0CFH is the op-code for IRET. + JMP IRET_INST ; @P1C + ORG TABLE+(0CEH*3) ; 0CEH is the op-code for INTO. + JMP INTO_INST ; @P1C + ORG TABLE+(0CDH*3) ; 0CDH is the op-code for INT. + JMP INT_INST ; @P1C + ORG TABLE+(0CCH*3) ; 0CCH is the op-code for INT3. + JMP INT3 ; + ORG TABLE+(09DH*3) ; 09DH is the op-code for POPF. + JMP POPF_INST ; @P1C + ORG TABLE+(09CH*3) ; 09CH is the op-code for PUSHF. + JMP PUSHF_INST ; @P1C + ORG TABLE+(00FH*3) ; 00FH is the op-code for POP CS. + JMP MANPORT ; Expedient until 0F opcode properly emulated + + ORG TABLE_END + +VALUE3 DB 3 + + PUBLIC EMULATE + PUBLIC POPIO + PUBLIC INTCOM + +EMULATE PROC NEAR + + CLD + +PAGE +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Get the op-code that faulted from real memory. Use it as an index into ;; +;; the jump table to go to the appropriate routine. ;; +;; ;; +;; Note: The DATAOV macro creates a prefix that makes the instruction that ;; +;; immediately follows access all data as 32 bits wide. Similarly, ;; +;; the ADDROV macro creates a prefix that makes the instruction that ;; +;; immediately follows use addresses that are 32 bits wide. ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + MOV AX,HUGE_PTR ; Load DS with a selector that will + MOV DS,AX ; access all of memory as data + + MOV SS:WORD PTR [BP+BP_IP2],0 ; Clear the high words of the V86 + MOV SS:WORD PTR [BP+BP_CS2],0 ; task's CS and IP + + DATAOV + MOV SI,SS:[BP+BP_IP] ; Get the V86 IP into our SI. The high + DATAOV ; order word is zeroes. + MOV AX,SS:[BP+BP_CS] ; Get the V86 CS into AX. Again, the + DATAOV ; high order word is zeroes. + SHL AX,4 ; Multiply CS by 16 to convert it to an + DATAOV ; offset. + ADD SI,AX ; Add on IP. Now SI contains the offset + ; from 0 of the instruction that + ; faulted. + ADDROV + LODSB ; Get the op-code into AL + + ADDROV ; Intel bug # A0-119 + NOP ; Intel bug # A0-119 + + MUL VALUE3 ; Multiply the op-code by 3 to get an + LEA BX,TABLE ; index into the jump table + ADD AX,BX ; Add on the offset of the base of the + ; table + JMP AX ; Jump to the entry in the table. This + ; entry will then jump us to the + ; routine that handles this op-code. + +PAGE +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Woops! We got an op-code that we did not expect to fault. First let's ;; +;; check if this instruction faulted because the coprocessor was not avail- ;; +;; able. This will be signalled by an exception code of 07. If this is the ;; +;; case then reset the the following bits in CR0: EM (EMulation) says that ;; +;; coprocessor functions are emulated by software when set to 0; MP (monitor ;; +;; Processor), when set to 1 raises an exception 7 when TS (Task Switched) ;; +;; is set to 1 and a WAIT instruction is executed. TS is set every time ;; +;; there is a task switch. ;; +;; ;; +;; If it was not an execption 7 then we'll check the I/O privilege level ;; +;; (IOPL). An IOPL other less than 3 will cause all I/O and some sensitive ;; +;; instructions to fault. We really don't want to be bothered by all these ;; +;; faulting instructions so we'll set the IOPL to 3 which will allow anyone ;; +;; to do I/O and the sensitive instructions. This will improve performance ;; +;; since the V86 task will be interrupted less often. But first we'll check ;; +;; to see if the IOPL is already 3. If so then we got trouble. Most likely ;; +;; it's an invalid op-code. In this case we'll signal the error handler in ;; +;; INDEEXC. ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +UNEXPECTED: + CMP SS:WORD PTR [BP+BP_EX],0007H + ; Check if it's an 07 exception -- co- + ; processor not available + JNE TRYIOPL3 ; If no then try setting the IOPL to 3 + + MOV AX,8000H ; Set the paging enabled bit + DATAOV + SHL AX,16 ; It's the one all the way on the left + MOV AX,0001H ; Set protect mode on. Leave all other + ; bits off. + CMOV CR0,EAX ; Reset CR0 + JMP POPREGS ; Return to the V86 task @P1C + +; Try setting the IOPL to 3 + +TRYIOPL3: + MOV BX,AX ; Save the faulty op-code in BX + MOV AX,SS:WORD PTR [BP+BP_FL] ; Get the V86 flags and check if + AND AX,3000H ; IOPL is already set to 3 + CMP AX,3000H + JE WHOOPS ; If we're already at IOPL 3 the some- + ; things fishy. Time to signal an + ; error. + OR SS:WORD PTR [BP+BP_FL],3000H + ; Otherwise set IOPL to 3 and return to + JMP POPREGS ; the V86 task and let it try to @P1C + ; execute the instruction again. + +; We got trouble. + +WHOOPS: + +; Convert jump address back to opcode in al + + MOV AX,BX ; Put the jump table index back into AX + LEA BX,TABLE ; Subtract the offset of the base of the + SUB AX,BX ; jump table + DIV VALUE3 ; Divide AX by 3 to get the opcode back. + JMP DISPLAY ; Go to the error routine in INDEEXC + +PAGE +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Emulate the LOCK instruction. This is an instruction we really don't want ;; +;; to emulate so we will set the IOPL to 3 so that further LOCKs won't bother ;; +;; us. If the exception code is for "invalid op-code" then we will just jump ;; +;; to the routine above to set the IOPL to 3. Otherwise we will just step IP ;; +;; past the LOCK instruction thus treating it as a NOP. ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +LOCK_INST: ; @P1C + CMP SS:WORD PTR [BP+BP_EX],0006H ; Check if it's an invalid op code + JNE TRYIOPL3 ; Try setting the IOPL to 3 + ADD WORD PTR SS:[BP+BP_IP],1 ; Step IP past the instruction + JMP POPIO ; thus treating it as a NOP + +PAGE +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Emulate the STI, enable interupts, instruction. This is pretty simple to ;; +;; do. Just get the V86 task's flags and flip on the enable interrupts bit. ;; +;; And while we're at it we'll set the IOPL to 3. ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +STI_INST: ; @P1C + OR WORD PTR SS:[BP+BP_FL],3200H ; Set the enable interrupts bit + ; and set IOPL to 3 + ADD WORD PTR SS:[BP+BP_IP],1 ; Step IP past STI instruction + JMP POPIO + +PAGE +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Emulate the CLI, disable interrupts, instruction. Just as in STI above, ;; +;; all that is needed is to turn of the enable interrups bit. And again, set ;; +;; the IOPL to 3 so that we won't get control again. ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +CLI_INST: ; @P1C + AND WORD PTR SS:[BP+BP_FL],3DFFH ; Set interrupts disabled + OR WORD PTR SS:[BP+BP_FL],3000H ; Insure IOPL = 3 for speed + ADD WORD PTR SS:[BP+BP_IP],1 ; Step IP past instruction + JMP POPIO + +PAGE +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Emulate the INT3 instruction. To do this we put a 3 in the exception code ;; +;; and jump to the portion of the code that emulates the INT instruction. ;; +;; That code uses the exception code to get the interrupt vector from real ;; +;; memory and gives control to the V86 task at the interrupt address. ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +INT3: + MOV WORD PTR SS:[BP+BP_EX],3 ; Put a 3 in the exception field + ; This will cause the INTCOM + ; section to go to interrupt 3 + ADD WORD PTR SS:[BP+BP_IP],1 ; Step IP past INT3 inscruction + JMP INTCOM ; Go get the vector from real + ; memory + +PAGE +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Emulate the INTO instruction. This is done just like the INT3 above. It ;; +;; puts a 4 in the exception code and jumps to the code in the INT emulator ;; +;; that will get the real address of the interrupt. ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +INTO_INST: ; @P1C + MOV WORD PTR SS:[BP+BP_EX],4 ; Put a 4 in the exception field + ; This will cause the INTCOM + ; section to go to interrupt 4 + ADD WORD PTR SS:[BP+BP_IP],1 ; Step IP past INTO inscruction + JMP INTCOM ; Go get the vector from real + ; memory + +PAGE +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Emulate the IRET instruction. Get CS, IP and the flags off of the V86 ;; +;; task's stack and place them in the register values on our stack. When we ;; +;; return control to the V86 task these values will be taken off of our stack ;; +;; and placed in the V86 task's registers. ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +IRET_INST: ; @P1C + DATAOV ; Get the user's ESP (32 bit SP) + MOV AX,SS:[BP+BP_SP] ; and save it in ESI. + DATAOV + MOV SI,AX + ADD AX,6 ; Add 6 to the user's SP. This + MOV SS:WORD PTR [BP+BP_SP],AX ; skips over the IP, CS and + ; flags on the user's stack. + ; This puts SP where it would be + ; after the IRET. It assumes + ; there are at least six bytes + ; on the stack. + DATAOV + MOV AX,SS:[BP+BP_SS] ; Get the user's SS and multiply + DATAOV ; by 16. This converts the + SHL AX,4 ; segment value to an offset. + DATAOV ; Add this on to the ESP value in + ADD SI,AX ; ESI and now ESI is the offset + ; from 0 of the user's stack. + ADDROV + LODSW ; Get the user's EIP into EAX + + ADDROV ; Intel bug # A0-119 + NOP ; Intel bug # A0-119 + + MOV WORD PTR SS:[BP+BP_IP],AX ; Put IP into the register values + ; on our stack + ADDROV + LODSW ; Get the user's CS into EAX + + ADDROV ; Intel bug # A0-119 + NOP ; Intel bug # A0-119 + + MOV WORD PTR SS:[BP+BP_CS],AX ; Put CS into the register values + ; on our stack + ADDROV + LODSW ; Get the user's flags (32 bits) + + ADDROV ; Intel bug # A0-119 + NOP ; Intel bug # A0-119 + + AND AX,3FFFH ; Clean up the flags + OR AX,3000H ; Set IOPL to 3 + MOV WORD PTR SS:[BP+BP_FL],AX ; Put the flags into the register + ; values on our stack + JMP POPREGS ; Go return to the V86 task @P1C + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Emulate the INT instruction. Step the V86 task's CS and IP past the INT ;; +;; instruction. Push the flags, CS and IP in the task's stack. Get the ;; +;; interrupt number and use it to find the appropriate interrupt vector in ;; +;; low memory. Set the task's CS and IP to the interrupt vector and return ;; +;; control to the task. ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +INT_INST: ; @P1C + +; Get the interrupt number from the instruction. It is the second byte of the +; instruction. DS:SI was used to get the op-code. Now DS:SI points to the next +; byte of the instruction. All we have to do is get it. + + ADDROV + LODSB ; Get the interrupt number + + ADDROV ; Intel bug # A0-119 + NOP ; Intel bug # A0-119 + + MOV AH,0 ; Clear the high byte + MOV WORD PTR SS:[BP+BP_EX],AX ; Save the interrupt number in + ; the exception code field + +; Step IP past the INT instruction. + + ADD WORD PTR SS:[BP+BP_IP],2 ; STEP IP PAST INT INSTRUCTION + +; Check for INT 15. This is handled by INDEI15. + +INTCONT: + CMP AL,15H ; Is it interrupt 15? + JNE INTCOM ; If not, continue + JMP INT15 ; Else go to INDEI15 + +; Now use the interrupt number to get the appropriate interrupt vector from +; low core. + +INTCOM: + MOV AX,HUGE_PTR ; Load ES with the selector that + MOV ES,AX ; accesses all of memory as data + DATAOV + MOV DI,SS:[BP+BP_SP] ; Load EDI with the user's ESP + ; Now ES:EDI points to the user's + ; stack + SUB DI,6 ; Decrement "SP" to make space for + ; the flags, CS snd IP + MOV SS:WORD PTR [BP+BP_SP],DI ; Set the user's new SP + + DATAOV + MOV AX,SS:[BP+BP_SS] ; Get the user's SS and shift it + DATAOV ; left four bits to convert it + SHL AX,4 ; to an offset + DATAOV ; Add it to EDI so that EDI now + ADD DI,AX ; contains the physical offset + ; of the user's stack + +; Now put the flags, CS and IP on the V86 task's stack. They are put on in the +; order IP, CS, flags. This is backwards from the INT push order of flags, CS +; and then IP. This is because we are moving forward through memory (CLD) +; whereas the stack grows backwards through memory as things apushed on to it. + + MOV AX,SS:[BP+BP_IP] + ADDROV + STOSW ; Put IP on the V86 task's stack + ADDROV ; Intel bug # A0-119 + NOP ; Intel bug # A0-119 + + MOV AX,SS:[BP+BP_CS] + ADDROV + STOSW ; Put CS on the V86 task's stack + ADDROV ; Intel bug # A0-119 + NOP ; Intel bug # A0-119 + + MOV AX,SS:[BP+BP_FL] ; Get the v86 task's flags + OR AX,3000H ; Set IPOL to 3 while we're here + ADDROV + STOSW ; Put the flags on the v86 task's + ; stack + + ADDROV ; INTEL BUG # A0-119 + NOP ; INTEL BUG # A0-119 + AND AX,3CFFH ; Clean up flags for our IRET + MOV WORD PTR SS:[BP+BP_FL],AX + +; Use the interrupt number to get the CS and IP of the interrupt routine + + MOV SI,SS:[BP+BP_EX] ; Get the interrupt number + SHL SI,2 ; Multiply by 4 since interrupt + ; vectors are 4 bytes long + LODSW ; Get the IP for the vector + MOV WORD PTR SS:[BP+BP_IP],AX ; Put it in the V86 task's IP + LODSW ; Get the CS for the vector + MOV WORD PTR SS:[BP+BP_CS],AX ; Put it in the V86 task's CS + + JMP POPREGS ; Go return to the V86 task @P1C + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Emulate the PUSHF instruction. Get the V86 task's flags and put them on ;; +;; its stack. ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +PUSHF_INST: ; @P1C + MOV AX,HUGE_PTR ; Load ES with the selector that + MOV ES,AX ; accesses all of memory as data + + DATAOV + MOV DI,SS:[BP+BP_SP] ; Load EDI with the V86 task's SP + SUB DI,2 ; Decrement "SP" by one word to + ; make room for the flags + MOV SS:WORD PTR [BP+BP_SP],DI ; Store the new V86 task's SP + DATAOV + MOV AX,SS:[BP+BP_SS] ; Get the user's SS and shift it + DATAOV ; left four bits to convert it + SHL AX,4 ; to an offset + DATAOV ; Add it to EDI so that EDI now + ADD DI,AX ; contains the physical offset + ; of the user's stack + MOV AX,SS:[BP+BP_FL] ; Get the v86 task's flags + OR AX,3000H ; Set IPOL to 3 so that we won't + ADDROV ; be bothered anymore + STOSW ; Put the flags on the stack + ADDROV ; Intel bug # A0-119 + NOP ; Intel bug # A0-119 + + ADD WORD PTR SS:[BP+BP_IP],1 ; Step IP past PUSHF instruction + + JMP POPIO ; Go return to the V86 task + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Emulate the POPF instruction. Get the next word off of the V86 task's ;; +;; stack, set IOPL to 3 and put it in the V86 task's flags. ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +POPF_INST: ; @P1C + MOV AX,HUGE_PTR ; Big segment selector + MOV DS,AX ; Stack seg + DATAOV ; Create 32-bit operand prefix for next instruction + MOV AX,SS:[BP+BP_SP] ; stack ptr + DATAOV ; Create 32-bit operand prefix for next instruction + MOV SI,AX ; SI = stack ptr + ADD AX,2 + MOV SS:WORD PTR [BP+BP_SP],AX ; NEW STACK POINTER + DATAOV ; Create 32-bit operand prefix for next instruction + MOV AX,SS:[BP+BP_SS] ; Convert ss to 20 bit address + DATAOV ; Create 32-bit operand prefix for next instruction + SHL AX,4 + DATAOV ; Create 32-bit operand prefix for next instruction + ADD SI,AX ; Now have 32-bit offset from 0 + ADDROV ; Use 32-bit offset + LODSW ; GET REAL MODE FLAGS + ADDROV ; INTEL BUG # A0-119 + NOP ; INTEL BUG # A0-119 + AND AX,0FFFH ; CLEAN UP FLAGS FOR OUR IRET +; A POPF at level 3 will not change IOPL - WE WANT TO KEEP IT AT IOPL = 3 + OR AX,3000H ; SET IOPL = 3 + MOV WORD PTR SS:[BP+BP_FL],AX + ADD WORD PTR SS:[BP+BP_IP],1 ; STEP IP PAST INSTRUCTION + JMP POPIO ; CHECK FOR SINGLE STEP + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; The following entry point, POPIO, is the exit routine for situations when ;; +;; a single step condition would be lost by a normal IRET to the V86 task. ;; +;; You see, in real mode the single step interrupt gets control whenever the ;; +;; single step flag is on. However, we just got control and emulated the ;; +;; instruction. If we just return to the V86 task at CS:IP then the step ;; +;; between the instruction we just emulated and the next instruction will be ;; +;; missed by the single step routine. Therefore we check the V86 task's flags;; +;; to see if the single step flag is on. If so, then we give control to the ;; +;; singel step interrupt. Otherwise we just IRET to the V86 task's CS:IP. ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +POPIO: + CMP SS:WORD PTR [BP+BP_EX],1 ; First check if the reason we got + ; control was because of a + ; single step + JE POPCONT ; If so, then we don't have to + ; give control to the single + ; step routine 'cause we already + ; did it. + TEST WORD PTR SS:[BP+BP_FL],0100H ; Was the single step flag on? + JZ POPCONT ; If not then just IRET + MOV SS:WORD PTR [BP+BP_EX],1 ; Otherwise put a 1 (single step + JMP INTCOM ; interrupt number) in the + ; exception code and go to + ; INTCOM to give control to the + ; interrupt +POPCONT: + +; Restore the registers. On entry, in INDEEXC, the registers were pushed as: +; DS, all registers, ES. + + POP ES ; Restore ES + DATAOV + POPA ; Restore all the registers (32 bits wide) + POP DS ; Restore DS + ADD SP,(BP_IP-BP_EX); Move SP past the exception ID an error code + ; that were put on our stack when the 386 + ; gave us control for the exception. + ; SS:SP now points to the V86's IP, CS, flags + ; for the IRET + DATAOV ; IP, CS, and flags are saved 32 bits wide + IRET ; Give control back to the V86 task + +EMULATE ENDP + +PROG ENDS + + END + diff --git a/v4.0/src/DEV/XMAEM/INDEEXC.ASM b/v4.0/src/DEV/XMAEM/INDEEXC.ASM new file mode 100644 index 0000000..a8faaa5 --- /dev/null +++ b/v4.0/src/DEV/XMAEM/INDEEXC.ASM @@ -0,0 +1,799 @@ +PAGE 60,132 +TITLE INDEEXC - 386 XMA EMULATOR - System Exception Handler + +COMMENT # +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* * +* MODULE NAME : INDEEXC * +* * +* * +* 5669-196 (C) COPYRIGHT 1988 Microsoft Corp. * +* * +* DESCRIPTIVE NAME: 80386 XMA Emulator System Exception Handler * +* * +* STATUS (LEVEL) : VERSION (0) LEVEL (1.0) * +* * +* FUNCTION : This module gets control whenever an interrupt 00 - 07, * +* 09 - 0E or 15 occurs. This is because this module's * +* entry point was placed in the IDT entries for these * +* interrupts. It determines what course of action to take * +* on the interrupt/exception. * +* * +* First thing it does is is to check to see who caused the * +* exception. If the exception came from the virtual 8086 * +* (V86) task then it will try to emulate the interrupt if * +* necessary. If the exception came from the emulator it- * +* self then we may have problems. If it was a general * +* protection exception (INT 0D) then it just ignores it and * +* passes control back to the V86 task. If it was a page * +* fault (INT 14) then it assumes that whatever is running in* +* the V86 task came up with a bad address so it terminates * +* the application since it is obviously bad. If it is * +* neither of these two errors then something has gone bad * +* in the emulator. When this happens it signals the error * +* handler to prompt the user to take a dump or reIPL the * +* system. * +* * +* The old error routine used to display a panel with the * +* contents of the registers and the stack. The new error * +* routine just forces the V86 task to run the NMI code. * +* The old routine was left in place for debugging purposes. * +* * +* MODULE TYPE : ASM * +* * +* REGISTER USAGE : 80386 Standard * +* * +* RESTRICTIONS : None * +* * +* DEPENDENCIES : None * +* * +* ENTRY POINT : VEXCPT13 * +* * +* LINKAGE : This entry point is placed in the IDT for each interrupt * +* we want to handle. Whenever one of those interrupts is * +* execupted, control comes here. * +* * +* INPUT PARMS : None * +* * +* RETURN PARMS : None * +* * +* OTHER EFFECTS : None * +* * +* EXIT NORMAL : IRET to the virtual 8086 task * +* * +* EXIT ERROR : Force the V86 task to execute an NMI * +* * +* EXTERNAL * +* REFERENCES : EMULATE - Entry point for INDEEMU * +* INT15 - Entry point for INDEI15 * +* * +* SUB-ROUTINES : HEXD - Display the double word in EAX * +* HEXW - Display the word in AX * +* HEXB - Display the byte in AL * +* * +* MACROS : DATAOV - Create a prefix for the following instruction * +* so that it accesses data 32 bits wide * +* ADDROV - Create a prefix for the following instruction * +* so that it uses addresses that are 32 bits wide * +* * +* CONTROL BLOCKS : INDEDAT.INC * +* * +* CHANGE ACTIVITY : * +* * +* $MOD(INDEEXC) COMP(LOAD) PROD(3270PC) : * +* * +* $D0=D0004700 410 870523 D : NEW FOR RELEASE 1.1 * +* $P1=P0000312 410 870804 D : CLEAN UP WARNING MESSAGES * +* * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +# + + .286P ; Enable recognition of 286 privileged instructs. + + .XLIST ; Turn off the listing + INCLUDE INDEDAT.INC ; Include system data + + IF1 ; Only include macros on the first pass of + INCLUDE INDEOVP.MAC ; of the assembler + ENDIF + .LIST ; Turn on the listing + +SEX_ATTR EQU 04B00H +STACK_ATTR EQU 00700H +BLANK EQU 00020H +BP_START EQU 0 + + PUBLIC INDEEXC + +PROG SEGMENT PARA PUBLIC 'PROG' + + ASSUME CS:PROG + ASSUME DS:NOTHING + ASSUME ES:NOTHING + ASSUME SS:NOTHING + +INDEEXC LABEL NEAR + + ; External entry points + + EXTRN EMULATE:NEAR ; Entry point to INDEEMU + EXTRN INT15:NEAR ; Entry point to INDEI15 + + ; External variables + + EXTRN CRT_SELECTOR:WORD ; Selector for the display buffer (INDEI15) + EXTRN XMATID:BYTE ; Current bank ID (INDEXMA) + +PAGE + +VEXCPT13 LABEL NEAR + + PUBLIC SEX + PUBLIC POPREGS ; P1C + PUBLIC HEXD + PUBLIC HEXW + PUBLIC HEXB + PUBLIC VEXCPT13 + PUBLIC DISPLAY + +SEX PROC NEAR + + CLD ; All moves go forward + +; Save the registers on the stack. These are the registers of the task that +; got interrupted. + +SAVE_REGS: + PUSH DS ; Save DS + + DATAOV ; Save all the registers (32 bits wide). They are + PUSHA ; pushed in the order: AX, CX, DX, BX, original + ; SP (before the PUSHA), BP, SI, DI. + + PUSH ES ; Save ES + MOV BP,SP ; Point BP to the start of the register save area + +PAGE +; First let's check to see who caused the exception, the V86 task or us. This +; is done by checking the flags of the routine that was interrupted. The VM +; flag is set for every routine that is running in V86 mode. There are really +; only two entities in the system, the emulator and the V86 task. The V86 task +; has the VM bit set when it is running, the emulator does not. So we can read +; this bit to determine who was interrupted. + + MOV AX,SS:WORD PTR [BP+BP_FL2] ; Get hi-order word of the flags + TEST AL,02H ; Check the VM bit + JZ DISPLAY ; Uh oh! It's us. + JMP LONGWAY ; It's the V86 task + +PAGE +; The following entry point, DISPLAY, is know to other modules. They jump here +; when they encounter a severe error and want to call the error handler. + +DISPLAY: +; JMP DODISP ; Just display the registers. + ; Comment out for final product. + +; Check if it was a general protection exception. If so, then we'll just pass +; control back to the V86 task and let it worry about it. + + MOV BP,SP ; Point BP to the saved registers + CMP SS:WORD PTR [BP+BP_EX],0DH ; Was it a general protection + ; exception + JNE DISPCONT ; If not, the continue + JMP POPREGS ; Else just return to the V86 @P1C + ; task + +; Check if it was a page fault. Page faults only occur when the page that is +; addressed is marked not present. When the emulator sets up memory it marks +; all pages as present. And this is true because the emulator does no page +; swapping. It messes with the page tables but it doesn't remove pages from +; memory. Therefore, if the page is not present then whatever is running in +; the V86 task came up with some wierd non-existant address. This guy obviously +; has gone west or doesn't know what he's doing. So we forcr the application +; to be terminated. + +DISPCONT: + CMP SS:WORD PTR [BP+BP_EX],0EH ; Was it a page fault? + JNE CHKVM ; Nope. Continue checking. + JMP PAGE_FAULT ; Yup. Assume application had bad + ; addresses. Therefore, termin- + ; ate the application. + +; Lastly we'll check who had the error, them or us. We need to check again +; because anybody can jump to the DISPLAY label above. If the V86 task had +; the exception then we will just terminate whatever was running in the V86 +; task. If the emulator had the exception, then obviously WE don't know +; what WE'RE doing. Oops! In this case we will force an NMI and bring down +; the whole system. If the emulator isn't healthy then nothing else should +; run either. It may sould selfish, but if the emulator is damaged then the +; rest of the system will die soon anyway. + +CHKVM: + MOV AX,SS:WORD PTR [BP+BP_FL2] ; Check the VM bit in the flags + TEST AL,02H ; to see who was running + JZ ERROR ; It was us. Better Force an NMI. + JMP TERM_APP ; It was them. Terminate whatever + ; is running. + +PAGE +ERROR: + +;----------------------------------------------------------------------------D1A +; We're in big trouble now. Something has gone west and there's no way to D1A +; get back home. At this point we give up and send up a flare. We signal D1A +; the error handler by forcing the V86 task to execute the NMI interrupt. D1A +; We put a marker of 0DEADH at the fixed location 0:4F2. This is in the D1A +; BIOS communication area. The error handler will look here for our marker D1A +; to determine if the NMI came from the emulator. If it finds it, it will D1A +; put up a severe error with our return code and ask the user to take a dump D1A +; or reIPL. The code following this new code is old code to display a debug D1A +; panel with the contents of the registers and stack. It is left here for D1A +; debugging but will not be executed when the new code is in place. D1A +;----------------------------------------------------------------------------D1A + ; D1A + MOV AX,HUGE_PTR ; Load ES with a selector that @D1A + MOV ES,AX ; accesses all of memory as data @D1A + ; D1A + MOV DI,4F2H ; Put our 0DEADH marker at the @D1A + MOV WORD PTR ES:[DI],0DEADH ; fixed location 0:4F2. D1A + MOV WORD PTR SS:[BP+BP_EX],2; Put a 2, the NMI interrupt number,@D1A + ; in the exception field. The D1A + ; code after LONGWAY4 will use D1A + ; this number to get the interrupt D1A + ; vector. D1A + JMP LONGWAY4 ; Go do the NMI @D1A + +PAGE +; The following code will not be executed. It is left as a debugging tool. + +DODISP: +; Blank the display screen + MOV DI,CRT_SELECTOR ; Load ES with the selector for the + MOV ES,DI ; display buffer + XOR DI,DI ; DI points to the start of the buffer + MOV CX,80*15 ; Only clear 15 lines + MOV AX,STACK_ATTR+BLANK ; AH = white on black attribute + ; AL = ASCII for a blank + REP STOSW ; Write 15 rows of while blanks on black + +; Highlite the display area + + XOR DI,DI ; DI points to the start of the buffer + MOV CX,80*6 ; Highlite 6 lines + MOV AX,SEX_ATTR+BLANK ; AH = white on red attribute + ; AL = ASCII for a blank + REP STOSW ; Highlight the 6 lines + +; Display the registers one at at time + + MOV CX,21 ; 18 regs + excpt id + task id + error code + MOV SI,SYS_PATCH_DS ; Load DS with the selector for our data + MOV DS,SI ; area + MOV SI,OFFSET REG_TABLE ; DS:SI now points to the reg table + SUB AX,AX ; Clear AH + MOV AL,XMATID ; Load AL with the current XMA bank ID + MOV WORD PTR SS:[BP+BP_PSP2],AX ; The bank ID gets displayed as + ; the task ID + +; Display one register + +DO_REG: + +; Calculate the offset into the display buffer + + LODSB ; Get the row coordinate + MOV AH,160 ; Multiply by 160 byte to a row + MUL AH ; (80 bytes of character, attribute) + ADD AL,DS:BYTE PTR [SI] ; Add on the number of columns + ADC AH,0 ; Don't forget the carry + ADD AL,DS:BYTE PTR [SI] ; Add the columns again (remember - + ADC AH,0 ; character, attribute) + INC SI ; Point to next entry in the reg table + MOV DI,AX ; Load DI with the offset into the + ; display buffer + +DO_ID: + +; Put the register name on the screen. + + MOV BX,SEX_ATTR ; Load the attribute byte into AH + MOV AH,BH + LODSB ; Get the character to display + CMP AL,0 ; Are we at the end of the string yet? + JZ DID_ID ; Yup. Then go display the register + ; value. + STOSW ; Else put the next character of the + ; register name on the screen + JMP DO_ID ; Go get the next character + +DID_ID: + +; Put the register value on the screen. + + MOV BP,SP ; BP points the start of the register + ; save area + LODSW ; Get the offset of this register's + ; save area + ADD BP,AX ; Add to BP. BP ponts to the register + ; value. + LODSW ; Get the length of this register's + MOV DX,AX ; save area + CMP DX,2 ; If the length is not two words + JNE MORE ; Then go to the one word code + + DATAOV ; Grab all 32 bits of the register + MOV AX,SS:WORD PTR [BP] + ADD BP,4 ; Point BP past the register value + CALL HEXD ; Display the 32 bit value + JMP LOOPREG ; Jump over the one word code + +MORE: + MOV AX,SS:WORD PTR [BP] ; Get the word value into AX + ADD BP,2 ; Step BP past the register value + CALL HEXW ; Display the 16 bit value + +LOOPREG: + LOOP DO_REG ; Go do another register + +PAGE +; +; Let's go put up the stack for everyone to see !!! +; + MOV BP,SP ; Reset BP to point to the beginning + ; of the register save area + +; If the V86 task faulted, display its stack. Else display our stack. + + MOV AX,SS:WORD PTR [BP+BP_FL2] ; Alright, whose fault was it? + TEST AL,02H ; Check the VM flag + JZ NOTVM86 ; Gulp! It's us. + +; It was the V86 task that faulted. Set DS:SI to point to their stack. + + MOV AX,HUGE_PTR ; Load DS with a slector that accesses + MOV DS,AX ; all of memory as data + DATAOV + SUB SI,SI ; Clear all 32 bits of ESI + MOV SI,SS:[BP+BP_SP] ; Load SI wiht the V86 task's SP + DATAOV + SUB AX,AX ; Clear all 32 bits of EAX + MOV AX,SS:[BP+BP_SS] ; Get the V86 task's SS + DATAOV ; Shift it left 4 bits to convert it + SHL AX,4 ; to an offset + DATAOV ; Add it on to SP. Now SI contains + ADD SI,AX ; the offest of the stack from 0 + + MOV BP,0FFFFH ; I don't know what this code does but + DATAOV ; I left it anyway. The following + ; comment is the only clue. + SHL BP,16 ; Make stack seg limit very large + JMP COMSTACK + +; It was us that faulted. Set DS:SI to point to our stack. + +NOTVM86: + MOV AX,SS ; Load DS with our own SS + MOV DS,AX + DATAOV + SUB SI,SI ; Clear all 32 bits of ESI + MOV SI,SP ; Now DS:SI points to our stack + +; DS:SI points to the beginning of a stack. Now display it. + +COMSTACK: + MOV DI,1120 ; Load DI with the offset into the + ; display buffer of where we want + ; to display the stack + MOV CX,70H ; Display 70H words of the stack + MOV BX,STACK_ATTR ; Load BH with the attribute byte + +DISP_STACK: + + ADDROV ; Get a word off of the stack + LODSW + ADDROV ; Intel bug # A0-119 + NOP ; Intel bug # A0-119 + CALL HEXW ; Display the word + MOV AX,STACK_ATTR+BLANK ; Put a blank after each word + STOSW ; Put that on the screen + LOOP DISP_STACK ; Do the rest of the stack + +; Wait for the operator to press the system request key to go to +; the monitor, or the escape key to perform the reset operation + +WAIT_HERE: + + IN AL,064H ; Poll the keystroke port + TEST AL,000000001B ; Did the user hit a key? + JZ WAIT_HERE ; Nope. Go check again. + + IN AL,060H ; Get the keystroke + CMP AL,054H ; System request key? + JNE CHK_ESC ; No. Check for Esc key. + + CMP SS:WORD PTR [BP+BP_EX],0EH ; It was system request key. Now + ; check for a page fault. + JE PAGE_FAULT ; If so, go remove the extra return code + ; from the stack and terminate the + ; application running in the V86 task. + JMP POPREGS ; Else just return to the V86 task @P1C + +CHK_ESC: + CMP AL,001H ; Was the Esc key hit? + JNE CHKPRT ; Nope. Go check for Print Screen and + ; Ctrl-Alt-Del. + MOV BP,SP ; Point BP to the register save area + CMP SS:WORD PTR [BP+BP_EX],0EH ; Check for a page fault + JE PAGE_FAULT ; If so, go remove the extra return + ; code from the stack and terminate + ; the application running in the + ; V86 task. + MOV AX,SS:WORD PTR [BP+BP_FL2] ; Else, Esc key hit and no page fault + TEST AL,02H ; Check who faulted, them or us + JZ DO_RESET ; If it's us, then reIPL. + +TERM_APP: + MOV SS:WORD PTR [BP+BP_EX],21H ; If it's them, termintate whatever + MOV SS:WORD PTR [BP+BP_AX],4CFFH ; is running by forcing a DOS + ; termintate. Return code is FF. + JMP DO_MONITOR ; Go pass the interrupt to the V86 + ; task + +PAGE_FAULT: +; +; On a page fault the 80386 processor puts an extra error code on our stack. +; (How handy!) We now need to remove the extra error code so that when we pop +; the registers off our stack at the end we end up with our stack possitioned +; correctly for the IRET. To do this, we move everything on the stack that is +; below the extra error code up four bytes. The error code takes up four bytes. +; + + STD ; Shift into reverse, 'cause stacks + ; grow down + MOV CX,(BP_EC-BP_START)/2 ; Load CX with the number of words + MOV DI,(BP_EC+2-BP_START) ; Point DI to the last word of the + ADD DI,BP ; extra error code + MOV SI,(BP_EC-2-BP_START) ; Point SI to the last word of the + ADD SI,BP ; exception code + MOV AX,SS ; Set up the selectors + MOV ES,AX + MOV DS,AX +STACK_LOOP: + LODSW ; Get a word off the stack + STOSW ; And move it up four bytes + LOOP STACK_LOOP ; Do that trick again + + CLD ; Shift back into forward + ADD BP,4 ; Scoot BP up four bytes to point to + ; pur new register save area + MOV SP,BP ; Adjust SP, too + JMP TERM_APP ; Go kill whatever is running in the V86 + ; task +CHKPRT: + CMP AL,053H ; Was the Del (as in Ctrl-Alt-Del) key + ; pressed? + JE DO_RESET ; If so, then reIPL + + CMP AL,037H ; Was the print screen key pressed? + JNE WAIT_HERE ; Nope. Must be an invalid key. Go get + ; another keystroke. + + MOV BP,SP ; It was a print screen. Reset BP to + ; point to our register save area. + MOV AX,SS:WORD PTR [BP+BP_FL2] ; If is was us that had the problem + TEST AL,02H ; then we don't allow print screen + ; because the system is not healthy + JZ WAIT_HERE ; Go get another key + + MOV SS:WORD PTR [BP+BP_EX],05H ; If it was them then we can do a + JMP DO_MONITOR ; print screen. Force the V86 + ; task to do an INT 5 (Prt Sc). + +; +; Reset the system, i.e. reIPL. Put a 1234 in the BIOS reset flag at 472H. +; This will keep BIOS from running through the whole POST upon reIPL. +; + +DO_RESET: + MOV AX,HUGE_PTR ; Load ES with a selector that accesses all + MOV ES,AX ; of memory as data + DATAOV + SUB DI,DI ; Clear EDI (32 bit DI) + MOV DI,472H ; Load the offset of the BIOS reset flag + MOV AX,1234H + ADDROV + STOSW ; Put 1234 in the BIOS reset flag + + ADDROV ; Intel bug # A0-119 + NOP ; Intel bug # A0-119 + + MOV AL,0FEH ; Now OUT a FE to port 64H. This will cause + OUT 064H,AL ; the machine to reIPL. + +HALT: HLT ; Just in case we don't reIPL, this halt @P1C + JMP HALT ; loop will keep the processor from doing @P1C + ; anything else + +DO_MONITOR: + +; If the exception camefrom the V86 task then pass the interrupt to the +; real mode interrupt vector. + + MOV BP,SP ; Reset BP to point to our register save area + ; on the stack + MOV AX,SS:WORD PTR [BP+BP_FL2] ; Check if it was the V86 task that + TEST AL,02H ; faulted + JNZ LONGWAY ; If so, pass the interrupt on + JMP POPREGS ; Otherwise just return @P1C + +PAGE + +; We come here if the check up front said it was the V86 task that faulted. + +LONGWAY: + MOV SS:WORD PTR [BP+BP_SP2],0 ;Purify high-order words of SP, SS + MOV SS:WORD PTR [BP+BP_SS2],0 ; and IP + MOV SS:WORD PTR [BP+BP_IP2],0 + +; Test for interrupt versus exception. + + CMP SS:WORD PTR [BP+BP_EX],13 ; Check if it was a general + ; protection exception + JNE LONGWAY2 ; If not, continue checking + JMP EMULATE ; If so, then go to INDEEMU to + ; emulate the instruction +LONGWAY2: + CMP SS:WORD PTR [BP+BP_EX],6 ; Was it an invalid op-code + ; exception? + JB LONGWAY4 ; If lower, then pass the + ; interrupt back to the V86 task + CMP SS:WORD PTR [BP+BP_EX],7 ; Was it a coprocessor not avail- + ; able exception? + JA LONGWAY3 ; If greater then do more checking + JMP EMULATE ; Emulation needed for interrupts + ; 6 and 7 +LONGWAY3: + CMP SS:WORD PTR [BP+BP_EX],15H ; Check if it was INT 15 + JNE LONGWAY4 ; Nope, pass interrupt back to + ; the V86 task + JMP INT15 ; Emulation needed for INT 15 + +LONGWAY4: + +; Pass the interrupt back to the V86 task. + + MOV AX,HUGE_PTR ; Load ES with a selector that accesses + MOV ES,AX ; all of memory as data + DATAOV + SUB DI,DI ; Clear all 32 bits of EDI + MOV DI,SS:[BP+BP_SP] ; Load DI with the V86 task's SP + SUB DI,6 ; Decrement "SP" to make room for the + ; push of IP, CS and the flags. + ; Note that this assumes there are at + ; least 6 bytes keft on the stack. + MOV SS:WORD PTR [BP+BP_SP],DI ; Put the new SP into the V86 register + ; save area + DATAOV + SUB AX,AX ; Clear all 32 bits of EAX + MOV AX,SS:[BP+BP_SS] ; Load AX with the V86 task's SS + DATAOV ; Shift it left four bits to convert + SHL AX,4 ; it to an offset + DATAOV ; Add it on to SP. Now DI contains + ADD DI,AX ; the offest of the stack from 0 + +; Now put the V86 task's IP, CS and flags on the stack. They are put on in +; reverse order because the stack grows down, but we are going up as we put +; the stuff on the stack. + + MOV AX,SS:[BP+BP_IP] ; Get the V86 task's IP + ADDROV + STOSW ; Put it on his stack + ADDROV ; Intel bug # A0-119 + NOP ; Intel bug # A0-119 + + MOV AX,SS:[BP+BP_CS] ; Get the V86 task's CS + ADDROV + STOSW ; Put it on his stack + ADDROV ; Intel bug # A0-119 + NOP ; Intel bug # A0-119 + + MOV AX,SS:[BP+BP_FL] ; Get the V86 task's flags + ADDROV + STOSW ; Put them on his stack + ADDROV ; Intel bug # A0-119 + NOP ; Intel bug # A0-119 + AND AX,3CFFH ; Clean up the flags for our IRET + MOV WORD PTR SS:[BP+BP_FL],AX + + MOV SI,SS:[BP+BP_EX] ; Get the interrupt vector + SHL SI,2 ; Multiply by four because interrupt + ; vectorsare four bytes long + MOV AX,HUGE_PTR ; Load DS with a selector that accesses + MOV DS,AX ; all of memory as data + LODSW ; Get the IP for the interrupt + MOV WORD PTR SS:[BP+BP_IP],AX ; Store it in the V86 task's IP + LODSW ; Get the CS for the interrupt + MOV WORD PTR SS:[BP+BP_CS],AX ; Store it in the V86 task's CS + +PAGE +POPREGS: ; @P1C + +; Pop the saved registers off of our stack and IRET to the V86 task. + + POP ES ; Restore ES + DATAOV ; Restore all the registers + POPA ; (32 bit registers) + POP DS ; Restore DS + ADD SP,(BP_IP-BP_EX) ; Step SP past the error code placed + ; on our stack by the 80386 + DATAOV + IRET ; IRET to the V86 task + +SEX ENDP + +SUBTTL HEXD - Convert DWORD in EAX to ASCII string at ES:DI +PAGE +; +; INPUT: EAX = hex double word to display +; BH = attribute byte +; ES:DI = location in the display buffer where the characters are +; to be placed +; +; OUTPUT: DI is incremented past last character displayed +; Characters are placed on the screen +; + +HEXD PROC NEAR + DATAOV + PUSH AX ; Save EAX on the stack + DATAOV + SHR AX,24 ; Shift the high order byte into AL + CALL HEXB ; Convert the byte in AL to ASCII at ES:DI + DATAOV + POP AX ; Restore the original EAX + PUSH AX ; Save the low word of EAX (i.e. AX) + DATAOV + SHR AX,16 ; Shift the second highest byte into AL + CALL HEXB ; Convert the byte in AL to ASCII at ES:DI + POP AX ; Restore the low word of EAX (i.e. AX) + PUSH AX ; And save it again + XCHG AH,AL ; Move the thrid highest byte into AL + CALL HEXB ; Convert the byte in AL to an ASCII string + POP AX ; Restore AX + CALL HEXB ; And conver the last byte to ASCII at ES:DI + RET + +HEXD ENDP + +SUBTTL HEXW - Convert WORD in AX to ASCII string at ES:DI +PAGE +; +; INPUT: AX = hex word to display +; BH = attribute byte +; ES:DI = location in the display buffer where the characters are +; to be placed +; +; OUTPUT: DI is incremented past last character +; Characters are placed on the screen +; + +HEXW PROC NEAR + + PUSH AX ; Save the value in AX on the stack + XCHG AH,AL ; Move the high byte into AL + CALL HEXB ; Convert the byte in AL to a string at ES:DI + POP AX ; Restore AX + CALL HEXB ; Convert the low byte to ASCII at ES:DI + RET + +HEXW ENDP + +SUBTTL HEXD - Convert BYTE in AL to ASCII string at ES:DI +PAGE +; +; INPUT: AL = hex byte to display +; BH = attribute byte +; ES:DI = location in the display buffer where the characters are +; to be placed +; +; OUTPUT: DI is incremented past last character +; Characters are placed on the screen +; + +HEXB PROC NEAR + + PUSH AX ; Save the value in AX + AND AL,0F0H ; Clear the low nibble of AL + SHR AL,1 ; Shift the high nibble into the low nibble + SHR AL,1 + SHR AL,1 + SHR AL,1 + ADD AL,030H ; Add '0' to convert to ASCII + CMP AL,03AH ; Was this hex digit greater than 9? + JC OK1 ; Nope. It's OK, so go display it. + ADD AL,7 ; Yup. Then convert to 'A' to 'F'. +OK1: MOV AH,BH ; Move the attribute into AH + STOSW ; Put the character & attribute into the display + ; buffer at ES:DI + POP AX ; Restore AX + AND AL,00FH ; Clear the high nibble of AL + ADD AL,030H ; Convert the low nibble to ASCII as before + CMP AL,03AH ; Hex digit greater than 9? + JC OK2 ; Nope. It's OK, so go display it. + ADD AL,7 ; Yup. Then convert to 'A' to 'F'. +OK2: MOV AH,BH + STOSW + RET + +HEXB ENDP + + PAGE + +REG MACRO NAME,ROW,COL,L + DB &ROW ; Display of register &NAME starts in + DB &COL ; row &ROW and column &COL + DB '&NAME:' ; Name to display for register &NAME + DB 0 ; End of string marker + DW BP_&NAME ; Offset of value of register &NAME + ; that we saved on our stack + DW &L ; Number of words in the register + ENDM + +SUBTTL Register table +PAGE +REG_TABLE LABEL NEAR +; +; Declare data used for displaying the registers on the screen. For each +; register there is a structure that contains the row and column of where the +; display of the register starts, the text or register name ended with a 0, the +; offset into the stack where the value in the register was saved, and the +; number of words in the register. +; + +; First, lets fake a register to put the exception message on the screen. + + DB 1 ; Row 1 + DB 10 ; Column 10 + DB 'System Exception - ' ; Text + DB 0 ; End of text + DW BP_EX ; Offset to hex value on the stack + DW 1 ; Number of words of data + +; Now, fake one to put the task id (bank ID) on the screen. + + DB 1 ; Row 1 + DB 50 ; Column 50 + DB 'Task ID - ' ; Text + DB 0 ; End of text + DW BP_PSP2 ; Offset to hex value on the stack + DW 1 ; Number of words of data + +; Now, lets do the registers + + REG CS,3,1,1 + REG IP,3,9,2 + REG SS,3,21,1 + REG SP,3,29,2 + REG DS,3,41,1 + REG SI,3,49,2 + REG ES,3,61,1 + REG DI,3,69,2 + + REG AX,4,1,2 + REG BX,4,13,2 + REG CX,4,25,2 + REG DX,4,37,2 + REG BP,4,49,2 + REG EC,4,61,2 + + REG FL,5,1,2 + REG VMDS,5,18,1 + REG VMES,5,33,1 + REG VMFS,5,48,1 + REG VMGS,5,63,1 + +PROG ENDS + + END + diff --git a/v4.0/src/DEV/XMAEM/INDEGDT.ASM b/v4.0/src/DEV/XMAEM/INDEGDT.ASM new file mode 100644 index 0000000..e945373 --- /dev/null +++ b/v4.0/src/DEV/XMAEM/INDEGDT.ASM @@ -0,0 +1,379 @@ +PAGE 60,132 +TITLE INDEGDT - 386 XMA Emulator - Build Global Descriptor Table + +COMMENT # +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* * +* MODULE NAME : INDEGDT * +* * +* * +* 5669-196 (C) COPYRIGHT 1988 Microsoft Corp. * +* * +* DESCRIPTIVE NAME: Build the Global Descriptor Table (GDT) * +* * +* STATUS (LEVEL) : Version (0) Level (1.0) * +* * +* FUNCTION : Build the Global Descriptor Table (GDT) for the 80386 * +* XMA emulator * +* * +* MODULE TYPE : ASM * +* * +* REGISTER USAGE : 80386 Standard * +* * +* RESTRICTIONS : None * +* * +* DEPENDENCIES : None * +* * +* ENTRY POINT : GDT_BLD * +* * +* LINKAGE : Called NEAR from INDEINI * +* * +* INPUT PARMS : None * +* * +* RETURN PARMS : None * +* * +* OTHER EFFECTS : None * +* * +* EXIT NORMAL : Return to INDEINI * +* * +* EXIT ERROR : None * +* * +* EXTERNAL * +* REFERENCES : None * +* * +* SUB-ROUTINES : SREG_2_24BITS - Convert the 16 bit value in AX to a 24 * +* bit value in DH and AX. * +* ADDOFF - Add the 16 bit offset in AX to the 24 bit value * +* in DH and BX. * +* * +* MACROS : DESCR_DEF - Declare a descriptor entry * +* DESCR_INIT - Initialize a descriptor * +* * +* CONTROL BLOCKS : INDEDAT - System data structures * +* * +* CHANGE ACTIVITY : * +* * +* $MOD(INDEGDT) COMP(LOAD) PROD(3270PC) : * +* * +* $D0=D0004700 410 870530 D : NEW FOR RELEASE 1.1 * +* $P1=P0000293 410 870731 D : LIMIT LINES TO 80 CHARACTERS * +* $P2=P0000312 410 870804 D : CHANGE COMPONENT FROM MISC TO LOAD * +* $P3=P0000410 410 870918 D : RELOCATE DATA AREAS TO MAKE ROOM FOR BIT MAP * +* * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +# + + .286P ; Enable recognition of 286 privileged instructs. + + .XLIST ; Turn off the listing + INCLUDE INDEDAT.INC ; Include system data structures + INCLUDE INDEACC.INC ; Include access byte definitions + + IF1 ; Only include macros on the first pass + INCLUDE INDEDES.MAC ; Descriptor macros + ENDIF + .LIST ; Turn on the listing + +PROG SEGMENT PARA PUBLIC 'PROG' + + ASSUME CS:PROG + ASSUME SS:NOTHING + ASSUME DS:PROG + ASSUME ES:NOTHING + +INDEGDT LABEL NEAR + + PUBLIC INDEGDT + PUBLIC GDT_BLD + PUBLIC GDT_DATA_START + PUBLIC SREG_2_24BITS + +; The following data define a pre-initialized GDT. They represent +; all structures which will exist when the emulator comes up. +; THESE MUST BE INITIALIZED IN THE ORDER IN WHICH THEY APPEAR IN THE +; GDT_DEF STRUCTURE DEFINITION AS IT APPEARS IN INDEDAT.INC. This data +; area will be copied from the code segment to the final GDT resting +; place during initialization. + +GDT_DATA_START LABEL WORD + +; First entry is unusable + + DESCR_DEF SEG, 0, 0, 0, 0 + +; The descriptor for GDT itself + + DESCR_DEF SEG, GDT_LEN, GDT_LOC, 3, CPL0_DATA_ACCESS +PAGE + +; The system IDT descriptor + + DESCR_DEF SEG, SIDT_LEN, SIDT_LOC, 3, CPL0_DATA_ACCESS + +; The real system data area descriptor (XMA pages) + + DESCR_DEF SEG, 0FFFFH, 0000H, 11H, CPL0_DATA_ACCESS + +; The virtual IDT descriptor (not needed so use for all memory) + + DESCR_DEF SEG, MAX_SEG_LEN, NSEG@_LO, NSEG@_HI, CPL0_DATA_ACCESS + +; The LOADALL descriptor + + DESCR_DEF SEG, 0, 0, 0, 0 +PAGE + +; Compatible monochrome display + + DESCR_DEF SEG, MCRT_SIZE, MCRT@_LO, MCRT@_HI, CPL0_DATA_ACCESS + +; Compatible color display + + DESCR_DEF SEG, CCRT_SIZE, CCRT@_LO, CCRT@_HI, CPL0_DATA_ACCESS + +; Enhanced color display - one entry for each 64K P1C + + DESCR_DEF SEG, ECCRT_SIZE, ECCRT@_LO_LO, ECCRT@_LO_HI, CPL0_DATA_ACCESS + +; Second part of enhanced display P1C + + DESCR_DEF SEG, ECCRT_SIZE, ECCRT@_HI_LO, ECCRT@_HI_HI, CPL0_DATA_ACCESS +PAGE + +; Code segment for ROM code, system IDT + + DESCR_DEF SEG, MAX_SEG_LEN, CSEG@_LO, CSEG@_HI, CPL0_CODE_ACCESS + +; Data segment for ROM code, system IDT + + DESCR_DEF SEG, MAX_SEG_LEN, CSEG@_LO, CSEG@_HI, CPL0_CODE_ACCESS + +; Temporarily, the monitor is installed using the patch +; segment descriptors in the GDT + +MSEG@_LO EQU 00000H +MSEG@_HI EQU 008H + + +; Code segment for patch code, system IDT + + DESCR_DEF SEG, MAX_SEG_LEN, MSEG@_LO, MSEG@_HI, CPL0_CODE_ACCESS + +; Data segment for patch code, system IDT + + DESCR_DEF SEG, MAX_SEG_LEN, MSEG@_LO, MSEG@_HI, CPL0_DATA_ACCESS +PAGE + +; Code segment for ROM code, virtual IDT + + DESCR_DEF SEG, MAX_SEG_LEN, CSEG@_LO, CSEG@_HI, CPL0_CODE_ACCESS + +; Data segment for ROM code, virtual IDT + + DESCR_DEF SEG, MAX_SEG_LEN, CSEG@_LO, CSEG@_HI, CPL0_CODE_ACCESS + +; Code segment for patch code, virtual IDT + + DESCR_DEF SEG, NULL_SEG_LEN, NSEG@_LO, NSEG@_HI, NULL_ACCESS + +; Data segment for patch code, virtual IDT + + DESCR_DEF SEG, NULL_SEG_LEN, NSEG@_LO, NSEG@_HI, NULL_ACCESS +PAGE + +; Temporary descriptors for ES, CS, SS, and DS + + DESCR_DEF SEG, MAX_SEG_LEN, NSEG@_LO, NSEG@_HI, CPL0_DATA_ACCESS + + DESCR_DEF SEG, MAX_SEG_LEN, NSEG@_LO, NSEG@_HI, CPL0_CODE_ACCESS + + DESCR_DEF SEG, MAX_SEG_LEN, NSEG@_LO, NSEG@_HI, CPL0_DATA_ACCESS + + DESCR_DEF SEG, MAX_SEG_LEN, NSEG@_LO, NSEG@_HI, CPL0_DATA_ACCESS +PAGE + +; These DQ's pad out the space between the last MultiPC descriptor and the +; PMVM descriptors. They don't need initialization. + + DQ 9 DUP (0) ; These 9 are for the Monitor descriptors + +; This is for the keyboard owner (not used) + + DQ 0 + +; These 16 are for the virtual timer support + + DQ 16 DUP (0) + +; The following 32 descriptors are for exception condition task gates. + + REPT 32 + DQ 0 + ENDM + +; The following 16 pairs are for the hardware interrupt handling tasks. + + REPT 16 + DQ 0 + DQ 0 + ENDM + +; The following pair is for the DISPATCH task + + DESCR_DEF SEG, TSS_LEN, DISPATCH_LOC, 3, + DESCR_DEF SEG, TSS_LEN, DISPATCH_LOC, 3, CPL0_DATA_ACCESS + + DESCR_DEF SEG, 0, 0, 0,LDT_DESC + +; BASIC's segment + + DESCR_DEF SEG, 07FFFH, 06000H, 0FH, CPL0_DATA_ACCESS + +; BIOS's segment + + DESCR_DEF SEG, 01FFFH, 00000H, 0FH, CPL0_DATA_ACCESS + + DQ 13 DUP (0) ; Reserved guys + +; The following guys are junk ! Used before the first TSS allocated. These +; have to be in the PMVM location in the GDT. + + DESCR_DEF SEG, TSS_LEN, 0C000H, 0, FREE_TSS ; For the TR + + DESCR_DEF SEG, TSS_LEN, 0C000H, 0, CPL0_DATA_ACCESS ; TSS as data + + DESCR_DEF SEG, GDT_LEN, 0D000H, 0, LDT_DESC ; For the LDTR + + DESCR_DEF SEG, GDT_LEN, 0D000H, 0, CPL0_DATA_ACCESS ; LDT as data + +GDT_DATA_END LABEL WORD + +COPY_LEN EQU GDT_DATA_END-GDT_DATA_START + +; +; End of pre-allocated GDT +; + +PAGE + +GDT_BLD PROC NEAR + +; Copy the pre-initialized GDT into its proper location in memory + + CLI ; All string operations go forward + + MOV SI,OFFSET GDT_DATA_START ; DS:SI points to the pre-initialized + ; GDT above + MOV CX,COPY_LEN/2 ; CX = number of words to copy + MOV DI,GDT_LOC ; ES:DI points to the GDT location + REP MOVSW ; Copy GDT into its final resting place + +; Now let's initialize some of the GDT entries + +; Set up the descriptors for our code segment and data segment + + MOV AX,CS ; Get our CS + CALL SREG_2_24BITS ; And convert it to a 24 bit offset + MOV BX,AX ; Get the monitor offset + +ALLSET: + DESCR_INIT SEG, SYS_PATCH_CS, 07FFFH, BX, DH, CPL0_CODE_ACCESS + DESCR_INIT SEG, SYS_PATCH_DS, 0FFFFH, BX, DH, CPL0_DATA_ACCESS + +; Initialize the descriptor for the GDT + + MOV AX,ES ; Get the segment of the GDT + CALL SREG_2_24BITS ; Convert to a 24 bit offset + MOV DL,DH ; Save a copy of the hi byte + MOV BX,GDT_LOC ; Add on the offset of the GDT + CALL ADDOFF + + DESCR_INIT SEG, GDT_PTR, GDT_LEN, BX, DH, CPL0_DATA_ACCESS + +; Initialize the descriptor for the IDT + + MOV BX,SIDT_LOC ; DH,AX already contains the segment + ; converted to 24 bits so all we + CALL ADDOFF ; have to do is add on the offset + + DESCR_INIT SEG, MON_IDT_PTR, SIDT_LEN, BX, DH, CPL0_DATA_ACCESS + +; Initialize the descriptor that accesses all of memory as data + + DESCR_INIT BSEG, HUGE_PTR, 0FFFFH, 0, 0, CPL0_DATA_ACCESS + +; Initialize the descriptors for the V86 task's LDT + + MOV BX,DISPATCH_LOC ; @P3C + CALL ADDOFF + + DESCR_INIT SEG,SCRUBBER.VM_LDTR,00FFFH,BX,DH,LDT_DESC + DESCR_INIT SEG,SCRUBBER.LDT_PTR,00FFFH,BX,DH,CPL0_DATA_ACCESS + +; Initialize the descriptors for the V86 task's TR + + MOV BX,DISPATCH_LOC ; @P3C + CALL ADDOFF + + DESCR_INIT SEG,SCRUBBER.VM_TR,TSS_LEN,BX,DH,FREE_TSS_386 ; @P3C + DESCR_INIT SEG,SCRUBBER.TSS_PTR,TSS_LEN,BX,DH,CPL0_DATA_ACCESS; @P3C + + RET + +GDT_BLD ENDP + +PAGE +; SREG_2_24BITS converts the segment register 16 bit value in the AX register +; into a 24 bit value in DH and AX +; +; Input : AX = segment register value +; +; Output: AX = 24 bit low word +; DH = 24 bit high byte + + +SREG_2_24BITS PROC NEAR + +; Put the high four bits of AH into the low four bits of DH + + MOV DH,AH ; Get the high byte of the segment value + ; into DH + AND DH,0F0H ; Strip off the low nibble + SHR DH,4 ; Shift right four bits + +; Now shift AX left four bits + + AND AH,00FH ; Strip high nibble from AH + ; This keeps the carry flag from being + ; set which could effect later ADDs. + SHL AX,4 ; Shift AX + + RET + +SREG_2_24BITS ENDP + +PAGE +; ADDOFF adds the 16 bit offset in BX to the 24 bit value in DL and AX. The +; result is left in DH and BX. +; +; Input : DL = 24 bit high byte +; AX = 24 bit low word +; BX = offset to be added +; +; Output: DH = 24 bit high byte +; BX = 24 bit low word + +ADDOFF PROC NEAR + + MOV DH,DL ; Restore the high byte that was saved + ; in DL + ADD BX,AX ; Add on the offset + ADC DH,0 ; Add the carry, if any, to the high + ; byte + RET + +ADDOFF ENDP + +PROG ENDS + + END diff --git a/v4.0/src/DEV/XMAEM/INDEI15.ASM b/v4.0/src/DEV/XMAEM/INDEI15.ASM new file mode 100644 index 0000000..047648d --- /dev/null +++ b/v4.0/src/DEV/XMAEM/INDEI15.ASM @@ -0,0 +1,503 @@ +PAGE 60,132 +TITLE INDEI15 - 386 XMA Emulator - Interrupt 15 handler + +COMMENT # +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* * +* MODULE NAME : INDEI15 * +* * +* * +* 5669-196 (C) COPYRIGHT 1988 Microsoft Corp. * +* * +* DESCRIPTIVE NAME: Interrupt 15H handler for the 80386 XMA emulator * +* * +* STATUS (LEVEL) : Version (0) Level (2.0) * +* * +* FUNCTION : This module emulates the MOVEBLOCK functions of interrupt * +* 15H. The MOVEBLOCK functions are specified by an AH value* +* of 87H to 89H. The user can use the MOVEBLOCK functions * +* to copy a block of memory to another block of memory. * +* This includes copying to and from memory above 1M. This * +* is really where this function comes in handy. The user * +* can reserve memory above 1M for use by the MOVEBLOCK * +* functions by specifying the number of K to be reserved as * +* a parameter on the line to load the emulator in the * +* CONFIG.SYS file. * +* * +* DEVICE=INDXMAEM.SYS bbb * +* * +* "bbb" is the number of K to reserve for MOVEBLOCK * +* functions * +* * +* We allocate a buffer for the MOVEBLOCK functions at the * +* top of available memory. Any functions dealing with this * +* buffer area must be handles by us. * +* * +* Function 87H is the actual MOVEBLOCK function. The user * +* passes a 32 bit source address and a 32 bit destination * +* address in a parameter list pointed to by ES:SI. CX * +* contains the number of words to copy. We need to * +* intercept this call and check the source and destination * +* addresses. If either or both of these addresses is above * +* 1M then we need to adjust the addresses so that they * +* access the MOVEBLOCK buffer up at the top of memory. You * +* see, the user thinks the extended memory starts right * +* after the 1M boundary. We want to make it look like the * +* MOVEBLOCK buffer sits right after the 1M boundary. So we * +* monkey with the user's addresses so that they access the * +* MOVEBLOCK buffer instead of real memory after 1M, because * +* that memory is us. * +* * +* Function 88H queries how many K are above the 1M * +* boundary. We can't tell him how much is really there * +* because some of it is us and our XMA pages. So for this * +* function we will just return the size of the MOVEBLOCK * +* buffer. This function was moved to a real mode P3C* +* interrupt handler in module INDE15H. P3C* +* * +* Function 89H is reserved for the MOVEBLOCK functions but * +* is not in use right now. So for this function we just * +* return a bad return code in AH and set the carry flag. * +* * +* MODULE TYPE : ASM * +* * +* REGISTER USAGE : 80386 Standard * +* * +* RESTRICTIONS : None * +* * +* DEPENDENCIES : None * +* * +* ENTRY POINT : INT15 * +* * +* LINKAGE : Jumped to from INDEEXC * +* * +* INPUT PARMS : None * +* * +* RETURN PARMS : None * +* * +* OTHER EFFECTS : None * +* * +* EXIT NORMAL : Go to POPIO in INDEEMU to IRET to the V86 task * +* * +* EXIT ERROR : None * +* * +* EXTERNAL * +* REFERENCES : EMULATE - Entry point for INDEEMU * +* POPIO - Entry in INDEEMU to check for single step * +* interrupts, pop the registers and IRET to the * +* V86 task * +* POPREGS - Entry point in INDEEXC to pop the registers * +* off the stack and IRET to the V86 task P2C* +* * +* SUB-ROUTINES : None * +* * +* MACROS : DATAOV - Add prefix for the next instruction so that it * +* accesses data as 32 bits wide * +* ADDROV - Add prefix for the next instruction so that it * +* uses addresses that are 32 bits wide * +* * +* CONTROL BLOCKS : INDEDAT.INC * +* * +* CHANGE ACTIVITY : * +* * +* $MOD(INDEI15) COMP(LOAD) PROD(3270PC) : * +* * +* $D0=D0004700 410 870603 D : NEW FOR RELEASE 1.1 * +* $P1=P0000293 410 870731 D : LIMIT LINES TO 80 CHARACTERS * +* $P2=P0000312 410 870804 D : CLEAN UP WARNING MESSAGES * +* $D1=D0007100 410 870817 D : CHANGE TO EMULATE XMA 2 * +* $P3=P0000xxx 120 880331 D : MOVE FUNCTION 88H HANDLING TO INDE15H * +* * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +# + + .286P ; Enable recognition of 286 privileged instructs. + + .XLIST ; Turn off the listing + INCLUDE INDEDAT.INC ; Include the system data structures + + IF1 ; Only include the macros on the first pass + INCLUDE INDEOVP.MAC + ENDIF + .LIST ; Turn on the listing + +PROG SEGMENT PARA PUBLIC 'PROG' + + ASSUME CS:PROG + ASSUME DS:PROG + ASSUME ES:NOTHING + ASSUME SS:NOTHING + +INDEI15 LABEL NEAR + + EXTRN EMULATE:NEAR ; Entry point for INDEEMU + EXTRN POPIO:NEAR ; Entry in INDEEMU to check for single + ; step interrupts and return to the + ; V86 task + EXTRN POPREGS:NEAR ; Entry in INDEEXC to return to the P2C + ; V86 task + + PUBLIC INDEI15 + PUBLIC INT15 + PUBLIC TTTABLE + +PAGE + +INT15 PROC NEAR + + CLD ; All string operations go forward + +; We handle the INT 15H functions for MOVEBLOCK interface. These functions +; are specified by an AH value of 87H to 89H. Function 87H is the MOVEBLOCK +; function. Function 88H queries the size of memory above 1M. Function 89H +; is reserved but not supported so we return a return code of 86H. + + CMP SS:BYTE PTR [BP+BP_AX+1],87H ; Is AH asking for function 87H? + JB NOTMINE ; No. It's too low. It's out of our + ; range so we'll pass it on to the + ; real vector. + JE MOVEBLK ; It is 87H! Let's go do the MOVEBLOCK. + + CMP SS:BYTE PTR [BP+BP_AX+1],89H ; Is AH asking for function 89H? + JNE NOTMINE ; No. It's not our function so @P3C + ; so we'll pass it on to the real + ; vector. + ; @P3D + MOV SS:BYTE PTR [BP+BP_AX+1],86H ; It's 89H. Sorry we don't support + ; that function. Put an 86H return + ; code in AH. + OR WORD PTR SS:[BP+BP_FL],1 ; Set the carry flag + JMP POPIO ; And return to the V86 task + +; Hey, it's not MY interrupt. + +NOTMINE: + JMP DOINT ; Go pass the interrupt back to the + ; real INT 15H vector + + +; Function 88H code to query the size of memory above 1M was moved to 3@P3D +; INDE15H. + +PAGE +; The user wants to move a block of memory. Now the source and target of the +; MOVEBLOCK can each be below 1M or above 1M. For addresses above 1M we must +; make adjustments so that the MOVEBLOCK is done to and/or from the MOVEBLOCK +; buffer in high memory. The user passes a parameter list which is pointed +; at by ES:SI. At offset 0EH is a 32 bit pointer to the source block. At +; offset 1AH is a 32 bit pointer to the destination block. CX contains the +; number of words to move. Here we go! + +MOVEBLK: + MOV AX,HUGE_PTR ; Load DS and ES with a selector that + MOV DS,AX ; accesses all of memory as data + MOV ES,AX + +; Get the user's ES:SI and convert it to a 32 bit offset in ESI. + + DATAOV ; Purge ESI + SUB SI,SI + MOV SI,SS:[BP+BP_SI] ; Load SI with the user's SI + + DATAOV ; Purge EBX + SUB BX,BX + MOV BX,10H ; Set EBX to 1M by loading it with 10H + DATAOV ; and shifting it left 16 bits to + SHL BX,16 ; multiply by 64K + + DATAOV ; Sterilize EAX + SUB AX,AX + MOV AX,SS:[BP+BP_VMES] ; Load AX with the user's ES + DATAOV ; Shift it left four bits to convert it + SHL AX,4 ; to an offset + + DATAOV ; Add the ES offset on to SI. Now ESI + ADD SI,AX ; is the offset from 0 of the user's + ; parameter list. + DATAOV ; Add 1AH to SI. Now it points to the + ADD SI,1AH ; 32 bit destination address. + + DATAOV + ADDROV ; Get the 32 bit destination address + LODSW ; into EAX + + ADDROV ; Intel bug # A0-119 + NOP ; Intel bug # A0-119 + + DATAOV ; Clear the top eight bits of any + SHL AX,8 ; residual gunk. Only 24 bit ;P1C + DATAOV ; addresses (16M) are allowed anyway. + SHR AX,8 ; Shift the bits off the left end and + ; shift zeroes back in. + DATAOV ; Move this clean value into EDI + MOV DI,AX ; EDI now has the destination address + + DATAOV ; Check if this address is over 1M. If + CMP DI,BX ; so then it's going to our MOVEBLOCK + ; buffer. + JB OK1 ; It's below 1M? OK. Leave it alone. + +; The destination is above 1M so we have to modify the destination address so +; that it points to our MOVEBLOCK buffer. + + PUSH DS ; Save DS + MOV AX,SYS_PATCH_DS ; Load DS with the selector for our data + MOV DS,AX ; segment + + DATAOV ; Clean up EAX + SUB AX,AX + MOV AX,MAXMEM ; Load the total number of K on the box + SUB AX,BUFF_SIZE ; Subtract the MOVEBLOCK buffer size + SUB AX,1024 ; Subtract 1M (/1K) for 0 to 1M. This + ; leaves AX with the number of K from + ; 1M to the MOVEBLOCK buffer. + POP DS ; Restore DS + DATAOV ; Multiply EAX by 1K (shift left 10) to + SHL AX,10 ; convert it to an offset from 1M of + ; the MOVEBLOCK buffer + DATAOV ; Add this to EDI. EDI now points to + ADD DI,AX ; a location within (hopefully) the + ; MOVEBLOCK buffer as if the buffer + ; were located at the 1M boundary. + +; Now let's get the source address + +OK1: + DATAOV ; Subtract 0C from ESI to point ESI to + SUB SI,0CH ; offset 0E in the parameter list + + DATAOV + ADDROV ; Get the 32 bit source address into + LODSW ; EAX + + ADDROV ; Intel bug # A0-119 + NOP ; Intel bug # A0-119 + + DATAOV ; Clear the top eight bits of any + SHL AX,8 ; residual gunk. Only 24 bit address + DATAOV ; (16M) are allowed. Shift the gunky + SHR AX,8 ; bits off the left end and shift + ; zeroes back in. + DATAOV ; Move this clean value into ESI + MOV SI,AX ; ESI now has the source address + + DATAOV ; Check if this address is over 1M. If + CMP SI,BX ; so then it's goin' to our MOVEBLOCK + ; buffer. + JB OK2 ; It's below 1M? OK. Let it be. + +; The source is above 1M so we have to modify the source address so that it +; points to our MOVEBLOCK buffer. + + PUSH DS ; Save DS + MOV AX,SYS_PATCH_DS ; Load DS with the selector for our data + MOV DS,AX ; segment + + DATAOV ; Sanitize up EAX + SUB AX,AX + MOV AX,MAXMEM ; Load the total number of K on the box + SUB AX,BUFF_SIZE ; Subtract the MOVEBLOCK buffer size + SUB AX,1024 ; Subtract 1M (/1K) for 0 to 1M. This + ; leaves AX with the number of K from + ; 1M to the MOVEBLOCK buffer. + POP DS ; Restore DS + DATAOV ; Multiply EAX by 1K (shift left 10) to + SHL AX,10 ; convert it to an offset from 1M of + ; the MOVEBLOCK buffer + DATAOV ; Add this to ESI. ESI now points to + ADD SI,AX ; a location within (hopefully) the + ; MOVEBLOCK buffer as if the buffer + ; were located at the 1M boundary. + +; Our pointers are all set. Let's get CX and do the copy for the guy. + +OK2: + MOV CX,SS:[BP+BP_CX] ; Get the user's CX + TEST CL,01H ; Is this an even number? + JZ MOV4 ; If so, we can make the copy faster + ; by moving double words + ADDROV ; Nope. It's odd. We'll just do the + REP MOVSW ; copy with words. + + ADDROV ; Intel bug # A0-119 + NOP ; Intel bug # A0-119 + + JMP MOVCOM ; Skip over the double word copy + +MOV4: + SHR CX,1 ; Divide the count by two since we'll + ; be copying double words + DATAOV ; Do it 32 bits wide + ADDROV ; Use the 32 bit ESI and EDI + REP MOVSW ; Ready? ZOOOOM! + + ADDROV ; Intel bug # A0-119 + NOP ; Intel bug # A0-119 + +; Now let's set the flags and return code in AH to show that every thing went +; A-OK. + +MOVCOM: + MOV SS:BYTE PTR [BP+BP_AX+1],0 ; Set a zero return code in AH + AND WORD PTR SS:[BP+BP_FL],0FFFEH ; Reset the carry flag + OR WORD PTR SS:[BP+BP_FL],40H ; Set the zero flag + + JMP POPIO ; Return to the V86 task + +PAGE + +; It's not a MOVEBLOCK function so we'll just pass the interrupt on to the real +; interrupt handler. + +DOINT: + MOV AX,HUGE_PTR ; Load ES with a selector that accesses + MOV ES,AX ; all of memory as data + DATAOV ; Load EDI with the user's ESP + MOV DI,SS:[BP+BP_SP] + + SUB DI,6 ; Decrement "SP" by six to make room + ; for our simulated interrupt that + ; will put the flags, CS and IP on + ; the stack. This assumes that there + ; are indeed six bytes left on the + ; stack. + MOV SS:WORD PTR [BP+BP_SP],DI ; Set the user's new SP + + DATAOV ; Get the user's SS into our AX + MOV AX,SS:[BP+BP_SS] + DATAOV ; Shift "SS" left four bits to convert + SHL AX,4 ; it to an offset + DATAOV ; Add this to "SP" in DI to make EDI + ADD DI,AX ; a 32 bit offset from 0 of the user's + ; stack + +; Now put the flags, CS and IP on the V86 task's stack. They are put on in the +; order IP, CS, flags. This is backwards from the INT push order of flags, CS +; and then IP. This is because we are moving forward through memory (CLD) +; whereas the stack grows backwards through memory as things pushed on to it. + + MOV AX,SS:[BP+BP_IP] ; Get the user's IP + ADDROV ; And put it on his stack + STOSW + + ADDROV ; Intel bug # A0-119 + NOP ; Intel bug # A0-119 + + MOV AX,SS:[BP+BP_CS] ; Get the user's CS + ADDROV ; And put it on his stack + STOSW + + ADDROV ; Intel bug # A0-119 + NOP ; Intel bug # A0-119 + + MOV AX,SS:[BP+BP_FL] ; Get the user's flags + OR AX,3000H ; Set the IOPL to 3 so we get fewer + ; faults + ADDROV ; And put them on his stack + STOSW + + ADDROV ; Intel bug # A0-119 + NOP ; Intel bug # A0-119 + + AND AX,3CFFH ; Clean up the flags for our IRET + MOV WORD PTR SS:[BP+BP_FL],AX ; Put them on our stack + + MOV SI,SS:[BP+BP_EX] ; Get the interrupt number + SHL SI,2 ; Multiply by four 'cause interrupt + ; vectors are four bytes long + MOV AX,HUGE_PTR ; Load DS with a selector that accesses + MOV DS,AX ; all of memory as data + LODSW ; Get the IP of the interrupt vector + ; from the interrupt vector table + MOV WORD PTR SS:[BP+BP_IP],AX ; Put it in the IP saved on our stack + LODSW ; Get the CS of the interrupt vector + ; from the interrupt vector table + MOV WORD PTR SS:[BP+BP_CS],AX ; Put it in the CS saved on our stack + + JMP POPREGS ; Now when we do an IRET we will @P2C + ; actually be giving control to the + ; real INT 15H vector. +INT15 ENDP + +PAGE +; Macros used to define data areas + +; DDL - Define a label and make it public + +DDL MACRO NAME,SIZE + PUBLIC &NAME +&NAME LABEL &SIZE + ENDM + + +; DDW - Define a word and make it public + +DDW MACRO NAME,VALUE + IFNB <&NAME> ;; If a name was given then make it public + PUBLIC &NAME + ENDIF + IFNB <&VALUE> ;; If a value was given then initialize the +&NAME DW &VALUE ;; variable to that value + ELSE ;; Else initialize it to 0 +&NAME DW 0 + ENDIF + ENDM + + +; Now lets define some data. Remember, these are all PUBLIC even though they +; are not listed at the top of the program as being such. It's easy to lose +; these guys. + + DDW REAL_SP,0 ; Our initial SP when we come up in real mode + + DDW REAL_SS,0 ; Our initial SS when we come up in real mode + + DDW REAL_CS,0 ; Our initial CS when we come up in real mode + + DDW PGTBLOFF,0 ; The offset of the normal page tables + + DDW SGTBLOFF,0 ; The offset of the page directory + + DDW NORMPAGE,0 ; The entry for the first page directory entry + DDW ,0 ; which points to the first normal page table. + ; A 32 bit value + DDW XMAPAGE,7 ; Page directory entry that points to the first + DDW ,0011H ; XMA page table at 11000:0. Access and present + ; bits set. It, too, is a 32 bit value. + DDW BUFF_SIZE,0 ; Size of the MOVEBLOCK buffer. Initialized to 0. + + DDW MAXMEM,1000H ; Total amount of K in the box. Initialized to 4M. + + DDW CRT_SELECTOR,C_BWCRT_PTR ; Selector for the display buffer + +; And now, the world famous Translate Table!! YEAAAA!! +; +; The first 160 entries (0 to 640K) are initialized to blocks 0 to '9F'X. D1A +; This is to emulate the XMA 2 device driver which uses these blocks to back D1A +; the memory on the mother board from 0 to 640K which it disabled. It sets D1A +; up the translate table for bank 0 such that it maps the XMA memory from 0 D1A +; to 640K to conventional memory at 0 to 640K. So we emulate that here by D1A +; initializing the firs 160 entries in the translate table. D1A + +TTTABLE: + BLOCK = 0 ; Start with block number 0 @D1A + REPT 20 ; Do 20 times (20 x 8 = 160) @D1A + DW BLOCK,BLOCK+1,BLOCK+2,BLOCK+3,BLOCK+4,BLOCK+5,BLOCK+6,BLOCK+7 + ; Define eight translate table entries @D1A + ; initialized to the block number D1A + BLOCK = BLOCK + 8 ; Increment the block number to the next set @D1A + ENDM ; of eight translate table entries @D1A + + DW 96 + 256*15 DUP(0FFFH) ; The rest of the translate table @D1C + +TTTABLE_END: ; Label to mark the end of the translate table + + +; Define our stack for when we're in protect mode + + DDW MON_STACK_BASE,<500 DUP(0)> + DDL SP_INIT,WORD ; Top of the stack. The initial SP points here. + +PROG ENDS + + END diff --git a/v4.0/src/DEV/XMAEM/INDEIDT.ASM b/v4.0/src/DEV/XMAEM/INDEIDT.ASM new file mode 100644 index 0000000..28e9161 --- /dev/null +++ b/v4.0/src/DEV/XMAEM/INDEIDT.ASM @@ -0,0 +1,512 @@ +PAGE 60,132 +TITLE INDEIDT - 386 XMA Emulator - Build Interrupt Descriptor Table + +COMMENT # +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* * +* MODULE NAME : INDEIDT * +* * +* * +* 5669-196 (C) COPYRIGHT 1988 Microsoft Corp. * +* * +* DESCRIPTIVE NAME: Build the Interrupt Descriptor Table (IDT) * +* * +* STATUS (LEVEL) : Version (0) Level (2.0) * +* * +* FUNCTION : Build the Interrupt Descriptor Table for the 80386 XMA * +* emulator. * +* * +* MODULE TYPE : ASM * +* * +* REGISTER USAGE : 80386 Standard * +* * +* RESTRICTIONS : None * +* * +* DEPENDENCIES : None * +* * +* ENTRY POINT : SIDT_BLD (not to be confused with SIDTBLD) * +* * +* LINKAGE : Called by INDEINI * +* * +* INPUT PARMS : None * +* * +* RETURN PARMS : None * +* * +* OTHER EFFECTS : None * +* * +* EXIT NORMAL : Return to INDEINI * +* * +* EXIT ERROR : None * +* * +* EXTERNAL * +* REFERENCES : VEXCP13 - Entry point for INDEEXC * +* * +* SUB-ROUTINES : BLD_IDT - Put the entries into the IDT * +* * +* MACROS : DATAOV - Create a prefix for the following instruction * +* so that it accesses data 32 bits wide * +* ADDROV - Create a prefix for the following instruction * +* so that it uses addresses that are 32 bits wide * +* * +* CONTROL BLOCKS : INDEDAT * +* * +* CHANGE ACTIVITY : * +* * +* $MOD(INDEIDT) COMP(LOAD) PROD(3270PC) : * +* * +* $D0=D0004700 410 870530 D : NEW FOR RELEASE 1.1 * +* $P1=P0000312 410 870803 D : CHANGE COMPONENT FROM MISC TO LOAD * +* $P2=P0000xxx 120 880517 D : HANDLE INT 0D FROM V86 TASK, I.E., OPTICAL DISK * +* * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +# + + .286P ; Enable recognition of 286 privileged instructs. + + .XLIST ; Turn off the listing + INCLUDE INDEDAT.INC ; System data structures and equates + + IF1 ; Only include macros on the first pass + INCLUDE INDEOVP.MAC + ENDIF + .LIST ; Turn on the listing +PAGE + +PROG SEGMENT PARA PUBLIC 'PROG' + + ASSUME CS:PROG + ASSUME SS:NOTHING + ASSUME DS:NOTHING + ASSUME ES:NOTHING + +INDEIDT LABEL NEAR + +; Let these entry points be known to other modules. + + PUBLIC INDEIDT + PUBLIC SIDT_BLD + +; This is the entry point to INDEEXC. + + EXTRN VEXCPT13:NEAR + +PAGE +; Define the stack structure for our fast path. For all the interrupts that we +; don't want to handle we just pass the interrupt back to the real interrupt +; vector. The entry points for these vectors push the interrupt vector offset +; (interrupt number * 4) onto the stack and then call FASTPATH to pass the +; interrupt to the real vector. FASTPATH pushes BP, AX, DI and SI on to the +; stack. The following structure is a map of the stack after these registers +; are pushed. This structure allows us to access info on the stack. + +SPSTACK STRUC + +SP_SI DW 0 ; Saved ESI (32 bit SI) + DW 0 +SP_DI DW 0 ; Saved EDI (32 bit DI) + DW 0 +SP_AX DW 0 ; Saved EAX + DW 0 +SP_BP DW 0 ; Saved BP (only 16 bits) +SP_EX DW 0 ; Interrupt vector offset (interrupt number * 4) + +; The following information is saved by the 80386 + +SP_IP DW 0 ; Interruptee's EIP (32 bit IP) +SP_IP2 DW 0 +SP_CS DW 0 ; Interruptee's CS (16 bit CS and 16 bit junk) +SP_CS2 DW 0 +SP_FL DW 0 ; Interruptee's Eflags (32 bit flags) +SP_FL2 DW 0 +SP_SP DW 0 ; Interruptee's ESP +SP_SP2 DW 0 +SP_SS DW 0 ; Interruptee's SS +SP_SS2 DW 0 +SP_VMES DW 0 ; Interruptee's ES + DW 0 +SP_VMDS DW 0 ; Interruptee's DS + DW 0 +SP_VMFS DW 0 ; Interruptee's FS + DW 0 +SP_VMGS DW 0 ; Interruptee's GS + DW 0 +SP_STK DW 0 ; The rest of the stack + +SPSTACK ENDS + +SP_START EQU 0 ; Offset from BP of the start of the save area + ; BP is set ot point to the start of the save area + +PAGE + +SIDTBLD PROC NEAR + +; Generate the entry points for all (yes, ALL) 256 interrupt vectors. For +; interrupt 0D (general Protection exception) we will check if it was the V86 +; task that faulted. If so, then we will just pass the interrupt back to the +; V86 task. Else, we will go to our exception handler since the interrupt +; happened because of the emulator. +; +; For interrupts 00, 01, 02, 03, 04, 05, 06, 07, 09, 0A, 0B, 0C, 0E and 15 we +; will go to our exception handler. +; +; For all other interrupts we will go to the FASTPATH routine which will pass +; the interrupt back to the V86 interrupt vector. +; +; Note: For interrupts that go to our exception handler we push a 32 bit error +; code and then push the interrupt number. For the FASTPATH interrupts +; we push the interrupt vector offset (interrupt number *4). This results +; in different stack structures depending on how the interrupt is handled. +; So be careful when you're trying to figure out what's on the stack. +; + +; Interrupt 0D + + IRP V,<0D> +VEC&V: + PUSH 0&V&H ; Push the interrupt number (0D) + PUSH BP ; Save BP + DATAOV ; @P2A + PUSH AX ; Save EAX, all 32bits of it. @P2A + DATAOV ; @P2A + PUSH DI ; Save EDI @P2A + DATAOV ; @P2A + PUSH SI ; Save ESI @P2A + MOV BP,SP ; Point BP to the save area @P2A + + ; Now we must check if the INT 0D came from the V86 task P2A + ; or if it was a General Protection exception. In the P2A + ; case of a General Protection exception the 80386 puts P2A + ; an error code on the stack after pushing the EFLAGS, CS P2A + ; and EIP. The error code is 32 bits wide. If the V86 P2A + ; task issues an INT 0D, an error code is NOT placed on P2A + ; the stack. In this case we want to pass the interrupt P2A + ; back to the V86 task instead of going to our exception P2A + ; handler. The way we check for an error code is by P2A + ; checking how much ESP has been decremented since the P2A + ; start of the interrupt. The original ESP is saved in P2A + ; the TSS. Our stack definition above does not include P2A + ; an error code. So if ESP has been decremented more than P2A + ; the size of our structure, we can know that an error P2A + ; code is on the stack and then go to our exception P2A + ; handler. P2A + + MOV AX,SCRUBBER.TSS_PTR ; Load DS with the selector @P2A + MOV DS,AX ; that accesses the TSS as data @P2A + MOV SI,0 ; Base for reading the TSS @P2A + DATAOV ; @P2A + MOV AX,[SI].ETSS_SP0 ; Get the original SP before the @P2A + DATAOV ; interrupt @P2A + SUB AX,SP ; Subtract the current stack @P2A + ; pointer @P2A + CMP AX,SP_STK ; Check for an error code @P2A + ; @P2D + JG SKIP&V ; If there's an error code, go @P2C + ; handle the exception P2C + MOV WORD PTR [BP+SP_EX],0&V&H*4 ; If there is no error @P2A + ; code then multiply the vector P2A + ; number by four for the FASTPATH P2A + ; code. P2A + JMP PASS_ON ; Give the interrupt back to the @P2C + ; V86 task. +SKIP&V: DATAOV ; @P2A + POP SI ; Restore ESI from off our stack @P2A + DATAOV ; @P2A + POP DI ; Restore EDI @P2A + DATAOV ; @P2A + POP AX ; Restore EAX @P2A + POP BP ; Take BP off the stack. This leaves + ; the interrupt number that we pushed + ; above and the error code that was + ; pushed by the 386 on the INT 0D. + JMP VEXCPT13 ; Go to the exception handler. + + ENDM + +PAGE +; For interrupts 00, 01, 02, 03, 04, 05, 06, 07, 09, 0A, 0B, 0C, 0E and 15 +; push a dummy error code of 0 and then the interrupt number. Then go to the +; exception handler. + + IRP V,<00,01,02,03,04,05,06,07,09,0A,0B,0C,0E,15> +VEC&V: + PUSH 0 ; Push a dummy error code of 0 + PUSH 0 ; 32 bits wide +SKIP&V: + PUSH 0&V&H ; Push the interrupt number + JMP VEXCPT13 ; Go to the exception handler + ENDM + +PAGE +; For the rest of the interrupts push the interrupt vector offset (interrupt +; number * 4) and go to the fast path routine. +; +; INT 08H is given the FASTPATH. It's the double fault interrupt so we are +; dead any way. This interrupt is normally used for the timer interrupt. +; +; INT 10H, BIOS video calls, is given the fastest code path by putting it just +; before the FASTPATH routine. + + IRP V,<08,0F,11,12,13,14,16,17,18,19,1A,1B,1C,1D,1E,1F> +VEC&V: + PUSH 0&V&H*4 ; Push the interrupt vector offset + JMP FASTPATH ; Go to the fastpath routine + ENDM + IRP V,<20,21,22,23,24,25,26,27,28,29,2A,2B,2C,2D,2E,2F> +VEC&V: + PUSH 0&V&H*4 ; Push the interrupt vector offset + JMP FASTPATH ; Go to the fastpath routine + ENDM + IRP V,<30,31,32,33,34,35,36,37,38,39,3A,3B,3C,3D,3E,3F> +VEC&V: + PUSH 0&V&H*4 ; Push the interrupt vector offset + JMP FASTPATH ; Go to the fastpath routine + ENDM + IRP V,<40,41,42,43,44,45,46,47,48,49,4A,4B,4C,4D,4E,4F> +VEC&V: + PUSH 0&V&H*4 ; Push the interrupt vector offset + JMP FASTPATH ; Go to the fastpath routine + ENDM + IRP V,<50,51,52,53,54,55,56,57,58,59,5A,5B,5C,5D,5E,5F> +VEC&V: + PUSH 0&V&H*4 ; Push the interrupt vector offset + JMP FASTPATH ; Go to the fastpath routine + ENDM + IRP V,<60,61,62,63,64,65,66,67,68,69,6A,6B,6C,6D,6E,6F> +VEC&V: + PUSH 0&V&H*4 ; Push the interrupt vector offset + JMP FASTPATH ; Go to the fastpath routine + ENDM + IRP V,<70,71,72,73,74,75,76,77,78,79,7A,7B,7C,7D,7E,7F> +VEC&V: + PUSH 0&V&H*4 ; Push the interrupt vector offset + JMP FASTPATH ; Go to the fastpath routine + ENDM + IRP V,<80,81,82,83,84,85,86,87,88,89,8A,8B,8C,8D,8E,8F> +VEC&V: + PUSH 0&V&H*4 ; Push the interrupt vector offset + JMP FASTPATH ; Go to the fastpath routine + ENDM + IRP V,<90,91,92,93,94,95,96,97,98,99,9A,9B,9C,9D,9E,9F> +VEC&V: + PUSH 0&V&H*4 ; Push the interrupt vector offset + JMP FASTPATH ; Go to the fastpath routine + ENDM + IRP V, +VEC&V: + PUSH 0&V&H*4 ; Push the interrupt vector offset + JMP FASTPATH ; Go to the fastpath routine + ENDM + IRP V, +VEC&V: + PUSH 0&V&H*4 ; Push the interrupt vector offset + JMP FASTPATH ; Go to the fastpath routine + ENDM + IRP V, +VEC&V: + PUSH 0&V&H*4 ; Push the interrupt vector offset + JMP FASTPATH ; Go to the fastpath routine + ENDM + IRP V, +VEC&V: + PUSH 0&V&H*4 ; Push the interrupt vector offset + JMP FASTPATH ; Go to the fastpath routine + ENDM + IRP V, +VEC&V: + PUSH 0&V&H*4 ; Push the interrupt vector offset + JMP FASTPATH ; Go to the fastpath routine + ENDM + IRP V, +VEC&V: + PUSH 0&V&H*4 ; Push the interrupt vector offset + JMP FASTPATH ; Go to the fastpath routine + ENDM + +VEC10: + PUSH 010H*4 ; Push the interrupt vector offset + +PAGE +FASTPATH: + PUSH BP ; Save BP + DATAOV + PUSH AX ; Save EAX, all 32bits of it. + DATAOV + PUSH DI ; Save EDI + DATAOV + PUSH SI ; Save ESI + MOV BP,SP ; Point BP to the save area + +PASS_ON: ; @P2C + CLD ; All string operations go forward + + MOV AX,HUGE_PTR ; Load DS and ES with a selector that + MOV DS,AX ; accesses all of memory as data + MOV ES,AX + DATAOV + SUB DI,DI ; Clear EDI + MOV DI,SS:[BP+SP_SP] ; Load DI with the interruptee's SP + SUB DI,6 ; Decrement "SP" to simulate the pushing + ; of the flags, CS and IP on an INT. + MOV SS:WORD PTR [BP+SP_SP],DI ; Replace the user's SP + + DATAOV + SUB AX,AX ; Clear EAX + MOV AX,SS:[BP+SP_SS] ; Load AX with the user's SS register + DATAOV ; Shift "SS" left four bits to convert + SHL AX,4 ; it to an offset + DATAOV ; Add on "SP" to get a 32 bit offset + ADD DI,AX ; from 0 of the user's stack. + +; Put the user's IP, CS and flags onto his stack. This is done in reverse +; order because we are moving forward in memory whereas stacks grow backward. + + MOV AX,SS:[BP+SP_IP] ; Get the user's IP + ADDROV + STOSW ; And put it on the stack + ADDROV ; Intel bug # A0-119 + NOP ; Intel bug # A0-119 + + MOV AX,SS:[BP+SP_CS] ; Get the user's CS + ADDROV + STOSW ; And put it on the stack + ADDROV ; Intel bug # A0-119 + NOP ; Intel bug # A0-119 + + MOV AX,SS:[BP+SP_FL] ; Get the user's flags + ADDROV + STOSW ; And put them on the stack + ADDROV ; Intel bug # A0-119 + NOP ; Intel bug # A0-119 + + AND AX,3CFFH ; Clean up the flags for our IRET by + MOV WORD PTR SS:[BP+SP_FL],AX ; setting IOPL to 3 + +; Replace the interruptee's CS:IP with the CS:IP of the interrupt vector. When +; we IRET back to the V86 task control will go to the interrupt routine. + + MOV SI,SS:[BP+SP_EX] ; Get the interrupt vector offset + LODSW ; Get the IP of the interrupt vector + MOV WORD PTR SS:[BP+SP_IP],AX ; Replace the user's IP + LODSW ; Get the CS of the interrupt vector + MOV WORD PTR SS:[BP+SP_CS],AX ; Replace the user's CS + + DATAOV + POP SI ; Restore ESI from off our stack + DATAOV + POP DI ; Restore EDI + DATAOV + POP AX ; Restore EAX + POP BP ; Restore BP + ADD SP,(SP_IP-SP_EX) ; Step SP past the interrupt vector + ; offset + DATAOV + IRET ; Give control back to the interruptee + +PAGE + +; Build a talbe of the offsets of all the interrupt entry points. This table +; is used as input to the procedure that builds the IDT. + +SIDT_OFFSETS LABEL WORD + + IRP V,<00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F> + DW OFFSET VEC&V + ENDM + IRP V,<10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F> + DW OFFSET VEC&V + ENDM + IRP V,<20,21,22,23,24,25,26,27,28,29,2A,2B,2C,2D,2E,2F> + DW OFFSET VEC&V + ENDM + IRP V,<30,31,32,33,34,35,36,37,38,39,3A,3B,3C,3D,3E,3F> + DW OFFSET VEC&V + ENDM + IRP V,<40,41,42,43,44,45,46,47,48,49,4A,4B,4C,4D,4E,4F> + DW OFFSET VEC&V + ENDM + IRP V,<50,51,52,53,54,55,56,57,58,59,5A,5B,5C,5D,5E,5F> + DW OFFSET VEC&V + ENDM + IRP V,<60,61,62,63,64,65,66,67,68,69,6A,6B,6C,6D,6E,6F> + DW OFFSET VEC&V + ENDM + IRP V,<70,71,72,73,74,75,76,77,78,79,7A,7B,7C,7D,7E,7F> + DW OFFSET VEC&V + ENDM + IRP V,<80,81,82,83,84,85,86,87,88,89,8A,8B,8C,8D,8E,8F> + DW OFFSET VEC&V + ENDM + IRP V,<90,91,92,93,94,95,96,97,98,99,9A,9B,9C,9D,9E,9F> + DW OFFSET VEC&V + ENDM + IRP V, + DW OFFSET VEC&V + ENDM + IRP V, + DW OFFSET VEC&V + ENDM + IRP V, + DW OFFSET VEC&V + ENDM + IRP V, + DW OFFSET VEC&V + ENDM + IRP V, + DW OFFSET VEC&V + ENDM + IRP V, + DW OFFSET VEC&V + ENDM +PAGE +SIDT_BLD: + +; Build the system IDT. The system IDT will contain 256 interrupt gates. + + MOV AX,CS ; Set DS:SI to point to the table of + MOV DS,AX ; interrupt entry points + MOV SI,OFFSET SIDT_OFFSETS + + MOV DI,SIDT_LOC ; Set ES:DI to point to the beginning + ; of the IDT + MOV BX,SYS_PATCH_CS ; Load BX with the selector for the + ; segment of the interrupt routines. + ; It's our code segment. + +; DX contains the second highest word of the interrupt descriptor. + + MOV DH,0EEH ; Set DPL to 3 to reduce the number of + ; exceptions + MOV DL,0 ; The word count field is unused + + MOV CX,256 ; 256 interrupt gates + + CALL BLD_IDT ; Go build the IDT + + RET ; Return to INDEINI + +PAGE + +; This loop builds descriptors in the IDT. DS:SI points to a table of 16 bit +; offsets for the interrupt entry points. ES:DI points to the start of the IDT. +; BX contains the segment selector of the interrupt entry points. DX contains +; the DPL of the interrupt gates. + +BLD_IDT: + MOVSW ; Get an interrupt routine entry point + ; and put it in the offset field + MOV AX,BX ; Get the segment selector + STOSW ; and put it in the selector field + MOV AX,DX ; Get the interrupt gate DPL + STOSW ; and put it in the access rights field + MOV AX,0 ; Zero out the reserved portions + STOSW + LOOP BLD_IDT ; Repeat for all interrupt vectors + + RET + +SIDTBLD ENDP + +PROG ENDS + + END diff --git a/v4.0/src/DEV/XMAEM/INDEINI.ASM b/v4.0/src/DEV/XMAEM/INDEINI.ASM new file mode 100644 index 0000000..19c8b79 --- /dev/null +++ b/v4.0/src/DEV/XMAEM/INDEINI.ASM @@ -0,0 +1,1474 @@ +PAGE 60,132 +TITLE INDEINI - 386 XMA EMULATOR - Initialization + +COMMENT # +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* * +* MODULE NAME : INDEINI * +* * +* 5669-196 (C) COPYRIGHT 1988 Microsoft Corp. * +* * +* DESCRIPTIVE NAME: 80386 XMA EMULATOR INITIALIZATION * +* * +* STATUS (LEVEL) : VERSION (0) LEVEL (2.0) * +* * +* FUNCTION : Do all the initialization needed for the 386 XMA emulator.* +* * +* The 386 XMA emulator is installed by putting the follow- * +* ing command in the CONFIG.SYS file: * +* * +* DEVICE=\386XMAEM.SYS bbb * +* * +* where "bbb" is the number of K reserved for the MOVEBLOCK * +* function. If EMS is used, this command must appear * +* before the command to load EMS. * +* * +* This module first of all does all the stuff to set up * +* the device driver linkage to DOS. The driver is a * +* character device. The only command it recognizes is P3C* +* "initialize". When it receives the initialize command * +* it does all the set up for the emulator. For information * +* on device drivers see the DOS Technical Reference. * +* * +* Then it checks to see if we're on a model_80 and the * +* emulator has not been previously installed. If this is * +* the case, then it procedes to do the following: * +* Get the MOVEBLOCK buffer size from the parameter list * +* Save the maximum XMA block number in the header * +* Relocate to high memory * +* Initialize the page directory and page tables * +* Call INDEIDT to initialize the IDT * +* Call INDEGDT to initialize the GDT * +* Switch to virtual mode * +* Initialize the TSS for the virtual 8086 task * +* Initialize the XMA page tables * +* Enable paging * +* * +* This module also contains code to handle the Generic D2A* +* IOCTL call which is used to query the highest valid D2A* +* XMA block number. This code is left resident. D2A* +* * +* MODULE TYPE : ASM * +* * +* REGISTER USAGE : 80386 STANDARD * +* * +* RESTRICTIONS : None * +* * +* DEPENDENCIES : None * +* * +* LINKAGE : Invoked as a DOS device driver * +* * +* INPUT PARMS : The number of 1K blocks reserved for the MOVE BLOCK * +* service can be specified after the DEVICE command in the * +* CONFIG.SYS file. 0K is the default. * +* * +* RETURN PARMS : A return code is returned to DOS in the device header * +* at offset 3. * +* * +* OTHER EFFECTS : None * +* * +* EXIT NORMAL : Return to DOS after device driver is loaded * +* * +* EXIT ERROR : Return to DOS after putting up error messages * +* * +* EXTERNAL * +* REFERENCES : SIDT_BLD - Entry point for INDEIDT to build the IDT * +* GDT_BLD - Entry point for INDEGDT to build the GDT * +* WELCOME - The welcome message * +* GOODLOAD - Message saying we loaded OK * +* NO_80386 - Error message for not running on a model_80 * +* WAS_INST - Error message for protect mode in use * +* SP_INIT - Initial protect mode SP * +* REAL_CS - Place to save our real mode CS * +* REAL_SS - Place to save our real mode SS * +* REAL_SP - Place to save our real mode SP * +* PGTBLOFF - Offset of the page tables * +* SGTBLOFF - Offest of the page directory * +* NORMPAGE - Normal page directory entry * +* XMAPAGE - Page directory entry for the first XMA page D1A* +* BUFF_SIZE- Size of the MOVEBLOCK buffer * +* MAXMEM - Maximum amount of memory on the box * +* CRT_SELECTOR - Selector for the display buffer * +* * +* SUB-ROUTINES : GATE_A20 - Gate on or off address bit 20 * +* GET_PARMS - Get the MOVEBLOCK buffer size specified on * +* the command in CONFIG.SYS and convert to * +* binary. * +* * +* MACROS : DATAOV - Add prefix for the next instruction so that it * +* accesses data as 32 bits wide * +* ADDROV - Add prefix for the next instruction so that it * +* uses addresses that are 32 bits wide * +* CMOV - Move to and from control registers * +* JUMPFAR - Build an instruction that will jump to the * +* offset and segment specified * +* * +* CONTROL BLOCKS : INDEDAT.INC * +* * +* CHANGE ACTIVITY : * +* * +* $MOD(INDEINI) COMP(LOAD) PROD(3270PC) : * +* * +* $D0=D0004700 410 870521 D : NEW FOR RELEASE 1.1. CHANGES TO THE ORIGINAL * +* CODE ARE MARKED WITH D0A. * +* $P1=P0000281 410 870730 D : SAVE 32 BIT REGISTERS ON model_80 * +* $P2=P0000312 410 870804 D : CHANGE COMPONENT FROM MISC TO LOAD * +* $P3=P0000335 410 870811 D : HEADER INFORMATION ALL SCREWED UP * +* $D1=D0007100 410 870810 D : CHANGE TO EMULATE XMA 2 * +* CHANGE ID STRING TO "386XMAEMULATOR10" * +* $P4=P0000649 411 880125 D : A20 NOT ENABLED WHEN PASSWORD SET * +* $P5=P0000650 411 880128 D : COPROCESSOR APPLICATIONS FAIL * +* $P6=P0000740 411 880129 D : IDSS CAPTURED DCR 87 CODE. REMOVE IT. * +* $D2=D0008700 120 880206 D : SUPPORT DOS 3.4 IOCTL CALL * +* $P7=P0000xxx 120 880331 D : FIX INT 15. LOAD AS V86 MODE HANDLER. * +* * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +# + + .286P ; Enable recognition of 286 privileged instructs. + + .XLIST ; Turn off the listing + INCLUDE INDEDAT.INC + + IF1 ; Only include the macros in the first pass + INCLUDE INDEOVP.MAC ; of the assembler + INCLUDE INDEINS.MAC + ENDIF + .LIST ; Turn on the listing + + ; Let these variables be known to external procedures + + PUBLIC POST + PUBLIC INDEINI + +PROG SEGMENT PARA PUBLIC 'PROG' + + ASSUME CS:PROG + ASSUME SS:NOTHING + ASSUME DS:PROG + ASSUME ES:NOTHING + +INDEINI LABEL NEAR + + ; These variables are located in INDEI15 + + EXTRN SP_INIT:WORD ; Initial protect mode SP + EXTRN REAL_CS:WORD ; Place to save our real mode CS + EXTRN REAL_SS:WORD ; Place to save our real mode SS + EXTRN REAL_SP:WORD ; Place to save our real mode SP + EXTRN PGTBLOFF:WORD ; Offset of the page tables + EXTRN SGTBLOFF:WORD ; Offest of the page directory + EXTRN NORMPAGE:WORD ; Normal page directory entry. Points to the + ; page table that maps the real 0 to 4M. + EXTRN XMAPAGE:WORD ; Page directory entry for the first XMA + ; page table (page table for bank 0) @D1A + EXTRN BUFF_SIZE:WORD ; Size of the MOVEBLOCK buffer + EXTRN MAXMEM:WORD ; Maximum amount of memory on the box + EXTRN CRT_SELECTOR:WORD ; Selector for the display buffer + + ; These are the messages + + EXTRN WELCOME:BYTE ; The welcome message + EXTRN GOODLOAD:BYTE ; Message saying we loaded OK + EXTRN NO_80386:BYTE ; Error message for not running on a model_80 + EXTRN WAS_INST:BYTE ; Error message for protect mode in use + Extrn Small_Parm:Byte ; Parm value < 64 and > 0 ;an000; dms; + Extrn No_Mem:Byte ; Parm value > memory available ;an000; dms; + + ; These entries are located in external procedures + + EXTRN SIDT_BLD:NEAR ; Build the interrupt descriptor table (IDT) + EXTRN GDT_BLD:NEAR ; Build the global descriptor table (GDT) + +; General equates + +DDSIZE EQU GDT_LOC ; Size of the device driver +HIGH_SEG EQU 0FFF0H ; The segment we relocate to +MEG_SUPPORTED EQU 24 ; Must be a multiple of 4 +XMA_PAGES_SEL EQU RSDA_PTR ; Selector for XMA pages +DISPSTRG EQU 09H ; DOS display string function number D0A +GET_VECT EQU 35H ; DOS get vector function number P7A +SET_VECT EQU 25H ; DOS set vector function number P7A +model_80 EQU 0F8H ; Model byte for the Wangler D0A +XMA640KSTRT EQU 580H ; Start address of XMA block for D0A + ; 640K (16000:0 / 1K) D0A P3C + +; ASCII character equates + +TAB EQU 09H ; ASCII tab +LF EQU 0AH ; ASCII line feed +CR EQU 0DH ; ASCII carriage return + +SUBTTL Structure Definitions +PAGE +;------------------------------------------------------------------------------; +; Request Header (Common portion) ; +;------------------------------------------------------------------------------; + +RH EQU DS:[BX] ; The Request Header structure is based off + ; of DS:[BX] + +RHC STRUC ; Fields common to all request types + DB ? ; Length of Request Header (including data) + DB ? ; Unit code (subunit) +RHC_CMD DB ? ; Command code +RHC_STA DW ? ; Status + DQ ? ; Reserved for DOS +RHC ENDS ; End of common portion + +; Status values for RHC_STA + +STAT_DONE EQU 0100H ; Function complete status (high order byte)@P3C +STAT_CMDERR EQU 8003H ; Invalid command code error +STAT_GEN EQU 800CH ; General error code D0A + +;------------------------------------------------------------------------------; +; Request Header for INIT command ; +;------------------------------------------------------------------------------; + +RH0 STRUC + DB (TYPE RHC) DUP (?) ; Reserve space for the header + +RH0_NUN DB ? ; Number of units + ; Set to 1 if installation succeeds, + ; Set to 0 to cause installation failure +RH0_ENDO DW ? ; Offset of ending address +RH0_ENDS DW ? ; Segment of ending address +RH0_BPBO DW ? ; Offset of BPB array address +RH0_BPBS DW ? ; Segment of BPB array address +RH0_DRIV DB ? ; Drive code (DOS 3 only) +RH0 ENDS + +RH0_BPBA EQU DWORD PTR RH0_BPBO ; Offset & segment of BPB array address. + ; On the INIT command the BPB points to + ; the characters following the "DEVICE=" + ; in the CONFIG.SYS file. + +;---------------------------------------------------------------------------D2A; +; Request Header for Generic IOCTL Request D2A; +;---------------------------------------------------------------------------D2A; + +RH19 STRUC + DB (TYPE RHC) DUP (?) ; Reserve space for the header @D2A + +RH19_MAJF DB ? ; Major function @D2A +RH19_MINF DB ? ; Minor function @D2A +RH19_SI DW ? ; Contents of SI @D2A +RH19_DI DW ? ; Contents of DI @D2A +RH19_RQPK DD ? ; Pointer to Generic IOCTL request packet @D2A +RH19 ENDS + +SUBTTL Device Driver Header +PAGE +POST PROC NEAR + + ; Declare the device driver header + + ORG 0 ; Device header must the very first thing in the + ; device driver + DD -1 ; Becomes pointer to next device header + DW 0C040H ; Character device, does IOCTL @P3C @D2C + DW OFFSET STRATEGY ; Pointer to device "strategy" routine + DW OFFSET IRPT ; Pointer to device "interrupt handler" + DB "386XMAEM" ; Device name @D0C + + ; End of device driver header + +;------------------------------------------------------------------------------; +; Request Header (RH) address, saved here by "strategy" routine ; +;------------------------------------------------------------------------------; + +RH_PTRA LABEL DWORD +RH_PTRO DW ? ; Offset of the request header +RH_PTRS DW ? ; Segment of the request header + ; Character ID "386XMAEMULATOR10" deleted 2@D2D +HI_XMA_BLK DW ? ; The highest XMA block number @D0A +EXT_MEM DW ? ; Number of K of extended memory @P7A + ; D0A +RBX DW ? ; Temporary save area for register BX @P1A +ISmodel_80 DB -1 ; model_80 flag. Set to 1 if on a model_80 @P1A + ; Set to 0 if not on a model_80 @D1C + +SUBTTL Device Strategy +PAGE +;------------------------------------------------------------------------------; +; Device "strategy" entry point ; +; ; +; Retain the Request Header address for use by Interrupt routine ; +;------------------------------------------------------------------------------; + +STRATEGY PROC FAR + + MOV CS:RH_PTRO,BX ; Save the offset of the request header + MOV CS:RH_PTRS,ES ; Save the segment of the request header + RET + +STRATEGY ENDP + +SUBTTL Device Interrupt Intry Point +PAGE + +;------------------------------------------------------------------------------; +; Table of command processing routine entry points ; +;------------------------------------------------------------------------------; +CMD_TABLE LABEL WORD + DW OFFSET INIT_P1 ; 0 - Initialization + DW OFFSET MEDIA_CHECK ; 1 - Media check + DW OFFSET BLD_BPB ; 2 - Build BPB + DW OFFSET INPUT_IOCTL ; 3 - IOCTL input + DW OFFSET INPUT ; 4 - Input + DW OFFSET INPUT_NOWAIT ; 5 - Non destructive input no wait + DW OFFSET INPUT_STATUS ; 6 - Input status + DW OFFSET INPUT_FLUSH ; 7 - Input flush + DW OFFSET OUTPUT ; 8 - Output + DW OFFSET OUTPUT_VERIFY ; 9 - Output with verify + DW OFFSET OUTPUT_STATUS ;10 - Output status + DW OFFSET OUTPUT_FLUSH ;11 - Output flush + DW OFFSET OUTPUT_IOCTL ;12 - IOCTL output + DW OFFSET DEVICE_OPEN ;13 - Device OPEN + DW OFFSET DEVICE_CLOSE ;14 - Device CLOSE + DW OFFSET REMOVABLE_MEDIA ;15 - Removable media + DW OFFSET INVALID_FCN ;16 - Invalid IOCTL function @D2A + DW OFFSET INVALID_FCN ;17 - Invalid IOCTL function @D2A + DW OFFSET INVALID_FCN ;18 - Invalid IOCTL function @D2A + DW OFFSET GENERIC_IOCTL ;19 - Generic IOCTL function @D2A + DW OFFSET INVALID_FCN ;20 - Invalid IOCTL function @D2A + DW OFFSET INVALID_FCN ;21 - Invalid IOCTL function @D2A + DW OFFSET INVALID_FCN ;22 - Invalid IOCTL function @D2A + DW OFFSET GET_LOG_DEVICE ;23 - Get Logical Device @D2A +MAX_CMD EQU ($-CMD_TABLE)/2 ; Highest valid command follows + DW OFFSET SET_LOG_DEVICE ;24 - Set Logical Device @D2A + +;------------------------------------------------------------------------------; +; Device "interrupt" entry point ; +;------------------------------------------------------------------------------; +IRPT PROC FAR ; Device interrupt entry point + +; First we must save all the registers that we use so that when we return to +; DOS the registers are not changed. + + PUSH DS ; Save the segment registers modified + PUSH ES + + CMP CS:ISmodel_80,-1; Did we already check what machine we are @D2A + JNE DID_CHECK ; running on? @D2A + + MOV CS:RBX,BX ; Save BX @P1A + MOV BX,0FFFFH ; Check the model byte at FFFF:000E @D0A @P1M + MOV ES,BX ; to see if we're running on a @D0A @P1M + MOV BX,0EH ; model_80 (PS/2 model 80). @D0A @P1M + CMP BYTE PTR ES:[BX],model_80 ; @P1A + MOV BX,CS:RBX ; Restore BX @P1A @D2M + JNE NO_model_80 + + MOV CS:ISmodel_80,1 ; Set the flag saying we're on a @P1A @D2M + JMP DID_CHECK ; model_80 @D2A + +NO_model_80: + MOV CS:ISmodel_80,0 ; Set the flag saying we're not on a @D2M + ; model_80 + +DID_CHECK: ; D2A + CMP ISmodel_80,1 ; Are we on a model_80? @D2A + JE PUSH32 ; If so, go save the 32 bit registers @P1A + +; Push 16 bit registers onto the stack. + + PUSH AX + PUSH BX + PUSH CX + PUSH DX + PUSH DI + PUSH SI + PUSH BP + + JMP PUSHED ; @P1A + +; Push 32 bit registers onto the stack P1A + ; @D2D +PUSH32: DATAOV ; Save all the 32 bit registers. The @P1A + PUSHA ; model_80's BIOS uses 32 bit registers, @P1A + ; so we must not trash the high order P1A + ; words as well as the low order words. P1A + +PUSHED: CLD ; All moves go forward + + LDS BX,CS:RH_PTRA ; Get the request header address passed to the + ; "strategy" routine into DS:BX + + MOV AL,RH.RHC_CMD ; Get the command code from the Request Header + CBW ; Zero AH (if AL > 7FH, next compare will + ; catch that error) + + CMP AL,MAX_CMD ; If command code is too high + JA IRPT_CMD_HIGH ; Then jump to error routine + + ADD AX,AX ; Double command code for table offset since + ; table entries are words + MOV DI,AX ; Put into index register for CALL + ; @D2D +; +; At entry to command processing routine: +; +; DS:BX = Request Header address +; CS = 386XMAEM code segment address +; AX = 0 +; + CALL CS:CMD_TABLE[DI] ; Call routine to handle the command + JMP IRPT_CMD_EXIT + + +IRPT_CMD_HIGH: ; JMPed to if RHC_CMD > MAX_CMD + MOV AX,STAT_CMDERR ; Return "Invalid Command" error code + OR AX,STAT_DONE ; Add "done" bit to status word @P3C + MOV RH.RHC_STA,AX ; Store status into request header + +IRPT_CMD_EXIT: ; Return from command routine + +; Restore the registers before returning to DOS. + + CMP CS:ISmodel_80,1 ; Are we on a model_80? @P1A + JE POP32 ; Yes. Then pop the 32 bit registers. @P1A + +; Pop 16 bit registers off of the stack. + + POP BP + POP SI + POP DI + POP DX + POP CX + POP BX + POP AX + + JMP POPPED ; @P1A + +; Pop 32 bit registers off of the stack. P1A + ; P1A +POP32: DATAOV ; @P1A + POPA ; @P1A + +; Pop the segment registers off of the stack. + +POPPED: POP ES + POP DS + + RET +IRPT ENDP + +SUBTTL Command Routines +PAGE + +MEDIA_CHECK: ; +BLD_BPB: ; +INPUT_IOCTL: ; IOCTL input +INPUT: ; +INPUT_NOWAIT: ; Non-destructive input no wait +INPUT_STATUS: ; Input status +INPUT_FLUSH: ; Input flush +OUTPUT: ; +OUTPUT_VERIFY: ; +OUTPUT_IOCTL: ; IOCTL output +OUTPUT_STATUS: ; Output status +OUTPUT_FLUSH: ; Output flush +DEVICE_OPEN: ; +DEVICE_CLOSE: ; +REMOVABLE_MEDIA: ; +INVALID_FCN: ; @D2A +GET_LOG_DEVICE: ; @D2A +SET_LOG_DEVICE: ; @D2A + + MOV AX,STAT_GEN ; Return general error code @D2A + OR AX,STAT_DONE ; Add "done" bit to status word @D2A + MOV RH.RHC_STA,AX ; Store status into request header @D2A + + RET + +SUBTTL Generic IOCTL Service Routine +PAGE + +;------------------------------------------------------------------------------; +; This routine handles the Generic IOCTL call. The Emulator provides an D2A; +; interface through the Generic IOCTL call to query the number of XMA D2A; +; blocks available. When the function code in the parameter list is 0 the D2A; +; Emulator will return the number of XMA blocks available. There are no D2A; +; other functions uspported at this time. D2A; +;------------------------------------------------------------------------------; + +GIP EQU ES:[DI] ; @D2A + +GEN_IOCTL_PARM STRUC ; @D2A + +GIOPLEN DW ? ; Length of the parameter list @D2A +GIOPFCN DW ? ; Function code @D2A +GIOPBLK DW ? ; Number of XMA blocks available @D2A + +GEN_IOCTL_PARM ENDS ; @D2A + +MAXFCN EQU 0 ; Highest function number allowed @D2A + +; Return codes D2A + +GOODRET EQU 0 ; Good return code @D2A +BADLEN EQU 1 ; Bad parameter list length @D2A +BADFCN EQU 2 ; Bad function number @D2A + +GENERIC_IOCTL: ; D2A + + LES DI,RH.RH19_RQPK ; Point ES:DI to the Generic IOCTL @D2A + ; request packet D2A + +; First check to make sure the parameter list is long enough to return the D2A +; number of XMA blocks. D2A + + CMP GIP.GIOPLEN,4 ; Do we have at least four bytes? @D2A + JAE GIP_CHKFCN ; Yup. Go to check function number. @D2A + + MOV GIP.GIOPFCN,BADLEN ; Nope. Sorry. Return the error @D2A + JMP GIP_DONE ; code and go to the end. @D2A + +; Check if the function number in the parameter list is a valid function. D2A + +GIP_CHKFCN: ; D2A + CMP GIP.GIOPFCN,MAXFCN ; Is the function code less than or @D2A + ; equal to the maximum supported? D2A + JLE GIP_CONT ; Yes. Good boy. You get to continue. @D2A + + MOV GIP.GIOPFCN,BADFCN ; No. Shamey, shamey. Set the bad @D2A + JMP GIP_DONE ; return code and go to the end. @D2A + +; Parameter list is OK. Let's return the number of XMA blocks. D2A + +GIP_CONT: ; D2A + MOV GIP.GIOPFCN,GOODRET ; Set a good return code @D2A + MOV AX,CS:HI_XMA_BLK ; Get the number of XMA blox @D2A + MOV GIP.GIOPBLK,AX ; Put it in the paramter list @D2A + + +GIP_DONE: ; D2A + MOV RH.RHC_STA,STAT_DONE ; Store done status and good return @D2A + ; code into request header D2A + RET ; @D2A + +INT15F88 PROC FAR ; P7A + +; The following is the interrupt chaining structure specified in the PC AT P7A +; Technical Reference. P7A + + JMP SHORT BEGIN ; P7A + +CHAINOFF DW 0 ; Offest of the previous INT 15 vect. @P7A +CHAINSEG DW 0 ; Segment of the previous INT 15 vect.@P7A +SIGNATURE DW 424BH ; Says we're doing chaining @P7A +FLAGS DB 0 ; @P7A +FIRST EQU 80H ; @P7A + JMP SHORT RESET ; @P7A +RESERVED DB 7 DUP (0) ; @P7A + +; OK. Let's see if the user asked for function 88H, query memory size. P7A +; The function number is specified in the AL register. If it's P7A +; function88h, then put the memory size in AX and IRET to the caller. P7A +; Else, just pass the interrupt on to the guy who was installed in the INT P7A +; 15 vector before us. P7A + +BEGIN: CMP AH,88H ; Is it function 88H? @P7A + JNE NOT_MINE ; It's not ours to handle @P7A + + MOV AX,CS:EXT_MEM ; Put the number of K into AX @P7A + IRET ; Return to the caller @P7A + +NOT_MINE: JMP CS:DWORD PTR CHAINOFF + ; Pass the interrupt on to the @P7A + ; previously installed vector @P7A + +RESET: RET ; This, too, is part of the interrupt@P7A + ; chaining structure. We will just@P7A + ; return on a call to reset. Note @P7A + ; that this is a far return. @P7A +INT15F88 ENDP ; @P7A + +LEAVE_RES LABEL NEAR ; Leave code up to here resident.@D0A @D2M + +SUBTTL Initialize Routine +PAGE +INIT_P1: + + PUSH ES ; Save our code segment at the @D0A + MOV DI,0 ; fixed location 0:4F4. This @P3C + MOV ES,DI ; gives us a quick way to find CS @P3C + MOV DI,4F4H ; and also enables us to break on @P3C + MOV ES:[DI],CS ; a write to 0:4F4 which helps us @P3C + POP ES ; find the code on the ICE386. @D0A + MOV AH,DISPSTRG ; Display the welcome message. @D0A + MOV DX,OFFSET WELCOME ; @D0A + PUSH DS ; Save DS since DS:BX points to the @D0A + PUSH CS ; request header @D0A + POP DS ; DS:DX points to the message @D0A + INT 21H ; Display the message @D0A + POP DS ; Restore DS @D0A + ; @P3D + MOV RH.RH0_ENDS,CS ; Set the segment and offset of the end + MOV RH.RH0_ENDO,OFFSET LEAVE_RES ; of code to leave resident + MOV RH.RHC_STA,STAT_DONE ; Store "done" status into request + ; header + CMP CS:ISmodel_80,1 ; Check if we're on a model_80 @D0A @P1C + JE CONT ; If so, then continue @D0A + ; D0A + MOV RH.RH0_ENDO,0 ; Leave nothing resident @D0A + MOV AX,STAT_GEN ; Return general error code @D0A + OR AX,STAT_DONE ; Add "done" bit to status word@D0A @P3C + MOV RH.RHC_STA,AX ; Store status into request header @D0A + ; D0A + MOV AH,DISPSTRG ; Display the message that we are @D0A + MOV DX,OFFSET NO_80386 ; not on a model_80 @D0A + PUSH CS ; @D0A + POP DS ; @D0A + INT 21H ; @D0A + ; D0A + RET ; D0A + ; D0A +CONT: ; @D0M + SMSW AX ; Get machine status register + TEST AL,1 ; Check if the processor is already in + ; protect mode. If so, then someone + ; else (maybe us) has already taken + ; over protect mode. + JZ STILLOK ; If not, keep going @D0C + + MOV RH.RH0_ENDO,0 ; Leave nothing resident @D0A + MOV AX,STAT_GEN ; Return general error code @D0A + OR AX,STAT_DONE ; Add "done" bit to status word@D0A @P3C + MOV RH.RHC_STA,AX ; Store status into request header @D0A + ; D0A + MOV AH,DISPSTRG ; Display the message that protect @D0A + MOV DX,OFFSET WAS_INST ; mode is taken. @D0A + PUSH CS ; DS:DX points to the message @D0A + POP DS ; @D0A + INT 21H ; @D0A + + RET ; +STILLOK: ; D0A + PUSH 0DEADH ; Push stack delimiter + ; Don't have to set character ID @D2D + CALL GET_PARMS ; Get the MOVEBLOCK buffer size if + jnc StillOK1 + MOV RH.RH0_ENDO,0 ; Leave nothing resident @D0A + MOV AX,STAT_GEN ; Return general error code @D0A + OR AX,STAT_DONE ; Add "done" bit to status word@D0A @P3C + MOV RH.RHC_STA,AX ; Store status into request header @D0A + ; D0A + pop ax + ret ; exit program + +StillOK1: + ; one was specified + CLI ; Disable interrupts + + PUSH CS ; Now we can point DS to our own @P3A + POP DS ; code segment @P3A + ; 2@D2D + MOV AX,CS + MOV REAL_CS,AX ; Save real CS for when we @P3C + MOV AX,SS ; switch to protect mode + MOV REAL_SS,AX ; Save real SS @P3C + MOV AX,SP + MOV REAL_SP,AX ; Save real SP @P3C + +;------------------------------------------------------------------------------; +; Enable address line A20 ; +;------------------------------------------------------------------------------; + + ; 3@P4D + CALL GATE_A20 + + INT 11H ; Get the BIOS equipment flags + AND AL,30H ; Bits 5 and 6 on means it's a mono + CMP AL,30H + JE LEAVEBW + MOV CRT_SELECTOR,C_CCRT_PTR ; Set the CRT selector to color display +LEAVEBW: + MOV AH,88H ; Get number of 1k blocks above 1M + INT 15H + ADD AX,1024 ; Add 640K for the memory below 640K @P7C + MOV MAXMEM,AX ; Save for later + +; Get the maximum XMA block number and save it in the header up front D0A +; All memory is treated as XMA memory. D1C + ; D0A + SUB AX,BUFF_SIZE ; Can't use the MOVEBLOCK buffer for @D0A + ; XMA memory. AX = number of K D0A + ; available. D0A + SUB AX,(1024-640) +128 ; Subtract 128k for the Emulator code ;an000; dms; + SHR AX,2 ; Divide by four to get the number of @D0A + ; 4K blocks D0A + DEC AX ; Subtract 1. This converts the @P3A + ; number of blocks available to the P3A + ; highest block number available. P3A + ; Block numbers are zero based. P3A + MOV HI_XMA_BLK,AX ; Save it in the header D0A + +;------------------------------------------------------------------------------; +; Now lets relocate ourselves to high memory. ; +;------------------------------------------------------------------------------; + + MOV AX,HIGH_SEG ; Set ES to the highest segment value + MOV ES,AX + MOV DI,0 ; ES:DI points to the place to relocate to + MOV AX,CS + MOV DS,AX + MOV SI,0 ; DS:SI points to our code to be moved + MOV CX,DDSIZE/2 ; Length of code / 2 since moving words + CLD + REP MOVSW ; Copy myself to high memory + + JUMPFAR NEXT,HIGH_SEG ; Jump to my relocated code +NEXT: + + MOV AX,HIGH_SEG ; Set DS to be the same as CS + MOV DS,AX +;------------------------------------------------------------------------------; +; The machine is still in real mode. Zero out GDT and IDT ram. ; +;------------------------------------------------------------------------------; + + MOV DI,GDT_LOC ; DI points to GDT location + + MOV CX,(GDT_LEN+SIDT_LEN)/2 ; Set GDT and IDT to zero + MOV AX,0 ; Store zeroes for now + REP STOSW + +;------------------------------------------------------------------------------; +; Use good-old real-mode selectors to set up the page tables. The ; +; page directory is a 4K block that is placed just before the ; +; beginning of the GDT and on a 4K boundary. Note that the DATAOV ; +; macro creates a prefix for the following instruction so that its ; +; data references are 32 bits wide. ; +;------------------------------------------------------------------------------; + + DATAOV + SUB AX,AX ; Clear EAX (32 bit AX reg.) + MOV AX,HIGH_SEG ; Get the current code segment + DATAOV + SUB BX,BX ; Clear EBX (32 bit BX reg.) + MOV BX,GDT_LOC/16 ; Load the offset of the GDT, converted + ; to paragraphs + DATAOV ; Add it on to the current code segment + ADD AX,BX ; to get the segment address of the GDT. + ; This will be over 1M, so use 32 bits. + AND AX,0FF00H ; Round down to nice 4k boundary + DATAOV + SUB BX,BX ; Clear EBX + MOV BX,4096/16 ; Load with the size of the page directory + ; converted to paragraphs + DATAOV ; Subtract the number of paragraphs needed + SUB AX,BX ; for the page directory + DATAOV + SHL AX,4 ; Convert from paragraphs to bytes + CMOV CR3,EAX ; Load the address of the page directory + ; into CR3 + DATAOV + SUB BX,BX ; Clear EBX + MOV BX,HIGH_SEG ; Load our current code segment + DATAOV + SHL BX,4 ; Convert from paragraphs to bytes + DATAOV + SUB AX,BX ; Subtract from the address of the page + ; directory to get the offset of the + ; directory in our code segment + MOV SGTBLOFF,AX ; Save for later + +; Now let's clear the page directory + + MOV CX,2048 ; Length is 4K/2 since storing words + DATAOV + MOV DI,AX ; ES:EDI points to beginning of directory + MOV AX,0 + REP STOSW ; Clear the page directory! + +;------------------------------------------------------------------------------; +; Initialize the first directory entries to our page tables ; +;------------------------------------------------------------------------------; + + CMOV EAX,CR3 ; Get back CR3 - the address of the page dir. + DATAOV + MOV DI,SGTBLOFF ; Point ES:EDI to first entry in directory + DATAOV + SUB BX,BX ; Clear EBX + MOV BX,MEG_SUPPORTED/4*4096 ; Load the size of the page tables. + ; Each page table maps 4M of memory, so divide + ; the number of Meg supported by 4 to get the + ; number of page tables. Each page table is + ; 4K in size, so multiply by 4K. + DATAOV + SUB AX,BX ; Subtract the size needed for the page tables + ; from the address of the page directory to + ; get the address of the first page table. + ADD AX,7 ; Set the present bit and access rights. + ; This converts the address to a valid entry + ; for the page directory. + DATAOV + MOV NORMPAGE,AX ; Save for later + MOV CX,MEG_SUPPORTED/4 ; Load the number of page tables into CX + DATAOV + SUB BX,BX ; Clear EBX + MOV BX,1000H ; Set up 4k increment +; +; Now we load the page directory. EAX contains the address of the first +; page table, EBX contains 4K, CX contains the number of page tables, and +; ES:EDI (32 bit DI reg.) points to the first page directory entry. Now what +; we do is stuff EAX into the 32bits pointed to by EDI. EDI is then auto- +; incremented by four bytes, because of the 32 bit stuff, and points to the +; next page directory entry. (Page directory and page table entries are four +; bytes long.) Then we add the 4K in EBX to the address in EAX making EAX +; the address of the next page table. This is done for the number of page +; table entries in CX. Pretty slick, huh? +; +LPT: + DATAOV ; Stuff the page table address into the + STOSW ; page directory + DATAOV ; Add 4K to the page table address in EAX + ADD AX,BX ; so that it contains the address of the + ; next page table + LOOP LPT ; Do it again + +; Now calcuate the offset from our code segment of the page tables + + DATAOV + SUB BX,BX ; Clear EBX + MOV BX,HIGH_SEG ; Load our current code segment + DATAOV + SHL BX,4 ; Convert paragraphs to bytes + DATAOV ; Load EAX with the address of the first + MOV AX,NORMPAGE ; page table + DATAOV + SUB AX,BX ; Convert EAX to an offset + AND AL,0F8H ; AND off the access rights + MOV PGTBLOFF,AX ; Save for later + +;------------------------------------------------------------------------------; +; Initialize the page tables ; +;------------------------------------------------------------------------------; + + MOV DI,PGTBLOFF ; ES:DI points to the first page table + DATAOV + SUB AX,AX ; Zero EAX + ADD AX,7 ; Set the present and access rights + MOV CX,MEG_SUPPORTED/4*1024 ; Load CX with the number of page table + ; entries to initialize. As mentioned + ; above, the number of page tables = + ; number of Meg / 4. There are 1K + ; entries per table so multiply by 1K + DATAOV + SUB BX,BX ; Clear EBX + MOV BX,1000H ; Set up 4k increment +; +; As with the page directory, we use a tight loop to initialize the page tables. +; EAX contains the address of the first page frame, which is 0000, plus the +; access rights. EBX contains a 4K increment. ES:DI points to the first entry +; in the first page table. CX contains the number of page table entries to +; initialize. The stuff and increment works the same as for the page directory +; with an added touch. Note that this does all the page tables in one fell +; swoop. When we finish stuffing the last address into the first page table +; the next place we stuff is into the first entry in the second page table. +; Since our page tables are back to back we can just zoom up the page tables +; incrementing by 4K as we go and thus initialize all the page tables in one +; fell swoop. +; +BPT: + DATAOV ; Stuff the page frame address into the + STOSW ; page table + DATAOV + ADD AX,BX ; Next 4k page frame + LOOP BPT + +;------------------------------------------------------------------------------; +; Now set up the first 64K over 1M to point to point to the first 64K ; +; in low memory to simulate the segment wrap over 1M. ; +; For now will set it up to point to itself and try to get DOS to load ; +; the device driver up there. Will find out if anyone tries to alter ; +; it because it will be marked for system use only. ; +;------------------------------------------------------------------------------; + + MOV DI,1024 ; 1M offset into page table + ADD DI,PGTBLOFF ; Page table offset + MOV AX,10H ; Set EAX to contain 1M address by loading + DATAOV ; it with 10H and shifting it 16 bits to + SHL AX,16 ; get 00100000. (Same as 10000:0) + ADD AX,5 ; Present, system use, read only + MOV CX,16 ; 16 entries = 64k +BPT2: + DATAOV + STOSW ; Stuff the address in the page table + DATAOV + ADD AX,BX ; Next 4k page frame + LOOP BPT2 + +PAGE +;------------------------------------------------------------------------------; +; Build the Global Descriptor Table and load the GDT register. ; +;------------------------------------------------------------------------------; + CALL GDT_BLD + + MOV DI,GDT_PTR ; Get the offset of the GDT descriptor + ADD DI,GDT_LOC ; located in the GDT + MOV BP,DI ; Transfer the offset to BP + LGDT ES:FWORD PTR[BP] ; Put the descriptor for the GDT into + ; the GDT register + +PAGE +;------------------------------------------------------------------------------; +; Build and initialize the system Interrupt Descriptor Table, ; +; then load the IDT register. ; +;------------------------------------------------------------------------------; + CALL SIDT_BLD + + MOV DI,MON_IDT_PTR ; Get the offset of the IDT descriptor + ADD DI,GDT_LOC ; located in the GDT + MOV BP,DI ; Transfer the offset to BP + + LIDT ES:FWORD PTR[BP] ; Put the descriptor for the IDT into + ; the IDT register + +PAGE +;------------------------------------------------------------------------------; +; At this point we prepare to switch to virtual mode. The first ; +; instruction after the LMSW that causes the switch must be a ; +; jump far to set a protected mode segment selector into CS. ; +;------------------------------------------------------------------------------; + + MOV AX,VIRTUAL_ENABLE ; Machine status word needed to + LMSW AX ; switch to virtual mode + + JUMPFAR DONE,SYS_PATCH_CS ; Must purge pre-fetch queue + ; and set selector into CS +DONE: +PAGE +;------------------------------------------------------------------------------; +; Initialize all the segment registers ; +;------------------------------------------------------------------------------; + + MOV AX,SYS_PATCH_DS ; Load DS, ES, and SS with the selector + MOV DS,AX ; for our data area. This is the same + MOV ES,AX ; as our code area but has read/write + ; access. + MOV SS,AX + MOV SP,OFFSET SP_INIT + + PUSH 0002H ; Clean up our flags. Turn off all bits + POPF ; except the one that is always on. + +;------------------------------------------------------------------------------; +; Load the LDTR to avoid faults ; +;------------------------------------------------------------------------------; + + MOV AX,SCRUBBER.TSS_PTR ; Load DS with the data descriptor for + MOV DS,AX ; the virtual machine's TSS + MOV AX,SCRUBBER.VM_LDTR ; Get the LDTR for virtual machine + MOV DS:VM_LDT,AX ; Set LDTR in TSS + LLDT AX ; Set the LDTR. Temporary for now. + +; Have to always have space allocated for the dispatch task TSS + + MOV AX,SCRUBBER.VM_TR ; Low mem gets clobbered without this @P5C + LTR AX ; Set current Task Register + ; This TSS is located right after the IDT + +PAGE +;------------------------------------------------------------------------------; +; Now we initialize the TSS (Task State Segment) for the one and only ; +; virtual 8086 task. This task encompasses everything that runs in real ; +; mode. First we clear the TSS and its I/O bit map. Then we initialize ; +; the bit map for all the I/O ports we want to trap. Then we set up the ; +; registers for the V86 task. These registers are given the same values ; +; as we got on entry. IP is set to point to TEST_EXIT. ; +;------------------------------------------------------------------------------; + + MOV AX,SCRUBBER.TSS_PTR ; Load ES and DS with the descriptor + MOV DS,AX ; for the VM's TSS with read/write + MOV ES,AX ; access rights + CLD + MOV DI,0 ; Point ES:DI to the beginning of the TSS + MOV AX,0 ; Clear AX + MOV BX,0 ; Clear BX + MOV CX,TSS_386_LEN ; Load CX with the length of the TSS + REP STOSB ; Clear the TSS + MOV CX,TSS_BM_LEN ; Load CX with the length of the I/O bit + ; map. The bit map immediately follows + ; the TSS and is in the TSS segment. + REP STOSB ; Clear the bit map + MOV AL,0FFH ; Intel requires this byte + STOSB + +; +; Now set up the bit map. Turn on bits for I/O ports that we want to trap. +; + + MOV DI,0+TSS_386_LEN ; Set bits 0,2,4,6 to 1 - DMA ports + MOV AL,055H + STOSB + MOV DI,1+TSS_386_LEN ; Set C to 1 - DMA port + MOV AL,010H + STOSB + MOV DI,3+TSS_386_LEN ; Set 18,1A to 1 - DMA ports + MOV AL,005H + STOSB + MOV DI,16+TSS_386_LEN ; Set 80-8f to 1s - DMA page ports + MOV AL,0FFH ; + manufacturing port for ctl-alt-del + STOSB + STOSB + MOV DI,0680H/8+TSS_386_LEN ; Set Roundup manuf. port to 1 + MOV AL,001H + STOSB + MOV DI,31A0H/8+TSS_386_LEN ; Set 31a0-31a7 to 1s (XMA) + MOV AL,0FFH + STOSB + + MOV WORD PTR [BX].ETSS_BM_OFFSET,TSS_386_LEN + ; Put the bit map offset in the TSS + MOV WORD PTR [BX].ETSS_SP0,OFFSET SP_INIT + ; Put our SP as the SP for privilege + ; level 0 + MOV WORD PTR [BX].ETSS_SS0,SYS_PATCH_DS + ; Put our SS as the SS for privilege + ; level 0 + +; Next we set up the segment registers + + MOV WORD PTR [BX].ETSS_GS,SEG PROG ; GS - our code segment + MOV WORD PTR [BX].ETSS_FS,SEG PROG ; FS - our code segment + MOV WORD PTR [BX].ETSS_DS,SEG PROG ; DS - our code segment + MOV WORD PTR [BX].ETSS_ES,SEG PROG ; ES - our code segment + +; Next the SS,SP + + MOV AX,CS:REAL_SS ; Set the real mode SS as the SS for the task + MOV WORD PTR [BX].ETSS_SS,AX + MOV AX,CS:REAL_SP ; Set the real mode SP as the SP for the task + MOV WORD PTR [BX].ETSS_SP,AX + +; The flags register + + MOV WORD PTR [BX].ETSS_FL2,2 ; Set the VM flag. Task is a V86 task. + MOV WORD PTR [BX].ETSS_FL,0202H ; Set interrupts enabled + +; Set up CS and IP + + MOV AX,CS:REAL_CS ; Set the real mode CS as the CS for the task + MOV WORD PTR [BX].ETSS_CS,AX ; This is the CS we got when we loaded + ; in low memory, before relocating + MOV AX,OFFSET PROG:TEST_EXIT ; Set IP to the label TEST_EXIT below. + MOV WORD PTR [BX].ETSS_IP,AX + +; The LDTR + + MOV WORD PTR [BX].ETSS_LDT,SCRUBBER.VM_LDTR + +; And finally, CR3, the page directory base register + + CMOV EAX,CR3 ; Get CR3 + DATAOV + MOV WORD PTR [BX].ETSS_CR3,AX ; Save it in the TSS + +PAGE +;------------------------------------------------------------------------------; +; Now initialize our wonderful XMA page tables. Each table maps 4M. ; +; There is one table for each XMA bank since 4M is enough to map the ; +; 1M address space. All the XMA tables are initialized to point to ; +; the real memory at 0 to 4M. This is done by just copying the page ; +; table entry for 0 to 4M that was initialized above. ; +;------------------------------------------------------------------------------; + + MOV AX,SYS_PATCH_DS ; Load DS with the selector for our data + MOV DS,AX + MOV SI,PGTBLOFF ; DS:SI point to the real page table for 0-4M + MOV AX,XMA_PAGES_SEL ; Load ES with the selector for the XMA pages + MOV ES,AX + SUB DI,DI ; ES:DI point to the first XMA page table + MOV CX,2048 ; Copy 4K / 2 since we're copying words + REP MOVSW ; Copy the first XMA page table +; +; Now ES:DI points to the second XMA page table. Set DS:SI to point to the +; first XMA page table as the source for the copy. Now we can put a count +; of 15 page tables in CX. After each page is copied it is used as the source +; for the next page. This method lets us zip up the page tables initializing +; them all to be the same as the original page table for 0 - 4M. +; + MOV AX,XMA_PAGES_SEL ; Load DS with the selector for the XMA page + MOV DS,AX ; tables + SUB SI,SI ; DS:SI points to the first XMA page table + MOV CX,2048*15 ; Copy 15 more page tables + REP MOVSW ; Copy to the other 15 XMA ID'S page tables + +; D1A +; Set the first page directory entry to point to the page table for bank 0. D1A +; This is another way of saying, "Let's make bank 0 the active bank." We D1A +; are now emulating the XMA 2 card along with its initialization device D1A +; driver, INDXMAA.SYS. When the device driver exits, it leaves the XMA 2 D1A +; card enabled and set to bank 0. Therefore, we must do the same. D1A +; D1A + ; D1A + MOV AX,SYS_PATCH_DS ; Load DS and ES with our data segment @D1A + MOV DS,AX ; selector @D1A + MOV ES,AX ; @D1A + MOV DI,SGTBLOFF ; Point ES:DI to the first page @D1A + ; directory entry D1A + DATAOV ; Load AX with the page directory entry @D1A + MOV AX,XMAPAGE ; for the first XMA page table @D1A + DATAOV ; Stuff the address of the page table @D1A + STOSW ; for bank 0 into the page directory @D1A + +PAGE +;------------------------------------------------------------------------------; +; And now, the moment you've all been waiting for -- TURN ON THE PAGING ; +; MECHANISM!!! ; +;------------------------------------------------------------------------------; + + CMOV EAX,CR0 ; Get CR0 @P5A + MOV BX,8000H ; Set up BX to OR on the Paging Enable bit @P5C + DATAOV + SHL BX,16 ; It's the one all the way on the left @P5C + DATAOV ; @P5A + OR AX,BX ; Set the paging enabled bit @P5A + OR AL,02H ; Set co-processor bit on @P5A + AND AL,0F7H ; Turn off Task Switch bit @P5C + CMOV CR0,EAX ; Here we go... + +; Make sure high order bits of ESP are zero - a1 errata + + MOV AX,SP ; Save SP in AX 'cause it changes when we do... + PUSH 0 ; this PUSH. Push 0 for high 16 bits of ESP + PUSH AX ; Push low 16 bits of SP + DATAOV + POP SP ; Pop 32 bit ESP! + +PAGE +;------------------------------------------------------------------------------; +; Now we give control back to the V86 task by setting up the stack P5C; +; for an IRET back to the V86 task. This requires putting the V86 P5C; +; task's segment registers, SS and ESP, and the EFLAGS, CS and IP on P5C; +; the stack. The 80386 puts all these values on the stack when it P5C; +; interrupts out of V86 mode, so it expects them there on an IRET P5C; +; back to V86 mode. But really we are giving control back to ; +; ourself. The CS:IP on the stack point to the label TEST_EXIT ; +; below, but it is in the copy of the emulator that was originally ; +; loaded, not the copy that was relocated to high memory and is now ; +; running in protect mode. This clever trick will result in the ; +; original copy of the emulator returning to DOS which will continue ; +; to load the rest of the system. The system will come up completely ; +; unaware that it is running in a small universe of a V86 task which ; +; is being monitored by the XMA emulator. ; +;------------------------------------------------------------------------------; + + + MOV AX,SCRUBBER.TSS_PTR ; Load DS with the descriptor for the @P5A + MOV DS,AX ; VM's TSS with read/write access @P5A + MOV BX,0 ; VM's TSS with read/write access @P5A +; P5A +; Set up our stack for an IRET to the V86 task. This is an inter-level P5A +; IRET to a V86 task so we need the V86 task's SS, ESP, ES, DS, FS and GS P5A +; as well as his EFLAGS, EIP and CS. P5A +; P5A + DATAOV ; @P5A + PUSH WORD PTR [BX].ETSS_GS ; Put V86 task's GS on the stack @P5A + DATAOV ; @P5A + PUSH WORD PTR [BX].ETSS_FS ; Put V86 task's FS on the stack @P5A + DATAOV ; @P5A + PUSH WORD PTR [BX].ETSS_DS ; Put V86 task's DS on the stack @P5A + DATAOV ; @P5A + PUSH WORD PTR [BX].ETSS_ES ; Put V86 task's ES on the stack @P5A + DATAOV ; @P5A + PUSH WORD PTR [BX].ETSS_SS ; Put V86 task's SS on the stack @P5A + DATAOV ; @P5A + PUSH WORD PTR [BX].ETSS_SP ; Put V86 task's ESP on the stack @P5A + DATAOV ; @P5A + PUSH WORD PTR [BX].ETSS_FL ; Put V86 task's EFLAGS on the stack @P5A + DATAOV ; @P5A + PUSH WORD PTR [BX].ETSS_CS ; Put V86 task's CS on the stack @P5A + DATAOV ; @P5A + PUSH WORD PTR [BX].ETSS_IP ; Put V86 task's EIP on the stack @P5A + DATAOV ; @P5A + IRET ; @P5A + ; @P5D + +TEST_EXIT: ; We are now running in V86 mode + POP AX ; Pop the stack until our DEAD delimiter is + CMP AX,0DEADH ; found + JNE TEST_EXIT + +; Replace the interrupt 15 vector with our handler (INT15F88). P7A + + MOV AH,GET_VECT ; Get the current vector at interrupt 15H @P7A + MOV AL,15H ; @P7A + INT 21H ; @P7A + + MOV CS:CHAINSEG,ES ; Save it in the chaining header in @P7A + MOV CS:CHAINOFF,BX ; INT15F88 @P7A + + MOV AH,SET_VECT ; Set the entry point of INT15F88 as the @P7A + MOV AL,15H ; new interrupt 15 vector @P7A + PUSH CS ; @P7A + POP DS ; @P7A + MOV DX,OFFSET INT15F88 ; @P7A + INT 21H ; @P7A + +; Copy the number of K for extended memory from BUFF_SIZE to EXT_MEM. This P7A +; is needed because BUFF_SIZE does not stay resident, EXT_MEM does. P7A + + MOV AX,BUFF_SIZE ; @P7A + MOV EXT_MEM,AX ; @P7A + +; Issue the message that says we installed successfully + + MOV AH,DISPSTRG ; Set AH to DOS display string function @D0A + MOV DX,OFFSET GOODLOAD ; @D0A + PUSH CS ; @D0A + POP DS ; DS:DX points to the message @D0A + INT 21H ; Display the message @D0A + + RET ; Return to IRPT which called INIT_P1 + +SUBTTL Gate A20 +PAGE +;------------------------------------------------------------------------------; +; GATE_A20 ; +; This routine controls a signal which gates address bit 20. ; +; Bit 2 of port 92H controls the enabling of A20. If bit 2 is on, P4C; +; then A20 is enabled. Conversely, if bit 2 is off, A20 is disabled. P4C; +; ; +;------------------------------------------------------------------------------; + +; Equates for the Gate A20 enable + +ENABLE_A20 EQU 02H ; Bit 2 of port 92H turns on A20 @P4C + +GATE_A20 PROC + + IN AL,92H ; Get the current value of port 92 @P4A + OR AL,ENABLE_A20 ; Turn on the bit to enable A20 @P4A + OUT 92H,AL ; Send it back out to port 92 @P4A + RET + ; 15@P4D +GATE_A20 ENDP + +SUBTTL GET_PARMS parameter line scan +PAGE +;------------------------------------------------------------------------------; +; GET_PARMS ; +; This procedure converts the numeric parameter following the DEVICE statement ; +; in the CONFIG.SYS file to a binary number and saves it in BUFF_SIZE. The ; +; number is rounded up to the nearest 16K boundary. ; +; ; +; Register usage: ; +; DS:SI indexes parameter string ; +; AL contains character from parameter string ; +; CX value from GET_NUMBER ; +; ; +;------------------------------------------------------------------------------; + + ASSUME DS:NOTHING ; DS:BX point to Request Header + +GET_PARMS PROC + + PUSH DS ; Save DS + push bx ; save bx ;an000; dms; + + LDS SI,RH.RH0_BPBA ; DS:SI point to all text after "DEVICE=" + ; in CONFIG.SYS + XOR AL,AL ; Start with a null character in AL. + +;------------------------------------------------------------------------------; +; Skip until first delimiter is found. There may be digits in the path string.; +; ; +; DS:SI points to \pathstring\386XMAEM.SYS nn nn nn ; +; The character following 386XMAEM.SYS may have been changed to a null (00H). ; +; All letters have been changed to uppercase. ; +;------------------------------------------------------------------------------; + +GET_PARMS_A: + CALL GET_PCHAR ; Get a character from the parameter string + JZ Get_Parms_Null ; The zero flag is set if the end of the line + ; is found. If so, then exit. + +; Check for various delimeters + + OR AL,AL ; Null + JZ GET_PARMS_B + CMP AL,' ' ; Blank + JE GET_PARMS_B + CMP AL,',' ; Comma + JE GET_PARMS_B + CMP AL,';' ; Semi-colon + JE GET_PARMS_B + CMP AL,'+' ; Plus sign + JE GET_PARMS_B + CMP AL,'=' ; Equals + JE GET_PARMS_B + CMP AL,TAB ; Tab + JNE GET_PARMS_A ; Skip until delimiter or CR is found + +GET_PARMS_B: ; Now pointing to first delimiter + CALL SKIP_TO_DIGIT ; Skip to first digit + JZ Get_Parms_C ; Found EOL, no digits remain + + CALL GET_NUMBER ; Extract the digits and convert to binary + jmp Get_Parms_Found ; Parm found + +Get_Parms_Null: + + xor cx,cx ; set cx to 0 ;an000; dms; + +Get_Parms_Found: + + mov bx,cx ; put cx value in bx ;an000; dms; + + cmp cx,0 ; 0 pages requested? ;an000; dms; + jne Get_Parm_Max ; allocate maximum number ;an000; dms; + MOV CS:BUFF_SIZE,0; Store buffer size + jmp Get_Parms_C + +Get_Parm_Max: + + cmp bx,64 ; >= 64 pages requested? ;an000; dms; + jnb Get_Parms_64_Pg ; yes - continue ;an000; dms; + mov dx,offset Small_Parm ; Parm < 64 and > 0 ;an000; dms; + mov ah,Dispstrg ; Display the welcome message. ;an000; dms; + push ds ; Save DS ;an000; dms; + push cs ; ;an000; dms; + pop ds ; DS:DX points to the message ;an000; dms; + int 21h ; Display the message ;an000; dms; + pop ds ; Restore DS ;an000; dms; + stc ; flag an error occurred ;an000; dms; + jmp Get_Parms_C ; exit routine ;an000; dms; + +Get_Parms_64_Pg: + + mov ax,bx ; prepare to adjust to Kb value ;an000; dms; + mov cx,10h ; 16Kb per page ;an000; dms; + xor dx,dx ; clear high word ;an000; dms; + mul cx ; get Kb value ;an000; dms; + + mov bx,ax ; store page Kb value in bx ;an000; dms; + add bx,128 ; adjust for emulator code + + mov ah,88h ; get number of 1k blocks above 1Mb ;an000; dms; + int 15h ; + + sub ax,bx ; get number of blocks to allocate for extended ;an000; dms; + jnc Get_Parms_Ext ; set extended memory value in buff size ;an000; dms; + mov dx,offset No_Mem ; not enough memory for parm + mov ah,Dispstrg ; Display the welcome message. ;an000; dms; + push ds ; Save DS ;an000; dms; + push cs ; ;an000; dms; + pop ds ; DS:DX points to the message ;an000; dms; + int 21h ; Display the message ;an000; dms; + pop ds ; Restore DS ;an000; dms; + stc ; flag an error ;an000; dms; + jmp Get_Parms_C ; exit routine ;an000; dms; + +Get_Parms_Ext: + + MOV CS:BUFF_SIZE,ax ; Store buffer size + clc + +GET_PARMS_C: + pop bx ; restore bx ;an000; dms; + POP DS ; Restore DS + + RET + +;------------------------------------------------------------------------------; +; GET_PCHAR -- Get a character from the parameter string into AL ; +;------------------------------------------------------------------------------; + +GET_PCHAR PROC + CMP AL,CR ; Carriage return already encountered? + JE GET_PCHAR_X ; Don't read past end of line + LODSB ; Get character from DS:SI, increment SI + CMP AL,CR ; Is the character a carriage return? + JE GET_PCHAR_X ; Yes, leave the zero flag set to signal end + ; of line + CMP AL,LF ; No, is it a line feed? This will leave the + ; zero flag set if a line feed was found. +GET_PCHAR_X: + RET + +GET_PCHAR ENDP + +;------------------------------------------------------------------------------; +; CHECK_NUM -- Check if the character in AL is a numeric digit, ASCII for ; +; 0 - 9. The zero flag is set if the character is a digit, ; +; otherwise it is reset. ; +;------------------------------------------------------------------------------; + +CHECK_NUM PROC + CMP AL,'0' ; If character is less than a "0" then it is not + JB CHECK_NUM_X ; a number, so exit + + CMP AL,'9' ; If character is greater than a "9" then it is + JA CHECK_NUM_X ; not a number, so exit + + CMP AL,AL ; Set the zero flag to show it is a number +CHECK_NUM_X: + RET ; Zero flag is left reset if character is not +CHECK_NUM ENDP ; a number + +;------------------------------------------------------------------------------; +; SKIP_TO_DIGIT -- Scan the parameter string until a numeric character is ; +; found or the end of the line is encountered. If a numeric ; +; character is not found then the zero flag is set. Else if ; +; a character was found then the zero flag is reset. ; +;------------------------------------------------------------------------------; + +SKIP_TO_DIGIT PROC + CALL CHECK_NUM ; Is the current character a digit? + JZ SKIP_TO_DIGIT_X ; If zero flag is set then it is a number + + CALL GET_PCHAR ; Get the next character from the line + JNZ SKIP_TO_DIGIT ; Loop until first digit or CR or LF is found + RET ; Fall through to here if digit not found + +SKIP_TO_DIGIT_X: + CMP AL,0 ; Digit found, reset the zero flag to show digit + RET ; was found +SKIP_TO_DIGIT ENDP + +;------------------------------------------------------------------------------; +; GET_NUMBER -- Convert the character digits in the parameter string to a ; +; binary value. The value is returned in CX, unless the ; +; calculation overflows, in which case return a 0. The next ; +; character after the digits is left in AL. ; +;------------------------------------------------------------------------------; + +C10 DW 10 +GN_ERR DB ? ; Zero if no overflow in accumulation + +GET_NUMBER PROC ; Convert string of digits to binary value + XOR CX,CX ; Clear CX, the resulting number + MOV CS:GN_ERR,CL ; No overflow yet + +GET_NUMBER_A: + SUB AL,'0' ; Convert the ASCII character in AL to binary + CBW ; Clear AH + XCHG AX,CX ; Previous accumulation in AX, new digit in CL + MUL CS:C10 ; DX:AX = AX*10 + OR CS:GN_ERR,DL ; Any overflow from AX goes into DX. Any non- + ; zero value in DL will signal an error + ADD AX,CX ; Add the new digit to ten times the previous + ; digits + XCHG AX,CX ; New number now in CX + CALL GET_PCHAR ; Get the next character + CALL CHECK_NUM ; Check if it is numeric + JZ GET_NUMBER_A ; If so, then go back and add this digit to the + ; result + CMP CS:GN_ERR,0 ; Did we overflow? + JE GET_NUMBER_B ; If not, we're done + XOR CX,CX ; Return a zero result if overflow +GET_NUMBER_B: + RET +GET_NUMBER ENDP + +GET_PARMS ENDP + +POST ENDP + +PROG ENDS + END + diff --git a/v4.0/src/DEV/XMAEM/INDEINS.MAC b/v4.0/src/DEV/XMAEM/INDEINS.MAC new file mode 100644 index 0000000..c4b13e5 --- /dev/null +++ b/v4.0/src/DEV/XMAEM/INDEINS.MAC @@ -0,0 +1,923 @@ +COMMENT # +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* * +* MODULE NAME : INDEINS * +* * +* 5669-196 (C) COPYRIGHT 1988 Microsoft Corp. * +* * +* DESCRIPTIVE NAME: Instructions for the 80386 * +* * +* STATUS (LEVEL) : Version (0) Level (1.0) * +* * +* FUNCTION : These macros define instructions that are recognized by * +* the 80386 but that are not recognized by MASM 3.0. We * +* have to create these instructions ourselves because the * +* Macro Assembler won't. * +* * +* MODULE TYPE : MAC * +* * +* REGISTER USAGE : 80286 Standard * +* * +* CHANGE ACTIVITY : * +* * +* $MAC(INDEINS) COMP(LOAD) PROD(3270PC) : * +* * +* $D0=D0004700 410 870604 D : NEW FOR RELEASE 1.1 * +* $P1=P0000311 410 870804 D : RENAME MODULE'S LIBRARY FILE TYPE TO "MAC" * +* * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +# + +; Some information about creating instructions + +; MODIFIER BYTE VALUES + +; MOD REG/OPX R/M +; --- ------- --- +; 11 111 111 + +; EAX AX AL 000 DISP0 00 +; ECX CX CL 001 DISPB 01 +; EDX DX DL 010 DISPW 10 +; EBX BX BL 011 DISPR 11 +; ESP SP AH 100 +; EBP BP CH 101 +; ESI SI DH 110 +; EDI DI BH 111 + +; ES:0 +; CS:1 +; SS:2 +; DS:3 +; FS:4 +; GS:5 + + +; OPX FIELD VALUES + +; 00F-000 OPCODE VALUES 00F-001 OPCODE VALUES +; --------------------- --------------------- + +; SLDT 000 SGDT 000 +; STR 001 SIDT 001 +; LLDT 010 LIDT 010 +; LTR 011 LGDT 011 +; VERR 100 SMSW 100 +; VERW 101 ? 101 +; ? 110 LMSW 110 +; ? 111 ? 111 + + +PAGE + +; Macros to move to and from the 80386 system registers and to and from the +; new segment registers FS and GS. + + +; CMOV - Move to and From Control Registers +; +; Examples: +; +; CMOV CRx,EREG +; CMOV EREG,CRx +; + +CMOV MACRO REG1,REG2 + + _CREGFD = 0 + _CRCNT = 0 + IRP TREG, + IFIDN <®1>,<&TREG> + _CREGFD = 1 + _CRCNT = 0 + ELSE + _CRCNT = _CRCNT + 1 + ENDIF + ENDM + IFE _CREGFD-1 + F_DREG <®2> + IF _DREGNUM LT 8 + DB 0FH + DB 22H + DB 0C0H + _CRCNT*8 + _DREGNUM + ELSE + SYNTAX ERROR - EXTENDED REGISTER EXPECTED + ENDIF + ELSE + _CREGFD = 0 + _CRCNT = 0 + IRP TREG, + IFIDN <®2>,<&TREG> + _CREGFD = 1 + _CRCNT = 0 + ELSE + _CRCNT = _CRCNT + 1 + ENDIF + ENDM + IFE _CREGFD-1 + F_DREG <®1> + IF _DREGNUM LT 8 + DB 0FH + DB 20H + DB 0C0H + _CRCNT*8 + _DREGNUM + ELSE + SYNTAX ERROR - EXTENDED REGISTER EXPECTED + ENDIF + ELSE + SYNTAX ERROR - CONTROL REGISTER EXPECTED + ENDIF + ENDIF + ENDM + + +; DMOV - Move to and From Debug Registers +; +; Examples: +; +; DMOV DRx,EREG +; DMOV EREG,DRx +; + +DMOV MACRO REG1,REG2 + + _DREGFD = 0 + _DRCNT = 0 + IRP TREG, + IFIDN <®1>,<&TREG> + _DREGFD = 1 + _DRCNT = 0 + ELSE + _DRCNT = _DRCNT + 1 + ENDIF + ENDM + IFE _DREGFD-1 + F_DREG <®2> + IF _DREGNUM LT 8 + DB 0FH + DB 23H + DB 0C0H + _DRCNT*8 + _DREGNUM + ELSE + SYNTAX ERROR - EXTENDED REGISTER EXPECTED + ENDIF + ELSE + _DREGFD = 0 + _DRCNT = 0 + IRP TREG, + IFIDN <®2>,<&TREG> + _DREGFD = 1 + _DRCNT = 0 + ELSE + _DRCNT = _DRCNT + 1 + ENDIF + ENDM + IFE _DREGFD-1 + F_DREG <®1> + IF _DREGNUM LT 8 + DB 0FH + DB 21H + DB 0C0H + _DRCNT*8 + _DREGNUM + ELSE + SYNTAX ERROR - EXTENDED REGISTER EXPECTED + ENDIF + ELSE + SYNTAX ERROR - DEBUG REGISTER EXPECTED + ENDIF + ENDIF + ENDM + +; TMOV - Move to and From Test Registers +; +; Examples: +; +; TMOV TRx,EREG +; TMOV EREG,TRx +; + +TMOV MACRO REG1,REG2 + + _TREGFD = 0 + _TRCNT = 0 + IRP TREG, + IFIDN <®1>,<&TREG> + _TREGFD = 1 + _TRCNT = 0 + ELSE + _TRCNT = _TRCNT + 1 + ENDIF + ENDM + _TRCNT = _TRCNT + 6 + IFE _TREGFD-1 + F_DREG <®2> + IF _DREGNUM LT 8 + DB 0FH + DB 26H + DB 0C0H + _TRCNT*8 + _DREGNUM + ELSE + SYNTAX ERROR - EXTENDED REGISTER EXPECTED + ENDIF + ELSE + _TREGFD = 0 + _TRCNT = 0 + IRP TREG, + IFIDN <®2>,<&TREG> + _TREGFD = 1 + _TRCNT = 0 + ELSE + _TRCNT = _TRCNT + 1 + ENDIF + ENDM + _TRCNT = _TRCNT + 6 + IFE _TREGFD-1 + F_DREG <®1> + IF _DREGNUM LT 8 + DB 0FH + DB 24H + DB 0C0H + _TRCNT*8 + _DREGNUM + ELSE + SYNTAX ERROR - EXTENDED REGISTER EXPECTED + ENDIF + ELSE + SYNTAX ERROR - TEST REGISTER EXPECTED + ENDIF + ENDIF + ENDM + +; SMOV - Move to/from FS/GS segment registers from/to general registers +; +; Examples: +; +; SMOV SReg, REG16 +; SMOV REG16, SReg +; + +SMOV MACRO REG1,REG2 + _SREGNUM = 8 + _SREG1 = 1 + IFIDN <®1>, + _SREGNUM = 4 + ELSE + IFIDN <®1>, + _SREGNUM = 4 + ENDIF + ENDIF + IF _SREGNUM GT 7 + IFIDN <®1>, + _SREGNUM = 5 + ELSE + IFIDN <®1>, + _SREGNUM = 5 + ENDIF + ENDIF + ENDIF + IF _SREGNUM GT 7 + _SREG1 = 0 + IFIDN <®2>, + _SREGNUM = 4 + ELSE + IFIDN <®2>, + _SREGNUM = 4 + ENDIF + ENDIF + IF _SREGNUM GT 7 + IFIDN <®2>, + _SREGNUM = 5 + ELSE + IFIDN <®2>, + _SREGNUM = 5 + ENDIF + ENDIF + ENDIF + ENDIF + IF _SREGNUM GT 7 + SYNTAX ERROR - FS OR GS SEGMENT REGISTER EXPECTED + ELSE + IF _SREG1 EQ 1 + DB 8EH + F_WREG <®2> + ELSE + DB 8CH + F_WREG <®1> + ENDIF + IF _WREGNUM GT 7 + SYNTAX ERROR - WORD REGISTER EXPECTED + ELSE + DB 0C0H + _SREGNUM*8 + _WREGNUM + ENDIF + ENDIF + ENDM + +F_MOD MACRO TYPE,DISP1,DISP2 + _DISP = 2 +;; 1 0 + IRP _TEST_, + IFIDN <&TYPE>,<&_TEST_> + _DISP = 0 + ELSE + _DISP = _DISP + 1 + ENDIF + ENDM + IFE (_DISP LT 2) +;; 1 0 + IRP _TEST_, + IFIDN <&TYPE>,<&_TEST_> + _DISP = 0 + ELSE + _DISP = _DISP + 1 + ENDIF + ENDM + ENDIF + IF _DISP LT 2 + IFB <&DISP1> + SYNTAX ERROR - IMMEDIATE OPERAND EXPECTED + ELSE + IFE _DISP-1 + _MOD = 2 + ELSE + _MOD = 1 + ENDIF + ENDIF + ELSE + _MOD = 0 + ENDIF + ENDM + +MK_DISP MACRO P3,P4 + IFE _DISP + DB &P3 + ELSE + DW &P3 + IFNB <&P4> + IFDIF <&P4>, + DW &P4 + ENDIF + ELSE + DW 0H + ENDIF + ENDIF + ENDM + +MK_IMMD MACRO P2,P3,P4,P5 + _IMMDCNT = 3 + IRP _PARM,<&P2,&P3,&P4,&P5> + IFE _IMMDCNT + IF _SIZE EQ 1 + DB &_PARM + ELSE + DW &_PARM + ENDIF + ELSE + IFE _IMMDCNT-1 + IF _SIZE EQ 4 + IFNB <&_PARM> + DW &_PARM + ELSE + DW 0H + ENDIF + ENDIF + ENDIF + ENDIF + _IMMDCNT = _IMMDCNT + 1 + IFIDN <&_PARM>, + _IMMDCNT = 0 + ENDIF + ENDM + ENDM + +F_BREG MACRO TBREG + _BREGNUM = 0 + IRP TREG, + IFIDN <&TBREG>,<&TREG> + _BREGNUM = 0 + ELSE + _BREGNUM = _BREGNUM + 1 + ENDIF + ENDM + IFE (_BREGNUM LT 8) + IRP TREG, + IFIDN <&TDREG>,<&TREG> + _BREGNUM = 0 + ELSE + _BREGNUM = _BREGNUM + 1 + ENDIF + ENDM + ENDIF + ENDM + +F_WREG MACRO TWREG + _WREGNUM = 0 + IRP TREG, + IFIDN <&TWREG>,<&TREG> + _WREGNUM = 0 + ELSE + _WREGNUM = _WREGNUM + 1 + ENDIF + ENDM + IFE (_WREGNUM LT 8) + IRP TREG, + IFIDN <&TWREG>,<&TREG> + _WREGNUM = 0 + ELSE + _WREGNUM = _WREGNUM + 1 + ENDIF + ENDM + ENDIF + ENDM + +F_DREG MACRO TDREG + _DREGNUM = 0 + IRP TREG, + IFIDN <&TDREG>,<&TREG> + _DREGNUM = 0 + ELSE + _DREGNUM = _DREGNUM + 1 + ENDIF + ENDM + IFE (_DREGNUM LT 8) + IRP TREG, + IFIDN <&TDREG>,<&TREG> + _DREGNUM = 0 + ELSE + _DREGNUM = _DREGNUM + 1 + ENDIF + ENDM + ENDIF + ENDM + +F_BASE MACRO TBASE + _BASE = 0 +;; 7 6 5 4 3 2 1 0 + IRP TREG,<[EDI],[ESI],[EBP],[ESP],[EBX],[EDX],[ECX],[EAX]> + IFIDN <&TBASE>,<&TREG> + _BASE = 0 + ELSE + _BASE = _BASE + 1 + ENDIF + ENDM + IFE (_BASE LT 8) +;; 7 6 5 4 3 2 1 0 + IRP TREG,<[EDI],[ESI],[EBP],[ESP],[EBX],[EDX],[ECX],[EAX]> + IFIDN <&TBASE>,<&TREG> + _BASE = 0 + ELSE + _BASE = _BASE + 1 + ENDIF + ENDM + ENDIF + ENDM + +F_INDEX MACRO INDX + _INDEX = 0 +;; 7 6 5 4 3 2 1 0 + IRP TREG,<[EDI,[ESI,[EBP,_XX_,[EBX,[EDX,[ECX,[EAX> + IFIDN <&INDX>,<&TREG> + _INDEX = 0 + ELSE + _INDEX = _INDEX + 1 + ENDIF + ENDM + IFE (_INDEX LT 8) +;; 7 6 5 4 3 2 1 0 + IRP TREG,<[EDI,[ESI,[EBP,_XX_,[EBX,[EDX,[ECX,[EAX> + IFIDN <&INDX>,<&TREG> + _INDEX = 0 + ELSE + _INDEX = _INDEX + 1 + ENDIF + ENDM + ENDIF + ENDM + +F_SCALE MACRO TSCALE + _SCALE = 0 +;; 3 2 1 0 + IRP TREG,<*8], *4], *2], *1]> + IFIDN <&TSCALE>,<&TREG> + _SCALE = 0 + ELSE + _SCALE = _SCALE + 1 + ENDIF + ENDM + ENDM + +PAGE + +; Macros to PUSH and POP the new segment registers FS and GS + + +; PUSH_FS - PUSH FS segment register + +PUSH_FS MACRO + DB 00FH + DB 0A0H + ENDM + + +; PUSH_GS - PUSH GS segment register + +PUSH_GS MACRO + DB 00FH + DB 0A8H + ENDM + + +; POP_FS - POP FS segment register + +POP_FS MACRO + DB 00FH + DB 0A1H + ENDM + + +; POP_GS - POP GS segment register + +POP_GS MACRO + DB 00FH + DB 0A9H + ENDM + +PAGE + +; Macros for multiplication instructions + +; RIMUL - Uncharacterized Signed Multiply (16-bit) +; Syntax: RIMUL REG,REG/MEM + +RIMUL MACRO REG,OPND + LOCAL L1,L2 + _2BYTEOP = 1 + DB 0FH + .XLIST +L1 LABEL BYTE + .LIST + CMP ®,&OPND + .XLIST +L2 LABEL BYTE + ORG OFFSET CS:L1 + .LIST + DB 0AFH + .XLIST + ORG OFFSET CS:L2 + .LIST + ENDM + +; ERIMUL - 32 bit Uncharacterized Signed Multiply +; Systax: ERIMUL REG,REG/MEM + +ERIMUL MACRO REG,OPND + DB 66H + RIMUL ®,<&OPND> + ENDM + +PAGE + +; Macros to load pointers with the segment in FS, GS or SS. That is, these are +; just like the instructions LDS and LES but for the FS, GS and SS registers. + +NEWLS MACRO OP,REG,OPND + LOCAL L1,L2 + DB 0FH + .XLIST +L1 LABEL BYTE + .LIST + LDS ®,DWORD PTR &OPND + .XLIST +L2 LABEL BYTE + ORG OFFSET CS:L1 + .LIST + DB &OP + .XLIST + ORG OFFSET CS:L2 + .LIST + ENDM + +; LFS REG,OPND + +LFS MACRO REG,OPND + NEWLS 0B4H,®,<&OPND> + ENDM + +; LGS REG,OPND + +LGS MACRO REG,OPND + NEWLS 0B5H,®,<&OPND> + ENDM + +; LSS REG,OPND + +LSS MACRO REG,OPND + NEWLS 0B2H,®,<&OPND> + ENDM + +; Now we do 32 bit versions of the above + +; ELFS REG,OPND + +ELFS MACRO REG,OPND + DB 66H + NEWLS 0B4H,®,<&OPND> + ENDM + +; ELGS REG,OPND + +ELGS MACRO REG,OPND + DB 66H + NEWLS 0B5H,®,<&OPND> + ENDM + +; ELSS REG,OPND + +ELSS MACRO REG,OPND + DB 66H + NEWLS 0B2H,®,<&OPND> + ENDM + +PAGE + +; Macros for some shift instructions + +; Shift Left Double R/M, Reg [CL = COUNT] [16-bit Operand] +; SHLD OPND,REG (Double left shift) [CL = COUNT] + +SHLD MACRO OPND,REG + SHDOP 0A5H,<&OPND>,® + ENDM + + +; Shift Right Double R/M, Reg [CL = COUNT] [16-bit Operand] +; SHRD OPND,REG (Double right shift) [CL = COUNT] + +SHRD MACRO OPND,REG + SHDOP 0ADH,<&OPND>,® + ENDM + + +; Shift Left Double R/M, Reg, Immd (8-bit) [16-bit Operand] +; SHLDI OPND,REG,IMMD-8 + +SHLDI MACRO OPND,REG,IMMD + SHDOP 0A4H,<&OPND>,® + DB &IMMD + ENDM + + +; Shift Right Double R/M, Reg, Immd (8-bit) [16-bit Operand] +; SHRDI OPND,REG,IMMD-8 + +SHRDI MACRO OPND,REG,IMMD + SHDOP 0ACH,<&OPND>,® + DB &IMMD + ENDM + +; Now 32 bit versions of the above + +; Shift Left Double R/M, Reg [CL = COUNT] [32-bit Operand] +; ESHLD OPND,REG (Double left shift) [CL = COUNT] + +ESHLD MACRO OPND,REG + DB 66H + SHDOP 0A5H,<&OPND>,® + ENDM + + +; Shift Right Double R/M, Reg [CL = COUNT] [32-bit Operand] +; ESHRD OPND,REG (Double right shift) [CL = COUNT] + +ESHRD MACRO OPND,REG + DB 66H + SHDOP 0ADH,<&OPND>,® + ENDM + + +; Shift Left Double R/M, Reg, Immd (8-bit) [32-bit Operand] +; ESHLDI OPND,REG,IMMD-8 (Double left shift) + +ESHLDI MACRO OPND,REG,IMMD + DB 66H + SHDOP 0A4H,<&OPND>,® + DB &IMMD + ENDM + + +; Shift Right Double R/M, Reg, Immd (8-bit) [32-bit Operand] +; ESHRDI OPND,REG,IMMD-8 (Double right shift) + +ESHRDI MACRO OPND,REG,IMMD + DB 66H + SHDOP 0ACH,<&OPND>,® + DB &IMMD + ENDM + + +SHDOP MACRO OP,OPND,REG + LOCAL L1,L2 + _2BYTEOP = 1 + DB 0FH + .XLIST +L1 LABEL BYTE + .LIST + OR ®,&OPND + .XLIST +L2 LABEL BYTE + ORG OFFSET CS:L1 + .LIST + DB &OP + .XLIST + ORG OFFSET CS:L2 + .LIST + ENDM + +PAGE + +; The following two instructions, CALLFAR and JUMPFAR, work in the +; MS Macro Assembler, but not for intersegment direct. The assembler +; generates segments based on 8088 values, and we need them based +; on protect-mode selector values. The assembler works just ducky for +; jump and call far indirect, since you go pick up the offset and +; segment at execution time. + +CALLFAR MACRO DISP,SEGMENT + + DB 09AH ; Call far direct + DW (OFFSET &DISP) ; to this offset + DW &SEGMENT ; in this segment + + ENDM + + +JUMPFAR MACRO DISP,SEGMENT + + DB 0EAH ; Jump far direct + DW (OFFSET &DISP) ; to this offset + DW &SEGMENT ; in this segment + + ENDM + +PAGE + +; Macros for extended jump instructions + +LJCOND MACRO OP,DISPL + _2BYTEOP = 1 +TEMP = $ + 4 + DB 0FH + DB &OP + DW (OFFSET &DISPL)-(&TEMP) + ENDM + +; LJO DISPL (Long Jump on Overflow) +LJO MACRO DISPL + LJCOND 80H,<&DISPL> + ENDM + + +; LJNO DISPL (Long Jump on NO Overflow) +LJNO MACRO DISPL + LJCOND 81H,<&DISPL> + ENDM + +; LJB DISPL (Long Jump on Below) +LJB MACRO DISPL + LJCOND 82H,<&DISPL> + ENDM + +; LJC DISPL (Long Jump on Carry) +LJC MACRO DISPL + LJCOND 82H,<&DISPL> + ENDM + +; LNAE DISPL (Long Jump on Not Above or Equal) +LNAE MACRO DISPL + LJCOND 82H,<&DISPL> + ENDM + +; LJNB DISPL (Long Jump on Not Below) +LJNB MACRO DISPL + LJCOND 83H,<&DISPL> + ENDM + +; LJNC DISPL (Long Jump on No Carry) +LJNC MACRO DISPL + LJCOND 83H,<&DISPL> + ENDM + +; LJAE DISPL (Long Jump on Above or Equal) +LJAE MACRO DISPL + LJCOND 83H,<&DISPL> + ENDM + +; LJE DISPL (Long Jump on Equal) +LJE MACRO DISPL + LJCOND 84H,<&DISPL> + ENDM + +; LJZ DISPL (Long Jump on Zero) +LJZ MACRO DISPL + LJCOND 84H,<&DISPL> + ENDM + +; LJNE DISPL (Long Jump on Not Equal) +LJNE MACRO DISPL + LJCOND 85H,<&DISPL> + ENDM + +; LJNZ DISPL (Long Jump on Not Zero) +LJNZ MACRO DISPL + LJCOND 85H,<&DISPL> + ENDM + +; LJBE DISPL (Long Jump on Below or Equal) +LJBE MACRO DISPL + LJCOND 86H,<&DISPL> + ENDM + +; LJNA DISPL (Long Jump on Not Above) +LJNA MACRO DISPL + LJCOND 86H,<&DISPL> + ENDM + +; LJNBE DISPL (Long Jump on Not Below or Equal) +LJNBE MACRO DISPL + LJCOND 87H,<&DISPL> + ENDM + +; LJA DISPL (Long Jump on Above) +LJA MACRO DISPL + LJCOND 87H,<&DISPL> + ENDM + +; LJS DISPL (Long Jump on Sign) +LJS MACRO DISPL + LJCOND 88H,<&DISPL> + ENDM + +; LJNS DISPL (Long Jump on No Sign) +LJNS MACRO DISPL + LJCOND 89H,<&DISPL> + ENDM + +; LJP DISPL (Long Jump on Parity) +LJP MACRO DISPL + LJCOND 8AH,<&DISPL> + ENDM + +; LJPE DISPL (Long Jump on Parity Even) +LJPE MACRO DISPL + LJCOND 8AH,<&DISPL> + ENDM + +; LJNP DISPL (Long Jump on No Parity) +LJNP MACRO DISPL + LJCOND 8BH,<&DISPL> + ENDM + +; LJPO DISPL (Long Jump on Parity Odd) +LJPO MACRO DISPL + LJCOND 8BH,<&DISPL> + ENDM + +; LJL DISPL (Long Jump on Less) +LJL MACRO DISPL + LJCOND 8CH,<&DISPL> + ENDM + +; LJNGE DISPL (Long Jump on Not Greater or Equal) +LJNGE MACRO DISPL + LJCOND 8CH,<&DISPL> + ENDM + +; LJNL DISPL (Long Jump on Not Less) +LJNL MACRO DISPL + LJCOND 8DH,<&DISPL> + ENDM + +; LJGE DISPL (Long Jump on Greater than or Equal) +LJGE MACRO DISPL + LJCOND 8DH,<&DISPL> + ENDM + +; LJLE DISPL (Long Jump on Less than or Equal) +LJLE MACRO DISPL + LJCOND 8EH,<&DISPL> + ENDM + +; LJNG DISPL (Long Jump on Not Greater than) +LJNG MACRO DISPL + LJCOND 8EH,<&DISPL> + ENDM + +; LJNLE DISPL (Long Jump on Not Less than or Equal) +LJNLE MACRO DISPL + LJCOND 8FH,<&DISPL> + ENDM + +; LJG DISPL (Long Jump on Greater than) +LJG MACRO DISPL + LJCOND 8FH,<&DISPL> + ENDM + +; JECXZ DISPL (Jump short on ECX Zero) +JECEXZ MACRO DISPL + DB 66H + JCXZ &DISPL + ENDM + diff --git a/v4.0/src/DEV/XMAEM/INDEMAUS.ASM b/v4.0/src/DEV/XMAEM/INDEMAUS.ASM new file mode 100644 index 0000000..1174510 --- /dev/null +++ b/v4.0/src/DEV/XMAEM/INDEMAUS.ASM @@ -0,0 +1,73 @@ +PAGE 60,132 +TITLE INDEMAUS - 386 XMA Emulator - Messages + +COMMENT # +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* * +* MODULE NAME : INDEMAUS * +* * +* 5669-196 (C) COPYRIGHT 1988 Microsoft Corp. * +* * +* DESCRIPTIVE NAME: 80386 XMA Emulator messages -- U.S. * +* * +* STATUS (LEVEL) : Version (0) Level (1.0) * +* * +* FUNCTION : Declare the U.S. messages for the 80386 XMA Emulator * +* * +* MODULE TYPE : ASM * +* * +* REGISTER USAGE : N/A * +* * +* RESTRICTIONS : None * +* * +* DEPENDENCIES : None * +* * +* ENTRY POINT : None * +* * +* LINKAGE : The messages are made PUBLIC so that the initialization * +* module, INDEINI, can access them. * +* * +* INPUT PARMS : None * +* * +* RETURN PARMS : None * +* * +* OTHER EFFECTS : None * +* * +* EXIT NORMAL : None * +* * +* EXIT ERROR : None * +* * +* EXTERNAL * +* REFERENCES : None * +* * +* SUB-ROUTINES : None * +* * +* MACROS : None * +* * +* CONTROL BLOCKS : None * +* * +* CHANGE ACTIVITY : * +* * +* $MOD(INDEMAUS) COMP(LOAD) PROD(3270PC) : * +* * +* $D0=D0004700 410 870629 D : NEW FOR RELEASE 1.1 * +* * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +# + +SUBTTL Messages ; D0A +PAGE ; D0A + ; D0A +PROG SEGMENT PARA PUBLIC 'PROG' ; D0A + ; D0A + ASSUME CS:PROG ; D0A + ASSUME SS:NOTHING ; D0A + ASSUME DS:PROG ; D0A + ASSUME ES:NOTHING ; D0A + ; D0A +INDEMAUS LABEL NEAR ; D0A + ; D0A + INCLUDE INDEMSUS.INC ; Use the US messages D0A + ; D0A +PROG ENDS ; D0A + END ; D0A diff --git a/v4.0/src/DEV/XMAEM/INDEMSG.ASM b/v4.0/src/DEV/XMAEM/INDEMSG.ASM new file mode 100644 index 0000000..1adf363 --- /dev/null +++ b/v4.0/src/DEV/XMAEM/INDEMSG.ASM @@ -0,0 +1,96 @@ +PAGE 60,132 +TITLE INDEMSG - 80386 XMA Emulator - Messages + +COMMENT # +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* * +* MODULE NAME : INDEMSG * +* * +* 5669-196 (C) COPYRIGHT 1988 Microsoft Corp. * +* * +* DESCRIPTIVE NAME: 80386 XMA Emulator messages -- U.S. * +* * +* STATUS (LEVEL) : Version (0) Level (1.10) * +* * +* FUNCTION : Declare the U.S. messages for the 80386 XMA Emulator * +* * +* MODULE TYPE : ASM * +* * +* REGISTER USAGE : N/A * +* * +* RESTRICTIONS : None * +* * +* DEPENDENCIES : None * +* * +* ENTRY POINT : None * +* * +* LINKAGE : The messages are made PUBLIC so that the initialization * +* module, INDEINI, can access them. * +* * +* INPUT PARMS : None * +* * +* RETURN PARMS : None * +* * +* OTHER EFFECTS : None * +* * +* EXIT NORMAL : None * +* * +* EXIT ERROR : None * +* * +* EXTERNAL * +* REFERENCES : None * +* * +* SUB-ROUTINES : None * +* * +* MACROS : None * +* * +* CONTROL BLOCKS : None * +* * +* CHANGE ACTIVITY : * +* * +* $MOD(INDEMSG) COMP(LOAD) PROD(3270PC) : * +* * +* $D0=D0004700 410 870629 D : NEW FOR RELEASE 1.1 * +* $P1=P0000311 410 870805 D : RENAME MODULE TO INDEMSUS * +* $P2=P0000489 410 871002 D : RENAME MODULE TO INDEMSG. DECLARE MESSAGES HERE.* +* $P3=P0000649 411 880125 D : NEW VERSION OF THE EMULATOR * +* $P4=P0000741 411 880203 D : UPDATE COPYRIGHT * +* $D1=D0008700 120 880206 D : SUPPORT DOS 4.00 IOCTL CALL * +* * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +# + +SUBTTL Messages ; D0A +PAGE ; D0A + ; D0A +PROG SEGMENT PARA PUBLIC 'PROG' ; D0A + ; D0A + ASSUME CS:PROG ; D0A + ASSUME SS:NOTHING ; D0A + ASSUME DS:PROG ; D0A + ASSUME ES:NOTHING ; D0A + ; D0A +INDEMSG LABEL NEAR ; D0A + ; D0A +;---------------------------------------------------------------------------P2A; +; Declare messages that the emulator will display on the screen. These P2A; +; messages are declared with line lengths of 80 bytes to allow for World P2A; +; Trade translation. The messages are made public so that other modules P2A; +; can access them. P2A; +; Note that the messages are declared 80 bytes long to facilitate world trade translation. P2A; +;---------------------------------------------------------------------------P2A; + ; P2A + PUBLIC WELCOME ; P2A + PUBLIC GOODLOAD ; P2A + PUBLIC NO_80386 ; P2A + PUBLIC WAS_INST ; P2A + Public Small_Parm ;an000; dms; + Public No_Mem ;an000; dms; + ; P2A +CR EQU 13 ; ASCII for a carriage return ; @P2A +LF EQU 10 ; ASCII for a line feed ; @P2A + ; P2A +INCLUDE xmaem.cl1 + +PROG ENDS ; D0A + END ; D0A diff --git a/v4.0/src/DEV/XMAEM/INDEMSUS.ASM b/v4.0/src/DEV/XMAEM/INDEMSUS.ASM new file mode 100644 index 0000000..d73d016 --- /dev/null +++ b/v4.0/src/DEV/XMAEM/INDEMSUS.ASM @@ -0,0 +1,76 @@ +PAGE 60,132 +TITLE INDEMSG - 80386 XMA Emulator - Messages + +COMMENT # +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* * +* MODULE NAME : INDEMSUS * +* * +* 5669-196 (C) COPYRIGHT 1988 Microsoft Corp. * +* * +* DESCRIPTIVE NAME: 80386 XMA Emulator messages -- U.S. * +* * +* STATUS (LEVEL) : Version (0) Level (1.0) * +* * +* FUNCTION : Declare the U.S. messages for the 80386 XMA Emulator * +* * +* MODULE TYPE : ASM * +* * +* REGISTER USAGE : N/A * +* * +* RESTRICTIONS : None * +* * +* DEPENDENCIES : None * +* * +* ENTRY POINT : None * +* * +* LINKAGE : The messages are made PUBLIC so that the initialization * +* module, INDEINI, can access them. * +* * +* INPUT PARMS : None * +* * +* RETURN PARMS : None * +* * +* OTHER EFFECTS : None * +* * +* EXIT NORMAL : None * +* * +* EXIT ERROR : None * +* * +* EXTERNAL * +* REFERENCES : None * +* * +* SUB-ROUTINES : None * +* * +* MACROS : None * +* * +* CONTROL BLOCKS : None * +* * +* CHANGE ACTIVITY : * +* * +* $MOD(INDEMSUS) COMP(LOAD) PROD(3270PC) : * +* * +* $D0=D0004700 410 870629 D : NEW FOR RELEASE 1.1 * +* $P1=P0000311 410 870805 D : RENAME MODULE TO INDEMSUS * +* * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +# + +SUBTTL Messages ; D0A +PAGE ; D0A + ; D0A +PROG SEGMENT PARA PUBLIC 'PROG' ; D0A + ; D0A + ASSUME CS:PROG ; D0A + ASSUME SS:NOTHING ; D0A + ASSUME DS:PROG ; D0A + ASSUME ES:NOTHING ; D0A + ; D0A +INDEMSG LABEL NEAR ; D0A + ; D0A + INCLUDE INDEMSUS.INC ; Use the US messages D0A + ; D0A + include copyrigh.inc ; DCL p1821 + ; +PROG ENDS ; D0A + END ; D0A diff --git a/v4.0/src/DEV/XMAEM/INDEMSUS.INC b/v4.0/src/DEV/XMAEM/INDEMSUS.INC new file mode 100644 index 0000000..e352729 --- /dev/null +++ b/v4.0/src/DEV/XMAEM/INDEMSUS.INC @@ -0,0 +1,64 @@ +COMMENT # +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* * +* MODULE NAME : INDEMSUS * +* * +* 5669-196 (C) COPYRIGHT 1988 Microsoft Corp. * +* * +* DESCRIPTIVE NAME: 80386 XMA Emulator messages -- U.S. * +* * +* STATUS (LEVEL) : Version (0) Level (1.0) * +* * +* FUNCTION : Include file for U.S. messages for the 80386 XMA Emulator.* +* The messages are made PUBLIC so that the initialization * +* module, INDEINI, can access them. * +* * +* MODULE TYPE : INC * +* * +* MACROS : None * +* * +* CONTROL BLOCKS : None * +* * +* CHANGE ACTIVITY : * +* * +* $MAC(INDEMSUS) COMP(LOAD) PROD(3270PC) : * +* * +* $D0=D0004700 410 870722 D : NEW FOR RELEASE 1.1 * +* $P1=P0000311 410 870804 D : RENAME MODULE'S LIBRARY FILE TYPE TO "INC" * +* $P2=P0036900 110 870826 D : CHG MSG NO. INDXE003 * +* * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +# + +;---------------------------------------------------------------------------D0A; +; Declare messages that the emulator will display on the screen. These D0A; +; messages are declared with line lengths of 80 bytes to allow for World D0A; +; Trade translation. The messages are made public so that other modules D0A; +; can access them. D0A; +; Note that the messages are declared 80 bytes long to facilitate world trade translation. D0A; +;---------------------------------------------------------------------------D0A; + ; D0A + PUBLIC WELCOME ; D0A + PUBLIC GOODLOAD ; D0A + PUBLIC NO_80386 ; D0A + PUBLIC WAS_INST ; D0A + ; D0A +CR EQU 13 ; ASCII for a carriage return ; @D0A +LF EQU 10 ; ASCII for a line feed ; @D0A + ; D0A +WELCOME DB "INDXE001 80386 XMA Emulator Version 1.00 " ; @D0A + DB " (C) Copyright 1988 Microsoft Corporation All rights reserved " ; @D0A + DB CR,LF,"$" ; @D0A + ; D0A +GOODLOAD DB "INDXE002 80386 XMA Emulator installed " ; @D0A + DB CR,LF,"$" ; @D0A + ; D0A +NO_80386 DB "INDXE003 80386 XMA Emulator not installed. This system unit " ; @D0A + DB " is not supported. The 80386 XMA Emulator requires " ; @D0A + DB " an IBM Personal System/2 Model 80. " ; @D0A + DB CR,LF,"$" ; @D0A + ; D0A +WAS_INST DB "INDXE004 80386 XMA Emulator not installed. " ; @D0A + DB " Protected mode already in use. " ; @D0A + DB CR,LF,"$" ; @D0A + ; D0A diff --git a/v4.0/src/DEV/XMAEM/INDEOVP.MAC b/v4.0/src/DEV/XMAEM/INDEOVP.MAC new file mode 100644 index 0000000..3f2e213 --- /dev/null +++ b/v4.0/src/DEV/XMAEM/INDEOVP.MAC @@ -0,0 +1,111 @@ +COMMENT # +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* * +* MODULE NAME : INDEOVP * +* * +* 5669-196 (C) COPYRIGHT 1988 Microsoft Corp. * +* * +* DESCRIPTIVE NAME: Override prefix macros * +* * +* STATUS (LEVEL) : Version (0) Level (1.0) * +* * +* FUNCTION : DATAOV - Creates a prefix so that the next instruction * +* accesses data twice as wide as it normally would.* +* Bytes go to words, and words go to double words. * +* ADDROV - Creates a prefix so that the next instruction * +* uses 32 bit addresses instead of 16 bit. * +* SEGOV - Creates a segment override prefix for the next * +* instruction. * +* * +* MODULE TYPE : MAC * +* * +* REGISTER USAGE : 80286 Standard * +* * +* CHANGE ACTIVITY : * +* * +* $MAC(INDEOVP) COMP(LOAD) PROD(3270PC) : * +* * +* $D0=D0004700 410 870604 D : NEW FOR RELEASE 1.1 * +* $P1=P0000311 410 870804 D : RENAME MODULE'S LIBRARY FILE TYPE TO "MAC" * +* * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +# + +PAGE +; DATAOV - Create a prefix for an instruction so that it accesses data twice +; as wide as it normally would have. If the instruction was to access +; bytes then it will access words. If it was to access words then it +; will access double words (32 bits). + +DATAOV MACRO + DB 066H + ENDM + +PAGE +; ADDROV - Create a prefix for an instruction so that it uses 32 bit addresses +; instead of 16 bit addresses. + +ADDROV MACRO + DB 067H + ENDM + +PAGE +; SEGOV - Segment Prefix Overrides +; This macro will create segment prefix overrides for all the segment registers +; on the 80386. It will also create prefixes for the data override and address +; override as listed in the DATOV and ADDROV macros above. +; +; Syntax: SEGOV ES | CS | SS | DS | FS | GS | DATA | ADDRESS +; + +SEGOV MACRO SR + IFIDN <&SR>, + DB 026H + ENDIF + IFIDN <&SR>, + DB 026H + ENDIF + IFIDN <&SR>, + DB 02EH + ENDIF + IFIDN <&SR>, + DB 02EH + ENDIF + IFIDN <&SR>, + DB 036H + ENDIF + IFIDN <&SR>, + DB 036H + ENDIF + IFIDN <&SR>, + DB 03EH + ENDIF + IFIDN <&SR>, + DB 03EH + ENDIF + IFIDN <&SR>, + DB 064H + ENDIF + IFIDN <&SR>, + DB 064H + ENDIF + IFIDN <&SR>, + DB 065H + ENDIF + IFIDN <&SR>, + DB 065H + ENDIF + IFIDN <&SR>, + DB 066H + ENDIF + IFIDN <&SR>, + DB 066H + ENDIF + IFIDN <&SR>,
+ DB 067H + ENDIF + IFIDN <&SR>,
+ DB 067H + ENDIF + ENDM + diff --git a/v4.0/src/DEV/XMAEM/INDEPAT.ASM b/v4.0/src/DEV/XMAEM/INDEPAT.ASM new file mode 100644 index 0000000..e14d1d8 --- /dev/null +++ b/v4.0/src/DEV/XMAEM/INDEPAT.ASM @@ -0,0 +1,74 @@ +PAGE 60,132 +TITLE INDEPAT - 80386 XMA Emulator - Patch area + +COMMENT # +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* * +* MODULE NAME : INDEPAT * +* * +* 5669-196 (C) COPYRIGHT 1988 Microsoft Corp. * +* * +* DESCRIPTIVE NAME: 80386 XMA Emulator patch area * +* * +* STATUS (LEVEL) : Version (0) Level (1.0) * +* * +* FUNCTION : Declare a patch area for the 80386 XMA Emulator * +* * +* MODULE TYPE : ASM * +* * +* REGISTER USAGE : N/A * +* * +* RESTRICTIONS : None * +* * +* DEPENDENCIES : None * +* * +* ENTRY POINT : None * +* * +* LINKAGE : None * +* * +* INPUT PARMS : None * +* * +* RETURN PARMS : None * +* * +* OTHER EFFECTS : None * +* * +* EXIT NORMAL : None * +* * +* EXIT ERROR : None * +* * +* EXTERNAL * +* REFERENCES : None * +* * +* SUB-ROUTINES : None * +* * +* MACROS : None * +* * +* CONTROL BLOCKS : None * +* * +* CHANGE ACTIVITY : * +* * +* $MOD(INDEPAT) COMP(LOAD) PROD(3270PC) : * +* * +* $P0=P0000489 410 871002 D : NEW FOR WSP VERSION 1.1 * +* * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +# + +SUBTTL Patch Area +PAGE + +PROG SEGMENT PARA PUBLIC 'PROG' + + ASSUME CS:PROG + ASSUME SS:NOTHING + ASSUME DS:PROG + ASSUME ES:NOTHING + + PUBLIC INDEPAT + +INDEPAT LABEL NEAR + + DB 512 DUP(0EEH) + +PROG ENDS + END diff --git a/v4.0/src/DEV/XMAEM/INDEXMA.ASM b/v4.0/src/DEV/XMAEM/INDEXMA.ASM new file mode 100644 index 0000000..c35dd24 --- /dev/null +++ b/v4.0/src/DEV/XMAEM/INDEXMA.ASM @@ -0,0 +1,781 @@ +PAGE 60,132 +TITLE INDEXMA - 386 XMA Emulator - XMA Emulation + +COMMENT # +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* * +* MODULE NAME : INDEXMA * +* * +* 5669-196 (C) COPYRIGHT 1988 Microsoft Corp. * +* * +* DESCRIPTIVE NAME: Do the XMA emulation for the 80386 XMA Emulator * +* * +* STATUS (LEVEL) : Version (0) Level (1.0) * +* * +* FUNCTION : This module does the actual manipulation of the page * +* tables to emulate the XMA card. Using the 80386 * +* paging mechanism we let the 4K page frames represent * +* the 4K XMA blocks on the XMA card. We let the page * +* tables represent the translate table. * +* * +* The XMA "blocks" start at address 12000:0. The D1C* +* Emulator emulates the XMA 2 card with the INDXMAA D1C* +* device driver. On initial power up, the XMA 2 card is D1C* +* disabled. The INDXMAA device driver then disables the D1C* +* memory from 0K to 640K and backs it with memory from D1C* +* 0K to 640K on the XMA 2 card. The Emulator looks like D1C* +* it does the same thing. The XMA blocks for 0K to 640K D1C* +* are taken from the system board memory from 0K to D1C* +* 640K. This memory on the motherboard is treated as D1C* +* XMA memory. This emulates the INDXMAA device driver's D1C* +* mapping of 0K to 640K on the XMA card to real memory. D1C* +* The XMA "blocks" for 640K and up are located in high D1C* +* memory starting at 12000:0. These "blocks" run up to D1C* +* the start of the MOVEBLOCK buffer. The MOVEBLOCK D1C* +* buffer is a chunk of storage (in 16K multiples) at the D1C* +* end of available memory that is reserved for the D1C* +* MOVEBLOCK functions. D1C* +* * +* The page tables are used to emulate the translate * +* table. By setting the address of the XMA "block" into * +* the page table entry for a specific page frame we can * +* make that address access that particular XMA page * +* frame. To the user this looks just like the translate * +* table is active. * +* * +* The tricky part comes in disabling pages (blocks). On D1C* +* the XMA 2 card, when a translate table entry is D1C* +* disabled the addresses for that address range go to D1C* +* real memory. If the address is between 0K and 640K D1C* +* then any access of that storage gets nothing because D1C* +* there is no memory backed from 0K to 640K on the real D1C* +* system. All other addresses go to real memory. So D1C* +* when the user disables translation of a translate D1C* +* table entry we need to check what range that entry D1C* +* covers. If the entry points to somewhere between 0K D1C* +* and 640K then we will set the page table entry that D1C* +* corresponds to the translate table entry to point to D1C* +* non-existent memory. For all other addresses we will D1C* +* just point the page table entry back to the real D1C* +* memory at that address. D1C* +* * +* This module receives control on all "IN"s and "OUT"s * +* done by the user. If the "IN" or "OUT" is not to an * +* XMA port then it passes the I/O on to INDEDMA. If it * +* is for an XMA port then the request is handled here. * +* * +* This module keeps its own copies of the XMA registers * +* and the translate table. When any I/O comes for the * +* XMA card it updates its copies of the registers and * +* the translate table. Then it does any needed * +* modifications on the page tables to emulate the XMA * +* request. * +* * +* MODULE TYPE : ASM * +* * +* REGISTER USAGE : 80386 Standard * +* * +* RESTRICTIONS : None * +* * +* DEPENDENCIES : None * +* * +* ENTRY POINTS : INW - Emulate "IN" for a word with port number * +* in DX * +* INWIMMED - Emulate "IN" for a word with an immediate * +* port number * +* INIMMED - Emulate "IN" for a byte with an immediate * +* port number * +* XMAIN - Emulate "OUT" for a byte with port number * +* in DX * +* OUTW - Emulate "OUT" for a word with port number * +* in DX * +* OUTWIMMED - Emulate "OUT" for a word with an immediate * +* port number * +* XMAOUTIMMED - Emulate "OUT" for a byte with an immediate * +* port number * +* XMAOUT - Emulate "OUT" for a byte with port number * +* in DX * +* * +* LINKAGE : Jumped to by INDEEXC * +* * +* INPUT PARMS : None * +* * +* RETURN PARMS : None * +* * +* OTHER EFFECTS : None * +* * +* EXIT NORMAL : Go to POPIO in INDEEMU to IRET to the V86 task * +* * +* EXIT ERROR : None * +* * +* EXTERNAL * +* REFERENCES : POPIO:NEAR - Entry in INDEEMU to return to V86 task * +* HEXW:NEAR - Entry in INDEEXC to display word in AX * +* DMAIN:NEAR - Entry in INDEDMA to "IN" from DMA port * +* DMAOUT:NEAR - Entry in INDEDMA to "OUT" to DMA port * +* PGTBLOFF:WORD - Offset of the normal page tables * +* SGTBLOFF:WORD - Offset of the page directory * +* NORMPAGE:WORD - Entry for the 1st page directory entry * +* so that it points to the normal * +* page tables * +* XMAPAGE:WORD - Entry for the 1st page directory entry * +* that points to the XMA page tables * +* TTTABLE:WORD - The translate table * +* BUFF_SIZE:WORD - Size of the MOVEBLOCK buffer * +* MAXMEM:WORD - Number of kilobytes on this machine * +* * +* SUB-ROUTINES : TTARCHANGED - Put the block number at the translate table * +* entry in 31A0H into "ports" 31A2H and 31A4H * +* UPDATETT - Update the translate table and page tables * +* to reflect the new block number written to * +* either 31A2H or 31A4H * +* * +* MACROS : DATAOV - Add prefix for the next instruction so that it * +* accesses data as 32 bits wide * +* ADDROV - Add prefix for the next instruction so that it * +* uses addresses that are 32 bits wide * +* CMOV - Move to and from control registers * +* * +* CONTROL BLOCKS : INDEDAT.INC - system data structures * +* * +* CHANGE ACTIVITY : * +* * +* $MOD(INDEXMA) COMP(LOAD) PROD(3270PC) : * +* * +* $D0=D0004700 410 870530 D : NEW FOR RELEASE 1.1 * +* $P1=P0000293 410 870731 D : LIMIT LINES TO 80 CHARACTERS * +* $P2=P0000312 410 870804 D : CHANGE COMPONENT FROM MISC TO LOAD * +* $D1=D0007100 410 870810 D : CHANGE TO EMULATE XMA 2 * +* * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +# + + .286P ; Enable recognition of 286 privileged instructs. + + .XLIST ; Turn off the listing + INCLUDE INDEDAT.INC ; Include system data structures + + IF1 ; Only include macros on the first pass + INCLUDE INDEOVP.MAC + INCLUDE INDEINS.MAC + ENDIF + .LIST ; Turn on the listing + +CRT_SELECTOR EQU 00030H ; Selector for mono display buffer +SEX_ATTR EQU 04B00H ; Attribute for turquoise on red +STACK_ATTR EQU 00700H ; Attribute for white o black +BLANK EQU 00020H ; ASCII for a blank +XMA_PAGES_SEL EQU RSDA_PTR ; Selector for the XMA pages +HIMEM EQU 120H ; Adjustment for XMA pages >= 640K. @D1C + ; They start at address 12000:0. + ; It's the block number corresponding + ; to address 12000:0. + ; @D1D + +PROG SEGMENT PARA PUBLIC 'PROG' + + ASSUME CS:PROG + ASSUME DS:PROG + ASSUME ES:NOTHING + ASSUME SS:NOTHING + +INDEXMA LABEL NEAR + +; The following entry points are in other modules + + EXTRN POPIO:NEAR ; Return to V86 task - in INDEEMU + EXTRN HEXW:NEAR ; Display word in AX - in INDEEXC + EXTRN DMAIN:NEAR ; "IN" from DMA port - in INDEDMA + EXTRN DMAOUT:NEAR ; "OUT" to DMA port - in INDEDMA + +; The following data are in INDEI15.ASM + + EXTRN PGTBLOFF:WORD ; Offset of the normal page tables + EXTRN SGTBLOFF:WORD ; Offset of the page directory + EXTRN NORMPAGE:WORD ; Entry for the 1st page directory entry + ; so that it points to the normal + ; page tables + EXTRN XMAPAGE:WORD ; Entry for the 1st page directory entry + ; that points to the XMA page tables + EXTRN TTTABLE:WORD ; The translate table + EXTRN BUFF_SIZE:WORD ; Size of the MOVEBLOCK buffer + EXTRN MAXMEM:WORD ; Number of kilobytes on this machine + +; Let the following entries be known to other modules + + PUBLIC INDEXMA + PUBLIC INW + PUBLIC INWIMMED + PUBLIC INIMMED + PUBLIC XMAIN + PUBLIC OUTW + PUBLIC OUTWIMMED + PUBLIC XMAOUTIMMED + PUBLIC XMAOUT + PUBLIC NOTXMAOUT + +; Let the following data be known to other modules + + PUBLIC WORD_FLAG + PUBLIC XMATTAR + PUBLIC XMATTIO + PUBLIC XMATTII + PUBLIC XMATID + PUBLIC XMACTL + +; The following XMA labels represent the XMA ports starting at 31A0H. +; THEY MUST BE KEPT IN THE FOLLOWING ORDER. + +XMATTAR DW 0 ; Port 31A0H - Translate table index +XMATTIO DW 0 ; Port 31A2H - XMA block number +XMATTII DW 0 ; Port 31A4H - Block number with auto-increment +XMATID DB 0 ; Port 31A6H - Bank ID +XMACTL DB 02H ; Port 31A7H - Control flags. Virtual @D1C + ; enable bit is initially on. + +; How about some flags? + +WORD_FLAG DB 0 ; If set to 1 then I/O is for a word. + ; Else, it's for a byte + +PAGE + +; Control comes here for an "IN" for a word with the port value in DX + +INW: + MOV AX,SYS_PATCH_DS ; Load DS with the selector for our + MOV DS,AX ; data segment so we can set WORD_FLAG + MOV WORD_FLAG,1 ; Flag this as a word operation + JMP XMAIN ; Go do the "IN" + +; Control comes here for an "IN" for a word with an immediate port value + +INWIMMED: + MOV AX,SYS_PATCH_DS ; Load DS with the selector for our + MOV DS,AX ; data segment so we can set WORD_FLAG + MOV WORD_FLAG,1 ; Flag this as a word operation + +; Control comes here for an "IN" for a byte with an immediate port value + +INIMMED: + + ADD WORD PTR SS:[BP+BP_IP],1 ; Step IP past the "IN" instruction + +; Get the port address from the instruction. The port address is in the byte +; immediately following the "IN" op-code. We will load the port address into +; DX. This way when we join the code below it will look like the port address +; was in DX all along. + + MOV AX,HUGE_PTR ; Load DS with a selector that accesses + MOV DS,AX ; all of memory as data + + MOV SS:WORD PTR [BP+BP_IP2],0 ; Clear the high words of the V86 + MOV SS:WORD PTR [BP+BP_CS2],0 ; task's CS and IP + + DATAOV ; Load ESI (32 bit SI) with the V86 + MOV SI,SS:[BP+BP_IP] ; task's IP + DATAOV + MOV AX,SS:[BP+BP_CS] ; Load EAX with the V86 task's CS + DATAOV ; and then shift left four bits to + SHL AX,4 ; convert it to an offset + DATAOV ; Add the CS offset to "IP" in SI + ADD SI,AX ; SI now contains CS:IP as a 32 bit + ; offset from 0 + ADDROV ; Get the byte after the "IN" instruc- + LODSB ; tion. This is the port address. + + ADDROV ; Intel bug # A0-119 + NOP ; Intel bug # A0-119 + + SUB DX,DX ; Clear DX to prepare for one byte move + MOV DL,AL ; DX now has the port address + +; Control comes here for an "IN" for a byte with the port value in DX + +XMAIN PROC NEAR + + MOV AX,SYS_PATCH_DS ; Load DS with the selector for our + MOV DS,AX ; data segment + + CMP DX,31A0H ; Is the port address below 31A0H? + JB NOTXMAIN ; Yup. Then it's not XMA. + + CMP DX,31A7H ; Is the port address above 31A7H? + JA NOTXMAIN ; Yup. Then it's not XMA. + +; It's an XMA port so lets do the "IN" for the guy. + + AND XMATTAR,0FFFH ; First lets clear the high nibbles of + AND XMATID,0FH ; our ports. This insures that we + AND XMACTL,0FH ; have valid values in our ports. + + LEA SI,XMATTAR ; Point SI to the port requested by + ADD SI,DX ; first pointing it to port 31A0H + SUB SI,31A0H ; and then adding on the difference + ; between 31A0H and the requested port + CMP WORD_FLAG,0 ; Is this a word operation? + JNE GETWORD ; Yes. Then go get a word. + + LODSB ; Else get a byte from the "port" + MOV BYTE PTR SS:[BP+BP_AX],AL ; Put it in the V86 task's AL register + JMP INEXIT ; Th-th-that's all folks! + +; For non-XMA ports we just pass the "IN" on to INDEDMA + +NOTXMAIN: + JMP DMAIN + +; The "IN" is for a word + +GETWORD: + LODSW ; Get a word from the "port" + MOV WORD PTR SS:[BP+BP_AX],AX ; Put it in the V86 task's AX register + + MOV WORD_FLAG,0 ; Reset the word flag + + CMP DX,31A4H ; Is this an "IN" from the auto- + ; increment port? + JNE INEXIT ; Nope. Then just leave. + + INC XMATTAR ; The "IN" is from the auto-increment + ; port so increment the translate + CALL TTARCHANGED ; table index and call TTARCHANGED + ; to update the status of the "card" +INEXIT: + ADD WORD PTR SS:[BP+BP_IP],1 ; Step IP past the instruction (past + ; the port value for immediate insts.) + JMP POPIO ; Go return to the V86 task + +PAGE + +; Control comes here for an "OUT" for a word with the port value in DX + +OUTW: + MOV AX,SYS_PATCH_DS ; Load DS with the selector for our + MOV DS,AX ; data segment so we can set WORD_FLAG + MOV WORD_FLAG,1 ; Flag this as a word operation + JMP XMAOUT ; Go do the "OUT" + +; Control comes here for an "OUT" for a word with an immediate port value + +OUTWIMMED: + MOV AX,SYS_PATCH_DS ; Load DS with the selector for our + MOV DS,AX ; data segment so we can set WORD_FLAG + MOV WORD_FLAG,1 ; Flag this as a word operation + +; Control comes here for an "OUT" for a byte with an immediate port value + +XMAOUTIMMED: + + ADD WORD PTR SS:[BP+BP_IP],1 ; Step IP past the "OUT" instruction + +; Get the port address from the instruction. The port address is in the byte +; immediately following the "OUT" op-code. We will load the port address into +; DX. This way when we join the code below it will look like the port address +; was in DX all along. + + MOV AX,HUGE_PTR ; Load DS with a selector that accesses + MOV DS,AX ; all of memory as data + + MOV SS:WORD PTR [BP+BP_IP2],0 ; Clear the high words of the V86 + MOV SS:WORD PTR [BP+BP_CS2],0 ; task's CS and IP + + DATAOV ; Load ESI (32 bit SI) with the V86 + MOV SI,SS:[BP+BP_IP] ; task's IP + DATAOV + MOV AX,SS:[BP+BP_CS] ; Load EAX with the V86 task's CS + DATAOV ; and then shift left four bits to + SHL AX,4 ; convert it to an offset + DATAOV ; Add the CS offset to "IP" in SI + ADD SI,AX ; SI now contains CS:IP as a 32 bit + ; offset from 0 + ADDROV ; Get the byte after the "OUT" instruc- + LODSB ; tion. This is the port address. + + ADDROV ; Intel bug # A0-119 + NOP ; Intel bug # A0-119 + + SUB DX,DX ; Clear DX to prepare for one byte move + MOV DL,AL ; DX now has the port address + +; Control comes here for an "OUT" for a byte with the port value in DX + +XMAOUT: + MOV AX,SYS_PATCH_DS ; Load DS and ES with the selector for + MOV DS,AX ; our data area + MOV ES,AX + + CMP DX,31A0H ; Is the port address below 31A0H? + JB NOTXMAOUT ; Yes. Then it's not XMA. + + CMP DX,31A7H ; Is the port address above 31A7H? + JA NOTXMAOUT ; Yes. Then it's not XMA. + + LEA DI,XMATTAR ; Point SI to the port requested by + ADD DI,DX ; first pointing it to port 31A0H + SUB DI,31A0H ; and then adding on the difference + ; between 31A0H and the requested port + CMP WORD_FLAG,0 ; Is this a word operation? + JNE PUTWORD ; Yes. Then go put a word. + + MOV AL,BYTE PTR SS:[BP+BP_AX] ; Put the value in the V86 task's AL + STOSB ; register into the "port" + + CMP DX,31A6H ; Is this "OUT" to the bank ID port? + JE CHKCNTRL ; If so, go set the new bank + + CMP DX,31A7H ; Is the "OUT" to the control port? + JE CHKCNTRL ; Affirmative. Go handle control bits. + + CMP DX,31A1H ; Is this "OUT" to the TT index? + ; (high byte) + JBE TTAROUT ; Yup. Go update dependent fields. + + JMP OUTEXIT ; Any other ports just exit. + +; The "OUT" is for a word + +PUTWORD: + MOV AX,WORD PTR SS:[BP+BP_AX] ; Put the value in the V86 task's AX + STOSW ; register into the "port" + + MOV WORD_FLAG,0 ; Reset the word flag + + CMP DX,31A0H ; Is the "OUT" to the TT index port? + JE TTAROUT ; Si. Go update the dependent fields. + + CMP DX,31A2H ; Is the "OUT" to set a block number? + JNE CHKA4 ; No. Go do some more checks. + + MOV XMATTII,AX ; The "OUT" is to 31A2H. Set the auto- + ; increment port to the same value. + ; The two ports should always be in + ; sync. + CALL UPDATETT ; Update the "translate table" with the + ; new block number + JMP OUTEXIT ; That's it. Let's leave. + +CHKA4: + CMP DX,31A4H ; Is "OUT" to the auto-increment port + JNE CHKCNTRL ; No. Then it must be to the bank ID/ + ; control byte port (31A6H). + MOV XMATTIO,AX ; The "OUT is to the auto-increment port + CALL UPDATETT ; Update the "translate table" + INC XMATTAR ; Increment the translate table index + CALL TTARCHANGED ; Update fields that depend on the + ; translate table index + JMP OUTEXIT ; And return to the V86 task + +; The translate table index was changed + +TTAROUT: + CALL TTARCHANGED ; Update fields that depend on the + ; setting of the translate table index + JMP OUTEXITDMA ; Skip flushing the page-translation + ; cache since the page tables have + ; not changed. + +; It's not an XMA "OUT" so pass it on to INDEDMA + +NOTXMAOUT: + JMP DMAOUT + +; The "OUT" is to the bank ID port (31A6H), the control port (31A7H) or both + +CHKCNTRL: + + TEST XMACTL,02H ; Is the virtual enable bit on? + JNZ SETXMA ; Aye. Go make the specified XMA bank + ; active. + DATAOV ; Nay. We simulate disabling the XMA + MOV AX,NORMPAGE ; card by making the normal page + ; tables active. + MOV DI,SGTBLOFF ; This is done by setting the first + DATAOV ; entry in the page directory to + STOSW ; point to the page table for normal + ; memory. + JMP OUTEXIT ; Return to the V86 task + +SETXMA: + AND XMATID,0FH ; Wipe out the high nibble of the bank + MOV AL,XMATID ; ID. XMA only has 16 banks. + DATAOV ; Now multiply by 4K (shift left 12 ;P1C + SHL AX,28 ; bits) to get the offset from the + DATAOV ; base of the XMA page tables of the + SHR AX,28-12 ; page table for the requested bank. + ; Page tables are 4K in length. In + ; the process of shifting we shift the + ; high order 16 bits off the left end + ; of EAX so that they are 0 when we + ; shift back. + DATAOV ; Add on the offset of the base of the + ADD AX,XMAPAGE ; page tables. EAX now has the offset + ; of the page table for the XMA bank. + MOV DI,SGTBLOFF ; Point to the first entry in the page + ; directory. + DATAOV ; Set the first entry in the page + STOSW ; directory to point to the XMA page + ; table + +; Since the page tables have changed we need to purge the page-translation +; cache. "For greatest efficiency in address translation, the processor +; stores the most recently used page-table data in an on-chip cache... The +; existence of the page-translation cache is invisible to applications +; programmers but not to systems programmers; operating-system programmers +; must flush the cache whenever the page tables are changed." +; -- 80386 Programmer's Reference Manual (C) Intel 1986 + +OUTEXIT: + CMOV EAX,CR3 ; Get the page directory base register + NOP ; 386 errata B0-110 + CMOV CR3,EAX ; Write it back to reset the cache + NOP ; 386 errata B0-110 + +OUTEXITDMA: + ADD WORD PTR SS:[BP+BP_IP],1 ; Step IP past the "OUT" instruction + JMP POPIO ; Return to the V86 task + +PAGE + +; TTARCHANGED updates all the fields that depend on the translate table index +; in port 31A0H. This is mainly getting the translate table entries for the +; specified index and putting them in the block number ports 31A2H and 31A4H. + +TTARCHANGED PROC + + MOV AX,XMATTAR ; Get the new translate table index + AND AX,0FFFH ; The high nibble is not used + SHL AX,1 ; Change it to a word index. The + ; translate table entries are words. + LEA SI,TTTABLE ; Point SI to the translate table base + ADD SI,AX ; Add on the offset into the table + LODSW ; Get the XMA block number for the + ; specified translate table entry + MOV XMATTIO,AX ; Put it into "port" 31A2H + MOV XMATTII,AX ; Put it into "port" 31A4H + + RET + +TTARCHANGED ENDP + +PAGE + +; UPDATETT will update the "translate table" and the corresponding page +; tables when an XMA block number is written to either port 31A2H or the +; auto-increment port 31A4H. A write to either of these ports means to set +; the XMA block specified at the translate table entry indicated in port +; 31A0H. +; +; The Emulator is set up to look like an XMA 2 card with the INDXMAA device D1C +; driver. When the system comes up the XMA card is initially disabled. D1C +; INDXMAA then backs memory from 0K to 640K on the system board with memory D1C +; from 0K to 640K on the XMA card. To emulate this, the Emulator treats D1C +; real memory from 0K to 640K as XMA blocks from 0K to 640K on the XMA card. D1C +; This both saves memory and requires no code to back the real memory from D1C +; 0K to 640K with XMA memory on initialization. The Emulator therefore only D1C +; needs to allocate XMA memory for the XMA blocks over 640K. The XMA memory D1C +; for over 640K starts at 12000:0. The XMA blocks 00H to 9FH will be mapped D1C +; to the motherboard memory at 0K to 640K. The XMA blocks A0H and up will D1C +; be mapped to the memory at 12000:0 and up. D1C +; +; Bits 15 (IBM bit 0) and 11 (IBM bit 4) of the XMA block number have +; special meanings. When bit 15 is on it means that the block number is a +; 15 bit number. This is in anticipation of larger block numbers in the +; future. Current block numbers are 11 bits. When bit 11 is on it means +; that the XMA translation for this translation table entry should be +; disabled. The memory for this 4K block should be mapped back to real +; memory. +; +; We also check to make sure that the XMA block is not above the XMA memory +; limit. XMA memory ends where the MOVEBLOCK buffer starts. If the XMA +; block is above the end of XMA memory then the page table entry for that +; address is set to point to non-existent memory. +; +; When address translation is disabled for addresses above 640K then the D1C +; page table entry for that address is set to point back to real memory. D1C +; For disabled pages in the range 0K to 640K the page table entry is set to D1C +; point to non-existent memory. D1C + +UPDATETT PROC + + MOV AX,XMATTAR ; Get the index of the TT entry that + ; is to be changed + AND AX,0FFFH ; Clear the high four bits. They are + ; not used. + SHL AX,1 ; Change to a word offset since the TT + ; entries are words. + LEA DI,TTTABLE ; Point DI to the translate table base + ADD DI,AX ; Add on the offset of the entry that + ; is to be changed + MOV AX,XMATTIO ; Get the block number to be written + STOSW ; Store the block number in the TT + +; Convert bank number to a page address. +; The following code works only with paging enabled at 256k boundary. +; It is intended to support up to 128M at 4k granularity. +; It interprets the high order bits as a superset of XMA. +; Following is a truth table for bits 11 (XMA inhibit bit) and 15 ("enable-hi"). +; 15 11 +; 0 0 = enabled 11 bit address +; 0 1 = disabled address +; 1 x = enabled 15 bit address + + TEST AH,80H ; Is this a 15 bit block number? + JZ SMALL ; Far from it. Go do stuff for 11 bit + ; block numbers. + +; We have a 15 bit address + + CMP AX,0FFFFH ; If it's FFFFH then we treat it the + ; the same as 0FFFH which means + JE DISABLEPAGE ; disable the page + + AND AX,7FFFH ; Turn off the 15 bit address bit + JMP BOTH ; leaving a valid block number for + ; our calculations later + +SMALL: + TEST AH,08H ; Is the disable bit on? + JNZ DISABLEPAGE ; Yes. Go disable the page. + + AND AX,07FFH ; No. Turn off the high nibble and the + ; disable bit leaving a valid block + ; number for our upcoming calculations +BOTH: + CMP AX,640/4 ; Is this block number for 640K or over? + JB NOADJUST ; Yup. There's no adjustment @D1C + ; needed for blocks between 0K and + ; 640K since we use real memory for + ; these blocks. + ; XMA 1 emulation code deleted 3@D1D + ADD AX,HIMEM-(640/4) ; Add on the adjustment needed for @D1C + ; blocks above 640K to point to + ; the XMA blocks starting at 12000:0. + ; But don't forget to subtract the + ; block number for 640K. This makes + ; the block number 0 based before we + ; add on the block number for 12000:0. +NOADJUST: + DATAOV ; Shift the high order 16 bits of EAX + SHL AX,16 ; off the left end of the register. + DATAOV ; Now shift the block number back four + SHR AX,16-12 ; bits. This results in a net shift + ; left of 12 bits which converts the + ; block number to an offset, and it + ; clears the high four bits. + OR AL,7 ; Set the access and present bits. This + ; converts our offset to a valid page + ; table entry. + DATAOV ; Save the page table entry in EBX for + MOV BX,AX ; now + +; Now we must make sure the offset of our XMA page frame is within the address +; space of the XMA pages, that is, it is below the start of the MOVEBLOCK +; buffer. + + DATAOV ; Clear all 32 bits of EAX + SUB AX,AX + MOV AX,MAXMEM ; Load up the number of K on the box + SUB AX,BUFF_SIZE ; Subtract the number of K reserved + ; for the MOVEBLOCK buffer + DATAOV ; Multiply by 1K (shift left 10) to + SHL AX,10 ; convert it to an offset + DATAOV ; Is the XMA page address below the + CMP BX,AX ; MOVEBLOCK buffer address? + JB ENABLED ; Yup. Whew! Let's go set up the page + ; table entry for this XMA block. + JMP EMPTY ; Nope. Rats! Well, we'll just have + ; to point this TT entry to unbacked + ; memory. + +; We come here when we want to disable translation for this translate table +; entry. For TT entries for 640K and over we just point the translate table +; entry back to real memory. For TT entries between 0K and 640K we point +; the translate table to unbacked memory. This memory on the motherboard +; was disabled under real XMA so we emulate it by pointing to unbacked +; memory. + +DISABLEPAGE: + ; XMA 1 emulation code deleted 2@D1D + CMP BYTE PTR XMATTAR,640/4 ; Is the address at 640K or above? + JNB SPECIAL ; Aye. Go point back to real memory. + +; The address is between 256K and 640K. Let's set the page table entry to +; point to non-exiatent memory. + +EMPTY: + DATAOV ; Clear EAX + SUB AX,AX + MOV AX,MAXMEM ; Get the total number of K on the box + DATAOV ; Multiply by 1024 to convert to an + SHL AX,10 ; offset. AX now points to the 4K + ; page frame after the end of memory. + OR AL,7 ; Turn on the accessed and present bits + ; to avoid page faults + DATAOV ; Save the page table entry in EBX + MOV BX,AX + JMP ENABLED ; Go set up the page table + +; If the address is above 640K then the translate table (page table) entry D1C +; is set to point back to real memory. +SPECIAL: + MOV AX,XMATTAR ; Get the index of the TT entry that is + ; to be disabled + DATAOV ; Dump the high 24 bits off the left end + SHL AX,24 ; of the register + DATAOV ; Now shift it back 12 bits. This + SHR AX,24-12 ; results in a net shift left of 12 + ; bits which multiplies the TT index + ; by 4K while at the same time clear- + ; ing the high order bits. EAX is now + ; the offset of the memory pointed to + ; by the TT entry. + OR AL,7 ; Turn on the accessed and present bits + ; to make this a page table entry + DATAOV ; Save the page table entry in EBX + MOV BX,AX + +; Now let's put the new page table entry in EBX, which represents the XMA block, +; into the page table. +ENABLED: + MOV AX,XMATTAR ; Get the index of the TT entry + +; Now we want ot convert the index of the TT entry to an offset into our XMA +; page tables. The bank number is now in AH and the 4K block number of the +; bank is in AL. To point to the right page table we need to multiply the bank +; number by 4K (shift left 12 bits) since page tables are 4K in length. The +; bank number is already shifted left 8 bits by virtue of it being in AH. It +; needs to be shifted left four more bits. In order to access the right entry +; in the page table, the block number in AL must be multiplied by 4 (shifted +; left two bits) because the page table entries are 4 bytes in length. So, +; first we shift AH left two bits and then shift AX left two bits. In the end +; this shifts AH, the bank ID, left four bits and shifts AL, the block number, +; two bits, which is what we wanted. A long explanation for two instructions, +; but they're pretty efficient, don't you think? + + SHL AH,2 ; Shift the bank ID left two bits + SHL AX,2 ; Shift the bank ID and the block number + ; left two bits + MOV DI,AX ; Load DI with the offset of the page + ; table entry that is to be changed + PUSH ES ; Save ES + MOV AX,XMA_PAGES_SEL ; Load ES with the selector for our + MOV ES,AX ; XMA page tables. Now ES:DI points + ; to the page table entry to be + ; changed + DATAOV ; Get the new value for the page table + MOV AX,BX ; entry which was saved in EBX. + DATAOV ; Stuff it into the page table - all + STOSW ; 32 bits of it. + + POP ES ; Restore ES + + RET ; And return + +UPDATETT ENDP + +XMAIN ENDP + +PROG ENDS + + END diff --git a/v4.0/src/DEV/XMAEM/INDEXMAE.SYS b/v4.0/src/DEV/XMAEM/INDEXMAE.SYS new file mode 100644 index 0000000..d0fd31a --- /dev/null +++ b/v4.0/src/DEV/XMAEM/INDEXMAE.SYS @@ -0,0 +1,8 @@ +MZ%  ++V386XMAEM#86XMAEMULATOR11...(û&?t.(PSQRWVU.*.(f`.G<w3.6 +G.>*t +]^_ZY[Xfaû& PD!G OG(G.>*tG G FE!tG G 9F!ð3.h.Ok.A.?.=5$0<0tS8Q+O-&Ȏؾhؿѹ f+f+ۻ f%f+ۻf+f"f+ۻff+ãEf f>Ef+ۻ`f+fGf+ۻfff+ۻffGf+$C>Cf+f+ۻff>Cfff@ы&VO<ы&^`h؎м=6jظ*иظ؎h󪹗hUikx8GfhG=6GhG\GXGTGH.?GP.=G8G&G$.AGL|G G` fGh؋6C++x󥸀f"jPf\X=u D!u du`Q+d$Yw24t0 +t< t<,t<;t <+t<=t< u*t6.O< t< t< +<0r<9w:tu< +3.,0.& .t.>t3f`F4t~$ u~$uF4t &F$.>S3 3 Kh޾+.f FFK